1. 08 1月, 2013 1 次提交
  2. 19 12月, 2012 2 次提交
  3. 04 10月, 2012 1 次提交
  4. 24 6月, 2012 1 次提交
    • B
      ppc64: Rudimentary Support for extra page sizes on server CPUs · 4656e1f0
      Benjamin Herrenschmidt 提交于
      More recent Power server chips (i.e. based on the 64 bit hash MMU)
      support more than just the traditional 4k and 16M page sizes.  This
      can get quite complicated, because which page sizes are supported,
      which combinations are supported within an MMU segment and how these
      page sizes are encoded both in the SLB entry and the hash PTE can vary
      depending on the CPU model (they are not specified by the
      architecture).  In addition the firmware or hypervisor may not permit
      use of certain page sizes, for various reasons.  Whether various page
      sizes are supported on KVM, for example, depends on whether the PR or
      HV variant of KVM is in use, and on the page size of the memory
      backing the guest's RAM.
      
      This patch adds information to the CPUState and cpu defs to describe
      the supported page sizes and encodings.  Since TCG does not yet
      support any extended page sizes, we just set this to NULL in the
      static CPU definitions, expanding this to the default 4k and 16M page
      sizes when we initialize the cpu state.  When using KVM, however, we
      instead determine available page sizes using the new
      KVM_PPC_GET_SMMU_INFO call.  For old kernels without that call, we use
      some defaults, with some guesswork which should do the right thing for
      existing HV and PR implementations.  The fallback might not be correct
      for future versions, but that's ok, because they'll have
      KVM_PPC_GET_SMMU_INFO.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      4656e1f0
  5. 15 4月, 2012 1 次提交
    • D
      target-ppc: Add hooks for handling tcg and kvm limitations · 12b1143b
      David Gibson 提交于
      On target-ppc, our table of CPU types and features encodes the features as
      found on the hardware, regardless of whether these features are actually
      usable under TCG or KVM.  We already have cases where the information from
      the cpu table must be fixed up to account for limitations in the emulation
      method we're using.  e.g. TCG does not support the DFP and VSX instructions
      and KVM needs different numbering of the CPUs in order to tell it the
      correct thread to core mappings.
      
      This patch cleans up these hacks to handle emulation limitations by
      consolidating them into a pair of functions specifically for the purpose.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      [AF: Style and typo fixes, rename new functions and drop ppc_def_t arg]
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      12b1143b
  6. 15 3月, 2012 1 次提交
  7. 31 10月, 2011 6 次提交
    • D
      ppc: Fix up usermode only builds · 98efaf75
      David Gibson 提交于
      The recent usage of MemoryRegion in kvm_ppc.h breaks builds with
      CONFIG_USER_ONLY=y.  This patch fixes it.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      98efaf75
    • D
      ppc: First cut implementation of -cpu host · a1e98583
      David Gibson 提交于
      For convenience with kvm, x86 allows the user to specify -cpu host on the
      qemu command line, which means make the guest cpu the same as the host
      cpu.  This patch implements the same option for ppc targets.
      
      For now, this just read the host PVR (Processor Version Register) and
      selects one of our existing CPU specs based on it.  This means that the
      option will not work if the host cpu is not supported by TCG, even if that
      wouldn't matter for use under kvm.
      
      In future, we can extend this in future to override parts of the cpu spec
      based on information obtained from the host (via /proc/cpuinfo, the host
      device tree, or explicit KVM calls).  That will let us handle cases where
      the real kvm-virtualized CPU doesn't behave exactly like the TCG-emulated
      CPU.  With appropriate annotation of the CPU specs we'll also then be able
      to use host cpus under kvm even when there isn't a matching full TCG model.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a1e98583
    • D
      pseries: Add device tree properties for VMX/VSX and DFP under kvm · 6659394f
      David Gibson 提交于
      Sufficiently recent PAPR specifications define properties "ibm,vmx"
      and "ibm,dfp" on the CPU node which advertise whether the VMX vector
      extensions (or the later VSX version) and/or the Decimal Floating
      Point operations from IBM's recent POWER CPUs are available.
      
      Currently we do not put these in the guest device tree and the guest
      kernel will consequently assume they are not available.  This is good,
      because they are not supported under TCG.  VMX is similar enough to
      Altivec that it might be trivial to support, but VSX and DFP would
      both require significant work to support in TCG.
      
      However, when running under kvm on a host which supports these
      instructions, there's no reason not to let the guest use them.  This
      patch, therefore, checks for the relevant support on the host CPU
      and, if present, advertises them to the guest as well.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      6659394f
    • D
      pseries: Use Book3S-HV TCE acceleration capabilities · 0f5cb298
      David Gibson 提交于
      The pseries machine of qemu implements the TCE mechanism used as a
      virtual IOMMU for the PAPR defined virtual IO devices.  Because the
      PAPR spec only defines a small DMA address space, the guest VIO
      drivers need to update TCE mappings very frequently - the virtual
      network device is particularly bad.  This means many slow exits to
      qemu to emulate the H_PUT_TCE hypercall.
      
      Sufficiently recent kernels allow this to be mitigated by implementing
      H_PUT_TCE in the host kernel.  To make use of this, however, qemu
      needs to initialize the necessary TCE tables, and map them into itself
      so that the VIO device implementations can retrieve the mappings when
      they access guest memory (which is treated as a virtual DMA
      operation).
      
      This patch adds the necessary calls to use the KVM TCE acceleration.
      If the kernel does not support acceleration, or there is some other
      error creating the accelerated TCE table, then it will still fall back
      to full userspace TCE implementation.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      0f5cb298
    • D
      pseries: Allow KVM Book3S-HV on PPC970 CPUS · 354ac20a
      David Gibson 提交于
      At present, using the hypervisor aware Book3S-HV KVM will only work
      with qemu on POWER7 CPUs.  PPC970 CPUs also have hypervisor
      capability, but they lack the VRMA feature which makes assigning guest
      memory easier.
      
      In order to allow KVM Book3S-HV on PPC970, we need to specially
      allocate the first chunk of guest memory (the "Real Mode Area" or
      RMA), so that it is physically contiguous.
      
      Sufficiently recent host kernels allow such contiguous RMAs to be
      allocated, with a kvm capability advertising whether the feature is
      available and/or necessary on this hardware.  This patch enables qemu
      to use this support, thus allowing kvm acceleration of pseries qemu
      machines on PPC970 hardware.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      
      ---
      
      agraf: fix to use memory api
      354ac20a
    • D
      pseries: Support SMT systems for KVM Book3S-HV · e97c3636
      David Gibson 提交于
      Alex Graf has already made qemu support KVM for the pseries machine
      when using the Book3S-PR KVM variant (which runs the guest in
      usermode, emulating supervisor operations).  This code allows gets us
      very close to also working with KVM Book3S-HV (using the hypervisor
      capabilities of recent POWER CPUs).
      
      This patch moves us another step towards Book3S-HV support by
      correctly handling SMT (multithreaded) POWER CPUs.  There are two
      parts to this:
      
       * Querying KVM to check SMT capability, and if present, adjusting the
         cpu numbers that qemu assigns to cause KVM to assign guest threads
         to cores in the right way (this isn't automatic, because the POWER
         HV support has a limitation that different threads on a single core
         cannot be in different guests at the same time).
      
       * Correctly informing the guest OS of the SMT thread to core mappings
         via the device tree.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      e97c3636
  8. 06 10月, 2011 5 次提交
  9. 08 4月, 2011 1 次提交
  10. 02 4月, 2011 1 次提交
  11. 05 9月, 2010 1 次提交
    • A
      KVM: PPC: Add level based interrupt logic · fc87e185
      Alexander Graf 提交于
      KVM on PowerPC used to have completely broken interrupt logic. Usually,
      interrupts work by having a PIC that pulls a line up/down, so the CPU knows
      that an interrupt is active. This line stays active until some action is
      done to the PIC to release the line.
      
      On KVM for PPC, we just checked if there was an interrupt pending and pulled
      a line in the kernel module. We never released it though, hoping that kernel
      space would just declare an interrupt as released when injected - which is
      wrong.
      
      To fix this, we need to completely redesign the interrupt injection logic.
      Whenever an interrupt line gets triggered, we need to notify kernel space
      that the line is up. Whenever it gets released, we do the same. This way
      we can assure that the interrupt state is always known to kernel space.
      
      This fixes random stalls in KVM guests on PowerPC that were waiting for
      an interrupt while everyone else thought they received it already.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      fc87e185
  12. 27 8月, 2010 1 次提交
    • A
      PPC: Add PV hypercall transport through fw_cfg · 45024f09
      Alexander Graf 提交于
      On KVM for PPC we need to tell the guest which instructions to use when
      doing a hypercall. The clean way to do this is to go through an ioctl
      from userspace and passing it on to the guest using the device tree.
      
      So let's do the qemu part here: read out the hypercall and pass it on
      to the guest's fw_cfg so openBIOS can read it out and expose it again.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      45024f09
  13. 14 2月, 2010 1 次提交
    • A
      PPC: tell the guest about the time base frequency · dc333cd6
      Alexander Graf 提交于
      Our guest systems need to know by how much the timebase increases every second,
      so there usually is a "timebase-frequency" property in the cpu leaf of the
      device tree.
      
      This property is missing in OpenBIOS.
      
      With qemu, Linux's fallback timebase speed and qemu's internal timebase speed
      match up. With KVM, that is no longer true. The guest is running at the same
      timebase speed as the host.
      
      This leads to massive timing problems. On my test machine, a "sleep 2" takes
      about 14 seconds with KVM enabled.
      
      This patch exports the timebase frequency to OpenBIOS, so it can then put them
      into the device tree.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      dc333cd6
  14. 25 1月, 2009 1 次提交
  15. 16 12月, 2008 1 次提交