Received: from eggs.gnu.org ([2001:4830:134:3::10]:35033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpkt6-0004MZ-3g for qemu-devel@nongnu.org; Thu, 29 Sep 2016 19:37:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpkt4-0006E4-TH for qemu-devel@nongnu.org; Thu, 29 Sep 2016 19:37:12 -0400 Date: Fri, 30 Sep 2016 09:26:00 +1000 From: David Gibson Message-ID: <20160929232600.GH30519@umbus.fritz.box> References: <1475146087-19865-1-git-send-email-thuth@redhat.com> <1475146087-19865-3-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="r5lq+205vWdkqwtk" Content-Disposition: inline In-Reply-To: <1475146087-19865-3-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] target-ppc/kvm: Enable transactional memory on POWER8 with KVM-HV, too List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org --r5lq+205vWdkqwtk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 29, 2016 at 12:48:07PM +0200, Thomas Huth wrote: > Transactional memory is also supported on POWER8 KVM-HV if the > KVM_CAP_PPC_HTM is not available in the kernel yet, so add a hack > to allow TM here, too. >=20 > Signed-off-by: Thomas Huth Applied to ppc-for-2.8. > --- > hw/ppc/spapr.c | 2 +- > target-ppc/kvm.c | 9 ++++++++- > 2 files changed, 9 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index fc37145..2f4e818 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -584,7 +584,7 @@ static void spapr_populate_pa_features(CPUPPCState *e= nv, void *fdt, int offset) > */ > pa_features[3] |=3D 0x20; > } > - if (kvmppc_has_cap_htm()) { > + if (kvmppc_has_cap_htm() && pa_size > 24) { It looks like this is an unrelated fix to the original TM test. I'll fold it into the original patch. > pa_features[24] |=3D 0x80; /* Transactional memory support */ > } > =20 > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index dca50bc..e990cb7 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c > @@ -567,11 +567,18 @@ int kvm_arch_init_vcpu(CPUState *cs) > =20 > idle_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, kvm_kick_cpu, cpu); > =20 > - /* Some targets support access to KVM's guest TLB. */ > switch (cenv->mmu_model) { > case POWERPC_MMU_BOOKE206: > + /* This target supports access to KVM's guest TLB */ > ret =3D kvm_booke206_tlb_init(cpu); > break; > + case POWERPC_MMU_2_07: > + if (!cap_htm && !kvmppc_is_pr(cs->kvm_state)) { > + /* KVM-HV has transactional memory on POWER8 also without the > + * KVM_CAP_PPC_HTM extension, so enable it here instead. */ > + cap_htm =3D true; > + } > + break; > default: > break; > } --=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 --r5lq+205vWdkqwtk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX7aMIAAoJEGw4ysog2bOS6kMQAJdXgAJjvfw0p514YM3iCW8h Fq7Ybh8wDdvBWnEeekzvNvBSoubV3wGkfEC23gPoruMKViQ+8EHnGqjObd1ucaTZ 6Boz4iLqasp88QmXS6hvK2IFHQ8zNERiadTLgeWFwiRKki6sSYI7tNUBkapweuxV uuc/dg9g9bFuUb3zeEpqwlt44vb/140zO1fN9WYDUZmN3nDbu0LdrMn3U9lqgNbk m8PyqRkaXWFhBwEQq9YQ2hIeSYOIttGCGVAGn8fuDToCjx1IUR4cSKxqAnPLqxNX bnK0UJXbWcVU/u8e1jD9Lefc6OVCxmvD6sEEtbZFTkV9txYbkS/y9a4Vz4Jr1cKW C4AyFiedp/DNKh8GKH0/EZfWFo1neaJBDxpYjuBdu9XC68CUTx9ap7PzKxS0rFQo df4ACS4uXBlNQv/eoJozxi73TH9qMj0vDIlduIGzRiR9nx4WyMazdKFC89qewsjQ 9k1AJGB8TncZWz/ABeUiY2Q5dd8PXNg2IdyOtV0snvAop1MiTKTNJnz0VPitg2i9 DET87fZn81ap0Fez1qPw4RdQUKgBJse7FN8wNpeUyNr0pPD5VdalNp+iW/DZaara a5F3j4T4hWI0XyUbYe+xOIZ/rJ3KkahsYYHbD3MQKEFz4k9pAg50dU4EfyF15WZZ TTg3KqVX9UnpfeY/ZJBo =KX0Q -----END PGP SIGNATURE----- --r5lq+205vWdkqwtk--