[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 65/66] i386/tdx: Don't get/put guest state for TDX VMs
|
From: |
Xiaoyao Li |
|
Subject: |
[PATCH v4 65/66] i386/tdx: Don't get/put guest state for TDX VMs |
|
Date: |
Wed, 24 Jan 2024 22:23:27 -0500 |
From: Sean Christopherson <sean.j.christopherson@intel.com>
Don't get/put state of TDX VMs since accessing/mutating guest state of
production TDs is not supported.
Note, it will be allowed for a debug TD. Corresponding support will be
introduced when debug TD support is implemented in the future.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
target/i386/kvm/kvm.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 109f778ba14d..bad00da37c2f 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -4633,6 +4633,11 @@ int kvm_arch_put_registers(CPUState *cpu, int level)
assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
+ /* TODO: Allow accessing guest state for debug TDs. */
+ if (is_tdx_vm()) {
+ return 0;
+ }
+
/*
* Put MSR_IA32_FEATURE_CONTROL first, this ensures the VM gets out of VMX
* root operation upon vCPU reset. kvm_put_msr_feature_control() should
also
@@ -4733,6 +4738,12 @@ int kvm_arch_get_registers(CPUState *cs)
if (ret < 0) {
goto out;
}
+
+ /* TODO: Allow accessing guest state for debug TDs. */
+ if (is_tdx_vm()) {
+ return 0;
+ }
+
ret = kvm_getput_regs(cpu, 0);
if (ret < 0) {
goto out;
--
2.34.1
- [PATCH v4 53/66] i386/tdx: Wire TDX_REPORT_FATAL_ERROR with GuestPanic facility, (continued)
- [PATCH v4 53/66] i386/tdx: Wire TDX_REPORT_FATAL_ERROR with GuestPanic facility, Xiaoyao Li, 2024/01/24
- [PATCH v4 57/66] i386/tdx: Disable PIC for TDX VMs, Xiaoyao Li, 2024/01/24
- [PATCH v4 58/66] i386/tdx: Don't allow system reset for TDX VMs, Xiaoyao Li, 2024/01/24
- [PATCH v4 56/66] i386/tdx: Disable SMM for TDX VMs, Xiaoyao Li, 2024/01/24
- [PATCH v4 59/66] i386/tdx: LMCE is not supported for TDX, Xiaoyao Li, 2024/01/24
- [PATCH v4 60/66] hw/i386: add eoi_intercept_unsupported member to X86MachineState, Xiaoyao Li, 2024/01/24
- [PATCH v4 61/66] hw/i386: add option to forcibly report edge trigger in acpi tables, Xiaoyao Li, 2024/01/24
- [PATCH v4 62/66] i386/tdx: Don't synchronize guest tsc for TDs, Xiaoyao Li, 2024/01/24
- [PATCH v4 63/66] i386/tdx: Only configure MSR_IA32_UCODE_REV in kvm_init_msrs() for TDs, Xiaoyao Li, 2024/01/24
- [PATCH v4 64/66] i386/tdx: Skip kvm_put_apicbase() for TDs, Xiaoyao Li, 2024/01/24
- [PATCH v4 65/66] i386/tdx: Don't get/put guest state for TDX VMs,
Xiaoyao Li <=
- [PATCH v4 66/66] docs: Add TDX documentation, Xiaoyao Li, 2024/01/24