From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahre7-0005wH-3Q for qemu-devel@nongnu.org; Mon, 21 Mar 2016 00:40:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahre5-0006sB-Tk for qemu-devel@nongnu.org; Mon, 21 Mar 2016 00:40:51 -0400 Date: Mon, 21 Mar 2016 15:17:47 +1100 From: David Gibson Message-ID: <20160321041747.GF23586@voom.redhat.com> References: <1458526442-2125-1-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TeJTyD9hb8KJN2Jy" Content-Disposition: inline In-Reply-To: <1458526442-2125-1-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH qemu v2] spapr/target-ppc/kvm: Only add hcall-instructions if KVM supports it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf --TeJTyD9hb8KJN2Jy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 21, 2016 at 01:14:02PM +1100, Alexey Kardashevskiy wrote: > ePAPR defines "hcall-instructions" device-tree property which contains > code to call hypercalls in ePAPR paravirtualized guests. In general > pseries guests should not be using this facility (as there is sPAPR > interface) and this property should not be present in the device tree > for pseries guests. >=20 > However a while ago this interface was chosen to implement a hypervisor > interface to speed up PR KVM guests and since then the property is always > present in the device tree. All KVM guests use it at least to read featur= es > via the KVM_HC_FEATURES hypercall. >=20 > The property is populated by the code returned from the KVM's > KVM_PPC_GET_PVINFO ioctl; if not implemented in the KVM, QEMU writes there > "li r3, -1; nop; nop; nop". If QEMU does not create the property, and > the guest kernel is compiled with CONFIG_EPAPR_PARAVIRT (which is > normally the case), there is exactly the same stub at > @epapr_hypercall_start already. >=20 > Rather than maintaining the property (which used to be BE only; then was > fixed to be endian-agnostic) and confusing the guest (which might think > there is ePAPR host while there is none), it makes sense not to create > the property in the device tree in the first place if the host kernel > does not implement it. >=20 > This changes kvmppc_get_hypercall() to return 1 if the host kernel > does not implement KVM_CAP_PPC_GET_PVINFO. The caller can use it to decide > on whether to create the property or not. >=20 > This changes the pseries machine to not create the property if KVM does > not implement KVM_PPC_GET_PVINFO. In practice this means that from now > on the property will not be created if either HV KVM or TCG is used. >=20 > Signed-off-by: Alexey Kardashevskiy Further reworded the commit message and merged to ppc-for-2.6. --=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 --TeJTyD9hb8KJN2Jy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW73XrAAoJEGw4ysog2bOSv6UQAKm1IWhnWdkdSB10PwBRWaCv wY3lX0YfVN8TACat8dwkjrCopeV2sE1e3RfABM1gfGQXu58DM95qq7e7rYHUZzd1 ftqYMpM1LwzYiVm7LucEIq5BUs3QgVXE+gnqE/WsbmQUIhxt/l1Ib4rWByFfEONU 5UDhrOW0Zqbf3n9ayA9+hCpN3R4Us/EYIsESjjjURHRmviMbP87zK0g9o2yGpCKu CkhmdTkaKf437+QHt4pR9Wd/xvT0zpGLL5NKFfUEdzRbXSbhWJsgRrsEEmH77RZD lbjzhhO2tIXahQjYSI0HuLeJHnLhOtPcSwJdtd3GjP67X/ge8OKRaoW4C4et+FLW pg/pzdqCfd53FLwBW+pvIp39Mq4znQrSEsoJ/ykPiNYhF4lLVL3MJzSlPtpVmx8B IUcKxCIX3Yl8Y3fPZt9JjWCmd2eVf1TEKN2Z3oVtF+YP0di8sWA749PVfjcjlJgu KYkmIw2jQLQX1ly0pU7k6N7kiAaODZ4ji0vyXhaLlXQUrtBcHpLdtX6uu3ckaL1r P6Q9lUPqOMq2nbcB2izJ7UD/hRekQ30KoYo2lnZUJFGxmGCU9M0WOXBpnlDAGcZs cA3KYLN0hDUzh/mUNsPn64Kp9ySfOhwsoPuIdtPWz922d+vMsMlHxOf4E8Qwj6gl fvzXKn4ljz4bYUI4PxiG =KGE0 -----END PGP SIGNATURE----- --TeJTyD9hb8KJN2Jy--