[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 32/65] i386/tdx: Set kvm_readonly_mem_enabled to false for TDX
From: |
Xiaoyao Li |
Subject: |
[PATCH v5 32/65] i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VM |
Date: |
Thu, 29 Feb 2024 01:36:53 -0500 |
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>
---
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 42dbb5ce5c15..13f069171db7 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -480,6 +480,15 @@ static int tdx_kvm_init(ConfidentialGuestSupport *cgs,
Error **errp)
update_tdx_cpuid_lookup_by_tdx_caps();
+ /*
+ * 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;
+
tdx_guest = tdx;
return 0;
}
--
2.34.1
- [PATCH v5 16/65] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object, (continued)
- [PATCH v5 16/65] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object, Xiaoyao Li, 2024/02/29
- [PATCH v5 17/65] i386/tdx: Adjust the supported CPUID based on TDX restrictions, Xiaoyao Li, 2024/02/29
- [PATCH v5 18/65] i386/tdx: Make Intel-PT unsupported for TD guest, Xiaoyao Li, 2024/02/29
- [PATCH v5 21/65] i386/tdx: Integrate tdx_caps->attrs_fixed0/1 to tdx_cpuid_lookup, Xiaoyao Li, 2024/02/29
- [PATCH v5 19/65] i386/tdx: Update tdx_cpuid_lookup[].tdx_fixed0/1 by tdx_caps.cpuid_config[], Xiaoyao Li, 2024/02/29
- [PATCH v5 20/65] i386/tdx: Integrate tdx_caps->xfam_fixed0/1 into tdx_cpuid_lookup, Xiaoyao Li, 2024/02/29
- [PATCH v5 24/65] i386/tdx: Initialize TDX before creating TD vcpus, Xiaoyao Li, 2024/02/29
- [PATCH v5 25/65] i386/tdx: Add property sept-ve-disable for tdx-guest object, Xiaoyao Li, 2024/02/29
- [PATCH v5 22/65] i386/kvm: Move architectural CPUID leaf generation to separate helper, Xiaoyao Li, 2024/02/29
- [PATCH v5 23/65] kvm: Introduce kvm_arch_pre_create_vcpu(), Xiaoyao Li, 2024/02/29
- [PATCH v5 32/65] i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VM,
Xiaoyao Li <=
- [PATCH v5 31/65] i386/tdx: Implement user specified tsc frequency, Xiaoyao Li, 2024/02/29
- [PATCH v5 30/65] i386/tdx: Support user configurable mrconfigid/mrowner/mrownerconfig, Xiaoyao Li, 2024/02/29
[PATCH v5 26/65] i386/tdx: Make sept_ve_disable set by default, Xiaoyao Li, 2024/02/29
[PATCH v5 33/65] kvm/tdx: Don't complain when converting vMMIO region to shared, Xiaoyao Li, 2024/02/29
[PATCH v5 27/65] i386/tdx: Wire CPU features up with attributes of TD guest, Xiaoyao Li, 2024/02/29
[PATCH v5 34/65] kvm/tdx: Ignore memory conversion to shared of unassigned region, Xiaoyao Li, 2024/02/29