[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 17/31] i386/sev: Set CPU state to protected once SNP guest pay
From: |
Pankaj Gupta |
Subject: |
[PATCH v4 17/31] i386/sev: Set CPU state to protected once SNP guest payload is finalized |
Date: |
Thu, 30 May 2024 06:16:29 -0500 |
From: Michael Roth <michael.roth@amd.com>
Once KVM_SNP_LAUNCH_FINISH is called the vCPU state is copied into the
vCPU's VMSA page and measured/encrypted. Any attempt to read/write CPU
state afterward will only be acting on the initial data and so are
effectively no-ops.
Set the vCPU state to protected at this point so that QEMU don't
continue trying to re-sync vCPU data during guest runtime.
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
---
target/i386/sev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index cd47c195cd..2ca9a86bf3 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -1011,6 +1011,7 @@ sev_snp_launch_finish(SevCommonState *sev_common)
exit(1);
}
+ kvm_mark_guest_state_protected();
sev_set_guest_state(sev_common, SEV_STATE_RUNNING);
/* add migration blocker */
--
2.34.1
- [PATCH v4 04/31] i386/sev: Introduce "sev-common" type to encapsulate common SEV state, (continued)
- [PATCH v4 04/31] i386/sev: Introduce "sev-common" type to encapsulate common SEV state, Pankaj Gupta, 2024/05/30
- [PATCH v4 07/31] i386/sev: Introduce 'sev-snp-guest' object, Pankaj Gupta, 2024/05/30
- [PATCH v4 06/31] i386/sev: Move sev_launch_finish to separate class method, Pankaj Gupta, 2024/05/30
- [PATCH v4 09/31] i386/sev: Add sev_kvm_init() override for SEV class, Pankaj Gupta, 2024/05/30
- [PATCH v4 08/31] i386/sev: Add a sev_snp_enabled() helper, Pankaj Gupta, 2024/05/30
- [PATCH v4 11/31] i386/cpu: Set SEV-SNP CPUID bit when SNP enabled, Pankaj Gupta, 2024/05/30
- [PATCH v4 13/31] i386/sev: Add a class method to determine KVM VM type for SNP guests, Pankaj Gupta, 2024/05/30
- [PATCH v4 17/31] i386/sev: Set CPU state to protected once SNP guest payload is finalized,
Pankaj Gupta <=
- [PATCH v4 12/31] i386/sev: Don't return launch measurements for SEV-SNP guests, Pankaj Gupta, 2024/05/30
- [PATCH v4 15/31] i386/sev: Add the SNP launch start context, Pankaj Gupta, 2024/05/30
- [PATCH v4 14/31] i386/sev: Update query-sev QAPI format to handle SEV-SNP, Pankaj Gupta, 2024/05/30
- [PATCH v4 20/31] i386/sev: Add support for SNP CPUID validation, Pankaj Gupta, 2024/05/30
- [PATCH v4 21/31] i386/sev: Extract build_kernel_loader_hashes, Pankaj Gupta, 2024/05/30
- [PATCH v4 16/31] i386/sev: Add handling to encrypt/finalize guest launch data, Pankaj Gupta, 2024/05/30
- [PATCH v4 24/31] hw/i386/sev: Add support to encrypt BIOS when SEV-SNP is enabled, Pankaj Gupta, 2024/05/30
- [PATCH v4 22/31] i386/sev: Reorder struct declarations, Pankaj Gupta, 2024/05/30
- [PATCH v4 18/31] hw/i386/sev: Add function to get SEV metadata from OVMF header, Pankaj Gupta, 2024/05/30