Skip to content

Commit

Permalink
target/i386/cpu: Add dependencies of CPUID 0x12 leaves
Browse files Browse the repository at this point in the history
As SDM stated, CPUID 0x12 leaves depend on CPUID_7_0_EBX_SGX (SGX
feature word).

Since FEAT_SGX_12_0_EAX, FEAT_SGX_12_0_EBX and FEAT_SGX_12_1_EAX define
multiple feature words, add the dependencies of those registers to
report the warning to user if SGX is absent.

Signed-off-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
trueptolemy authored and bonzini committed Jul 31, 2024
1 parent 4912d69 commit 3722a98
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions target/i386/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,18 @@ static FeatureDep feature_dependencies[] = {
.from = { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX },
.to = { FEAT_7_0_ECX, CPUID_7_0_ECX_SGX_LC },
},
{
.from = { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX },
.to = { FEAT_SGX_12_0_EAX, ~0ull },
},
{
.from = { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX },
.to = { FEAT_SGX_12_0_EBX, ~0ull },
},
{
.from = { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX },
.to = { FEAT_SGX_12_1_EAX, ~0ull },
},
};

typedef struct X86RegisterInfo32 {
Expand Down

0 comments on commit 3722a98

Please sign in to comment.