Open 99Franz opened 7 months ago
I've spent a while trying to reproduce this but it works successfully for me. I see a similar output to you up until the point of the memory fault, then the very next line is early kernel output:
CpuDxe: 5-Level Paging = 0^M
MpInitChangeApLoopCallback() done!^M
SetUefiImageMemoryAttributes - 0x000000007F2E6000 - 0x0000000000007000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2E0000 - 0x0000000000006000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2D9000 - 0x0000000000007000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2D3000 - 0x0000000000006000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2C3000 - 0x0000000000010000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2BE000 - 0x0000000000005000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2B7000 - 0x0000000000007000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2B3000 - 0x0000000000004000 (0x0000000000000008)^M
SetUefiImageMemoryAttributes - 0x000000007F2AE000 - 0x0000000000005000 (0x0000000000000008)^M
[ 0.000000][ T0] Linux version 6.8.0-rc3-1-svsm+ (rhopkins@milo) (gcc (SUSE Linux) 13.2.1 20231130 [revision 741743c028dc00f27b9c8b1d5211c1f602f2fddd], GNU ld (GNU Binutils; openSUSE Tumbleweed) 2.41.0.20230908-1) #3 SMP PREEMPT_DYNAMIC Wed Feb 7 15:57:08 GMT 2024^M
A couple of questions:
1) How are you launching qemu? Are you using the launch script: scripts/launch_guest.sh
? If not, what is your command line.
2) Have you enabled console output for the kernel? Can you try adding this the kernel parameters?
console=tty0 console=ttyS0 earlycon=uart8250,io,0x3f8 earlyprintk=ttyS0
Thank you for the quick response. We did not use the launch script, but used a similar command:
#!/bin/bash
<path-to-qemu-system-x86_64> \
-name sev-snp-vm,process="sev-snp-vm" \
-enable-kvm \
-cpu EPYC-v4 \
-smp 4 \
-object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1,policy=0x30000,igvm-file=<path-to-coconut-qemu.igvm> \
-machine q35,vmport=off,confidential-guest-support=sev0,memory-backend=ram1 \
-object memory-backend-memfd,id=ram1,size=8G,share=true,prealloc=false,reserve=false \
-drive file=base.qcow2,format=qcow2,if=none,id=disk0 \
-device virtio-scsi-pci,id=scsi,disable-legacy=on,iommu_platform=on \
-device scsi-hd,drive=disk0 \
-nographic \
-nodefaults \
-netdev user,id=vmnic,hostfwd=tcp:127.0.0.1:6666-:22 \
-device virtio-net-pci,disable-legacy=on,iommu_platform=true,netdev=vmnic,romfile= \
-serial mon:stdio
We fixed it by copying kernel/initrd and kernel commandline out of the VM and directly providing it to QEMU / the UEFI. We added the following lines to our command:
...
-kernel vmlinuz-6.8.0-svsm-guest \
-append 'BOOT_IMAGE=/boot/vmlinuz-6.8.0-svsm-guest root=UUID=<UUID> ro console=tty0 console=ttyS0,115200n8 quiet' \
-initrd initrd.img-6.8.0-svsm-guest
We suppose that the issue might be related to the interaction between GRUB and the TPM, given that manually specifying the 'kernel' and 'initrd' leads to a successful image launch, which skips GRUB. Is this assumption accurate?
I think this address specifically is the video memory address that Ashish Kalra is proposing disabling access to in "[PATCH v11 1/3] x86/boot: Skip video memory access in the decompressor for SEV-ES/SNP"
When trying to launch the guest with qemu and a debian image, I get the following kernel panic:
We followed the steps of the install.md file. The following versions were used, which are the most recent at the time of writing this:
Our AMD SEV-SNP firmware version is 1.55.14 host kernel is on commit bc4de28 IGVM: commit 494aac2 Qemu: commit 896d803 Guest Firmware: commit d965a1b Guest Kernel: bc4de28 COCONUT-SVSM (tested with Debug and release version): commit dec6072
We first thought it was the same bug as in #311, however, we make it past the UEFI, bootloader and into the kernel from what we can see. Do you have any ideas how to fix this?