[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240904030751.117579-4-rick.p.edgecombe@intel.com>
Date: Tue, 3 Sep 2024 20:07:33 -0700
From: Rick Edgecombe <rick.p.edgecombe@...el.com>
To: seanjc@...gle.com,
pbonzini@...hat.com,
kvm@...r.kernel.org
Cc: kai.huang@...el.com,
dmatlack@...gle.com,
isaku.yamahata@...il.com,
yan.y.zhao@...el.com,
nik.borisov@...e.com,
rick.p.edgecombe@...el.com,
linux-kernel@...r.kernel.org,
Yuan Yao <yuan.yao@...ux.intel.com>,
Binbin Wu <binbin.wu@...ux.intel.com>
Subject: [PATCH 03/21] KVM: x86/mmu: Do not enable page track for TD guest
From: Yan Zhao <yan.y.zhao@...el.com>
TDX does not support write protection and hence page track.
Though !tdp_enabled and kvm_shadow_root_allocated(kvm) are always false
for TD guest, should also return false when external write tracking is
enabled.
Cc: Yuan Yao <yuan.yao@...ux.intel.com>
Signed-off-by: Yan Zhao <yan.y.zhao@...el.com>
Signed-off-by: Rick Edgecombe <rick.p.edgecombe@...el.com>
Reviewed-by: Binbin Wu <binbin.wu@...ux.intel.com>
---
v19:
- drop TDX: from the short log
- Added reviewed-by: BinBin
---
arch/x86/kvm/mmu/page_track.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c
index 561c331fd6ec..26436113103a 100644
--- a/arch/x86/kvm/mmu/page_track.c
+++ b/arch/x86/kvm/mmu/page_track.c
@@ -35,6 +35,9 @@ static bool kvm_external_write_tracking_enabled(struct kvm *kvm)
bool kvm_page_track_write_tracking_enabled(struct kvm *kvm)
{
+ if (kvm->arch.vm_type == KVM_X86_TDX_VM)
+ return false;
+
return kvm_external_write_tracking_enabled(kvm) ||
kvm_shadow_root_allocated(kvm) || !tdp_enabled;
}
--
2.34.1
Powered by blists - more mailing lists