1. 19 5月, 2011 12 次提交
    • M
      powerpc: Consolidate ipi message mux and demux · 23d72bfd
      Milton Miller 提交于
      Consolidate the mux and demux of ipi messages into smp.c and call
      a new smp_ops callback to actually trigger the ipi.
      
      The powerpc architecture code is optimised for having 4 distinct
      ipi triggers, which are mapped to 4 distinct messages (ipi many, ipi
      single, scheduler ipi, and enter debugger).  However, several interrupt
      controllers only provide a single software triggered interrupt that
      can be delivered to each cpu.  To resolve this limitation, each smp_ops
      implementation created a per-cpu variable that is manipulated with atomic
      bitops.  Since these lines will be contended they are optimialy marked as
      shared_aligned and take a full cache line for each cpu.  Distro kernels
      may have 2 or 3 of these in their config, each taking per-cpu space
      even though at most one will be in use.
      
      This consolidation removes smp_message_recv and replaces the single call
      actions cases with direct calls from the common message recognition loop.
      The complicated debugger ipi case with its muxed crash handling code is
      moved to debug_ipi_action which is now called from the demux code (instead
      of the multi-message action calling smp_message_recv).
      
      I put a call to reschedule_action to increase the likelyhood of correctly
      merging the anticipated scheduler_ipi() hook coming from the scheduler
      tree; that single required call can be inlined later.
      
      The actual message decode is a copy of the old pseries xics code with its
      memory barriers and cache line spacing, augmented with a per-cpu unsigned
      long based on the book-e doorbell code.  The optional data is set via a
      callback from the implementation and is passed to the new cause-ipi hook
      along with the logical cpu number.  While currently only the doorbell
      implemntation uses this data it should be almost zero cost to retrieve and
      pass it -- it adds a single register load for the argument from the same
      cache line to which we just completed a store and the register is dead
      on return from the call.  I extended the data element from unsigned int
      to unsigned long in case some other code wanted to associate a pointer.
      
      The doorbell check_self is replaced by a call to smp_muxed_ipi_resend,
      conditioned on the CPU_DBELL feature.  The ifdef guard could be relaxed
      to CONFIG_SMP but I left it with BOOKE for now.
      
      Also, the doorbell interrupt vector for book-e was not calling irq_enter
      and irq_exit, which throws off cpu accounting and causes code to not
      realize it is running in interrupt context.  Add the missing calls.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      23d72bfd
    • M
      powerpc: Remove stubbed beat smp support · d4fc8fe1
      Milton Miller 提交于
      I have no idea if the beat hypervisor supports multiple cpus in
      a partition, but the code has not been touched since these stubs
      were added in February of 2007 except to move them in April of 2008.
      These are stubs: start_cpu always returns fail (which is dropped),
      the message passing and reciving are empty functions, and the top
      of file comment says "Incomplete".
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d4fc8fe1
    • M
      powerpc: Remove alloc_maybe_bootmem for zalloc version · a56555e5
      Milton Miller 提交于
      Replace all remaining callers of alloc_maybe_bootmem with
      zalloc_maybe_bootmem.   The callsite in pci_dn is followed with a
      memset to clear the memory, and not zeroing at the other callsites
      in the celleb fake pci code could lead to following uninitialized
      memory as pointers or even freeing said pointers on error paths.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a56555e5
    • M
      powerpc: Remove powermac/pic.h · 7ca8aa09
      Milton Miller 提交于
      Its unused, and of the three declarations, one is duplicated in pmac.h,
      the second is static and the third is renamed and static.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7ca8aa09
    • M
      powerpc: Remove checks for MSG_ALL and MSG_ALL_BUT_SELF · f1072939
      Milton Miller 提交于
      Now that smp_ops->smp_message_pass is always called with an (online) cpu
      number for the target remove the checks for MSG_ALL and MSG_ALL_BUT_SELF.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f1072939
    • M
      powerpc: Use nr_cpu_ids in initial paca allocation · 2cd947f1
      Milton Miller 提交于
      Now that we never set a cpu above nr_cpu_ids possible we can
      limit our initial paca allocation to nr_cpu_ids.  We can then
      clamp the number of cpus in platforms/iseries/setup.c.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2cd947f1
    • M
      powerpc/iseries: Cleanup and fix secondary startup · 7c827337
      Milton Miller 提交于
      9cb82f2f (Make iSeries spin on
      __secondary_hold_spinloop, like pSeries) added a load of current_set
      but this load was repeated later and we don't even have the paca yet.
      It also checked __secondary_hold_spinloop with a 32 bit compare instead
      of a 64 bit compare.
      
      b6f6b98a (Don't spin on sync instruction
      at boot time) missed the copy of the startup code in iseries.
      
      1426d5a3 (Dynamically allocate pacas)
      doesn't allow for pacas to be less than lppacas and recalculated the paca
      location from the cpu id in r0 every time through the secondary loop.
      
      Various revisions over time made the comments on conditional branches
      confusing with respect to being a hold loop or forward progress
      
      Mostly in-order description of the changes:
      
      Replicate the few lines of code saved by the ugly scoped ifdef CONFIG_SMP
      in the secondary loop between yielding on UP and marking time with the
      hypervisor on SMP.  Always compile the iseries_secondary_yield loop and
      use it if the cpu id is above nr_cpu_ids.  Change all forward progress
      paths to be forward branches to the next numerical label.  Assign a
      label to all loops.  Move all sync instructions from the loops to the
      forward progress path.  Wait to load current_set until paca is set to go.
      Move the iseries_secondary_smp_loop label to cover the whole spin loop.
      Add HMT_MEDIUM when we make forward progress.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7c827337
    • A
      powerpc/pseries: Print corrupt r3 in FWNMI code · f0e939ae
      Anton Blanchard 提交于
      I have a report of an FWNMI with an r3 value that we think is
      corrupt, but since we don't print r3 we have no idea what was
      wrong with it.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f0e939ae
    • N
      pseries/iommu: Restore iommu table pointer when restoring iommu ops · eb0dd411
      Nishanth Aravamudan 提交于
      When we swtich to direct dma ops, we set the dma data union to have the
      dma offset.  When we switch back to iommu table ops because of a later
      dma_set_mask, we need to restore the iommu table pointer. Without this
      change, crashes have been observed on kexec where (for reasons still
      being investigated) we fall back to a 32-bit dma mask on a particular
      device and then panic because the table pointer is not valid.
      
      The easiset way to find this value is to call
      pci_dma_dev_setup_pSeriesLP which will search up the pci tree until it
      finds the node with the table.
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Cc: Milton Miller <miltonm@bga.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      eb0dd411
    • A
      powerpc: Remove ioremap_flags · 40f1ce7f
      Anton Blanchard 提交于
      We have a confusing number of ioremap functions. Make things just a
      bit simpler by merging ioremap_flags and ioremap_prot.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      40f1ce7f
    • N
      powerpc: Ensure dtl buffers do not cross 4k boundary · af442a1b
      Nishanth Aravamudan 提交于
      Future releases of fimrware will enforce a requirement that DTL buffers
      do not cross a 4k boundary. Commit
      127493d5 satisfies this requirement for
      CONFIG_VIRT_CPU_ACCOUNTING=y kernels, but if !CONFIG_VIRT_CPU_ACCOUNTING
      && CONFIG_DTL=y, the current code will fail at dtl registration time.
      Fix this by making the kmem cache from
      127493d5 visible outside of setup.c and
      using the same cache in both dtl.c and setup.c. This requires a bit of
      reorganization to ensure ordering of the kmem cache and buffer
      allocations.
      
      Note: Since firmware now limits the size of the buffer, I made
      dtl_buf_entries read-only in debugfs.
      
      Tested with upcoming firmware with the 4 combinations of
      CONFIG_VIRT_CPU_ACCOUNTING and CONFIG_DTL.
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      af442a1b
    • N
      powerpc: Fix kexec with dynamic dma windows · 76730334
      Nishanth Aravamudan 提交于
      When we kexec we look for a particular property added by the first
      kernel, "linux,direct64-ddr-window-info", per-device where we already
      have set up dynamic dma windows. The current code, though, wasn't
      initializing the size of this property and thus when we kexec'd, we
      would find the property but read uninitialized memory resulting in
      garbage ddw values for the kexec'd kernel and panics. Fix this by
      setting the size at enable_ddw() time and ensuring that the size of the
      found property is valid at dupe_ddw_if_kexec() time.
      Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      76730334
  2. 06 5月, 2011 3 次提交
  3. 04 5月, 2011 6 次提交
  4. 27 4月, 2011 7 次提交
  5. 20 4月, 2011 5 次提交
  6. 18 4月, 2011 2 次提交
  7. 05 4月, 2011 3 次提交
  8. 01 4月, 2011 2 次提交