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

igvmbuilder: configure XCR0 as expected in CPUID tables #511

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

msft-jlange
Copy link
Contributor

A recent change to the SVSM kernel requires XCR0 to match the value 1 when looking for CPUID[EAX=0Dh] leaves. However, the IGVM file builder was populating the CPUID template with XCR0=0, resulting in a mismatch when the CPUID lookup was attempted. This change sets XCR0=1 for the extended leaves in the CPUID template in the IGVM file so the constructed table matches the expected value at lookup time.

A recent change to the SVSM kernel requires XCR0 to match the value `1`
when looking for CPUID[EAX=0Dh] leaves.  However, the IGVM file builder
was populating the CPUID template with XCR0=0, resulting in a mismatch
when the CPUID lookup was attempted.  This change sets XCR0=1 for the
extended leaves in the CPUID template in the IGVM file so the
constructed table matches the expected value at lookup time.

Signed-off-by: Jon Lange <[email protected]>
The set of available extended features (XFEM/XCR0) is enumerated by
CPUID[EAX=0Dh,ECX=00h].EAX.  The set of available XSAVE features (e.g.
XSAVEOPT, XSAVEC) is enumerated by CPUID[EAX=0Dh,ECX=01h].EAX.  The
previous code had the CPUID detection inverted.

Signed-off-by: Jon Lange <[email protected]>
@joergroedel joergroedel merged commit 3c2c37f into coconut-svsm:main Nov 11, 2024
3 checks passed
@msft-jlange msft-jlange deleted the cpuid_xcr0 branch November 12, 2024 02:42
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.

2 participants