28 Nov, 2011

1 commit

  • As described in the help text in the patch, this token restricts general
    access to /dev/mem as a way of increasing the security. Specifically, access
    to exclusive IOMEM and kernel RAM is denied unless CONFIG_STRICT_DEVMEM is
    set to 'n'.

    Implement the 'devmem_is_allowed()' interface for Powerpc. It will be
    called from range_is_allowed() when userpsace attempts to access /dev/mem.

    This patch is based on an earlier patch from Steve Best and with input from
    Paul Mackerras and Scott Wood.

    [BenH] Fixed a typo or two and removed the generic change which should
    be submitted as a separate patch

    Signed-off-by: Sukadev Bhattiprolu
    Signed-off-by: Benjamin Herrenschmidt

    sukadev@linux.vnet.ibm.com
     

20 Sep, 2011

3 commits

  • This adds a udbg and an hvc console backend for supporting a console
    using the OPAL console interfaces.

    On OPAL v1 we have hvc0 mapped to whatever console the system was
    configured for (network or hvsi serial port) via the service
    processor.

    On OPAL v2 we have hvcN mapped to the Nth console provided by OPAL
    which generally corresponds to:

    hvc0 : network console (raw protocol)
    hvc1 : serial port S1 (hvsi)
    hvc2 : serial port S2 (hvsi)

    Note: At this point, early debug console only works with OPAL v1
    and shouldn't be enabled in a normal kernel.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • It was preventing the global early debug selection whenever KVM was enabled
    instead of only preventing the 440 specific one.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • Add a new udbg driver for the PS3 gelic Ehthernet device.

    This driver shares only a few stucture and constant definitions with the
    gelic Ethernet device driver, so is implemented as a stand-alone driver
    with no dependencies on the gelic Ethernet device driver.

    Signed-off-by: Hector Martin
    Signed-off-by: Andre Heider
    Signed-off-by: Geoff Levand
    Signed-off-by: Benjamin Herrenschmidt

    Hector Martin
     

29 Jun, 2011

1 commit

  • On pseries machines, consoles are provided by the hypervisor using
    a low level get_chars/put_chars type interface. However, this is
    really just a transport to the service processor which implements
    them either as "raw" console (networked consoles, HMC, ...) or as
    "hvsi" serial ports.

    The later is a simple packet protocol on top of the raw character
    interface that is supposed to convey additional "serial port" style
    semantics. In practice however, all it does is provide a way to
    read the CD line and set/clear our DTR line, that's it.

    We currently implement the "raw" protocol as an hvc console backend
    (/dev/hvcN) and the "hvsi" protocol using a separate tty driver
    (/dev/hvsi0).

    However this is quite impractical. The arbitrary difference between
    the two type of devices has been a major source of user (and distro)
    confusion. Additionally, there's an additional mini -hvsi implementation
    in the pseries platform code for our low level debug console and early
    boot kernel messages, which means code duplication, though that low
    level variant is impractical as it's incapable of doing the initial
    protocol negociation to establish the link to the FSP.

    This essentially replaces the dedicated hvsi driver and the platform
    udbg code completely by extending the existing hvc_vio backend used
    in "raw" mode so that:

    - It now supports HVSI as well
    - We add support for hvc backend providing tiocm{get,set}
    - It also provides a udbg interface for early debug and boot console

    This is overall less code, though this will only be obvious once we
    remove the old "hvsi" driver, which is still available for now. When
    the old driver is enabled, the new code still kicks in for the low
    level udbg console, replacing the old mini implementation in the platform
    code, it just doesn't provide the higher level "hvc" interface.

    In addition to producing generally simler code, this has several benefits
    over our current situation:

    - The user/distro only has to deal with /dev/hvcN for the hypervisor
    console, avoiding all sort of confusion that has plagued us in the past

    - The tty, kernel and low level debug console all use the same code
    base which supports the full protocol establishment process, thus the
    console is now available much earlier than it used to be with the
    old HVSI driver. The kernel console works much earlier and udbg is
    available much earlier too. Hackers can enable a hard coded very-early
    debug console as well that works with HVSI (previously that was only
    supported for the "raw" mode).

    I've tried to keep the same semantics as hvsi relative to how I react
    to things like CD changes, with some subtle differences though:

    - I clear DTR on close if HUPCL is set

    - Current hvsi triggers a hangup if it detects a up->down transition
    on CD (you can still open a console with CD down). My new implementation
    triggers a hangup if the link to the FSP is severed, and severs it upon
    detecting a up->down transition on CD.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

25 May, 2011

2 commits

  • Most arches define CONFIG_DEBUG_STACK_USAGE exactly the same way. Move it
    to lib/Kconfig.debug so each arch doesn't have to define it. This
    obviously makes the option generic, but that's fine because the config is
    already used in generic code.

    It's not obvious to me that sysrq-P actually does anything caution by
    keeping the most inclusive wording.

    Signed-off-by: Stephen Boyd
    Cc: Chris Metcalf
    Acked-by: David S. Miller
    Acked-by: Richard Weinberger
    Acked-by: Mike Frysinger
    Cc: Russell King
    Cc: Hirokazu Takata
    Acked-by: Ralf Baechle
    Cc: Paul Mackerras
    Acked-by: Benjamin Herrenschmidt
    Cc: Chen Liqin
    Cc: Lennox Wu
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • DEBUG_PER_CPU_MAPS is used in lib/cpumask.c as well as in
    inlcude/linux/cpumask.h and thus it has outgrown its use within x86 and
    powerpc alone. Any arch with SMP support may want to get some more
    debugging, so make this option generic.

    Signed-off-by: Stephen Boyd
    Cc:
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     

06 May, 2011

1 commit


15 Jun, 2010

1 commit

  • Irq stacks provide an essential protection from stack overflows through
    external interrupts, at the cost of two additionals stacks per CPU.

    Enable them unconditionally to simplify the kernel build and prevent
    people from accidentally disabling them.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Benjamin Herrenschmidt

    Christoph Hellwig
     

06 May, 2010

1 commit


17 Dec, 2009

1 commit

  • * 'next' of git://git.secretlab.ca/git/linux-2.6: (23 commits)
    powerpc: fix up for mmu_mapin_ram api change
    powerpc: wii: allow ioremap within the memory hole
    powerpc: allow ioremap within reserved memory regions
    wii: use both mem1 and mem2 as ram
    wii: bootwrapper: add fixup to calc useable mem2
    powerpc: gamecube/wii: early debugging using usbgecko
    powerpc: reserve fixmap entries for early debug
    powerpc: wii: default config
    powerpc: wii: platform support
    powerpc: wii: hollywood interrupt controller support
    powerpc: broadway processor support
    powerpc: wii: bootwrapper bits
    powerpc: wii: device tree
    powerpc: gamecube: default config
    powerpc: gamecube: platform support
    powerpc: gamecube/wii: flipper interrupt controller support
    powerpc: gamecube/wii: udbg support for usbgecko
    powerpc: gamecube/wii: do not include PCI support
    powerpc: gamecube/wii: declare as non-coherent platforms
    powerpc: gamecube/wii: introduce GAMECUBE_COMMON
    ...

    Fix up conflicts in arch/powerpc/mm/fsl_booke_mmu.c.

    Hopefully even close to correctly.

    Linus Torvalds
     

13 Dec, 2009

1 commit

  • Add support for using the USB Gecko adapter as an early debugging
    console on the Nintendo GameCube and Wii video game consoles.
    The USB Gecko is a 3rd party memory card interface adapter that provides
    a EXI (External Interface) to USB serial converter.

    Signed-off-by: Albert Herranz
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Grant Likely

    Albert Herranz
     

28 Oct, 2009

1 commit

  • Add hcall_entry and hcall_exit tracepoints. This replaces the inline
    assembly HCALL_STATS code and converts it to use the new tracepoints.

    To keep the disabled case as quick as possible, we embed a status word
    in the TOC so we can get at it with a single load. By doing so we
    keep the overhead at a minimum. Time taken for a null hcall:

    No tracepoint code: 135.79 cycles
    Disabled tracepoints: 137.95 cycles

    For reference, before this patch enabling HCALL_STATS resulted in a null
    hcall of 201.44 cycles!

    Signed-off-by: Anton Blanchard
    Signed-off-by: Paul Mackerras

    Anton Blanchard
     

16 Jun, 2009

1 commit

  • Add the option to build the code under arch/powerpc with -Werror.

    The intention is to make it harder for people to inadvertantly introduce
    warnings in the arch/powerpc code. It needs to be configurable so that
    if a warning is introduced, people can easily work around it while it's
    being fixed.

    The option is a negative, ie. don't enable -Werror, so that it will be
    turned on for allyes and allmodconfig builds.

    The default is n, in the hope that developers will build with -Werror,
    that will probably lead to some build breaks, I am prepared to be flamed.

    It's not enabled for math-emu, which is a steaming pile of warnings.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Benjamin Herrenschmidt

    Michael Ellerman
     

21 May, 2009

1 commit

  • If CONFIG_PPC_EMULATED_STATS is enabled, make available counters for the
    various classes of emulated instructions under
    /sys/kernel/debug/powerpc/emulated_instructions/ (assumed debugfs is mounted on
    /sys/kernel/debug). Optionally (controlled by
    /sys/kernel/debug/powerpc/emulated_instructions/do_warn), rate-limited warnings
    can be printed to the console when instructions are emulated.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Benjamin Herrenschmidt

    Geert Uytterhoeven
     

03 Apr, 2009

1 commit

  • This fixes a build failure with generic debug pagealloc:

    mm/debug-pagealloc.c: In function 'set_page_poison':
    mm/debug-pagealloc.c:8: error: 'struct page' has no member named 'debug_flags'
    mm/debug-pagealloc.c: In function 'clear_page_poison':
    mm/debug-pagealloc.c:13: error: 'struct page' has no member named 'debug_flags'
    mm/debug-pagealloc.c: In function 'page_poison':
    mm/debug-pagealloc.c:18: error: 'struct page' has no member named 'debug_flags'
    mm/debug-pagealloc.c: At top level:
    mm/debug-pagealloc.c:120: error: redefinition of 'kernel_map_pages'
    include/linux/mm.h:1278: error: previous definition of 'kernel_map_pages' was here
    mm/debug-pagealloc.c: In function 'kernel_map_pages':
    mm/debug-pagealloc.c:122: error: 'debug_pagealloc_enabled' undeclared (first use in this function)

    by fixing

    - debug_flags should be in struct page
    - define DEBUG_PAGEALLOC config option for all architectures

    Signed-off-by: Akinobu Mita
    Reported-by: Alexander Beregalov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

01 Apr, 2009

1 commit

  • CONFIG_DEBUG_PAGEALLOC is now supported by x86, powerpc, sparc64, and
    s390. This patch implements it for the rest of the architectures by
    filling the pages with poison byte patterns after free_pages() and
    verifying the poison patterns before alloc_pages().

    This generic one cannot detect invalid page accesses immediately but
    invalid read access may cause invalid dereference by poisoned memory and
    invalid write access can be detected after a long delay.

    Signed-off-by: Akinobu Mita
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

11 Mar, 2009

1 commit

  • CONFIG_PPC_MULTIPLATFORM is a remain of the pre-powerpc days and isn't
    really meaningful anymore. It was basically equivalent to PPC64 || 6xx.

    This removes it along with the following changes:

    - 32-bit platforms that relied on PPC32 && PPC_MULTIPLATFORM now rely
    on 6xx which is what they want anyway.

    - A new symbol, PPC_BOOK3S, is defined that represent compliance with
    the "Server" variant of the architecture. This is set when either 6xx
    or PPC64 is set and open the door for future BOOK3E 64-bit.

    - 64-bit platforms that relied on PPC64 && PPC_MULTIPLATFORM now use
    PPC64 && PPC_BOOK3S

    - A separate and selectable CONFIG_PPC_OF_BOOT_TRAMPOLINE option is now
    used to control the use of prom_init.c

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

03 Dec, 2008

1 commit

  • On my screen, when something crashes, I only have space for maybe 16
    functions of the stack trace before the information above it scrolls
    off the screen. It's easy to hack the kernel to print out only that
    much, but it's harder to remember to do it. This introduces a config
    option for it so that I can keep the setting in my config.

    Signed-off-by: Johannes Berg
    Signed-off-by: Paul Mackerras

    Johannes Berg
     

20 Aug, 2008

1 commit

  • There are now two almost identical implementations of an MSI bitmap
    allocator, one in mpic_msi.c and the other in fsl_msi.c.

    Merge them together and put the result in msi_bitmap.c. Some of the
    MPIC bits will remain to provide a nicer interface for the MPIC users.

    In the process we fix two buglets. The first is that the allocation
    routines, now msi_bitmap_alloc_hwirqs(), returned an unsigned result,
    even though they use -1 to indicate allocation failure. Although all
    the callers were checking correctly, it is much better for the routine
    to just return an int. At least until someone wants > ~2 billion MSIs.

    The second buglet is that the device tree reservation logic only
    allowed power-of-two reservations. AFAICT that didn't effect any
    existing code but it's nicer if we can reserve arbitrary irqs from MSI
    use.

    We also add some selftests, which exposed the two buglets and now test
    for them, as well as some basic sanity tests. The tests are only built
    when CONFIG_DEBUG_KERNEL=y.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

04 Aug, 2008

1 commit


24 Jul, 2008

1 commit

  • This patch removes the old kgdb reminants from ARCH=powerpc and
    implements the new style arch specific stub for the common kgdb core
    interface.

    It is possible to have xmon and kgdb in the same kernel, but you
    cannot use both at the same time because there is only one set of
    debug hooks.

    The arch specific kgdb implementation saves the previous state of the
    debug hooks and restores them if you unconfigure the kgdb I/O driver.
    Kgdb should have no impact on a kernel that has no kgdb I/O driver
    configured.

    Signed-off-by: Jason Wessel

    Jason Wessel
     

01 Jul, 2008

2 commits

  • This commit adds tests of the feature fixup code, they are run during
    boot if CONFIG_FTR_FIXUP_SELFTEST=y. Some of the tests manually invoke
    the patching routines to check their behaviour, and others use the
    macros and so are patched during the normal patching done during boot.

    Because we have two sets of macros with different names, we use a macro
    to generate the test of the macros, very niiiice.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • Add tests of the existing code patching routines, as well as the new
    routines added in the last commit. The self-tests are run late in boot
    when CONFIG_CODE_PATCHING_SELFTEST=y, which depends on DEBUG_KERNEL=y.

    Signed-off-by: Michael Ellerman
    Acked-by: Kumar Gala
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

29 Apr, 2008

1 commit

  • This makes it possible to use separate stacks for hard and soft IRQs
    on 32-bit powerpc as well as on 64-bit. The code for 32-bit is just
    the 32-bit analog of the 64-bit code.

    * Added allocation and initialization of the irq stacks. We limit the
    stacks to be in lowmem for ppc32.
    * Implemented ppc32 versions of call_do_softirq() and call_handle_irq()
    to switch the stack pointers
    * Reworked how we do stack overflow detection. We now keep around the
    limit of the stack in the thread_struct and compare against the limit
    to see if we've overflowed. We can now use this on ppc64 if desired.

    [ paulus@samba.org: Fixed bug on 6xx where we need to reload r9 with the
    thread_info pointer. ]

    Signed-off-by: Kumar Gala
    Signed-off-by: Paul Mackerras

    Kumar Gala
     

27 Apr, 2008

1 commit

  • This functionality is definitely experimental, but is capable of running
    unmodified PowerPC 440 Linux kernels as guests on a PowerPC 440 host. (Only
    tested with 440EP "Bamboo" guests so far, but with appropriate userspace
    support other SoC/board combinations should work.)

    See Documentation/powerpc/kvm_440.txt for technical details.

    [stephen: build fix]

    Signed-off-by: Hollis Blanchard
    Acked-by: Paul Mackerras
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Avi Kivity

    Hollis Blanchard
     

17 Apr, 2008

1 commit


24 Dec, 2007

2 commits


11 Dec, 2007

1 commit

  • This makes the early debug option force the console loglevel
    to the max. The early debug option is meant to catch messages very
    early in the kernel boot process, in many cases, before the kernel
    has a chance to parse the "debug" command line argument. Thus it
    makes sense when CONFIG_PPC_EARLY_DEBUG is set, to force the console
    log level to the max at boot time.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

20 Oct, 2007

1 commit

  • Currently there's no way to enable early boot console on PowerPC 44x
    not specifying uart's physical address in kernel config, which is used
    for very early debug messages. This patch splits very early debug output
    (which needs uart physical address in kernel config) and early boot console
    (which searches for uarts in the device tree using find_legacy_serial_ports).
    We enable early boot console for all 44x processors, while (dangerous)
    early debug is user-selectable.

    Signed-off-by: Valentine Barshak
    Signed-off-by: Josh Boyer

    Valentine Barshak
     

13 Oct, 2007

1 commit

  • Remove the following redundant and never or rarely used kconfig syntax:

    - "def_boolean" (same as "def_bool")
    - "requires" (same as "depends on")
    - "depends" (same as "depends on")

    This patch contains the code changes and Kconfig updates.
    The shipped files are in next patch to let actual codechange stand out.

    Signed-off-by: Adrian Bunk
    Cc: "Randy.Dunlap"
    Cc: Bryan Wu
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Dmitry Torokhov
    Cc: "John W. Linville"
    Cc: Roman Zippel
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Adrian Bunk
     

05 Oct, 2007

1 commit

  • The way the current CPM binding describes available multi-user (a.k.a.
    dual-ported) RAM doesn't work well when there are multiple free regions,
    and it doesn't work at all if the region doesn't begin at the start of
    the muram area (as the hardware needs to be programmed with offsets into
    this area). The latter situation can happen with SMC UARTs on CPM2, as its
    parameter RAM is relocatable, u-boot puts it at zero, and the kernel doesn't
    support moving it.

    It is now described with a muram node, similar to QE. The current CPM
    binding is sufficiently recent (i.e. never appeared in an official release)
    that compatibility with existing device trees is not an issue.

    The code supporting the new binding is shared between cpm1 and cpm2, rather
    than remain separated. QE should be able to use this code as well, once
    minor fixes are made to its device trees.

    Signed-off-by: Scott Wood
    Signed-off-by: Kumar Gala

    Scott Wood
     

04 Oct, 2007

1 commit


13 Sep, 2007

1 commit


30 Jul, 2007

1 commit


26 Jul, 2007

1 commit


09 May, 2007

1 commit


08 May, 2007

1 commit

  • This adds support for early serial debugging via the built in
    port on IBM/AMCC PowerPC 44x CPUs. It uses a bolted TLB entry in
    address space 1 for the UART's mapping, allowing robust debugging both
    before and after the initialization of the MMU.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     

13 Apr, 2007

1 commit

  • Here's an implementation of DEBUG_PAGEALLOC for 64 bits powerpc.
    It applies on top of the 32 bits patch.

    Unlike Anton's previous attempt, I'm not using updatepp. I'm removing
    the hash entries from the bolted mapping (using a map in RAM of all the
    slots). Expensive but it doesn't really matter, does it ? :-)

    Memory hot-added doesn't benefit from this unless it's added at an
    address that is below end_of_DRAM() as calculated at boot time.

    Signed-off-by: Benjamin Herrenschmidt

    arch/powerpc/Kconfig.debug | 2
    arch/powerpc/mm/hash_utils_64.c | 84 ++++++++++++++++++++++++++++++++++++++--
    2 files changed, 82 insertions(+), 4 deletions(-)
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt