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

Failed to launch /init #479

Open
pegahnikbakht opened this issue Oct 9, 2024 · 12 comments
Open

Failed to launch /init #479

pegahnikbakht opened this issue Oct 9, 2024 · 12 comments

Comments

@pegahnikbakht
Copy link

Hi,

I followed the instructions to setup a guest with coconut-svsm but seems like the guest VM creation get stuck with this error and some other errors afterwards:

[SVSM] Launching Firmware
[SVSM] Launching request-processing task on CPU 0
[SVSM] Failed to launch /init

svsm.log

I attached the whole log output, can someone help with this?

@stefano-garzarella
Copy link
Member

Hi @pegahnikbakht, thanks for attaching the log.
Looking at it, it looks like the main issue is the following:

KVM: unknown exit reason 24
EAX=00000000 EBX=00000000 ECX=0000020f EDX=00000000
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
EIP=00000000 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 00000000 00000000 00000000
CS =0000 00000000 00000000 00000000
SS =0000 00000000 00000000 00000000
DS =0000 00000000 00000000 00000000
FS =0000 00000000 00000000 00000000
GS =0000 00000000 00000000 00000000
LDT=0000 00000000 00000000 00000000
TR =0000 00000000 00000000 00000000
GDT=     0000000000000000 00000000
IDT=     0000000000000000 00000000
CR0=80010033 CR2=0000000000000000 CR3=0000000000000000 CR4=00000668
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=0000000000000000 DR7=0000000000000000
EFER=0000000000000d00
Code=<??> ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??

Did you install the SVSM patched kernel in your host?
You can find instructions here: https://github.com/coconut-svsm/svsm/blob/main/Documentation/docs/installation/INSTALL.md#preparing-the-host

@pegahnikbakht
Copy link
Author

@stefano-garzarella Yes I have installed kernel 6.8.0-snp-host-bc4de28e0cc1+ on host see below:

[    0.000000] SEV-SNP: RMP table physical range [0x0000000097f00000 - 0x00000000a84fffff]
[   16.712694] ccp 0000:47:00.1: SEV firmware update successful
[   17.685035] ccp 0000:47:00.1: SEV API:1.55 build:17
[   17.685042] ccp 0000:47:00.1: SEV-SNP API:1.55 build:17
[   17.695845] kvm_amd: SEV enabled (ASIDs 100 - 509)
[   17.695847] kvm_amd: SEV-ES enabled (ASIDs 1 - 99)
[   17.695849] kvm_amd: SEV-SNP enabled (ASIDs 1 - 99)
[   64.192721] ccp 0000:47:00.1: SEV firmware update successful
[   65.167958] ccp 0000:47:00.1: SEV API:1.55 build:17
[   65.167969] ccp 0000:47:00.1: SEV-SNP API:1.55 build:17
[   65.181142] kvm_amd: SEV enabled (ASIDs 100 - 509)
[   65.181144] kvm_amd: SEV-ES enabled (ASIDs 1 - 99)
[   65.181146] kvm_amd: SEV-SNP enabled (ASIDs 1 - 99)

@Freax13
Copy link
Contributor

Freax13 commented Oct 9, 2024

[SVSM] Failed to launch /init is currently expected because the SVSM doesn't yet have proper userspace support, so there's no init binary. The log messages following this line are not errors but UEFI logs. exit reason 24 is KVM_EXIT_SYSTEM_EVENT. My guess is that UEFI runs correctly, but the guest kernel crashes.

@pegahnikbakht
Copy link
Author

@Freax13 Do you have any script to setup guest and guest kernel properly?

@Freax13
Copy link
Contributor

Freax13 commented Oct 9, 2024

No, sorry.

@stefano-garzarella
Copy link
Member

@pegahnikbakht if your guest is using Fedora, we have a copr repo with a kernel image: https://copr.fedorainfracloud.org/coprs/g/virtmaint-sig/sev-snp-coconut/

I used it also in https://github.com/stefano-garzarella/snp-svsm-vtpm/blob/main/build-vm-image.sh to build an image on demand.
You can remove --encrypted in the kickstart script if you don't want an encrypted FS.

@pegahnikbakht
Copy link
Author

I'm using ubuntu :(

@stefano-garzarella
Copy link
Member

@pegahnikbakht did you solve this problem? Can we close the issue?

@pegahnikbakht
Copy link
Author

No we didn't solve the issue.

@stefano-garzarella
Copy link
Member

@pegahnikbakht can you provide a bit more info about your env?
e.g. QEMU version, edk2 version, Guest kernel version

@pegahnikbakht
Copy link
Author

We followed the installation.md so we used the versions provided there, we use kernel 6.8.0 for both host and guest.

@stefano-garzarella
Copy link
Member

@pegahnikbakht we are in active development, our repos are being updated frequently and so are our instructions. We have not experienced any problems with the latest versions we have, so if you can't provide the exact commits you are using to better understand what is wrong, I don't know how to help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants