sev: required shim changes for sev pre-attestation
qemu, qmp, config, kbs and hypervisor changes required for runtime support of SEV pre-attestation
Fixes: #6571
/test
@ryansavino, quick question, would this work well even with no attestation agent inside the guest?
Also, for GHA, we can just rely on the ok-to-test label that I just added.
I'm looking forward to this becoming ready to review, as it'll help to close the gap in the merge from main to CCv0.
@ryansavino can you remove the WIP from the title? Let's try to get some reviews here.
I reviewed this by (mostly) sanity-checking that the changes were correctly ported from the relevant PRs mentioned in the issue.
The only oddity that stood out is
kernelParameters()in qemu.go has a new code block from PR 5665 here. This code block doesn't seem to have been picked up in this merge-to-main change, and it seems relevant. (The code block is also still part of the CCv0 branch here so it didn't get wiped out by some later change, either.)Other than this, LGTM.
Ah, nice catch. I missed this. I've added it now. Thanks.
static-checks are failing here with the following error:
qemu.go:545:1: cyclomatic complexity 33 of func `(*qemu).CreateVM` is high (> 30) (gocyclo)
func (q *qemu) CreateVM(ctx context.Context, id string, network Network, hypervisorConfig *HypervisorConfig) error {
^
make: *** [Makefile:45: static-checks] Error 1
Error: Process completed with exit code 2.
This PR didn't create this function, so I'm wondering if there's a need to investigate this further. Is this happening in other places too? @fidencio @stevenhorsman
cyclomatic complexity 33 of func
(*qemu).CreateVMis high (> 30)
I wonder if the code block you added to qemu.go (lines 709 - 741) bumped that "cyclomatic complexity" over 30. (Never seen that metric; I think it's just saying "your function is long and windy".)
If it's easy to rerun static checks locally, maybe move that new code block to a function and see if passes?
static-checks are failing here with the following error:
qemu.go:545:1: cyclomatic complexity 33 of func `(*qemu).CreateVM` is high (> 30) (gocyclo) func (q *qemu) CreateVM(ctx context.Context, id string, network Network, hypervisorConfig *HypervisorConfig) error { ^ make: *** [Makefile:45: static-checks] Error 1 Error: Process completed with exit code 2.This PR didn't create this function, so I'm wondering if there's a need to investigate this further. Is this happening in other places too? @fidencio @stevenhorsman
The reason for the error is that you've increased the cyclomatic complexity of CreateVM by adding new code in there. I count 4 new branches, so I guess it was 29 before and you've tipped it over the threshold.
Cc @pmores who is leading the effort on the QEMU driver for runtime-rs.
This PR has been opened without with no activity for 180 days. Comment on the issue otherwise it will be closed in 7 days