Skip to content

Commit

Permalink
scripts/launch_guest: Update with new QEMU command line options
Browse files Browse the repository at this point in the history
Update the script to honour new QEMU command line options after the
development tree updates.

Signed-off-by: Joerg Roedel <[email protected]>
  • Loading branch information
joergroedel committed Dec 17, 2024
1 parent 4b8a807 commit 7b467e4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/launch_guest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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= \
Expand Down

0 comments on commit 7b467e4

Please sign in to comment.