lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200318172614.GK24357@linux.intel.com>
Date:   Wed, 18 Mar 2020 10:26:14 -0700
From:   Sean Christopherson <sean.j.christopherson@...el.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Ben Gardon <bgardon@...gle.com>,
        Junaid Shahid <junaids@...gle.com>,
        Liran Alon <liran.alon@...cle.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        John Haxby <john.haxby@...cle.com>,
        Miaohe Lin <linmiaohe@...wei.com>,
        Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [PATCH v2 31/32] KVM: nVMX: Don't flush TLB on nested VM
 transition with EPT enabled

On Wed, Mar 18, 2020 at 06:11:28PM +0100, Paolo Bonzini wrote:
> On 18/03/20 18:02, Sean Christopherson wrote:
> > So something like this?
> > 
> > 	if (!nested_ept)
> > 		kvm_mmu_new_cr3(vcpu, cr3, enable_ept ||
> > 					   nested_cpu_has_vpid(vmcs12));
> 
> ... which is exactly nested_has_guest_tlb_tag(vcpu).  Well, not exactly
> but it's a bug in your code above. :)

I don't think it's a bug, it's intentionally different.  When enable_ept=0,
nested_has_guest_tlb_tag() returns true if and only if L1 has enabled VPID
for L2 *and* L2 has been assigned a unique VPID by L0.

For sync purposes, whether or not L2 has been assigned a unique VPID is
irrelevant.  L0 needs to invalidate TLB entries to prevent resuing L1's
entries (assuming L1 has been assigned a VPID), but L0 doesn't need to sync
SPTEs because L2 doesn't expect them to be refreshed.

> It completely makes sense to use that as the third argument, and while a
> comment is still needed it will be much smaller.

Ya, agreed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ