diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 05ca841d0b66..50e68f9c1a41 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -472,6 +472,15 @@ int tdx_kvm_init(MachineState *ms, 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; }