[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 39/40] i386/tdx: Don't get/put guest state for TDX VMs
From: |
Xiaoyao Li |
Subject: |
[PATCH v1 39/40] i386/tdx: Don't get/put guest state for TDX VMs |
Date: |
Tue, 2 Aug 2022 15:47:49 +0800 |
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>
---
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 948c87ebdb97..95afbbac7116 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -4584,6 +4584,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;
+ }
+
/* must be before kvm_put_nested_state so that EFER.SVME is set */
ret = has_sregs2 ? kvm_put_sregs2(x86_cpu) : kvm_put_sregs(x86_cpu);
if (ret < 0) {
@@ -4678,6 +4683,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.27.0
- [PATCH v1 24/40] i386/tdx: Track mem_ptr for each firmware entry of TDVF, (continued)
- [PATCH v1 24/40] i386/tdx: Track mem_ptr for each firmware entry of TDVF, Xiaoyao Li, 2022/08/02
- [PATCH v1 34/40] hw/i386: add eoi_intercept_unsupported member to X86MachineState, Xiaoyao Li, 2022/08/02
- [PATCH v1 36/40] i386/tdx: Don't synchronize guest tsc for TDs, Xiaoyao Li, 2022/08/02
- [PATCH v1 38/40] i386/tdx: Skip kvm_put_apicbase() for TDs, Xiaoyao Li, 2022/08/02
- [PATCH v1 35/40] hw/i386: add option to forcibly report edge trigger in acpi tables, Xiaoyao Li, 2022/08/02
- [PATCH v1 37/40] i386/tdx: Only configure MSR_IA32_UCODE_REV in kvm_init_msrs() for TDs, Xiaoyao Li, 2022/08/02
- [PATCH v1 39/40] i386/tdx: Don't get/put guest state for TDX VMs,
Xiaoyao Li <=
- [PATCH v1 40/40] docs: Add TDX documentation, Xiaoyao Li, 2022/08/02
- Re: [PATCH v1 00/40] TDX QEMU support, Daniel P . Berrangé, 2022/08/02