1. 01 2月, 2013 1 次提交
    • A
      PPC: Unify dcbzl code path · 8e33944f
      Alexander Graf 提交于
      The bit that makes a dcbz instruction a dcbzl instruction was declared as
      reserved in ppc32 ISAs. However, hardware simply ignores the bit, making
      code valid if it simply invokes dcbzl instead of dcbz even on 750 and G4.
      
      Thus, mark the bit as unreserved so that we properly emulate a simple dcbz
      in case we're running on non-G5s.
      
      While at it, also refactor the code to check the 970 special case during
      runtime. This way we don't need to differenciate between a 970 dcbz and
      any other dcbz anymore. We also allow for future improvements to add e500mc
      dcbz handling.
      Reported-by: NAmadeusz Sławiński <amade@asmblr.net>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8e33944f
  2. 08 1月, 2013 2 次提交
    • A
      target-ppc: Slim conversion of model definitions to QOM subclasses · 2985b86b
      Andreas Färber 提交于
      Since the model list is highly macrofied, keep ppc_def_t for now and
      save a pointer to it in PowerPCCPUClass. This results in a flat list of
      subclasses including aliases, to be refined later.
      
      Move cpu_ppc_init() to translate_init.c and drop helper.c.
      Long-term the idea is to turn translate_init.c into a standalone cpu.c.
      
      Inline cpu_ppc_usable() into type registration.
      
      Split cpu_ppc_register() in two by code movement into the initfn and
      by turning the remaining part into a realizefn.
      Move qemu_init_vcpu() call into the new realizefn and adapt
      create_ppc_opcodes() to return an Error.
      
      Change ppc_find_by_pvr() -> ppc_cpu_class_by_pvr().
      Change ppc_find_by_name() -> ppc_cpu_class_by_name().
      
      Turn -cpu host into its own subclass. This requires to move the
      kvm_enabled() check in ppc_cpu_class_by_name() to avoid the class being
      found via the normal name lookup in the !kvm_enabled() case.
      Turn kvmppc_host_cpu_def() into the class_init and add an initfn that
      asserts KVM is in fact enabled.
      
      Implement -cpu ? and the QMP equivalent in terms of subclasses.
      This newly exposes -cpu host to the user, ordered last for -cpu ?.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      2985b86b
    • A
      PPC: Bring EPR support closer to reality · 68c2dd70
      Alexander Graf 提交于
      We already used to support the external proxy facility of FSL MPICs,
      but only implemented it halfway correctly.
      
      This patch adds support for
      
        * dynamic enablement of the EPR facility
        * interrupt acknowledgement only when the interrupt is delivered
      
      This way the implementation now is closer to real hardware.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      68c2dd70
  3. 19 12月, 2012 2 次提交
  4. 14 12月, 2012 1 次提交
    • D
      target-ppc: Don't use hwaddr to represent hardware state · b162d02e
      David Gibson 提交于
      The hwaddr type is somewhat vaguely defined as being able to contain bus
      addresses on the widest possible bus in the system.  For that reason it's
      discouraged for representing specific pieces of persistent hardware state,
      which should instead use an explicit width type that matches the bits
      available in real hardware.  In particular, because of the possibility that
      the size of hwaddr might change if different buses are added to the target
      in future, it's not suitable for use in vm state descriptions for savevm
      and migration.
      
      This patch purges such unwise uses of hwaddr from the ppc target code,
      which turns out to be just one.  The ppcemb_tlb_t struct, used on a number
      of embedded ppc models to represent a TLB entry contains a hwaddr for the
      real address field.  This patch changes it to be a fixed uint64_t which is
      suitable enough for all machine types which use this structure.
      
      Other uses of hwaddr in CPUPPCState turn out not to be problematic:
      htab_base and htab_mask are just used for the convenience of the TCG code;
      the underlying machine state is the SDR1 register, which is stored with
      a suitable type already.  Likewise the mpic_cpu_base field is only used
      internally and does not represent fundamental hardware state which needs to
      be saved.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b162d02e
  5. 02 11月, 2012 2 次提交
  6. 01 11月, 2012 2 次提交
    • D
      target-ppc: Extend FPU state for newer POWER CPUs · 30304420
      David Gibson 提交于
      This patch adds some extra FPU state to CPUPPCState.  Specifically,
      fpscr is extended to a target_ulong bits, since some recent (64 bit)
      CPUs now have more status bits than fit inside 32 bits.  Also, we add
      the 32 VSR registers present on CPUs with VSX (these extend the
      standard FP regs, which together with the Altivec/VMX registers form a
      64 x 128bit register file for VSX).
      
      We don't actually support the instructions using these extra registers
      in TCG yet, but we still need a place to store the state so we can
      sync it with KVM and savevm/loadvm it.  This patch updates the savevm
      code to not fail on the extended state, but also does not actually
      save it - that's a project for another patch.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      30304420
    • D
      target-ppc: Rework storage of VPA registration state · ac7d12ba
      David Gibson 提交于
      We change the storage of the VPA information to explicitly use fixed
      size integer types which will make life easier for syncing this data with
      KVM, which we will need in future.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      [agraf: fix commit message]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      ac7d12ba
  7. 31 10月, 2012 2 次提交
  8. 29 10月, 2012 1 次提交
    • D
      target-ppc: Rework storage of VPA registration state · 1bfb37d1
      David Gibson 提交于
      With PAPR guests, hypercalls allow registration of the Virtual Processor
      Area (VPA), SLB shadow and dispatch trace log (DTL), each of which allow
      for certain communication between the guest and hypervisor.  Currently, we
      store the addresses of the three areas and the size of the dtl in
      CPUPPCState.
      
      The SLB shadow and DTL are variable sized, with the size being retrieved
      from within the registered memory area at the hypercall time.  This size
      can later be overwritten with other information, however, so we need to
      save the size as of registration time.  We already do this for the DTL,
      but not for the SLB shadow, so this patch fixes that.
      
      In addition, we change the storage of the VPA information to use fixed
      size integer types which will make life easier for syncing this data with
      KVM, which we will need in future.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      1bfb37d1
  9. 23 10月, 2012 1 次提交
    • A
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity 提交于
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  10. 04 10月, 2012 1 次提交
  11. 24 6月, 2012 7 次提交
  12. 05 6月, 2012 1 次提交
  13. 15 4月, 2012 2 次提交
  14. 07 4月, 2012 1 次提交
  15. 15 3月, 2012 4 次提交
  16. 02 2月, 2012 6 次提交
  17. 02 12月, 2011 1 次提交
  18. 31 10月, 2011 3 次提交
    • D
      ppc: Alter CPU state to mask out TCG unimplemented instructions as appropriate · 02d4eae4
      David Gibson 提交于
      The CPU state contains two bitmaps, initialized from the CPU spec
      which describes which instructions are implemented on the CPU.  A
      couple of bits are defined which cover instructions (VSX and DFP)
      which are not currently implemented in TCG.  So far, these are only
      used to handle the case of -cpu host because a KVM guest can use
      the instructions when the host CPU supports them.
      
      However, it's a mild layering violation to simply not include those
      bits in the CPU descriptions for those CPUs that do support them,
      just because we can't handle them in TCG.  This patch corrects the
      situation, so that the instruction bits _are_ shown correctly in the
      cpu spec table, but are masked out from the cpu state in the non-KVM
      case.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      02d4eae4
    • D
      pseries: Correct vmx/dfp handling in both KVM and TCG cases · a7342588
      David Gibson 提交于
      Currently, when KVM is enabled, the pseries machine checks if the host
      CPU supports VMX, VSX and/or DFP instructions and advertises
      accordingly in the guest device tree.  It does this regardless of what
      CPU is selected on the command line.  On the other hand, when in TCG
      mode, it never advertises any of these facilities, even basic VMX
      (Altivec) which is supported in TCG.
      
      Now that we have a -cpu host option for ppc, it is fairly
      straightforward to fix both problems.  This patch changes the -cpu
      host code to override the basic cpu spec derived from the PVR with
      information queried from the host avout VMX, VSX and DFP capability.
      The pseries code then uses the instruction availability advertised in
      the cpu state to set the guest device tree correctly for both the KVM
      and TCG cases.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a7342588
    • 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