From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2hTT-0004YR-Ve for qemu-devel@nongnu.org; Thu, 03 Jul 2014 09:55:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2hTN-00023f-NC for qemu-devel@nongnu.org; Thu, 03 Jul 2014 09:54:55 -0400 Message-ID: <53B560A7.9020403@suse.de> Date: Thu, 03 Jul 2014 15:54:47 +0200 From: Alexander Graf MIME-Version: 1.0 References: <53B5502D.2090706@suse.de> <1404394327-21481-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1404394327-21481-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] target-ppc: Add pvr_match() callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org 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 > --- > 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