Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev tree update #577

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Documentation/docs/installation/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ guest:

```
-cpu EPYC-v4 \
-machine q35,confidential-guest-support=sev0,memory-backend=ram1 \
-object memory-backend-memfd,id=ram1,size=8G,share=true,prealloc=false,reserve=false\
-object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1,igvm-file=/path/to/coconut-qemu.igvm \
-machine q35,confidential-guest-support=sev0,memory-backend=ram1,igvm-cfg=igvm0 \
-object memory-backend-memfd,id=ram1,size=8G,share=true,prealloc=false,reserve=false \
-object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1 \
-object igvm-cfg,id=igvm0,file=/path/to/coconut-qemu.igvm
```

This selects the ```EPYC-v4``` CPU type which will pass the CPUID validation
Expand All @@ -293,9 +294,10 @@ $ export IGVM=/path/to/coconut-qemu.igvm
$ sudo $HOME/bin/qemu-svsm/bin/qemu-system-x86_64 \
-enable-kvm \
-cpu EPYC-v4 \
-machine q35,confidential-guest-support=sev0,memory-backend=ram1 \
-machine q35,confidential-guest-support=sev0,memory-backend=ram1,igvm-cfg=igvm0 \
-object memory-backend-memfd,id=ram1,size=8G,share=true,prealloc=false,reserve=false \
-object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1,igvm-file=$IGVM \
-object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1 \
-object igvm-cfg,id=igvm0,file=$IGVM \
-smp 8 \
-no-reboot \
-netdev user,id=vmnic -device e1000,netdev=vmnic,romfile= \
Expand Down
3 changes: 2 additions & 1 deletion kernel/src/cpu/vc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ mod tests {
}

#[test]
#[cfg_attr(not(test_in_svsm), ignore = "Can only be run inside guest")]
//#[cfg_attr(not(test_in_svsm), ignore = "Can only be run inside guest")]
#[ignore = "DBG_CTL access no longer intercepted"]
fn test_rdmsr_debug_ctl() {
const MSR_DEBUG_CTL: u32 = 0x1d9;
let apic_base = verify_ghcb_gets_altered(|| read_msr(MSR_DEBUG_CTL));
Expand Down
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
Loading