1. 28 5月, 2010 1 次提交
  2. 22 5月, 2010 25 次提交
  3. 21 5月, 2010 14 次提交
    • 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