From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE58EC35646 for ; Fri, 21 Feb 2020 10:29:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86057207FD for ; Fri, 21 Feb 2020 10:29:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728015AbgBUK3w (ORCPT ); Fri, 21 Feb 2020 05:29:52 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:50210 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726989AbgBUK3w (ORCPT ); Fri, 21 Feb 2020 05:29:52 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 5B8CF1C013E; Fri, 21 Feb 2020 11:29:50 +0100 (CET) Date: Fri, 21 Feb 2020 11:29:49 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sean Christopherson , Paolo Bonzini , Sasha Levin Subject: Re: [PATCH 4.19 009/191] KVM: nVMX: Use correct root level for nested EPT shadow page tables Message-ID: <20200221102949.GA14608@duo.ucw.cz> References: <20200221072250.732482588@linuxfoundation.org> <20200221072252.173149129@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: <20200221072252.173149129@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > Hardcode the EPT page-walk level for L2 to be 4 levels, as KVM's MMU > currently also hardcodes the page walk level for nested EPT to be 4 > levels. The L2 guest is all but guaranteed to soft hang on its first > instruction when L1 is using EPT, as KVM will construct 4-level page > tables and then tell hardware to use 5-level page tables. I don't get it. 7/191 reverts the patch, then 9/191 reverts the revert. Can we simply drop both 7 and 9, for exactly the same result? (Patch 8 is a unused file, so it does not change the picture). Best regards, Pavel > +++ b/arch/x86/kvm/vmx.c > @@ -5302,6 +5302,9 @@ static void vmx_set_cr0(struct kvm_vcpu *vcpu, unsi= gned long cr0) > =20 > static int get_ept_level(struct kvm_vcpu *vcpu) > { > + /* Nested EPT currently only supports 4-level walks. */ > + if (is_guest_mode(vcpu) && nested_cpu_has_ept(get_vmcs12(vcpu))) > + return 4; > if (cpu_has_vmx_ept_5levels() && (cpuid_maxphyaddr(vcpu) > 48)) > return 5; > return 4; > --=20 > 2.20.1 >=20 >=20 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXk+xHQAKCRAw5/Bqldv6 8hA+AKCQjLR8b57M1oGVUuZ/FRnrtl89owCfaUobAb3Myu7jCjOJfB5Uab4UUyE= =YRW/ -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl--