55 lines
2.0 KiB
Diff
55 lines
2.0 KiB
Diff
From 23e6031f307d262cae8a76306acb5341706098d6 Mon Sep 17 00:00:00 2001
|
|
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
Date: Fri, 18 Jul 2025 18:03:47 +0200
|
|
Subject: [PATCH 064/115] i386/tdx: Set kvm_readonly_mem_enabled to false for
|
|
TDX VM
|
|
|
|
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
RH-MergeRequest: 391: TDX support, including attestation and device assignment
|
|
RH-Jira: RHEL-15710 RHEL-20798 RHEL-49728
|
|
RH-Acked-by: Yash Mankad <None>
|
|
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
|
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
|
RH-Commit: [64/115] ee2c60314038f35359ea6bd00422b39c8573da88 (bonzini/rhel-qemu-kvm)
|
|
|
|
TDX only supports readonly for shared memory but not for private memory.
|
|
|
|
In the view of QEMU, it has no idea whether a memslot is used as shared
|
|
memory of private. Thus just mark kvm_readonly_mem_enabled to false to
|
|
TDX VM for simplicity.
|
|
|
|
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
|
|
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
|
|
Link: https://lore.kernel.org/r/20250508150002.689633-36-xiaoyao.li@intel.com
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
(cherry picked from commit da6728658bf63d6a3989f1587a33566b3e54bed8)
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
---
|
|
target/i386/kvm/tdx.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
|
|
index 410f8a9997..7bc36b620e 100644
|
|
--- a/target/i386/kvm/tdx.c
|
|
+++ b/target/i386/kvm/tdx.c
|
|
@@ -384,6 +384,15 @@ static int tdx_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
+ /*
|
|
+ * Set kvm_readonly_mem_allowed to false, because TDX only supports readonly
|
|
+ * memory for shared memory but not for private memory. Besides, whether a
|
|
+ * memslot is private or shared is not determined by QEMU.
|
|
+ *
|
|
+ * Thus, just mark readonly memory not supported for simplicity.
|
|
+ */
|
|
+ kvm_readonly_mem_allowed = false;
|
|
+
|
|
qemu_add_machine_init_done_notifier(&tdx_machine_done_notify);
|
|
|
|
tdx_guest = tdx;
|
|
--
|
|
2.50.1
|
|
|