From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Subject: Re: [PATCH 3/6] KVM: PPC: Book3S HV: Allow HPT and radix on the same core for POWER9 v2.2 Date: Thu, 18 Jan 2018 12:27:24 +1100 Message-ID: <20180118012724.GB22300@fergus.ozlabs.ibm.com> References: <1516182675-25331-1-git-send-email-paulus@ozlabs.org> <1516182675-25331-4-git-send-email-paulus@ozlabs.org> <1516187685.31850.190.camel@au1.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org To: Benjamin Herrenschmidt Return-path: Received: from ozlabs.org ([103.22.144.67]:53457 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbeARB12 (ORCPT ); Wed, 17 Jan 2018 20:27:28 -0500 Content-Disposition: inline In-Reply-To: <1516187685.31850.190.camel@au1.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jan 17, 2018 at 10:14:45PM +1100, Benjamin Herrenschmidt wrote: > On Wed, 2018-01-17 at 20:51 +1100, Paul Mackerras wrote: > > + > > + /* > > + * POWER9 chips before version 2.02 can't have some threads in > > + * HPT mode and some in radix mode on the same core. > > + */ > > + if (cpu_has_feature(CPU_FTR_ARCH_300)) { > > + unsigned int pvr = mfspr(SPRN_PVR); > > + if ((pvr >> 16) == PVR_POWER9 && (pvr & 0xfff) < 0x202) > > + no_mixing_hpt_and_radix = true; > > + } > > + > > return r; > > } > > You need to check that it's a Nimbus using the top nimble of the bottom > 16 bits of PVR. For Cumulus, the fixes are either in 1.0 or 1.1 (to > check). OK, how about this for the check: if (cpu_has_feature(CPU_FTR_ARCH_300)) { unsigned int pvr = mfspr(SPRN_PVR); if ((pvr >> 16) == PVR_POWER9 && (((pvr & 0xe000) == 0 && (pvr & 0xfff) < 0x202) || ((pvr & 0xe000) == 0x2000 && (pvr & 0xfff) < 0x101))) no_mixing_hpt_and_radix = true; } Paul.