1. 17 6月, 2010 5 次提交
  2. 16 6月, 2010 1 次提交
  3. 22 5月, 2010 1 次提交
  4. 21 5月, 2010 33 次提交
    • F
      powerpc: Remove unused 'protect4gb' boot parameter · 99ec28f1
      FUJITA Tomonori 提交于
      'protect4gb' boot parameter was introduced to avoid allocating dma
      space acrossing 4GB boundary in 2007 (the commit
      56997559).
      
      In 2008, the IOMMU was fixed to use the boundary_mask parameter per
      device properly. So 'protect4gb' workaround was removed (the
      383af952). But somehow I messed the
      'protect4gb' boot parameter that was used to enable the
      workaround.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      99ec28f1
    • M
      powerpc: Build-in e1000e for pseries & ppc64_defconfig · 40a5a443
      Michael Neuling 提交于
      The e1000e device is becoming more common these days, so let's just
      build it in for pseries & ppc64_defconfig.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      40a5a443
    • M
      powerpc/pseries: Make request_ras_irqs() available to other pseries code · 32c96f77
      Mark Nelson 提交于
      At the moment only the RAS code uses event-sources interrupts (for EPOW
      events and internal errors) so request_ras_irqs() (which actually requests
      the event-sources interrupts) is found in ras.c and is static.
      
      We want to be able to use event-sources interrupts in other pseries code,
      so let's rename request_ras_irqs() to request_event_sources_irqs() and
      move it to event_sources.c.
      
      This will be used in an upcoming patch that adds support for IO Event
      interrupts that come through as event sources.
      Signed-off-by: NMark Nelson <markn@au1.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      32c96f77
    • A
      powerpc/numa: Use ibm,architecture-vec-5 to detect form 1 affinity · bc8449cc
      Anton Blanchard 提交于
      I've been told that the architected way to determine we are in form 1
      affinity mode is by reading the ibm,architecture-vec-5 property which
      mirrors the layout of the fifth vector of the ibm,client-architecture
      structure.
      
      Eventually we may want to parse the ibm,architecture-vec-5 and create
      FW_FEATURE_* bits.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bc8449cc
    • A
      powerpc/numa: Set a smaller value for RECLAIM_DISTANCE to enable zone reclaim · 56608209
      Anton Blanchard 提交于
      I noticed /proc/sys/vm/zone_reclaim_mode was 0 on a ppc64 NUMA box. It gets
      enabled via this:
      
              /*
               * If another node is sufficiently far away then it is better
               * to reclaim pages in a zone before going off node.
               */
              if (distance > RECLAIM_DISTANCE)
                      zone_reclaim_mode = 1;
      
      Since we use the default value of 20 for REMOTE_DISTANCE and 20 for
      RECLAIM_DISTANCE it never kicks in.
      
      The local to remote bandwidth ratios can be quite large on System p
      machines so it makes sense for us to reclaim clean pagecache locally before
      going off node.
      
      The patch below sets a smaller value for RECLAIM_DISTANCE and thus enables
      zone reclaim.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      56608209
    • A
      powerpc: Use smt_snooze_delay=-1 to always busy loop · b878dc00
      Anton Blanchard 提交于
      Right now if we want to busy loop and not give up any time to the hypervisor
      we put a very large value into smt_snooze_delay. This is sometimes useful
      when running a single partition and you want to avoid any latencies due
      to the hypervisor or CPU power state transitions. While this works, it's a bit
      ugly - how big a number is enough now we have NO_HZ and can be idle for a very
      long time.
      
      The patch below makes smt_snooze_delay signed, and a negative value means loop
      forever:
      
      echo -1 > /sys/devices/system/cpu/cpu0/smt_snooze_delay
      
      This change shouldn't affect the existing userspace tools (eg ppc64_cpu), but
      I'm cc-ing Nathan just to be sure.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b878dc00
    • A
      powerpc: Remove check of ibm,smt-snooze-delay OF property · dd04c63c
      Anton Blanchard 提交于
      I'm not sure why we have code for parsing an ibm,smt-snooze-delay OF
      property. Since we have a smt-snooze-delay= boot option and we can
      also set it at runtime via sysfs, it should be safe to get rid of
      this code.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      dd04c63c
    • M
      powerpc/kdump: Fix race in kdump shutdown · 60adec62
      Michael Neuling 提交于
      When we are crashing, the crashing/primary CPU IPIs the secondaries to
      turn off IRQs, go into real mode and wait in kexec_wait.  While this
      is happening, the primary tears down all the MMU maps.  Unfortunately
      the primary doesn't check to make sure the secondaries have entered
      real mode before doing this.
      
      On PHYP machines, the secondaries can take a long time shutting down
      the IRQ controller as RTAS calls are need.  These RTAS calls need to
      be serialised which resilts in the secondaries contending in
      lock_rtas() and hence taking a long time to shut down.
      
      We've hit this on large POWER7 machines, where some secondaries are
      still waiting in lock_rtas(), when the primary tears down the HPTEs.
      
      This patch makes sure all secondaries are in real mode before the
      primary tears down the MMU.  It uses the new kexec_state entry in the
      paca.  It times out if the secondaries don't reach real mode after
      10sec.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      60adec62
    • M
      powerpc/kexec: Fix race in kexec shutdown · 1fc711f7
      Michael Neuling 提交于
      In kexec_prepare_cpus, the primary CPU IPIs the secondary CPUs to
      kexec_smp_down().  kexec_smp_down() calls kexec_smp_wait() which sets
      the hw_cpu_id() to -1.  The primary does this while leaving IRQs on
      which means the primary can take a timer interrupt which can lead to
      the IPIing one of the secondary CPUs (say, for a scheduler re-balance)
      but since the secondary CPU now has a hw_cpu_id = -1, we IPI CPU
      -1... Kaboom!
      
      We are hitting this case regularly on POWER7 machines.
      
      There is also a second race, where the primary will tear down the MMU
      mappings before knowing the secondaries have entered real mode.
      
      Also, the secondaries are clearing out any pending IPIs before
      guaranteeing that no more will be received.
      
      This changes kexec_prepare_cpus() so that we turn off IRQs in the
      primary CPU much earlier.  It adds a paca flag to say that the
      secondaries have entered the kexec_smp_down() IPI and turned off IRQs,
      rather than overloading hw_cpu_id with -1.  This new paca flag is
      again used to in indicate when the secondaries has entered real mode.
      
      It also ensures that all CPUs have their IRQs off before we clear out
      any pending IPI requests (in kexec_cpu_down()) to ensure there are no
      trailing IPIs left unacknowledged.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1fc711f7
    • M
      powerpc/kexec: Speedup kexec hash PTE tear down · d504bed6
      Michael Neuling 提交于
      Currently for kexec the PTE tear down on 1TB segment systems normally
      requires 3 hcalls for each PTE removal. On a machine with 32GB of
      memory it can take around a minute to remove all the PTEs.
      
      This optimises the path so that we only remove PTEs that are valid.
      It also uses the read 4 PTEs at once HCALL.  For the common case where
      a PTEs is invalid in a 1TB segment, this turns the 3 HCALLs per PTE
      down to 1 HCALL per 4 PTEs.
      
      This gives an > 10x speedup in kexec times on PHYP, taking a 32GB
      machine from around 1 minute down to a few seconds.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d504bed6
    • M
      powerpc/pseries: Add hcall to read 4 ptes at a time in real mode · f90ece28
      Michael Neuling 提交于
      This adds plpar_pte_read_4_raw() which can be used read 4 PTEs from
      PHYP at a time, while in real mode.
      
      It also creates a new hcall9 which can be used in real mode.  It's the
      same as plpar_hcall9 but minus the tracing hcall statistics which may
      require variables outside the RMO.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f90ece28
    • A
      powerpc: Use more accurate limit for first segment memory allocations · 095c7965
      Anton Blanchard 提交于
      Author: Milton Miller <miltonm@bga.com>
      
      On large machines we are running out of room below 256MB. In some cases we
      only need to ensure the allocation is in the first segment, which may be
      256MB or 1TB.
      
      Add slb0_limit and use it to specify the upper limit for the irqstack and
      emergency stacks.
      
      On a large ppc64 box, this fixes a panic at boot when the crashkernel=
      option is specified (previously we would run out of memory below 256MB).
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      095c7965
    • A
      powerpc/kdump: Use chip->shutdown to disable IRQs · 5d7a8721
      Anton Blanchard 提交于
      I saw this in a kdump kernel:
      
      IOMMU table initialized, virtual merging enabled
      Interrupt 155954 (real) is invalid, disabling it.
      Interrupt 155953 (real) is invalid, disabling it.
      
      ie we took some spurious interrupts. default_machine_crash_shutdown tries
      to disable all interrupt sources but uses chip->disable which maps to
      the default action of:
      
      static void default_disable(unsigned int irq)
      {
      }
      
      If we use chip->shutdown, then we actually mask the IRQ:
      
      static void default_shutdown(unsigned int irq)
      {
              struct irq_desc *desc = irq_to_desc(irq);
      
              desc->chip->mask(irq);
              desc->status |= IRQ_MASKED;
      }
      
      Not sure why we don't implement a ->disable action for xics.c, or why
      default_disable doesn't mask the interrupt.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5d7a8721
    • A
      powerpc/kdump: CPUs assume the context of the oopsing CPU · 06440794
      Anton Blanchard 提交于
      We wrap the crash_shutdown_handles[] calls with longjmp/setjmp, so if any
      of them fault we can recover. The problem is we add a hook to the debugger
      fault handler hook which calls longjmp unconditionally.
      
      This first part of kdump is run before we marshall the other CPUs, so there
      is a very good chance some CPU on the box is going to page fault. And when
      it does it hits the longjmp code and assumes the context of the oopsing CPU.
      The machine gets very confused when it has 10 CPUs all with the same stack,
      all thinking they have the same CPU id. I get even more confused trying
      to debug it.
      
      The patch below adds crash_shutdown_cpu and uses it to specify which cpu is
      in the protected region. Since it can only be -1 or the oopsing CPU, we don't
      need to use memory barriers since it is only valid on the local CPU - no other
      CPU will ever see a value that matches it's local CPU id.
      
      Eventually we should switch the order and marshall all CPUs before doing the
      crash_shutdown_handles[] calls, but that is a bigger fix.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      06440794
    • M
    • A
      powerpc/eeh: Fix oops when probing in early boot · ce47c1c4
      Anton Blanchard 提交于
      If we take an EEH error early enough, we oops:
      
      Call Trace:
      [c000000010483770] [c000000000013ee4] .show_stack+0xd8/0x218 (unreliable)
      [c000000010483850] [c000000000658940] .dump_stack+0x28/0x3c
      [c0000000104838d0] [c000000000057a68] .eeh_dn_check_failure+0x2b8/0x304
      [c000000010483990] [c0000000000259c8] .rtas_read_config+0x120/0x168
      [c000000010483a40] [c000000000025af4] .rtas_pci_read_config+0xe4/0x124
      [c000000010483af0] [c00000000037af18] .pci_bus_read_config_word+0xac/0x104
      [c000000010483bc0] [c0000000008fec98] .pcibios_allocate_resources+0x7c/0x220
      [c000000010483c90] [c0000000008feed8] .pcibios_resource_survey+0x9c/0x418
      [c000000010483d80] [c0000000008fea10] .pcibios_init+0xbc/0xf4
      [c000000010483e20] [c000000000009844] .do_one_initcall+0x98/0x1d8
      [c000000010483ed0] [c0000000008f0560] .kernel_init+0x228/0x2e8
      [c000000010483f90] [c000000000031a08] .kernel_thread+0x54/0x70
      EEH: Detected PCI bus error on device <null>
      EEH: This PCI device has failed 1 times in the last hour:
      EEH: location=U78A5.001.WIH8464-P1 driver= pci addr=0001:00:01.0
      EEH: of node=/pci@800000020000209/usb@1
      EEH: PCI device/vendor: 00351033
      EEH: PCI cmd/status register: 12100146
      
      Unable to handle kernel paging request for data at address 0x00000468
      Oops: Kernel access of bad area, sig: 11 [#1]
      ....
      NIP [c000000000057610] .rtas_set_slot_reset+0x38/0x10c
      LR [c000000000058724] .eeh_reset_device+0x5c/0x124
      Call Trace:
      [c00000000bc6bd00] [c00000000005a0e0] .pcibios_remove_pci_devices+0x7c/0xb0 (unreliable)
      [c00000000bc6bd90] [c000000000058724] .eeh_reset_device+0x5c/0x124
      [c00000000bc6be40] [c0000000000589c0] .handle_eeh_events+0x1d4/0x39c
      [c00000000bc6bf00] [c000000000059124] .eeh_event_handler+0xf0/0x188
      [c00000000bc6bf90] [c000000000031a08] .kernel_thread+0x54/0x70
      
      We called rtas_set_slot_reset while scanning the bus and before the pci_dn
      to pcidev mapping has been created. Since we only need the pcidev to work
      out the type of reset and that only gets set after the module for the
      device loads, lets just do a hot reset if the pcidev is NULL.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Acked-by: NLinas Vepstas <linasvepstas@gmail.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ce47c1c4
    • S
      powerpc/pci: Check devices status property when scanning OF tree · 5b339bdf
      Sonny Rao 提交于
      We ran into an issue where it looks like we're not properly ignoring a
      pci device with a non-good status property when we walk the device tree
      and instanciate the Linux side PCI devices.
      
      However, the EEH init code does look for the property and disables EEH
      on these devices. This leaves us in an inconsistent where we are poking
      at a supposedly bad piece of hardware and RTAS will block our config
      cycles because EEH isn't enabled anyway.
      Signed-of-by: NSonny Rao <sonnyrao@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5b339bdf
    • B
      powerpc/vio: Switch VIO Bus PM to use generic helpers · a1263c71
      Brian King 提交于
      Switch to use the generic power management helpers.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a1263c71
    • P
      powerpc: Avoid bad relocations in iSeries code · e62cee42
      Paul Mackerras 提交于
      Subrata Modak reported that building a CONFIG_RELOCATABLE kernel with
      CONFIG_ISERIES enabled gives the following warnings:
      
      WARNING: 4 bad relocations
      c00000000007216e R_PPC64_ADDR16_HIGHEST  __ksymtab+0x00000000009dcec8
      c000000000072172 R_PPC64_ADDR16_HIGHER  __ksymtab+0x00000000009dcec8
      c00000000007217a R_PPC64_ADDR16_HI  __ksymtab+0x00000000009dcec8
      c00000000007217e R_PPC64_ADDR16_LO  __ksymtab+0x00000000009dcec8
      
      The reason is that decrementer_iSeries_masked is using
      LOAD_REG_IMMEDIATE to get the address of a kernel symbol, which
      creates relocations that aren't handled by the kernel relocator code.
      
      Instead of reading the tb_ticks_per_jiffy variable, we can just set
      the decrementer to its maximum value (0x7fffffff) and that will work
      just as well.  In fact timer_interrupt sets the decrementer to that
      value initially anyway, and we are sure to get into timer_interrupt
      once interrupts are reenabled because we store 1 to the decrementer
      interrupt flag in the lppaca (LPPACADECRINT(r12) here).
      Reported-by: NSubrata Modak <subrata@linux.vnet.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e62cee42
    • M
      powerpc: Use common cpu_die (fixes SMP+SUSPEND build) · abb17f9c
      Milton Miller 提交于
      Configuring a powerpc 32 bit kernel for both SMP and SUSPEND turns on
      CPU_HOTPLUG to enable disable_nonboot_cpus to be called by the common
      suspend code.  Previously the definition of cpu_die for ppc32 was in
      the powermac platform code, causing it to be undefined if that platform
      as not selected.
      
      arch/powerpc/kernel/built-in.o: In function 'cpu_idle':
      arch/powerpc/kernel/idle.c:98: undefined reference to 'cpu_die'
      
      Move the code from setup_64 to smp.c and rename the power mac
      versions to their specific names.
      
      Note that this does not setup the cpu_die pointers in either
      smp_ops (request a given cpu die) or ppc_md (make this cpu die),
      for other platforms but there are generic versions in smp.c.
      Reported-by: NMatt Sealey <matt@genesi-usa.com>
      Reported-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      abb17f9c
    • A
      powerpc: Fix string library functions · ca5d0674
      Andreas Schwab 提交于
      The powerpc strncmp implementation does not correctly handle a zero
      length, despite the claim in 0119536c
      (Add hand-coded assembly strcmp).
      
      Additionally, all the length arguments are size_t, not int, so use
      PPC_LCMPI and eq instead of cmpwi and le throughout.
      Signed-off-by: NAndreas Schwab <schwab@linux-m68k.org>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ca5d0674
    • M
      powerpc/rtasd: Don't start event scan if scan rate is zero · 7358650e
      Michael Ellerman 提交于
      There appear to be Pegasos systems which have the rtas-event-scan
      RTAS tokens, but on which the event scan always fails. They also
      have an event-scan-rate property containing 0, which means call
      event scan 0 times per minute.
      
      So interpret a scan rate of 0 to mean don't scan at all. This fixes
      the problem on the Pegasos machines and makes sense as well.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7358650e
    • J
      earlyprintk,vga,kdb: Fix \b and \r for earlyprintk=vga with kdb · 61eaf539
      Jason Wessel 提交于
      Allow kdb to work properly with with earlyprintk=vga by interpreting
      the backspace and carriage return output characters.  These
      interpretation of these characters is used for simple line editing
      provided in the kdb shell.
      
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: H. Peter Anvin <hpa@zytor.com>
      CC: x86@kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      61eaf539
    • J
      x86,early dr regs,kgdb: Allow kernel debugger early dr register access · 0bb9fef9
      Jason Wessel 提交于
      If the kernel debugger was configured, attached and started with
      kgdbwait, the hardware breakpoint registers should get restored by the
      kgdb code which is managing the dr registers.
      
      CC: x86@kernel.org
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      0bb9fef9
    • J
      x86,kgdb: Implement early hardware breakpoint debugging · 031acd8c
      Jason Wessel 提交于
      It is not possible to use the hw_breakpoint.c API prior to mm_init(),
      but it is possible to use hardware breakpoints with the kernel
      debugger.
      
      Prior to smp_init() it is possible to simply write to the dr registers
      of the boot cpu directly.  This can be used up until the
      kgdb_arch_late() is invoked, at which point the standard hw_breakpoint.c
      API will get used.
      
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      031acd8c
    • J
      x86, kgdb, init: Add early and late debug states · 0b4b3827
      Jason Wessel 提交于
      The kernel debugger can operate well before mm_init(), but the x86
      hardware breakpoint code which uses the perf api requires that the
      kernel allocators are initialized.
      
      This means the kernel debug core needs to provide an optional arch
      specific call back to allow the initialization functions to run after
      the kernel has been further initialized.
      
      The kdb shell already had a similar restriction with an early
      initialization and late initialization.  The kdb_init() was moved into
      the debug core's version of the late init which is called
      dbg_late_init();
      
      CC: kgdb-bugreport@lists.sourceforge.net
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      0b4b3827
    • J
      x86, kgdb: early trap init for early debug · 29c84391
      Jan Kiszka 提交于
      Allow the x86 arch to have early exception processing for the purpose
      of debugging via the kgdb.
      Signed-off-by: NJan Kiszka <jan.kiszka@web.de>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      29c84391
    • J
      mips,kgdb: kdb low level trap catch and stack trace · 5dd11d5d
      Jason Wessel 提交于
      The only way the debugger can handle a trap in inside rcu_lock,
      notify_die, or atomic_notifier_call_chain without a recursive fault is
      to have a low level "first opportunity handler" do_trap_or_bp() handler.
      
      Generally this will be something the vast majority of folks will not
      need, but for those who need it, it is added as a kernel .config
      option called KGDB_LOW_LEVEL_TRAP.
      
      Also added was a die notification for oops such that kdb can catch an
      oops for analysis.
      
      There appeared to be no obvious way to pass the struct pt_regs from
      the original exception back to the stack back tracer, so a special
      case was added to show_stack() for when kdb is active because you
      generally desire to generally look at the back trace of the original
      exception.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      5dd11d5d
    • J
      powerpc,kgdb: Introduce low level trap catching · ba797b28
      Jason Wessel 提交于
      The only way the debugger can handle a trap in inside rcu_lock,
      notify_die, or atomic_notifier_call_chain without a recursive fault is
      to allow the kernel debugger to handle the exception first in
      program_check_exception().
      
      The other change here is to make sure that kgdb_handle_exception() is
      called with correct parameters when catching an oops, because kdb
      needs to know if the entry was an oops, single step, or breakpoint
      exception.
      
      [benh@kernel.crashing.org: move debugger_bpt instead of #ifdef]
      
      CC: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ba797b28
    • J
      x86,kgdb: Add low level debug hook · f503b5ae
      Jason Wessel 提交于
      The only way the debugger can handle a trap in inside rcu_lock,
      notify_die, or atomic_notifier_call_chain without a triple fault is
      to have a low level "first opportunity handler" in the int3 exception
      handler.
      
      Generally this will be something the vast majority of folks will not
      need, but for those who need it, it is added as a kernel .config
      option called KGDB_LOW_LEVEL_TRAP.
      
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: H. Peter Anvin <hpa@zytor.com>
      CC: x86@kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      f503b5ae
    • J
      kgdb: remove post_primary_code references · 98ec1878
      Jason Wessel 提交于
      Remove all the references to the kgdb_post_primary_code.  This
      function serves no useful purpose because you can obtain the same
      information from the "struct kgdb_state *ks" from with in the
      debugger, if for some reason you want the data.
      
      Also remove the unintentional duplicate assignment for ks->ex_vector.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      98ec1878
    • J
      kgdb: core changes to support kdb · dcc78711
      Jason Wessel 提交于
      These are the minimum changes to the kgdb core in order to enable an
      API to connect a new front end (kdb) to the debug core.
      
      This patch introduces the dbg_kdb_mode variable controls where the
      user level I/O is routed.  It will be routed to the gdbstub (kgdb) or
      to the kdb front end which is a simple shell available over the kgdboc
      connection.
      
      You can switch back and forth between kdb or the gdb stub mode of
      operation dynamically.  From gdb stub mode you can blindly type
      "$3#33", or from the kdb mode you can enter "kgdb" to switch to the
      gdb stub.
      
      The logic in the debug core depends on kdb to look for the typical gdb
      connection sequences and return immediately with KGDB_PASS_EVENT if a
      gdb serial command sequence is detected.  That should allow a
      reasonably seamless transition between kdb -> gdb without leaving the
      kernel exception state.  The two gdb serial queries that kdb is
      responsible for detecting are the "?" and "qSupported" packets.
      
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NMartin Hicks <mort@sgi.com>
      dcc78711
    • J
      kdb: core for kgdb back end (2 of 2) · 67fc4e0c
      Jason Wessel 提交于
      This patch contains the hooks and instrumentation into kernel which
      live outside the kernel/debug directory, which the kdb core
      will call to run commands like lsmod, dmesg, bt etc...
      
      CC: linux-arch@vger.kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NMartin Hicks <mort@sgi.com>
      67fc4e0c