1. 19 5月, 2016 3 次提交
  2. 15 1月, 2016 1 次提交
  3. 12 11月, 2015 1 次提交
    • A
      monitor/target-ppc: Define target_get_monitor_def · 0a9516c2
      Alexey Kardashevskiy 提交于
      At the moment get_monitor_def() returns only registers from statically
      defined monitor_defs array. However there is a lot of BOOK3S SPRs
      which are not in the list and cannot be printed from the monitor.
      
      This adds a new target platform hook - target_get_monitor_def().
      The hook is called if a register was not found in the static
      array returned by the target_monitor_defs() hook.
      
      The hook is only defined for POWERPC, it returns registered
      SPRs and fails on unregistered ones providing the user with information
      on what is actually supported on the running CPU. The register value is
      saved as uint64_t as it is the biggest supported register size;
      target_ulong cannot be used because of the stub - it is in a "common"
      code and cannot include "cpu.h", etc; this is also why the hook prototype
      is redefined in the stub instead of being included from some header.
      
      This replaces static descriptors for GPRs, FPRs, SRs with a helper which
      looks for a value in a corresponding array in the CPUPPCState.
      The immediate effect is that all 32 SRs can be printed now (instead of 16);
      later this can be reused for VSX or TM registers.
      
      This replaces callbacks for MSR and XER with static descriptors in
      monitor_defs as they are stored in CPUPPCState.
      
      While we are here, this adds "cr" as a synonym of "ccr".
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      0a9516c2
  4. 26 9月, 2014 1 次提交
  5. 25 8月, 2014 1 次提交
  6. 08 7月, 2014 1 次提交
    • A
      target-ppc: Add pvr_match() callback · 03ae4133
      Alexey Kardashevskiy 提交于
      So far it was enough to have a base PVR value and mask per CPU
      family such as POWER7 or POWER8. However there CPUs which are
      completely architecturally compatible but have different PVRs such
      as POWER7/POWER7+ and POWER8/POWER8E. For these CPUs, top 16 bits
      are CPU family and low 16 bits are the version. The families have
      PVR base values different enough so defining a mask which
      would cover both (or potentially more) CPUs within the family is
      not possible.
      
      This adds a pvr_match() callback to PowerPCCPUClass. The default
      handler simply compares PVR defined in the class.
      
      This implements ppc_pvr_match_power7/ppc_pvr_match_power8 callbacks
      for POWER7/8 families. These check for POWER7/POWER7+ and POWER8/POWER8E.
      
      This changes ppc_cpu_compare_class_pvr_mask() not to check masks but
      use the pvr_match() callback.
      
      Since all server CPUs use the same mask, this defines one mask
      value - CPU_POWERPC_POWER_SERVER_MASK - which is used everywhere now.
      This removes other mask definitions.
      
      This removes pvr_mask from PowerPCCPUClass as it is not used anymore.
      This removes pvr initialization for POWER7/8 families as it is not used
      to find the class, the pvr_match() callback is used instead.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      03ae4133
  7. 27 6月, 2014 1 次提交
    • A
      PPC: Add support for Apple gdb in gdbstub · b3cad3ab
      Alexander Graf 提交于
      The Apple gdbstub protocol is different from the normal gdbstub protocol
      used on PowerPC. Add support for the different variant, so that we can use
      Apple's gdb to debug guest code.
      
      Keep in mind that the switch is a compile time option. We can't detect
      during runtime whether a gdb connecting to us is an upstream gdb or an
      Apple gdb.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b3cad3ab
  8. 16 6月, 2014 5 次提交
    • A
      target-ppc: Define Processor Compatibility Masks · 1a68b714
      Alexey Kardashevskiy 提交于
      This introduces PCR mask for supported compatibility modes.
      This will be used later by the ibm,client-architecture-support call.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      1a68b714
    • A
      target-ppc: Implement "compat" CPU option · 6d9412ea
      Alexey Kardashevskiy 提交于
      This adds basic support for the "compat" CPU option. By specifying
      the compat property, the user can manually switch guest CPU mode from
      "raw" to "architected".
      
      This defines feature disable bits which are not used yet as, for example,
      PowerISA 2.07 says if 2.06 mode is selected, the TM bit does not matter -
      transactional memory (TM) will be disabled because 2.06 does not define
      it at all. The same is true for VSX and 2.05 mode. So just setting a mode
      must be ok.
      
      This does not change the existing behavior as the actual compatibility
      mode support is coming in next patches.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      [agraf: fix compilation on 32bit hosts]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      6d9412ea
    • A
      target-ppc: Add "compat" CPU option · 8dfa3a5e
      Alexey Kardashevskiy 提交于
      PowerISA defines a compatibility mode for server POWERPC CPUs which
      is supported by the PCR special register which is hypervisor privileged.
      To support this mode for guests, SPAPR defines a set of virtual PVRs,
      one per PowerISA spec version. When a hypervisor needs a guest to work in
      a compatibility mode, it puts a virtual PVR value into @cpu-version
      property of a CPU node.
      
      This introduces a "compat" CPU option which defines maximal compatibility
      mode enabled. The supported modes are power6/power7/power8.
      
      This does not change the existing behaviour, new property will be used
      by next patches.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8dfa3a5e
    • G
      target-ppc: Introduce callback for interrupt endianness · 382d2db6
      Greg Kurz 提交于
      POWER7, POWER7+ and POWER8 families use the ILE bit of the LPCR
      special purpose register to decide the endianness to use when
      entering interrupt handlers. When running a Linux guest, this
      provides a hint on the endianness used by the kernel. And when
      it comes to dumping a guest, the information is needed to write
      ELF headers using the kernel endianness.
      Suggested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      [agraf: change subject line]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      382d2db6
    • A
      spapr: Add support for time base offset migration · 98a8b524
      Alexey Kardashevskiy 提交于
      This allows guests to have a different timebase origin from the host.
      
      This is needed for migration, where a guest can migrate from one host
      to another and the two hosts might have a different timebase origin.
      However, the timebase seen by the guest must not go backwards, and
      should go forwards only by a small amount corresponding to the time
      taken for the migration.
      
      This is only supported for recent POWER hardware which has the TBU40
      (timebase upper 40 bits) register. That includes POWER6, 7, 8 but not
      970.
      
      This adds kvm_access_one_reg() to access a special register which is not
      in env->spr. This requires kvm_set_one_reg/kvm_get_one_reg patch.
      
      The feature must be present in the host kernel.
      
      This bumps vmstate_spapr::version_id and enables new vmstate_ppc_timebase
      only for it. Since the vmstate_spapr::minimum_version_id remains
      unchanged, migration from older QEMU is supported but without
      vmstate_ppc_timebase.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      98a8b524
  9. 14 3月, 2014 1 次提交
  10. 05 3月, 2014 1 次提交
    • A
      target-ppc: add PowerPCCPU::cpu_dt_id · 0ce470cd
      Alexey Kardashevskiy 提交于
      Normally CPUState::cpu_index is used to pick the right CPU for various
      operations. However default consecutive numbering does not always work
      for POWERPC.
      
      These indexes are reflected in /proc/device-tree/cpus/PowerPC,POWER7@XX
      and used to call KVM VCPU's ioctls. In order to achieve this,
      kvmppc_fixup_cpu() was introduced. Roughly speaking, it multiplies
      cpu_index by the number of threads per core.
      
      This approach has disadvantages such as:
      1. NUMA configuration stays broken after the fixup;
      2. CPU-targeted commands from the QEMU Monitor do not work properly as
      CPU indexes have been fixed and there is no clear way for the user to
      know what the new CPU indexes are.
      
      This introduces a @cpu_dt_id field in the CPUPPCState struct which
      is initialized from @cpu_index by default and can be fixed later
      to meet the device tree requirements.
      
      This adds an API to handle @cpu_dt_id.
      
      This removes kvmppc_fixup_cpu() as it is not more needed, @cpu_dt_id
      is calculated in ppc_cpu_realize().
      
      This will be used later in machine code.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Acked-by: NMike Day <ncmike@ncultra.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      0ce470cd
  11. 20 12月, 2013 1 次提交
    • A
      powerpc: add PVR mask support · 3bc9ccc0
      Alexey Kardashevskiy 提交于
      IBM POWERPC processors encode PVR as a CPU family in higher 16 bits and
      a CPU version in lower 16 bits. Since there is no significant change
      in behavior between versions, there is no point to add every single CPU
      version in QEMU's CPU list. Also, new CPU versions of already supported
      CPU won't break the existing code.
      
      This adds PVR value/mask support for KVM, i.e. for -cpu host option.
      
      As CPU family class name for POWER7 is "POWER7-family", there is no need
      to touch aliases.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3bc9ccc0
  12. 26 10月, 2013 1 次提交
    • A
      target-ppc: dump-guest-memory support · e62fbc54
      Aneesh Kumar K.V 提交于
      This patch add support for dumping guest memory using dump-guest-memory
      monitor command.
      
      Before patch:
      
      (qemu) dump-guest-memory testcrash
      this feature or command is not currently supported
      (qemu)
      
      After patch:
      
      (qemu) dump-guest-memory testcrash
      (qemu)
      
      crash was able to read the file
      
      crash> bt
      PID: 0      TASK: c000000000c0d0d0  CPU: 0   COMMAND: "swapper/0"
      
       R0:  0000000028000084    R1:  c000000000cafa50    R2:  c000000000cb05b0
       R3:  0000000000000000    R4:  c000000000bc4cb0    R5:  0000000000000000
       R6:  001efe93b8000000    R7:  0000000000000000    R8:  0000000000000000
       R9:  b000000000001032    R10: 0000000000000001    R11: 0001eb2117e00d55
      ....
      ...
      
      NOTE: Currently crash tools doesn't look at ELF notes in the dump on ppc64.
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      e62fbc54
  13. 29 7月, 2013 1 次提交
  14. 27 7月, 2013 1 次提交
  15. 23 7月, 2013 1 次提交
  16. 10 7月, 2013 1 次提交
  17. 28 6月, 2013 1 次提交
  18. 27 4月, 2013 1 次提交
    • D
      pseries: Fixes and enhancements to L1 cache properties · 0cbad81f
      David Gibson 提交于
      PAPR requires that the device tree's CPU nodes have several properties
      with information about the L1 cache.  We already create two of these
      properties, but with incorrect names - "[id]cache-block-size" instead
      of "[id]-cache-block-size" (note the extra hyphen).
      
      We were also missing some of the required cache properties.  This
      patch adds the [id]-cache-line-size properties (which have the same
      values as the block size properties in all current cases).  We also
      add the [id]-cache-size properties.
      
      Adding the cache sizes requires some extra infrastructure in the
      general target-ppc code to (optionally) set the cache sizes for
      various CPUs.  The CPU family descriptions in translate_init.c can set
      these sizes - this patch adds correct information for POWER7, I'm
      leaving other CPU types to people who have a physical example to
      verify against.  In addition, for -cpu host we take the values
      advertised by the host (if available) and use those to override the
      information based on PVR.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      0cbad81f
  19. 22 3月, 2013 1 次提交
    • D
      target-ppc: Use QOM method dispatch for MMU fault handling · b632a148
      David Gibson 提交于
      After previous cleanups, the many scattered checks of env->mmu_model in
      the ppc MMU implementation have, at least for "classic" hash MMUs been
      reduced (almost) to a single switch at the top of
      cpu_ppc_handle_mmu_fault().
      
      An explicit switch is still a pretty ugly way of handling this though.  Now
      that Andreas Färber's CPU QOM cleanups for ppc have gone in, it's quite
      straightforward to instead make the handle_mmu_fault function a QOM method
      on the CPU object.
      
      This patch implements such a scheme, initializing the method pointer at
      the same time as the mmu_model variable.  We need to keep the latter around
      for now, because of the MMU types (BookE, 4xx, et al) which haven't been
      converted to the new scheme yet, and also for a few other uses.  It would
      be good to clean those up eventually.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b632a148
  20. 12 3月, 2013 1 次提交
  21. 09 3月, 2013 1 次提交
    • A
      target-ppc: Convert CPU definitions · cfe34f44
      Andreas Färber 提交于
      Turn the array of model definitions into a set of self-registering QOM
      types with their own class_init. Unique identifiers are obtained from
      the combination of PVR, SVR and family identifiers; this requires all
      alias #defines to be removed from the list. Possibly there are some more
      left after this commit that are not currently being compiled.
      
      Prepares for introducing abstract intermediate CPU types for families.
      
      Keep the right-aligned macro line breaks within 78 chars to aid
      three-way merges.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      cfe34f44
  22. 03 3月, 2013 1 次提交
  23. 16 2月, 2013 1 次提交
  24. 08 1月, 2013 1 次提交
    • 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
  25. 19 12月, 2012 1 次提交
  26. 15 4月, 2012 1 次提交
  27. 10 4月, 2012 1 次提交
  28. 04 4月, 2012 1 次提交