Re: [PATCH 2/2] KVM: x86/mmu: Exclude the MMU_PRESENT bit from MMIO SPTE's generation

2021-03-09 Thread Tom Lendacky
On 3/8/21 8:19 PM, Sean Christopherson wrote: > Drop bit 11, used for the MMU_PRESENT flag, from the set of bits used to > store the generation number in MMIO SPTEs. MMIO SPTEs with bit 11 set, > which occurs when userspace creates 128+ memslots in an address space, > get false positives for

Re: [PATCH 2/2] KVM: x86/mmu: Exclude the MMU_PRESENT bit from MMIO SPTE's generation

2021-03-09 Thread Maxim Levitsky
On Tue, 2021-03-09 at 14:12 +0100, Paolo Bonzini wrote: > On 09/03/21 11:09, Maxim Levitsky wrote: > > What happens if mmio generation overflows (e.g if userspace keeps on > > updating the memslots)? > > In theory if we have a SPTE with a stale generation, it can became valid, > > no? > > > > I

Re: [PATCH 2/2] KVM: x86/mmu: Exclude the MMU_PRESENT bit from MMIO SPTE's generation

2021-03-09 Thread Paolo Bonzini
On 09/03/21 11:09, Maxim Levitsky wrote: What happens if mmio generation overflows (e.g if userspace keeps on updating the memslots)? In theory if we have a SPTE with a stale generation, it can became valid, no? I think that we should in the case of the overflow zap all mmio sptes. What do you

Re: [PATCH 2/2] KVM: x86/mmu: Exclude the MMU_PRESENT bit from MMIO SPTE's generation

2021-03-09 Thread Maxim Levitsky
On Mon, 2021-03-08 at 18:19 -0800, Sean Christopherson wrote: > Drop bit 11, used for the MMU_PRESENT flag, from the set of bits used to > store the generation number in MMIO SPTEs. MMIO SPTEs with bit 11 set, > which occurs when userspace creates 128+ memslots in an address space, > get false

[PATCH 2/2] KVM: x86/mmu: Exclude the MMU_PRESENT bit from MMIO SPTE's generation

2021-03-08 Thread Sean Christopherson
Drop bit 11, used for the MMU_PRESENT flag, from the set of bits used to store the generation number in MMIO SPTEs. MMIO SPTEs with bit 11 set, which occurs when userspace creates 128+ memslots in an address space, get false positives for is_shadow_present_spte(), which lead to a variety of