Skip to contentSkip to conversation

i386: correct cpu_x86_cpuid(0xd)

PATCH Sebastian Andrzej Siewior 2 participants 3 messages Oct 17, 2018 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 15 lines · Eduardo Habkost
Quoted 14 lines · Sebastian Andrzej Siewior

Intel SDM says for CPUID function 0DH, sub-function 0:

| • ECX enumerates the size (in bytes) required by the XSAVE instruction for an
|   XSAVE area containing all the user state components supported by this
|   processor.
| • EBX enumerates the size (in bytes) required by the XSAVE instruction for an
|   XSAVE area containing all the user state components corresponding to bits
|   currently set in XCR0.
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

target/i386/cpu.c void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, · line 4181

Quoted 10 lines
target/i386/cpu.c +1 -1
index f24295e6e4bb7..00c18444c0bac 100644
@@ -4178,7 +4178,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
             *ecx = xsave_area_size(x86_cpu_xsave_components(cpu));
             *eax = env->features[FEAT_XSAVE_COMP_LO];
             *edx = env->features[FEAT_XSAVE_COMP_HI];
-            *ebx = *ecx;
+            *ebx = xsave_area_size(env->xcr0);

ping

Sebastian

#3 lore raw
Quoted 29 lines · Sebastian Andrzej Siewior
Quoted 15 lines · Eduardo Habkost
Quoted 14 lines · Sebastian Andrzej Siewior

Intel SDM says for CPUID function 0DH, sub-function 0:

| • ECX enumerates the size (in bytes) required by the XSAVE instruction for an
|   XSAVE area containing all the user state components supported by this
|   processor.
| • EBX enumerates the size (in bytes) required by the XSAVE instruction for an
|   XSAVE area containing all the user state components corresponding to bits
|   currently set in XCR0.
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

target/i386/cpu.c void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, · line 4181

Quoted 10 lines
target/i386/cpu.c +1 -1
index f24295e6e4bb7..00c18444c0bac 100644
@@ -4178,7 +4178,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
             *ecx = xsave_area_size(x86_cpu_xsave_components(cpu));
             *eax = env->features[FEAT_XSAVE_COMP_LO];
             *edx = env->features[FEAT_XSAVE_COMP_HI];
-            *ebx = *ecx;
+            *ebx = xsave_area_size(env->xcr0);
Quoted 1 line

ping

It's queued for my next pull request.

Paolo

#4 lore raw
Quoted 1 line · Paolo Bonzini

It's queued for my next pull request.

thanks.

Quoted 1 line

Paolo

Sebastian