Re: [PATCH] KVM: mmu: Fix SPTE encoding of MMIO generation upper half

2020-12-09 Thread Paolo Bonzini
On 08/12/20 22:12, Sean Christopherson wrote: #define MMIO_SPTE_GEN_MASK GENMASK_ULL(MMIO_SPTE_GEN_LOW_BITS + MMIO_SPTE_GEN_HIGH_BITS - 1, 0) What if we leave MMIO_SPTE_GEN_MASK as is, GENMASK_ULL(17, 0), and instead add a BUILD_BUG_ON() to assert that it matches the above logic?

Re: [PATCH] KVM: mmu: Fix SPTE encoding of MMIO generation upper half

2020-12-08 Thread Sean Christopherson
On Sun, Dec 06, 2020, Paolo Bonzini wrote: > On 05/12/20 01:48, Maciej S. Szmigiero wrote: > > From: "Maciej S. Szmigiero" > > > > Commit cae7ed3c2cb0 ("KVM: x86: Refactor the MMIO SPTE generation handling") > > cleaned up the computation of MMIO generation SPTE masks, however it > > introduced

Re: [PATCH] KVM: mmu: Fix SPTE encoding of MMIO generation upper half

2020-12-06 Thread Maciej S. Szmigiero
On 06.12.2020 11:09, Paolo Bonzini wrote: On 05/12/20 01:48, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Commit cae7ed3c2cb0 ("KVM: x86: Refactor the MMIO SPTE generation handling") cleaned up the computation of MMIO generation SPTE masks, however it introduced a bug how the upper

Re: [PATCH] KVM: mmu: Fix SPTE encoding of MMIO generation upper half

2020-12-06 Thread Paolo Bonzini
On 05/12/20 01:48, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Commit cae7ed3c2cb0 ("KVM: x86: Refactor the MMIO SPTE generation handling") cleaned up the computation of MMIO generation SPTE masks, however it introduced a bug how the upper part was encoded: SPTE bits 52-61 were

[PATCH] KVM: mmu: Fix SPTE encoding of MMIO generation upper half

2020-12-04 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Commit cae7ed3c2cb0 ("KVM: x86: Refactor the MMIO SPTE generation handling") cleaned up the computation of MMIO generation SPTE masks, however it introduced a bug how the upper part was encoded: SPTE bits 52-61 were supposed to contain bits 10-19 of the current