From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH v3 33/33] KVM: PPC: Book3S HV: Add a VM capability to enable nested virtualization Date: Fri, 5 Oct 2018 13:29:23 +1000 Message-ID: <20181005032922.GC13763@umbus.fritz.box> References: <1538479892-14835-1-git-send-email-paulus@ozlabs.org> <1538479892-14835-34-git-send-email-paulus@ozlabs.org> <20181003062144.GY1886@umbus.fritz.box> <20181004094826.GC3255@fergus> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8X7/QrJGcKSMr1RN" Cc: linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Paul Mackerras Return-path: Content-Disposition: inline In-Reply-To: <20181004094826.GC3255@fergus> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" List-Id: kvm.vger.kernel.org --8X7/QrJGcKSMr1RN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 04, 2018 at 07:48:26PM +1000, Paul Mackerras wrote: > On Wed, Oct 03, 2018 at 04:21:44PM +1000, David Gibson wrote: > > On Tue, Oct 02, 2018 at 09:31:32PM +1000, Paul Mackerras wrote: > > > With this, userspace can enable a KVM-HV guest to run nested guests > > > under it. > [snip] > > > +/* If set, guests are allowed to create and control nested guests */ > > > +static bool enable_nested =3D true; > > > +module_param(enable_nested, bool, S_IRUGO | S_IWUSR); > > > +MODULE_PARM_DESC(enable_nested, "Enable nested virtualization (only = on POWER9)"); > >=20 > > I'd suggest calling the module parameter just "nested" to match x86. >=20 > OK. >=20 > > > /* If set, the threads on each CPU core have to be in the same MMU m= ode */ > > > static bool no_mixing_hpt_and_radix; > > > =20 > > > @@ -5188,6 +5193,17 @@ static int kvmhv_configure_mmu(struct kvm *kvm= , struct kvm_ppc_mmuv3_cfg *cfg) > > > return err; > > > } > > > =20 > > > +static int kvmhv_enable_nested(struct kvm *kvm, bool enable) > > > +{ > > > + if (!(enable_nested && cpu_has_feature(CPU_FTR_ARCH_300))) > > > + return -EINVAL; > >=20 > > Maybe EPERM, rather than EINVAL. There's nothing invalid about the > > ioctl() parameters - we just can't do what they want. >=20 > Just for pedantry's sake, I'll make it EPERM for !enable_nested and > ENODEV for !POWER9. :) Sounds fair. --=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 --8X7/QrJGcKSMr1RN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlu22pAACgkQbDjKyiDZ s5JuEhAA0c/od/SWKpzb/mNeF758xTwySEWScTrtMHwKsm+8wQAlwXZKVyzuuOnF DOn8zihObGuRyQm7TykHSuVrz+NOUytwvVh8W7kV4ofAFa/uAlX9lIBbULct89s1 klg2QVTnls7p24siEQlrM+7AbJh/0j2/DL2j7S4Ngemcwx8VKZR5WHp7uifX/wxa /Anw0mxrbl7uuDA3MjpF5iRiIO8hqCNxRntoJHR7kWqjN9BNlMvjlqa9XSA5AgTV M56VaDvAAHSLb47VLa0vdtrvfByThmk709fqrBpObtFpj5rF7Ir5H2zhCrS/0LrP nEWKfQDd0Jvf3PaZwhmOWLwuHOVkCup9Ayx38ujzGFYoU4kGm4tMVEHMs7x6Omom ITEkaHguLsi975Af0JxX2XpsmF5Q/aCmAorCiFp++15El7o+1bff5WlCKg0i2MWW Wge21I4RCTO+thtM2iW5VKaUOkpxy2Yf4U8WMDQxwuR8lXxWN0IzGnr9/11W2BAT RXpqmedMD3Pg4evbrdwYpSuCCEVPYj0ZOqsWnlgm+624Fndym3RveHasT5jaMI+H AS5I6DfWlzkAvuwhEWIxCa4EAUKqnnKds3om96pnIca/994nwz9yJiiJsITcRI6B 5CGqKKGTQ7UaXM0IKy1zwyPenotZiRG8T1prQRwo5Ibu1EGgVhI= =Yxab -----END PGP SIGNATURE----- --8X7/QrJGcKSMr1RN--