1. 22 5月, 2011 1 次提交
  2. 24 10月, 2010 1 次提交
    • A
      KVM: PPC: Implement hypervisor interface · 2a342ed5
      Alexander Graf 提交于
      To communicate with KVM directly we need to plumb some sort of interface
      between the guest and KVM. Usually those interfaces use hypercalls.
      
      This hypercall implementation is described in the last patch of the series
      in a special documentation file. Please read that for further information.
      
      This patch implements stubs to handle KVM PPC hypercalls on the host and
      guest side alike.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      2a342ed5
  3. 17 5月, 2010 3 次提交
    • A
      KVM: PPC: Extract MMU init · 9cc5e953
      Alexander Graf 提交于
      The host shadow mmu code needs to get initialized. It needs to fetch a
      segment it can use to put shadow PTEs into.
      
      That initialization code was in generic code, which is icky. Let's move
      it over to the respective MMU file.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      9cc5e953
    • A
      KVM: PPC: Improve indirect svcpu accessors · c7f38f46
      Alexander Graf 提交于
      We already have some inline fuctions we use to access vcpu or svcpu structs,
      depending on whether we're on booke or book3s. Since we just put a few more
      registers into the svcpu, we also need to make sure the respective callbacks
      are available and get used.
      
      So this patch moves direct use of the now in the svcpu struct fields to
      inline function calls. While at it, it also moves the definition of those
      inline function calls to respective header files for booke and book3s,
      greatly improving readability.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      c7f38f46
    • A
      KVM: PPC: Allow userspace to unset the IRQ line · 18978768
      Alexander Graf 提交于
      Userspace can tell us that it wants to trigger an interrupt. But
      so far it can't tell us that it wants to stop triggering one.
      
      So let's interpret the parameter to the ioctl that we have anyways
      to tell us if we want to raise or lower the interrupt line.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      
      v2 -> v3:
      
       - Add CAP for unset irq
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      18978768
  4. 25 4月, 2010 4 次提交
    • A
      KVM: PPC: Add helpers to modify ppc fields · 0564ee8a
      Alexander Graf 提交于
      The PowerPC specification always lists bits from MSB to LSB. That is
      really confusing when you're trying to write C code, because it fits
      in pretty badly with the normal (1 << xx) schemes.
      
      So I came up with some nice wrappers that allow to get and set fields
      in a u64 with bit numbers exactly as given in the spec. That makes the
      code in KVM and the spec easier comparable.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      0564ee8a
    • A
      KVM: PPC: Add AGAIN type for emulation return · 37f5bca6
      Alexander Graf 提交于
      Emulation of an instruction can have different outcomes. It can succeed,
      fail, require MMIO, do funky BookE stuff - or it can just realize something's
      odd and will be fixed the next time around.
      
      Exactly that is what EMULATE_AGAIN means. Using that flag we can now tell
      the caller that nothing happened, but we still want to go back to the
      guest and see what happens next time we come around.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      37f5bca6
    • A
      KVM: PPC: Teach MMIO Signedness · 3587d534
      Alexander Graf 提交于
      The guest I was trying to get to run uses the LHA and LHAU instructions.
      Those instructions basically do a load, but also sign extend the result.
      
      Since we need to fill our registers by hand when doing MMIO, we also need
      to sign extend manually.
      
      This patch implements sign extended MMIO and the LHA(U) instructions.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      3587d534
    • A
      KVM: PPC: Enable MMIO to do 64 bits, fprs and qprs · b104d066
      Alexander Graf 提交于
      Right now MMIO access can only happen for GPRs and is at most 32 bit wide.
      That's actually enough for almost all types of hardware out there.
      
      Unfortunately, the guest I was using used FPU writes to MMIO regions, so
      it ended up writing 64 bit MMIOs using FPRs and QPRs.
      
      So let's add code to handle those odd cases too.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      b104d066
  5. 01 3月, 2010 6 次提交
    • A
      KVM: PPC: Fix initial GPR settings · 1c0006d8
      Alexander Graf 提交于
      Commit 7d01b4c3ed2bb33ceaf2d270cb4831a67a76b51b introduced PACA backed vcpu
      values. With this patch, when a userspace app was setting GPRs before it was
      actually first loaded, the set values get discarded.
      
      This is because vcpu_load loads them from the vcpu backing store that we use
      whenever we're not owning the PACA.
      
      That behavior is not really a major problem, because we don't need it for
      qemu. Other users (like kvmctl) do have problems with it though, so let's
      better do it right.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      1c0006d8
    • A
      KVM: PPC: Emulate trap SRR1 flags properly · 25a8a02d
      Alexander Graf 提交于
      Book3S needs some flags in SRR1 to get to know details about an interrupt.
      
      One such example is the trap instruction. It tells the guest kernel that
      a program interrupt is due to a trap using a bit in SRR1.
      
      This patch implements above behavior, making WARN_ON behave like WARN_ON.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      25a8a02d
    • 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
    • A
      KVM: PPC: Add helpers for CR, XER · 992b5b29
      Alexander Graf 提交于
      We now have helpers for the GPRs, so let's also add some for CR and XER.
      
      Having them in the PACA simplifies code a lot, as we don't need to care
      about where to store CC or not to overflow any integers.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      992b5b29
    • A
      KVM: PPC: Use accessor functions for GPR access · 8e5b26b5
      Alexander Graf 提交于
      All code in PPC KVM currently accesses gprs in the vcpu struct directly.
      
      While there's nothing wrong with that wrt the current way gprs are stored
      and loaded, it doesn't suffice for the PACA acceleration that will follow
      in this patchset.
      
      So let's just create little wrapper inline functions that we call whenever
      a GPR needs to be read from or written to. The compiled code shouldn't really
      change at all for now.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      8e5b26b5
    • A
      KVM: powerpc: Improve DEC handling · 7706664d
      Alexander Graf 提交于
      We treated the DEC interrupt like an edge based one. This is not true for
      Book3s. The DEC keeps firing until mtdec is issued again and thus clears
      the interrupt line.
      
      So let's implement this logic in KVM too. This patch moves the line clearing
      from the firing of the interrupt to the mtdec emulation.
      
      This makes PPC64 guests work without AGGRESSIVE_DEC defined.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Acked-by: NAcked-by: Hollis Blanchard <hollis@penguinppc.org>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      7706664d
  6. 05 11月, 2009 1 次提交
  7. 24 3月, 2009 6 次提交
  8. 31 12月, 2008 9 次提交
  9. 25 11月, 2008 1 次提交
  10. 15 10月, 2008 2 次提交
  11. 04 8月, 2008 1 次提交
  12. 27 7月, 2008 1 次提交
  13. 07 6月, 2008 1 次提交
  14. 04 5月, 2008 1 次提交
  15. 27 4月, 2008 1 次提交