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 <ryan.savino@amd.com>
This commit is contained in:
Ryan Savino 2025-01-17 14:44:24 -06:00
parent af235fc576
commit c1ca49a66c
2 changed files with 3 additions and 5 deletions

View File

@ -13,7 +13,7 @@
# XXX: Type: @PROJECT_TYPE@ # XXX: Type: @PROJECT_TYPE@
[hypervisor.qemu] [hypervisor.qemu]
path = "@QEMUSNPPATH@" path = "@QEMUPATH@"
kernel = "@KERNELCONFIDENTIALPATH@" kernel = "@KERNELCONFIDENTIALPATH@"
#image = "@IMAGEPATH@" #image = "@IMAGEPATH@"
initrd = "@INITRDCONFIDENTIALPATH@" initrd = "@INITRDCONFIDENTIALPATH@"
@ -58,7 +58,7 @@ enable_annotations = @DEFENABLEANNOTATIONS@
# Each member of the list is a path pattern as described by glob(3). # Each member of the list is a path pattern as described by glob(3).
# The default if not set is empty (all annotations rejected.) # The default if not set is empty (all annotations rejected.)
# Your distribution recommends: @QEMUVALIDHYPERVISORPATHS@ # Your distribution recommends: @QEMUVALIDHYPERVISORPATHS@
valid_hypervisor_paths = @QEMUSNPVALIDHYPERVISORPATHS@ valid_hypervisor_paths = @QEMUVALIDHYPERVISORPATHS@
# Optional space-separated list of options to pass to the guest kernel. # Optional space-separated list of options to pass to the guest kernel.
# For example, use `kernel_params = "vsyscall=emulate"` if you are having # For example, use `kernel_params = "vsyscall=emulate"` if you are having

View File

@ -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("id=%s", object.ID))
objectParams = append(objectParams, fmt.Sprintf("cbitpos=%d", object.CBitPos)) objectParams = append(objectParams, fmt.Sprintf("cbitpos=%d", object.CBitPos))
objectParams = append(objectParams, fmt.Sprintf("reduced-phys-bits=%d", object.ReducedPhysBits)) objectParams = append(objectParams, fmt.Sprintf("reduced-phys-bits=%d", object.ReducedPhysBits))
driveParams = append(driveParams, "if=pflash,format=raw,readonly=on") driveParams = append(driveParams, "if=pflash,format=raw,readonly=on")
driveParams = append(driveParams, fmt.Sprintf("file=%s", object.File)) driveParams = append(driveParams, fmt.Sprintf("file=%s", object.File))
case SNPGuest: 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("cbitpos=%d", object.CBitPos))
objectParams = append(objectParams, fmt.Sprintf("reduced-phys-bits=%d", object.ReducedPhysBits)) objectParams = append(objectParams, fmt.Sprintf("reduced-phys-bits=%d", object.ReducedPhysBits))
objectParams = append(objectParams, "kernel-hashes=on") objectParams = append(objectParams, "kernel-hashes=on")
driveParams = append(driveParams, "if=pflash,format=raw,readonly=on") config.Bios = object.File
driveParams = append(driveParams, fmt.Sprintf("file=%s", object.File))
case SecExecGuest: case SecExecGuest:
objectParams = append(objectParams, string(object.Type)) objectParams = append(objectParams, string(object.Type))
objectParams = append(objectParams, fmt.Sprintf("id=%s", object.ID)) objectParams = append(objectParams, fmt.Sprintf("id=%s", object.ID))