1. 17 5月, 2010 4 次提交
  2. 25 4月, 2010 1 次提交
    • A
      KVM: PPC: Simplify kvmppc_load_up_(FPU|VMX|VSX) · 964b6411
      Alexander Graf 提交于
      We don't need as complex code. I had some thinkos while writing it, figuring
      I needed to support PPC32 paths on PPC64 which would have required DR=0, but
      everything just runs fine with DR=1.
      
      So let's make the functions simple C call wrappers that reserve some space on
      the stack for the respective functions to clobber.
      
      Fixes out-of-RMA-access (and thus guest FPU loading) on the PS3.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      964b6411
  3. 01 3月, 2010 4 次提交
    • A
      KVM: PPC: Add helper functions to call real mode loaders · d5e52813
      Alexander Graf 提交于
      Linux contains quite some bits of code to load FPU, Altivec and VSX lazily for
      a task. It calls those bits in real mode, coming from an interrupt handler.
      
      For KVM we better reuse those, so let's wrap a bit of trampoline magic around
      them and then we can call them from normal module code.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d5e52813
    • A
      KVM: PPC: Call SLB patching code in interrupt safe manner · 021ec9c6
      Alexander Graf 提交于
      Currently we're racy when doing the transition from IR=1 to IR=0, from
      the module memory entry code to the real mode SLB switching code.
      
      To work around that I took a look at the RTAS entry code which is faced
      with a similar problem and did the same thing:
      
        A small helper in linear mapped memory that does mtmsr with IR=0 and
        then RFIs info the actual handler.
      
      Thanks to that trick we can safely take page faults in the entry code
      and only need to be really wary of what to do as of the SLB switching
      part.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      021ec9c6
    • A
      KVM: PPC: Implement 'skip instruction' mode · b4433a7c
      Alexander Graf 提交于
      To fetch the last instruction we were interrupted on, we enable DR in early
      exit code, where we are still in a very transitional phase between guest
      and host state.
      
      Most of the time this seemed to work, but another CPU can easily flush our
      TLB and HTAB which makes us go in the Linux page fault handler which totally
      breaks because we still use the guest's SLB entries.
      
      To work around that, let's introduce a second KVM guest mode that defines
      that whenever we get a trap, we don't call the Linux handler or go into
      the KVM exit code, but just jump over the faulting instruction.
      
      That way a potentially bad lwz doesn't trigger any faults and we can later
      on interpret the invalid instruction we fetched as "fetch didn't work".
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      b4433a7c
    • A
      KVM: PPC: Use PACA backed shadow vcpu · 7e57cba0
      Alexander Graf 提交于
      We're being horribly racy right now. All the entry and exit code hijacks
      random fields from the PACA that could easily be used by different code in
      case we get interrupted, for example by a #MC or even page fault.
      
      After discussing this with Ben, we figured it's best to reserve some more
      space in the PACA and just shove off some vcpu state to there.
      
      That way we can drastically improve the readability of the code, make it
      less racy and less complex.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      7e57cba0
  4. 05 11月, 2009 1 次提交
    • A
      Add interrupt handling code · c862125c
      Alexander Graf 提交于
      Getting from host state to the guest is only half the story. We also need
      to return to our host context and handle whatever happened to get us out of
      the guest.
      
      On PowerPC every guest exit is an interrupt. So all we need to do is trap
      the host's interrupt handlers and get into our #VMEXIT code to handle it.
      
      PowerPCs also have a register that can add an offset to the interrupt handlers'
      adresses which is what the booke KVM code uses. Unfortunately that is a
      hypervisor ressource and we also want to be able to run KVM when we're running
      in an LPAR. So we have to hook into the Linux interrupt handlers.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c862125c