From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH] KVM: PPC: Book3S HV: Disable HPT resizing on POWER9 for now Date: Sat, 18 Feb 2017 13:36:51 +1100 Message-ID: <20170218023651.GA13172@umbus.fritz.box> References: <20170217214140.GA8844@fergus.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org To: Paul Mackerras Return-path: Received: from ozlabs.org ([103.22.144.67]:40289 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752649AbdBRCg6 (ORCPT ); Fri, 17 Feb 2017 21:36:58 -0500 Content-Disposition: inline In-Reply-To: <20170217214140.GA8844@fergus.ozlabs.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 18, 2017 at 08:41:40AM +1100, Paul Mackerras wrote: > The new HPT resizing code added in commit b5baa6877315 ("KVM: PPC: > Book3S HV: KVM-HV HPT resizing implementation", 2016-12-20) doesn't > have code to handle the new HPTE format which POWER9 uses. Thus it > would be best not to advertise it to userspace on POWER9 systems > until it works properly. >=20 > Also, since resize_hpt_rehash_hpte() contains BUG_ON() calls that > could be hit on POWER9, let's prevent it from being called on POWER9 > for now. >=20 > Signed-off-by: Paul Mackerras Acked-by: David Gibson I probably would have put the check on entry to the prepare path, rather than deep in the rehashing, but we need the fix one way or another. > --- > arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 ++++++ > arch/powerpc/kvm/powerpc.c | 3 ++- > 2 files changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3= s_64_mmu_hv.c > index b68b342..f3158fb 100644 > --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c > +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c > @@ -1370,6 +1370,12 @@ static int resize_hpt_rehash(struct kvm_resize_hpt= *resize) > unsigned long i; > int rc; > =20 > + /* > + * resize_hpt_rehash_hpte() doesn't handle the new-format HPTEs > + * that POWER9 uses, and could well hit a BUG_ON on POWER9. > + */ > + if (cpu_has_feature(CPU_FTR_ARCH_300)) > + return -EIO; > for (i =3D 0; i < kvmppc_hpt_npte(&kvm->arch.hpt); i++) { > rc =3D resize_hpt_rehash_hpte(resize, i); > if (rc !=3D 0) > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 2b3e4e6..fcb253b 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -613,7 +613,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, lon= g ext) > r =3D 1; > break; > case KVM_CAP_SPAPR_RESIZE_HPT: > - r =3D !!hv_enabled; > + /* Disable this on POWER9 until code handles new HPTE format */ > + r =3D !!hv_enabled && !cpu_has_feature(CPU_FTR_ARCH_300); > break; > #endif > case KVM_CAP_PPC_HTM: --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYp7NAAAoJEGw4ysog2bOSTxMP/iIp4EwLTEdXrKqDOTKaIXcl xU/n0Dz6AZqBCwnjXNcweePV/irtQswJsMfCZrC15N7CvlAvy4AM8uZFGbYICrh0 kZlyZd21YGHSJ3CRf1Q1UmDB4M+n8HhtPxA8ch/1i6n47SFPUjKcANxPeSyh0QZx +fds7hY2fx+LLp2k7so7r0WtuQAByVwYE3CCdRIBluW/MJ5If+y04Dtngy7cjY41 iSkgBbjf0uDq8yuNppdATmPqdo8C2IcMEPkoXRwQthNkI+Nnb0o6eIiU09pmpMi6 vzh6tycwCBd+6bvVz4RiiHE9Xby86OIQcCEn9DHN0NxvPhyIFxSk5c/ajuPHHHAk +mnB2smcmz0SFuPl9hIr9SFe1hRfZ4fr0MNQ7zk9ZJfnK9hmtcq/09bJtsfNiN6i z2dikq2vyxx/WV+Z4OgKMlBlYY9QGhhyck/xU+tMNb0mOX8T0pa7MPSU+7KGdenX jWi6rRlT2aAfR/VtS7Sp40k08aL+V7g0ivMVH0mkK9JXgOsK2k834MmfYcfQ9iUk gvMSacpnyez2pzQSgmd5My+jljhCNPv26S6vIcwiyCGJWrp1958NeULeNVUThTKb zEsjRhDAZMUAgiDPNv8QJGkOKhpl2I8KBVPVgoyrcmqpVeYU3avhVl7I93deG6IQ H5yRnS9VJLXhTnrza78e =70uy -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--