add EPYC-Turin vCPU type support#392
Open
rouming wants to merge 2 commits into
Open
Conversation
Adds EpycTurin, EpycTurinV1, EpycTurinV2 variants to CpuType so
callers:(notably snpguest's "generate measurement --vcpu-type
EPYC-Turin") can compute launch digests for guests booted with QEMU's
EPYC-Turin CPU model. Without this, snpguest fails with:
ERROR: Invalid VCPU type value provided: EPYC-Turin
The CPUID family / model / stepping values used by sig() were taken
verbatim from QEMU's CPU definition at target/i386/cpu.c (entry
.name = "EPYC-Turin"):
.family = 26, .model = 0, .stepping = 0
Two version variants exist in the same QEMU table:
.versions = (X86CPUVersionDefinition[]) {
{ .version = 1 },
{ .version = 2, ... },
}
so EpycTurinV1 and EpycTurinV2 are added alongside the base EpycTurin;
all three share the same CPU signature cpu_sig(26, 0, 0), matching how
the existing Milan / Genoa entries are structured.
Tested end-to-end on a real EPYC-Turin host: snpguest generate
measurement, fetch ca / vcek, and verify attestation (TCB+FMC, signature,
measurement match) all succeed against a V5 attestation report.
Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Building with default-features=false, features=["openssl","snp"] (no "sev" feature) triggers five warnings. Fix each at the source. error.rs: "use openssl::error::ErrorStack" on cfg(all(openssl, sev)). firmware/host/types/snp.rs: replace unreachable "_" arms in TcbVersion's Encoder/Decoder. launch/linux/snp.rs: tag legacy "pub struct Init" (KVM_SEV_INIT payload, only consumed via the "sev" feature path) with #[allow(dead_code)] so it compiles cleanly under snp-only. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
7b09125 to
b28fcb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR adds EpycTurin, EpycTurinV1, EpycTurinV2 variants to CpuType so callers:(notably snpguest's
generate measurement --vcpu-type EPYC-Turin) can compute launch digests for guests booted with QEMU'sEPYC-TurinCPU model. Without this, snpguest fails with:The CPUID family / model / stepping values used by sig() were taken verbatim from QEMU's CPU definition at target/i386/cpu.c (entry .name = "EPYC-Turin").
Also fix some warnings when the lib is built with snp feature support only.