[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 27/49] i386/sev: Set ms->require_guest_memfd for SNP
From: |
Michael Roth |
Subject: |
[PATCH v3 27/49] i386/sev: Set ms->require_guest_memfd for SNP |
Date: |
Wed, 20 Mar 2024 03:39:23 -0500 |
SNP requires guest_memfd for private guest memory, so enable it so that
the appropriate guest_memfd backend will be available for normal RAM
regions.
Signed-off-by: Michael Roth <michael.roth@amd.com>
---
target/i386/sev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index e4deb7b41e..b06c796aae 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -880,6 +880,7 @@ out:
static int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
{
SevCommonState *sev_common = SEV_COMMON(cgs);
+ MachineState *ms = MACHINE(qdev_get_machine());
char *devname;
int ret, fw_error, cmd;
uint32_t ebx;
@@ -1000,6 +1001,10 @@ static int sev_kvm_init(ConfidentialGuestSupport *cgs,
Error **errp)
qemu_add_machine_init_done_notifier(&sev_machine_done_notify);
}
+ if (sev_snp_enabled()) {
+ ms->require_guest_memfd = true;
+ }
+
qemu_add_vm_change_state_handler(sev_vm_state_change, sev_common);
cgs->ready = true;
--
2.25.1
- Re: [PATCH v3 21/49] i386/sev: Introduce "sev-common" type to encapsulate common SEV state, (continued)
- [PATCH v3 22/49] i386/sev: Introduce 'sev-snp-guest' object, Michael Roth, 2024/03/20
- [PATCH v3 23/49] i386/sev: Add a sev_snp_enabled() helper, Michael Roth, 2024/03/20
- [PATCH v3 24/49] target/i386: Add handling for KVM_X86_SNP_VM VM type, Michael Roth, 2024/03/20
- [PATCH v3 25/49] i386/sev: Skip RAMBlock notifiers for SNP, Michael Roth, 2024/03/20
- [PATCH v3 26/49] i386/sev: Skip machine-init-done notifiers for SNP, Michael Roth, 2024/03/20
- [PATCH v3 27/49] i386/sev: Set ms->require_guest_memfd for SNP,
Michael Roth <=
- [PATCH v3 28/49] i386/sev: Disable SMM for SNP, Michael Roth, 2024/03/20
- [PATCH v3 29/49] i386/sev: Don't disable block discarding for SNP, Michael Roth, 2024/03/20
- [PATCH v3 30/49] i386/cpu: Set SEV-SNP CPUID bit when SNP enabled, Michael Roth, 2024/03/20
- [PATCH v3 02/49] scripts/update-linux-headers: Add setup_data.h to import list, Michael Roth, 2024/03/20
- [PATCH v3 31/49] i386/sev: Update query-sev QAPI format to handle SEV-SNP, Michael Roth, 2024/03/20