diff --git a/scripts/launch_guest.sh b/scripts/launch_guest.sh index f52f3f299..ccbd15946 100755 --- a/scripts/launch_guest.sh +++ b/scripts/launch_guest.sh @@ -67,12 +67,21 @@ QEMU_MINOR=${QEMU_MINOR%%.$QEMU_BUILD} # The QEMU machine and memory command line changed after QEMU 8.2.0 from # the coconut-svsm git repository. -if (( (QEMU_MAJOR > 8) || ((QEMU_MAJOR == 8) && (QEMU_MINOR >= 2)) )); then +if (( QEMU_MAJOR >= 9 )); then + MACHINE=q35,confidential-guest-support=sev0,memory-backend=mem0,igvm-cfg=igvm0 + MEMORY=memory-backend-memfd,size=8G,id=mem0,share=true,prealloc=false,reserve=false + SNP_GUEST="sev-snp-guest,id=sev0,cbitpos=$C_BIT_POS,reduced-phys-bits=1" + IGVM_OBJ="-object igvm-cfg,id=igvm0,file=$IGVM" +elif (( (QEMU_MAJOR > 8) || ((QEMU_MAJOR == 8) && (QEMU_MINOR >= 2)) )); then MACHINE=q35,confidential-guest-support=sev0,memory-backend=mem0 MEMORY=memory-backend-memfd,size=8G,id=mem0,share=true,prealloc=false,reserve=false + SNP_GUEST="sev-snp-guest,id=sev0,cbitpos=$C_BIT_POS,reduced-phys-bits=1,init-flags=5,igvm-file=$IGVM" + IGVM_OBJ="" else MACHINE=q35,confidential-guest-support=sev0,memory-backend=mem0,kvm-type=protected MEMORY=memory-backend-memfd-private,size=8G,id=mem0,share=true + SNP_GUEST="sev-snp-guest,id=sev0,cbitpos=$C_BIT_POS,reduced-phys-bits=1,init-flags=5,igvm-file=$IGVM" + IGVM_OBJ="" fi # Setup a disk if an image has been specified @@ -112,7 +121,8 @@ $SUDO_CMD \ -cpu EPYC-v4 \ -machine $MACHINE \ -object $MEMORY \ - -object sev-snp-guest,id=sev0,cbitpos=$C_BIT_POS,reduced-phys-bits=1,init-flags=5,igvm-file=$IGVM \ + $IGVM_OBJ \ + -object $SNP_GUEST \ -smp 4 \ -no-reboot \ -netdev user,id=vmnic -device e1000,netdev=vmnic,romfile= \