linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] KVM: x86/mmu: refine memtype related mmu zap
@ 2023-05-09 13:48 Yan Zhao
  2023-05-09 13:50 ` [PATCH v2 1/6] KVM: x86/mmu: add a new mmu zap helper to indicate memtype changes Yan Zhao
                   ` (6 more replies)
  0 siblings, 7 replies; 41+ messages in thread
From: Yan Zhao @ 2023-05-09 13:48 UTC (permalink / raw)
  To: kvm, linux-kernel; +Cc: pbonzini, seanjc, Yan Zhao

This series refines mmu zap caused by EPT memory type update.

The first 3 patches will only do mmu zap when the target is to update
memory type of EPT entries by introducing a help in patch 1 to skip
non-EPT cases.

The 4th patch will trigger zapping of EPT leaf entries if non-coherent
DMA devices count goes from 0 to 1 or from 1 to 0.

The 5th-6th patches reduces EPT zap count by introducing a per-VM based
guest MTRR and only zap EPT entries when this per-VM based guest MTRR
changes.

Changelog:
v1 --> v2:
1. Added a helper to skip non EPT case in patch 1
2. Added patch 2 to skip mmu zap when guest CR0_CD changes if EPT is not
   enabled. (Chao Gao)
3. Added patch 3 to skip mmu zap when guest MTRR changes if EPT is not
   enabled.
4. Do not mention TDX in patch 4 as the code is not merged yet (Chao Gao)
5. Added patches 5-6 to reduce EPT zap during guest bootup.

v1:
https://lore.kernel.org/all/20230508034700.7686-1-yan.y.zhao@intel.com/

Yan Zhao (6):
  KVM: x86/mmu: add a new mmu zap helper to indicate memtype changes
  KVM: x86/mmu: only zap EPT when guest CR0_CD changes
  KVM: x86/mmu: only zap EPT when guest MTRR changes
  KVM: x86/mmu: Zap all EPT leaf entries according noncoherent DMA count
  KVM: x86: Keep a per-VM MTRR state
  KVM: x86/mmu: use per-VM based MTRR for EPT

 arch/x86/include/asm/kvm_host.h |   3 +
 arch/x86/kvm/mmu.h              |   1 +
 arch/x86/kvm/mmu/mmu.c          |  18 ++++-
 arch/x86/kvm/mtrr.c             | 112 +++++++++++++++++++++++++-------
 arch/x86/kvm/vmx/vmx.c          |   2 +-
 arch/x86/kvm/x86.c              |  10 ++-
 arch/x86/kvm/x86.h              |   6 +-
 7 files changed, 122 insertions(+), 30 deletions(-)


base-commit: 5c291b93e5d665380dbecc6944973583f9565ee5
-- 
2.17.1


^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2023-05-31  0:44 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09 13:48 [PATCH v2 0/6] KVM: x86/mmu: refine memtype related mmu zap Yan Zhao
2023-05-09 13:50 ` [PATCH v2 1/6] KVM: x86/mmu: add a new mmu zap helper to indicate memtype changes Yan Zhao
2023-05-10  5:30   ` Chao Gao
2023-05-10  8:06     ` Yan Zhao
2023-05-23 22:51       ` Sean Christopherson
2023-05-24  2:22         ` Yan Zhao
2023-05-24 14:50           ` Sean Christopherson
2023-05-25 10:14             ` Yan Zhao
2023-05-25 15:54               ` Sean Christopherson
2023-05-30  1:32                 ` Yan Zhao
2023-05-30  9:48                 ` Yan Zhao
2023-05-30 23:51                   ` Sean Christopherson
2023-05-31  0:18                     ` Yan Zhao
2023-05-09 13:51 ` [PATCH v2 2/6] KVM: x86/mmu: only zap EPT when guest CR0_CD changes Yan Zhao
2023-05-09 13:51 ` [PATCH v2 3/6] KVM: x86/mmu: only zap EPT when guest MTRR changes Yan Zhao
2023-05-10  5:39   ` Chao Gao
2023-05-10  8:00     ` Yan Zhao
2023-05-10 10:54       ` Huang, Kai
2023-05-11  0:15         ` Yan Zhao
2023-05-11  2:42           ` Huang, Kai
2023-05-11  2:31             ` Yan Zhao
2023-05-11  3:05               ` Huang, Kai
2023-05-09 13:52 ` [PATCH v2 4/6] KVM: x86/mmu: Zap all EPT leaf entries according noncoherent DMA count Yan Zhao
2023-05-09 13:53 ` [PATCH v2 5/6] KVM: x86: Keep a per-VM MTRR state Yan Zhao
2023-05-10 17:23   ` David Matlack
2023-05-21  3:44   ` Robert Hoo
2023-05-23  6:21     ` Yan Zhao
2023-05-24  0:13       ` Sean Christopherson
2023-05-24 11:03         ` Yan Zhao
2023-05-24 18:21           ` Sean Christopherson
2023-05-25 10:09             ` Yan Zhao
2023-05-25 14:53               ` Sean Christopherson
2023-05-26  7:54                 ` Yan Zhao
2023-05-26 16:09                   ` Sean Christopherson
2023-05-30  1:19                     ` Yan Zhao
2023-05-25  7:21       ` Robert Hoo
2023-05-25 15:00         ` Sean Christopherson
2023-05-26  1:49           ` Robert Hoo
2023-05-09 13:53 ` [PATCH v2 6/6] KVM: x86/mmu: use per-VM based MTRR for EPT Yan Zhao
2023-05-24  0:15 ` [PATCH v2 0/6] KVM: x86/mmu: refine memtype related mmu zap Sean Christopherson
2023-05-24 11:04   ` Yan Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).