qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH v2] target-ppc: Add pvr_match() callback


From: Alexander Graf
Subject: Re: [Qemu-ppc] [PATCH v2] target-ppc: Add pvr_match() callback
Date: Thu, 03 Jul 2014 15:54:47 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0


On 03.07.14 15:32, Alexey Kardashevskiy wrote:
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: Alexey Kardashevskiy <address@hidden>
---
Changes:
v2:
* do not check pvr_match==NULL as it is always define for PPC
---
  target-ppc/cpu-models.c     |  1 -
  target-ppc/cpu-models.h     |  5 +----
  target-ppc/cpu-qom.h        |  2 +-
  target-ppc/translate_init.c | 49 ++++++++++++++++++++++++++++++++-------------
  4 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/target-ppc/cpu-models.c b/target-ppc/cpu-models.c
index 9a91af9..c9112e9 100644
--- a/target-ppc/cpu-models.c
+++ b/target-ppc/cpu-models.c
@@ -44,7 +44,6 @@
          PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);                       \
                                                                              \
          pcc->pvr          = _pvr;                                           \
-        pcc->pvr_mask     = CPU_POWERPC_DEFAULT_MASK;                       \

I still don't see you removing the definition of CPU_POWERPC_DEFAULT_MASK.


Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]