1. 10 1月, 2013 1 次提交
  2. 15 11月, 2012 1 次提交
  3. 08 4月, 2012 2 次提交
    • A
      KVM: PPC: e500mc: Add doorbell emulation support · 4ab96919
      Alexander Graf 提交于
      When one vcpu wants to kick another, it can issue a special IPI instruction
      called msgsnd. This patch emulates this instruction, its clearing counterpart
      and the infrastructure required to actually trigger that interrupt inside
      a guest vcpu.
      
      With this patch, SMP guests on e500mc work.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      4ab96919
    • S
      KVM: PPC: booke: category E.HV (GS-mode) support · d30f6e48
      Scott Wood 提交于
      Chips such as e500mc that implement category E.HV in Power ISA 2.06
      provide hardware virtualization features, including a new MSR mode for
      guest state.  The guest OS can perform many operations without trapping
      into the hypervisor, including transitions to and from guest userspace.
      
      Since we can use SRR1[GS] to reliably tell whether an exception came from
      guest state, instead of messing around with IVPR, we use DO_KVM similarly
      to book3s.
      
      Current issues include:
       - Machine checks from guest state are not routed to the host handler.
       - The guest can cause a host oops by executing an emulated instruction
         in a page that lacks read permission.  Existing e500/4xx support has
         the same problem.
      
      Includes work by Ashish Kalra <Ashish.Kalra@freescale.com>,
      Varun Sethi <Varun.Sethi@freescale.com>, and
      Liu Yu <yu.liu@freescale.com>.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      [agraf: remove pt_regs usage]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d30f6e48
  4. 20 6月, 2011 1 次提交
  5. 19 5月, 2011 2 次提交
    • 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 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
  6. 09 7月, 2010 2 次提交
    • M
      powerpc/book3e: Resend doorbell exceptions to ourself · 850f22d5
      Michael Ellerman 提交于
      If we are soft disabled and receive a doorbell exception we don't process
      it immediately. This means we need to check on the way out of irq restore
      if there are any doorbell exceptions to process.
      
      The problem is at that point we don't know what our regs are, and that
      in turn makes xmon unhappy. To workaround the problem, instead of checking
      for and processing doorbells, we check for any doorbells and if there were
      any we send ourselves another.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      850f22d5
    • B
      powerpc/book3e: More doorbell cleanups. Sample the PIR register · b9f1cd71
      Benjamin Herrenschmidt 提交于
      The doorbells use the content of the PIR register to match messages
      from other CPUs. This may or may not be the same as our linux CPU
      number, so using that as the "target" is no right.
      
      Instead, we sample the PIR register at boot on every processor
      and use that value subsequently when sending IPIs.
      
      We also use a per-cpu message mask rather than a global array which
      should limit cache line contention.
      
      Note: We could use the CPU number in the device-tree instead of
      the PIR register, as they are supposed to be equivalent. This
      might prove useful if doorbells are to be used to kick CPUs out
      of FW at boot time, thus before we can sample the PIR. This is
      however not the case now and using the PIR just works.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b9f1cd71
  7. 23 2月, 2009 1 次提交