Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1729837ybv; Fri, 21 Feb 2020 02:30:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxqWeyW4DNHlZB2Sve7ASj0xxGNSpMWkbNkxeZjxQuszu+cQ2wnGw/W9dSYyaR8289p42N/ X-Received: by 2002:a9d:4c8e:: with SMTP id m14mr26086604otf.245.1582281010039; Fri, 21 Feb 2020 02:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582281010; cv=none; d=google.com; s=arc-20160816; b=MKfsFfKk9tmvRTmgD9boIHDrQ8+XRykk6Gd3u1td+6XAt9CCEX+cqEHF02JGSUKgQi Sdb7m/1Jms/HvkoCOXsZyExtht+brtKMnuheVG39OCAkVSu4btEPMJOzCgsNg/CBXtLw ZB9gbSrOdQAKnO96TidFgxbVwiXpeG8lUC0Uelbb1V1U22A8l1ISCFpsz15rI1ObJsGL AMsXaX0GT3lmnC1GMxNL4GWNl1zq8q7LeE+gw5SrHh0yREZ90tffZtvnScL7eguwBFOS V3Y75guRa31I9jZJY7ooK/FCfsVSdr3ll7nOtQgzNer25lI/IyocgldEEzHlUfalJ3i+ CEBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=11Zrc6/tdXlGr09xoRXg9Ql6F7dmGvWugIfGutmFOtU=; b=wSjl1yUq5Aj2HJZ3dMZxgIaiBWzCZumVa5HgmxbAhS0LQT1htvq6fyAKuLhhmlfSAw 2dhMzwx/mNZfBamQ7mXVUGAZ2O4J+4eDokwTXa/R5T50A9bRmI8Ov0QeIEx4Nzq2RRTP u+FkzO9SZXzK1Udsv89ZfaimGDX1N2jdICIG0BPpV1FzLRZl+MOeRXIMld6CFI3cmyeT ve+kbtTOmo7qv85pVPAU9zJFrQOID0OWO6QxohMnUD4PS9UF5P7MWI4A7+gK5HzsoxUk 6aKUStFslWz1+aKQHG8sfaQG5i+soI8Eg3Q8chX0YD3PnkJiwTrsEsd2zjJWsAQVVQWm rjhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i21si553007oii.149.2020.02.21.02.29.55; Fri, 21 Feb 2020 02:30:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727686AbgBUK3w (ORCPT + 99 others); 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--