1. 31 10月, 2011 17 次提交
    • D
      ppc: Avoid decrementer related kvm exits · 55f7d4b0
      David Gibson 提交于
      In __cpu_ppc_store_decr(), we set up a regular timer used to trigger
      decrementer interrupts.  This is necessary to implement the decrementer
      properly under TCG, but is unnecessary under KVM (true for both Book3S-PR
      and Book3S-HV KVM variants), because the kernel handles generating and
      delivering decrementer exceptions.
      
      Under kvm, in fact, the timer causes expensive and unnecessary exits from
      kvm to qemu.  This patch, therefore, disables setting the timer when kvm
      is in use.
      Signed-off-by: NAnton Blanchard <anton@au1.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      55f7d4b0
    • A
      PPC: Disable non-440 CPUs for ppcemb target · f0ad8c34
      Alexander Graf 提交于
      The sole reason we have the ppcemb target is to support MMUs that have
      less than the usual 4k possible page size. There are very few of these
      chips and I don't want to add additional QA and testing burden to everyone
      to ensure that code still works when TARGET_PAGE_SIZE is not 4k.
      
      So this patch disables all CPUs except for MMU_BOOKE capable ones from
      the ppcemb target.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f0ad8c34
    • A
      PPC: Bump qemu-system-ppc to 64-bit physical address space · 8b242eba
      Alexander Graf 提交于
      Some 32-bit PPC CPUs can use up to 36 bit of physical address space.
      Treat them accordingly in the qemu-system-ppc binary type.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8b242eba
    • D
      pseries: Under kvm use guest cpu = host cpu by default · 6b7a2cf6
      David Gibson 提交于
      Now that we've implemented -cpu host for ppc, this patch updates the
      pseries machine to use the host cpu as the guest cpu by default when
      running under KVM.  This is important because under KVM Book3S-HV the guest
      cpu _cannot_ be of a different type to the host cpu (at the moment
      KVM Book3S-HV will silently virtualize the host cpu instead of whatever was
      requested, but in future it is likely to simply refuse to run the VM if
      a cpu model other than the host's is requested).
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      6b7a2cf6
    • D
      ppc: Add cpu defs for POWER7 revisions 2.1 and 2.3 · 37e305ce
      David Gibson 提交于
      This patch adds cpu specs to the table for POWER7 revisions 2.1 and 2.3.
      This allows -cpu host to be used on these host cpus.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      37e305ce
    • 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
      ppc: Remove broken partial PVR matching · be40edcd
      David Gibson 提交于
      The ppc target contains a ppc_find_by_pvr() function, which looks up a
      CPU spec based on a PVR (that is, based on the value in the target cpu's
      Processor Version Register).  PVR values contain information on both the
      cpu model (upper 16 bits, usually) and on the precise revision (low 16
      bits, usually).
      
      ppc_find_by_pvr, as well as making exact PVR matches, attempts to find
      "close" PVR matches, when we don't have a CPU spec for the exact revision
      specified.  This sounds like a good idea, execpt that the current logic
      is completely nonsensical.
      
      It seems to assume CPU families are subdivided bit by bit in the PVR in a
      way they just aren't.  Specifically, it requires a match on all bits of the
      specified pvr up to the last non-zero bit.  This has the bizarre effect
      that when the low bits are simply a sequential revision number (a common
      though not universal pattern), then odd specified revisions must be matched
      exactly, whereas even specified revisions will also match the next odd
      revision, likewise for powers of 4, 8 and so forth.
      
      To correctly do inexact matching we'd need to re-organize the table of CPU
      specs to include a mask showing what PVR range the spec is compatible with
      (similar to the cputable code in the Linux kernel).
      
      For now, just remove the bogosity by only permitting exact PVR matches.
      That at least makes the matching simple and consistent.  If we need inexact
      matching we can add the necessary per-subfamily masks later.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      be40edcd
    • D
      pseries: Update SLOF firmware image · d20dfdd4
      David Gibson 提交于
      This patch is a general update to the SLOF firmware image used on the
      pseries machine.  This doesn't contain updates for specific features but
      contains a number of bugfixes and enhancements in the main SLOF tree from
      Thomas Huth.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d20dfdd4
    • 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
      ppc: Generalize the kvmppc_get_clockfreq() function · 9bc884b7
      David Gibson 提交于
      Currently the kvmppc_get_clockfreq() function reads the host's clock
      frequency from /proc/device-tree, which is useful to past to the guest
      in KVM setups.  However, there are some other host properties
      advertised in the device tree which can also be relevant to the
      guests.
      
      This patch, therefore, replaces kvmppc_get_clockfreq() which can
      retrieve any named, single integer property from the host device
      tree's CPU node.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      9bc884b7
    • F
      Set an invalid-bits mask for each SPE instructions · 70560da7
      Fabien Chouteau 提交于
      SPE instructions are defined by pairs. Currently, the invalid-bits mask is set
      for the first instruction, but the second one can have a different mask.
      
      example:
      GEN_SPE(efdcmpeq,    efdcfs,      0x17, 0x0B, 0x00600000, 0x00180000, PPC_SPE_DOUBLE),
      Signed-off-by: NFabien Chouteau <chouteau@adacore.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      70560da7
    • D
      pseries: Update SLOF firmware image · bdcf9d6c
      David Gibson 提交于
      This patch updates the SLOF submodule and precompiled image.  The new
      SLOF versions contains two changes of note:
      
       * The previous SLOF has a bug in SCSI condition handling that was
         exposed by recent updates to qemu's SCSI emulation.  This update
         fixes the bug.
      
       * The previous SLOF has a bug in its addressing of SCSI devices,
         which can be exposed under certain conditions.  The new SLOF also
         fixes this.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      bdcf9d6c
    • 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
    • L
      ppc/e500_pci: Fix an array overflow issue · eeae2e7b
      Liu Yu-B13201 提交于
      When access PPCE500_PCI_IW1 the previous index get overflow.
      The patch fix the issue and update all to keep consistent style.
      Signed-off-by: NLiu Yu <yu.liu@freescale.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      eeae2e7b
    • L
      ppc/e500_pci: Fix code style · 6875dc8e
      Liu Yu-B13201 提交于
      Put trailing statements on next line.
      Signed-off-by: NLiu Yu <yu.liu@freescale.com>
      Reviewed-by: NAndreas Färber <andreas.faerber@web.de>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      6875dc8e
  2. 30 10月, 2011 5 次提交
  3. 28 10月, 2011 1 次提交
    • B
      Merge branch 'rth/vis2' of git://repo.or.cz/qemu/rth · b5a12aa2
      Blue Swirl 提交于
      * 'rth/vis2' of git://repo.or.cz/qemu/rth:
        target-sparc: Implement FALIGNDATA inline.
        target-sparc: Implement BMASK/BSHUFFLE.
        target-sparc: Implement ALIGNADDR* inline.
        target-sparc: Implement EDGE* instructions.
        target-sparc: Implement fpack{16,32,fix}.
        target-sparc: Implement PDIST.
        target-sparc: Do exceptions management fully inside the helpers.
        target-sparc: Change fpr representation to doubles.
        target-sparc: Undo cpu_fpr rename.
        target-sparc: Extract float128 move to a function.
        target-sparc: Extract common code for floating-point operations.
        target-sparc: Make FPU/VIS helpers const when possible.
        target-sparc: Pass float64 parameters instead of dt0/1 temporaries.
        target-sparc: Add accessors for double-precision fpr access.
        target-sparc: Mark fprs dirty in store accessor.
        target-sparc: Add accessors for single-precision fpr access.
      b5a12aa2
  4. 27 10月, 2011 17 次提交