Skip to content

add EPYC-Turin vCPU type support#392

Merged
DGonzalezVillal merged 2 commits into
virtee:mainfrom
rouming:add-epyc-turin-support
May 12, 2026
Merged

add EPYC-Turin vCPU type support#392
DGonzalezVillal merged 2 commits into
virtee:mainfrom
rouming:add-epyc-turin-support

Conversation

@rouming
Copy link
Copy Markdown
Contributor

@rouming rouming commented May 8, 2026

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'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").

Also fix some warnings when the lib is built with snp feature support only.

rouming added 2 commits May 8, 2026 15:53
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>
@rouming rouming force-pushed the add-epyc-turin-support branch from 7b09125 to b28fcb7 Compare May 8, 2026 13:58
@tylerfanelli
Copy link
Copy Markdown
Member

cc/ @DGonzalezVillal

Copy link
Copy Markdown
Member

@DGonzalezVillal DGonzalezVillal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes lgtm, @tylerfanelli do you mind if the introducing the warning fixes in this pr even if they're not directly related to the Turin Vcpu?

@tylerfanelli
Copy link
Copy Markdown
Member

It's fine with me, as it's a relatively small change.

@rouming
Copy link
Copy Markdown
Contributor Author

rouming commented May 12, 2026

@tylerfanelli @DGonzalezVillal guys, do you plan to release the sev lib with this change and update snpguest accordingly? Or you have a strict schedule for that? I'm asking because I depend on both in my other repo (the attest tool), I need turin support and don't want to depend on my own branches.

@DGonzalezVillal
Copy link
Copy Markdown
Member

@rouming I'm planning a release soon, I want to cut a release with all the new content before #378 gets merged since that will be a major breaking change

@DGonzalezVillal DGonzalezVillal merged commit a10176c into virtee:main May 12, 2026
123 checks passed
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

Successfully merging this pull request may close these issues.

5 participants