public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] x86: KVM: Limit guest physical bits when 5-level EPT is unsupported
@ 2023-12-18 14:05 Tao Su
  2023-12-18 14:05 ` [PATCH 1/2] " Tao Su
  2023-12-18 14:05 ` [PATCH 2/2] x86: KVM: Emulate instruction when GPA can't be translated by EPT Tao Su
  0 siblings, 2 replies; 34+ messages in thread
From: Tao Su @ 2023-12-18 14:05 UTC (permalink / raw)
  To: kvm
  Cc: seanjc, pbonzini, eddie.dong, chao.gao, xiaoyao.li, yuan.yao,
	yi1.lai, xudong.hao, chao.p.peng, tao1.su

When host doesn't support 5-level EPT, bits 51:48 of the guest physical
address must all be zero, otherwise an EPT violation always occurs[1], and
current handler can't resolve if the GPA is in RAM region. So, instruction
will be re-executed again and again, which causes infinite EPT violation.

Six KVM selftests are timeout due to this issue:
    kvm:access_tracking_perf_test
    kvm:demand_paging_test
    kvm:dirty_log_test
    kvm:dirty_log_perf_test
    kvm:kvm_page_table_test
    kvm:memslot_modification_stress_test

Just report the max supported physical bits and not host physical bits to
guest which is limited by TDP.

[1]
https://www.intel.com/content/www/us/en/content-details/671442/5-level-paging-and-5-level-ept-white-paper.html


Tao Su (2):
  x86: KVM: Limit guest physical bits when 5-level EPT is unsupported
  x86: KVM: Emulate instruction when GPA can't be translated by EPT

 arch/x86/kvm/cpuid.c   | 5 +++--
 arch/x86/kvm/mmu.h     | 1 +
 arch/x86/kvm/mmu/mmu.c | 7 +++++++
 arch/x86/kvm/vmx/vmx.c | 7 +++++++
 4 files changed, 18 insertions(+), 2 deletions(-)


base-commit: ceb6a6f023fd3e8b07761ed900352ef574010bcb
-- 
2.34.1


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

end of thread, other threads:[~2024-01-08 15:29 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 14:05 [PATCH 0/2] x86: KVM: Limit guest physical bits when 5-level EPT is unsupported Tao Su
2023-12-18 14:05 ` [PATCH 1/2] " Tao Su
2023-12-18 15:13   ` Sean Christopherson
2023-12-19  2:51     ` Chao Gao
2023-12-19  3:40       ` Jim Mattson
2023-12-19  8:09         ` Chao Gao
2023-12-19 15:26           ` Sean Christopherson
2023-12-20  7:16             ` Xiaoyao Li
2023-12-20 15:37               ` Sean Christopherson
2023-12-20 11:59             ` Tao Su
2023-12-20 13:39             ` Jim Mattson
2023-12-19  8:31     ` Tao Su
2023-12-20 16:28   ` Sean Christopherson
2023-12-21  7:45     ` Tao Su
2023-12-21  8:19     ` Xu Yilun
2024-01-02 23:24       ` Sean Christopherson
2024-01-03  0:34         ` Jim Mattson
2024-01-03 18:04           ` Sean Christopherson
2024-01-04  2:45             ` Chao Gao
2024-01-04  3:40               ` Jim Mattson
2024-01-04  4:34                 ` Jim Mattson
2024-01-04 11:56                   ` Tao Su
2024-01-04 14:03                     ` Jim Mattson
2024-01-04 15:07                 ` Chao Gao
2024-01-04 17:02                   ` Jim Mattson
2024-01-05 20:26                     ` Sean Christopherson
2024-01-08 13:45                       ` Tao Su
2024-01-08 15:29                         ` Sean Christopherson
2023-12-18 14:05 ` [PATCH 2/2] x86: KVM: Emulate instruction when GPA can't be translated by EPT Tao Su
2023-12-18 15:23   ` Sean Christopherson
2023-12-19  3:10     ` Chao Gao
2023-12-20 13:42   ` Jim Mattson
2024-01-08 13:48     ` Tao Su
2024-01-08 15:19       ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox