[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 39/58] i386/tdx: Finalize TDX VM
From: |
Xiaoyao Li |
Subject: |
[PATCH v2 39/58] i386/tdx: Finalize TDX VM |
Date: |
Fri, 18 Aug 2023 05:50:22 -0400 |
Invoke KVM_TDX_FINALIZE_VM to finalize the TD's measurement and make
the TD vCPUs runnable once machine initialization is complete.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
target/i386/kvm/tdx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 2d0efca6787b..5eabdafbe95c 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -660,6 +660,13 @@ static void tdx_finalize_vm(Notifier *notifier, void
*unused)
/* Tdvf image was copied into private region above. It becomes
unnecessary. */
ram_block = tdx_guest->tdvf_region->ram_block;
ram_block_discard_range(ram_block, 0, ram_block->max_length);
+
+ r = tdx_vm_ioctl(KVM_TDX_FINALIZE_VM, 0, NULL);
+ if (r < 0) {
+ error_report("KVM_TDX_FINALIZE_VM failed %s", strerror(-r));
+ exit(0);
+ }
+ tdx_guest->parent_obj.ready = true;
}
static Notifier tdx_machine_done_notify = {
--
2.34.1
- Re: [PATCH v2 33/58] headers: Add definitions from UEFI spec for volumes, resources, etc..., (continued)
[PATCH v2 34/58] i386/tdx: Setup the TD HOB list, Xiaoyao Li, 2023/08/18
[PATCH v2 37/58] i386/tdx: register TDVF as private memory, Xiaoyao Li, 2023/08/18
[PATCH v2 47/58] i386/tdx: Wire REPORT_FATAL_ERROR with GuestPanic facility, Xiaoyao Li, 2023/08/18
[PATCH v2 39/58] i386/tdx: Finalize TDX VM,
Xiaoyao Li <=
[PATCH v2 46/58] i386/tdx: Handle TDG.VP.VMCALL<REPORT_FATAL_ERROR>, Xiaoyao Li, 2023/08/18
[PATCH v2 49/58] i386/tdx: Disable PIC for TDX VMs, Xiaoyao Li, 2023/08/18
[PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Xiaoyao Li, 2023/08/18
- Re: [PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Markus Armbruster, 2023/08/22
- Re: [PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Daniel P . Berrangé, 2023/08/22
- Re: [PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Chenyi Qiang, 2023/08/29
- Re: [PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Daniel P . Berrangé, 2023/08/29
- Re: [PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Chenyi Qiang, 2023/08/30
- Re: [PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Xiaoyao Li, 2023/08/30
- Re: [PATCH v2 41/58] i386/tdx: handle TDG.VP.VMCALL<GetQuote>, Daniel P . Berrangé, 2023/08/30