mbox series

[0/4] KVM: x86/mmu: Bug fixes and cleanups in get_mmio_spte()

Message ID 20201218003139.2167891-1-seanjc@google.com (mailing list archive)
Headers show
Series KVM: x86/mmu: Bug fixes and cleanups in get_mmio_spte() | expand

Message

Sean Christopherson Dec. 18, 2020, 12:31 a.m. UTC
Two fixes for bugs that were introduced along with the TDP MMU (though I
strongly suspect only the one reported by Richard, fixed in patch 2/4, is
hittable in practice).  Two additional cleanup on top to try and make the
code a bit more readable and shave a few cycles.

Sean Christopherson (4):
  KVM: x86/mmu: Use -1 to flag an undefined spte in get_mmio_spte()
  KVM: x86/mmu: Get root level from walkers when retrieving MMIO SPTE
  KVM: x86/mmu: Use raw level to index into MMIO walks' sptes array
  KVM: x86/mmu: Optimize not-present/MMIO SPTE check in get_mmio_spte()

 arch/x86/kvm/mmu/mmu.c     | 53 +++++++++++++++++++++-----------------
 arch/x86/kvm/mmu/tdp_mmu.c |  9 ++++---
 arch/x86/kvm/mmu/tdp_mmu.h |  4 ++-
 3 files changed, 39 insertions(+), 27 deletions(-)

Comments

Richard Herbert Dec. 18, 2020, 1:27 a.m. UTC | #1
Hi, Sean and all.

Thanks so much for these.  Very glad to report that the problem has been 
solved.  I applied all four patches, recompiled kernel 5.10.1 and successfully 
launched a Qemu VM.  Let's hope these will get merged into 5.10.2.

Thanks again for the hard work and quick fix.

Richard Herbert


On Thursday, December 17, 2020 7:31:35 PM EST Sean Christopherson wrote:

> Two fixes for bugs that were introduced along with the TDP MMU (though I
> strongly suspect only the one reported by Richard, fixed in patch 2/4, is
> hittable in practice).  Two additional cleanup on top to try and make the
> code a bit more readable and shave a few cycles.
> 
> Sean Christopherson (4):
>   KVM: x86/mmu: Use -1 to flag an undefined spte in get_mmio_spte()
>   KVM: x86/mmu: Get root level from walkers when retrieving MMIO SPTE
>   KVM: x86/mmu: Use raw level to index into MMIO walks' sptes array
>   KVM: x86/mmu: Optimize not-present/MMIO SPTE check in get_mmio_spte()
> 
>  arch/x86/kvm/mmu/mmu.c     | 53 +++++++++++++++++++++-----------------
>  arch/x86/kvm/mmu/tdp_mmu.c |  9 ++++---
>  arch/x86/kvm/mmu/tdp_mmu.h |  4 ++-
>  3 files changed, 39 insertions(+), 27 deletions(-)
Paolo Bonzini Dec. 21, 2020, 6:26 p.m. UTC | #2
On 18/12/20 01:31, Sean Christopherson wrote:
> Two fixes for bugs that were introduced along with the TDP MMU (though I
> strongly suspect only the one reported by Richard, fixed in patch 2/4, is
> hittable in practice).  Two additional cleanup on top to try and make the
> code a bit more readable and shave a few cycles.
> 
> Sean Christopherson (4):
>    KVM: x86/mmu: Use -1 to flag an undefined spte in get_mmio_spte()
>    KVM: x86/mmu: Get root level from walkers when retrieving MMIO SPTE
>    KVM: x86/mmu: Use raw level to index into MMIO walks' sptes array
>    KVM: x86/mmu: Optimize not-present/MMIO SPTE check in get_mmio_spte()
> 
>   arch/x86/kvm/mmu/mmu.c     | 53 +++++++++++++++++++++-----------------
>   arch/x86/kvm/mmu/tdp_mmu.c |  9 ++++---
>   arch/x86/kvm/mmu/tdp_mmu.h |  4 ++-
>   3 files changed, 39 insertions(+), 27 deletions(-)
> 

Queued, thanks (and thanks for Ccing stable on the first two already :)).

Paolo