target/i386: Fix wrong count setting
PATCH 1/1 target/i386: Fix wrong count setting
The previous patch used wrong count setting with index value, which got wrong value from CPUID(EAX=12,ECX=0):EAX. So the SGX1 instruction can't be exposed to VM and the SGX decice can't work in VM.
Fixes d19d6ffa0710 ("target/i386: introduce helper to access supported CPUID")
Signed-off-by Yang Zhong <[email protected]>
--- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/cpu.c +1 -1
@@ -5559,7 +5559,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,* supports. Features can be further restricted by userspace, but not * made more permissive. */ -x86_cpu_get_supported_cpuid (0x12 , index, eax, ebx, ecx, edx); +x86_cpu_get_supported_cpuid (0x12 , count, eax, ebx, ecx, edx);if (count ==0 ) { *eax &= env->features[FEAT_SGX_12_0_EAX ];
Signature · 1 line
2.30.2
Paolo Bonzini
AppliedQueued, thanks.
Paolo