From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCHv3] kvmppc: Implement H_LOGICAL_CI_{LOAD,STORE} in KVM Date: Tue, 17 Mar 2015 12:41:13 +1100 Message-ID: <20150317014113.GL5741@voom.redhat.com> References: <1423097605-2169-1-git-send-email-david@gibson.dropbear.id.au> <54D2BFE7.9070204@suse.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DesjdUuHQDwS2t4N" Cc: paulus@samba.org, aik@ozlabs.ru, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Alexander Graf Return-path: Content-Disposition: inline In-Reply-To: <54D2BFE7.9070204@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org --DesjdUuHQDwS2t4N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 05, 2015 at 01:57:11AM +0100, Alexander Graf wrote: >=20 >=20 > On 05.02.15 01:53, David Gibson wrote: > > On POWER, storage caching is usually configured via the MMU - attributes > > such as cache-inhibited are stored in the TLB and the hashed page table. > >=20 > > This makes correctly performing cache inhibited IO accesses awkward when > > the MMU is turned off (real mode). Some CPU models provide special > > registers to control the cache attributes of real mode load and stores = but > > this is not at all consistent. This is a problem in particular for SLO= F, > > the firmware used on KVM guests, which runs entirely in real mode, but > > which needs to do IO to load the kernel. > >=20 > > To simplify this qemu implements two special hypercalls, H_LOGICAL_CI_L= OAD > > and H_LOGICAL_CI_STORE which simulate a cache-inhibited load or store to > > a logical address (aka guest physical address). SLOF uses these for IO. > >=20 > > However, because these are implemented within qemu, not the host kernel, > > these bypass any IO devices emulated within KVM itself. The simplest w= ay > > to see this problem is to attempt to boot a KVM guest from a virtio-blk > > device with iothread / dataplane enabled. The iothread code relies on = an > > in kernel implementation of the virtio queue notification, which is not > > triggered by the IO hcalls, and so the guest will stall in SLOF unable = to > > load the guest OS. > >=20 > > This patch addresses this by providing in-kernel implementations of the > > 2 hypercalls, which correctly scan the KVM IO bus. Any access to an > > address not handled by the KVM IO bus will cause a VM exit, hitting the > > qemu implementation as before. > >=20 > > Note that a userspace change is also required, in order to enable these > > new hcall implementations with KVM_CAP_PPC_ENABLE_HCALL. > >=20 > > Signed-off-by: David Gibson >=20 > Thanks, applied to kvm-ppc-queue. Any news on when this might go up to mainline? --=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 --DesjdUuHQDwS2t4N Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVB4Y5AAoJEGw4ysog2bOSWcoP/1tNnA4vynej7cDrRV0adQKP WMH11dbgNF39GH80QtpTWsouslhq0KgKadZXQ6k5jsR2KycwwS1ST0byBVBXuc5N U0S5Z3JjSs/9B1XqzcaPA8MB0huvfpb7kJqCVI1VA3n41pPAgAq9N4TtlyzCASXF dGaGQkoEmAeQDntiACD0jjr3h8NNMn2otFed0JjYfPG1G+NpnTdcBStn2GC6WMhm +Ln8udMu3G0fdROhiJoHInpULokN4hGBkPG4/TENWukiOl6tFK0jxq5HswDhysTJ Dy4CK0Fn1mDWpauV44KnsiENoQj49HFpkWEQPYdDE+rpF7f+9IVmvOuLYG8J4k3T 70Mf9RWv96GlfdJnmT841u9KM8yzhqaDY0t+MSRNmsEv3H7W+Kzje2Fcns6o6eFF j0JrguNklBKcAADaC//IUqwvAHXrSLMcGEFhuabPKxFIE9eAOJOB/qJd66F1OlNV mjKSnQacyxExdQpKIWRsFPiCQMYuSFoBrnjOF/M3Vreby3yPHOSMyME5m/lF3zG9 tejaLDzZtdLTPZNJgSe6k3mQpgOcEAeLSvsgYSSjQ9jxH8EsLmHP7v4flschD+hR Qo2Bob1n4q076y5JOL/GEWcBmWEQS/KqErB8QjrmH8uNfKS7qwJQiuq0j6zDhgFK jSkGYWO/JYWBd+Uzalmo =oble -----END PGP SIGNATURE----- --DesjdUuHQDwS2t4N--