-
Notifications
You must be signed in to change notification settings - Fork 49
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
add support for running native builds on qemu #614
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kraxel , this PR is pretty amazing! Together with the QEMU PR I can boot a non-cc VM. Just a question, the last messages I see from SVSM are:
[SVSM] Invalidating boot region [0x0000000000000000-0x00000000000a0000]
[SVSM] Invalidating boot region [0x0000000000800000-0x00000000008c2000]
[SVSM] Invalidating boot region [0x00000000008c2000-0x0000000000b6a000]
[SVSM] Invalidating boot region [0x0000000000b6a000-0x0000000000b71000]
[SVSM] Invalidating boot region [0x0000000000b71000-0x0000000000b74000]
[SVSM] Size of OBJECT = 2104
[SVSM] Size of components in TPMT_SENSITIVE = 1384
[SVSM] TPMI_ALG_PUBLIC 2
[SVSM] TPM2B_AUTH 50
[SVSM] TPM2B_DIGEST 50
[SVSM] TPMU_SENSITIVE_COMPOSITE 1282
[SVSM] VTPM: TPM 2.0 Reference Implementation initialized
[SVSM] [CPU 0] Virtual memory pages used: 0 * 4K, 0 * 2M
Is that expected?
configs/qemu-native-target.json
Outdated
{ | ||
"igvm": { | ||
"qemu": { | ||
"output": "coconut-qemu.igvm", | ||
"platforms": [ | ||
"snp", | ||
"native" | ||
], | ||
"policy": "0x30000", | ||
"measure": "print", | ||
"check-kvm": true | ||
} | ||
}, | ||
"kernel": { | ||
"svsm": { | ||
"features": "nosmep,nosmap", | ||
"binary": true | ||
}, | ||
"stage2": { | ||
"manifest": "kernel/Cargo.toml", | ||
"binary": true, | ||
"objcopy": "binary" | ||
} | ||
}, | ||
"firmware": { | ||
"env": "FW_FILE" | ||
}, | ||
"fs": { | ||
"modules": { | ||
"userinit": { | ||
"path": "/init" | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for a separate target definition. Just add native
as a platform to qemu-target.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for a separate target definition. Just add
native
as a platform toqemu-target.json
.
I also need "features": "nosmep,nosmap",
, otherwise svsm goes panic on my intel box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, okay, then a separate target definition makes sense. But can you name it around the feature difference and add all three targets (snp
,tdp
, native
) to the existing qemu target and the one you add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I only need to turn those features on the qemu cmd line to get things going without separate config.
Dunno, I'm new to svsm ... For me it looks like this (without vtpm included, have some autoconf problems building it which I didn't investigate yet):
What exactly you are concerned about? The zero virtual memory pages reported? Or init not printing something? |
Okay, for me it is not booting to user-space yet, but that is probably a problem with my configuration or an unrelated bug in the SVSM code-base. No reason to block this PR on it. |
A possibly unrelated issue I see here is that it works for me only with tcg. With kvm it fails (stage2 pagefaults when loading the kernel elf binary to 0xffff000000000000) for some reason I've not tracked down yet. |
igvm builder does not add pre-built page tables to native platform builds, so when starting the cpu with paging enabled it triple-fails right away. Fix that by including page tables for both VSM and NATIVE platforms. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Add 'native' to the list of platforms in configs/qemu-target.json Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
No description provided.