1. 17 Apr, 2013 1 commit
  2. 17 Jan, 2013 1 commit
  3. 10 Jan, 2013 1 commit
  4. 30 Oct, 2012 1 commit
  5. 11 Jul, 2012 1 commit
  6. 06 May, 2012 4 commits
    • Alexander Graf's avatar
      KVM: PPC: Emulator: clean up SPR reads and writes · 54771e62
      Alexander Graf authored
      
      
      When reading and writing SPRs, every SPR emulation piece had to read
      or write the respective GPR the value was read from or stored in itself.
      
      This approach is pretty prone to failure. What if we accidentally
      implement mfspr emulation where we just do "break" and nothing else?
      Suddenly we would get a random value in the return register - which is
      always a bad idea.
      
      So let's consolidate the generic code paths and only give the core
      specific SPR handling code readily made variables to read/write from/to.
      
      Functionally, this patch doesn't change anything, but it increases the
      readability of the code and makes is less prone to bugs.
      
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      54771e62
    • Alexander Graf's avatar
      KVM: PPC: Emulator: clean up instruction parsing · c46dc9a8
      Alexander Graf authored
      
      
      Instructions on PPC are pretty similarly encoded. So instead of
      every instruction emulation code decoding the instruction fields
      itself, we can move that code to more generic places and rely on
      the compiler to optimize the unused bits away.
      
      This has 2 advantages. It makes the code smaller and it makes the
      code less error prone, as the instruction fields are always
      available, so accidental misusage is reduced.
      
      Functionally, this patch doesn't change anything.
      
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      c46dc9a8
    • Alexander Graf's avatar
      KVM: PPC: Fix stbux emulation · 978b4fae
      Alexander Graf authored
      
      
      Stbux writes the address it's operating on to the register specified in ra,
      not into the data source register.
      
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      978b4fae
    • Bharat Bhushan's avatar
      KVM: PPC: Use clockevent multiplier and shifter for decrementer · 6e35994d
      Bharat Bhushan authored
      
      
      Time for which the hrtimer is started for decrementer emulation is calculated
      using tb_ticks_per_usec. While hrtimer uses the clockevent for DEC
      reprogramming (if needed) and which calculate timebase ticks using the
      multiplier and shifter mechanism implemented within clockevent layer.
      
      It was observed that this conversion (timebase->time->timebase) are not
      correct because the mechanism are not consistent.
      In our setup it adds 2% jitter.
      
      With this patch clockevent multiplier and shifter mechanism are used when
      starting hrtimer for decrementer emulation. Now the jitter is < 0.5%.
      
      Signed-off-by: default avatarBharat Bhushan <bharat.bhushan@freescale.com>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      6e35994d
  7. 08 Apr, 2012 2 commits
    • Alexander Graf's avatar
      KVM: PPC: Emulate tw and td instructions · 6df79df5
      Alexander Graf authored
      
      
      There are 4 conditional trapping instructions: tw, twi, td, tdi. The
      ones with an i take an immediate comparison, the others compare two
      registers. All of them arrive in the emulator when the condition to
      trap was successfully fulfilled.
      
      Unfortunately, we were only implementing the i versions so far, so
      let's also add support for the other two.
      
      This fixes kernel booting with recents book3s_32 guest kernels.
      
      Reported-by: default avatarJörg Sommer <joerg@alea.gnuu.de>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      6df79df5
    • Alexander Graf's avatar
      KVM: PPC: Pass EA to updating emulation ops · 6020c0f6
      Alexander Graf authored
      
      
      When emulating updating load/store instructions (lwzu, stwu, ...) we need to
      write the effective address of the load/store into a register.
      
      Currently, we write the physical address in there, which is very wrong. So
      instead let's save off where the virtual fault was on MMIO and use that
      information as value to put into the register.
      
      While at it, also move the XOP variants of the above instructions to the new
      scheme of using the already known vaddr instead of calculating it themselves.
      
      Reported-by: default avatarJörg Sommer <joerg@alea.gnuu.de>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      6020c0f6
  8. 05 Mar, 2012 4 commits
  9. 22 May, 2011 2 commits
  10. 24 Oct, 2010 2 commits
    • Alexander Graf's avatar
      KVM: PPC: Convert SPRG[0-4] to shared page · a73a9599
      Alexander Graf authored
      
      
      When in kernel mode there are 4 additional registers available that are
      simple data storage. Instead of exiting to the hypervisor to read and
      write those, we can just share them with the guest using the page.
      
      This patch converts all users of the current field to the shared page.
      
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      a73a9599
    • Alexander Graf's avatar
      KVM: PPC: Convert SRR0 and SRR1 to shared page · de7906c3
      Alexander Graf authored
      
      
      The SRR0 and SRR1 registers contain cached values of the PC and MSR
      respectively. They get written to by the hypervisor when an interrupt
      occurs or directly by the kernel. They are also used to tell the rfi(d)
      instruction where to jump to.
      
      Because it only gets touched on defined events that, it's very simple to
      share with the guest. Hypervisor and guest both have full r/w access.
      
      This patch converts all users of the current field to the shared page.
      
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      de7906c3
  11. 13 Oct, 2010 1 commit
  12. 17 May, 2010 4 commits
  13. 25 Apr, 2010 2 commits
    • Alexander Graf's avatar
      KVM: PPC: Add AGAIN type for emulation return · 37f5bca6
      Alexander Graf authored
      
      
      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: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      37f5bca6
    • Alexander Graf's avatar
      KVM: PPC: Teach MMIO Signedness · 3587d534
      Alexander Graf authored
      
      
      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: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      3587d534
  14. 01 Mar, 2010 6 commits
  15. 05 Nov, 2009 3 commits
  16. 10 Sep, 2009 3 commits
  17. 24 Mar, 2009 1 commit
  18. 31 Dec, 2008 1 commit
    • Hollis Blanchard's avatar
      KVM: ppc: Implement in-kernel exit timing statistics · 73e75b41
      Hollis Blanchard authored
      
      
      Existing KVM statistics are either just counters (kvm_stat) reported for
      KVM generally or trace based aproaches like kvm_trace.
      For KVM on powerpc we had the need to track the timings of the different exit
      types. While this could be achieved parsing data created with a kvm_trace
      extension this adds too much overhead (at least on embedded PowerPC) slowing
      down the workloads we wanted to measure.
      
      Therefore this patch adds a in-kernel exit timing statistic to the powerpc kvm
      code. These statistic is available per vm&vcpu under the kvm debugfs directory.
      As this statistic is low, but still some overhead it can be enabled via a
      .config entry and should be off by default.
      
      Since this patch touched all powerpc kvm_stat code anyway this code is now
      merged and simplified together with the exit timing statistic code (still
      working with exit timing disabled in .config).
      
      Signed-off-by: default avatarChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
      Signed-off-by: default avatarHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      73e75b41