From c1ca49a66c16e1a1e817591e1bba085c8fd0ffe6 Mon Sep 17 00:00:00 2001 From: Ryan Savino Date: Fri, 17 Jan 2025 14:44:24 -0600 Subject: [PATCH] snp: set snp to use upstream qemu in config use upstream qemu in snp and nvidia snp configs. load ovmf with bios flag on qemu cmdline instead of file. Fixes: #10750 Signed-Off-By: Ryan Savino --- src/runtime/config/configuration-qemu-snp.toml.in | 4 ++-- src/runtime/pkg/govmm/qemu/qemu.go | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/runtime/config/configuration-qemu-snp.toml.in b/src/runtime/config/configuration-qemu-snp.toml.in index be5f40dfa1..929aa7e452 100644 --- a/src/runtime/config/configuration-qemu-snp.toml.in +++ b/src/runtime/config/configuration-qemu-snp.toml.in @@ -13,7 +13,7 @@ # XXX: Type: @PROJECT_TYPE@ [hypervisor.qemu] -path = "@QEMUSNPPATH@" +path = "@QEMUPATH@" kernel = "@KERNELCONFIDENTIALPATH@" #image = "@IMAGEPATH@" initrd = "@INITRDCONFIDENTIALPATH@" @@ -58,7 +58,7 @@ enable_annotations = @DEFENABLEANNOTATIONS@ # Each member of the list is a path pattern as described by glob(3). # The default if not set is empty (all annotations rejected.) # Your distribution recommends: @QEMUVALIDHYPERVISORPATHS@ -valid_hypervisor_paths = @QEMUSNPVALIDHYPERVISORPATHS@ +valid_hypervisor_paths = @QEMUVALIDHYPERVISORPATHS@ # Optional space-separated list of options to pass to the guest kernel. # For example, use `kernel_params = "vsyscall=emulate"` if you are having diff --git a/src/runtime/pkg/govmm/qemu/qemu.go b/src/runtime/pkg/govmm/qemu/qemu.go index 292ecb2ffc..aefa1ffdf7 100644 --- a/src/runtime/pkg/govmm/qemu/qemu.go +++ b/src/runtime/pkg/govmm/qemu/qemu.go @@ -379,7 +379,6 @@ func (object Object) QemuParams(config *Config) []string { objectParams = append(objectParams, fmt.Sprintf("id=%s", object.ID)) objectParams = append(objectParams, fmt.Sprintf("cbitpos=%d", object.CBitPos)) objectParams = append(objectParams, fmt.Sprintf("reduced-phys-bits=%d", object.ReducedPhysBits)) - driveParams = append(driveParams, "if=pflash,format=raw,readonly=on") driveParams = append(driveParams, fmt.Sprintf("file=%s", object.File)) case SNPGuest: @@ -388,8 +387,7 @@ func (object Object) QemuParams(config *Config) []string { objectParams = append(objectParams, fmt.Sprintf("cbitpos=%d", object.CBitPos)) objectParams = append(objectParams, fmt.Sprintf("reduced-phys-bits=%d", object.ReducedPhysBits)) objectParams = append(objectParams, "kernel-hashes=on") - driveParams = append(driveParams, "if=pflash,format=raw,readonly=on") - driveParams = append(driveParams, fmt.Sprintf("file=%s", object.File)) + config.Bios = object.File case SecExecGuest: objectParams = append(objectParams, string(object.Type)) objectParams = append(objectParams, fmt.Sprintf("id=%s", object.ID))