qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup
@ 2022-07-12  2:12 Xiaoyao Li
  2022-07-12  2:12 ` [PATCH 1/2] i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F Xiaoyao Li
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xiaoyao Li @ 2022-07-12  2:12 UTC (permalink / raw)
  To: Paolo Bonzini, Marcelo Tosatti; +Cc: qemu-devel, xiaoyao.li

The issue that fixed by Patch 1 looks fatal though it doesn't appear on
KVM because KVM always searches with assending order and hit with the
correct cpuid leaf 0.

Patch 2 removes the wrong constraint on CPUID leaf 1f

Xiaoyao Li (2):
  i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F
  i386/cpuid: Remove subleaf constraint on CPUID leaf 1F

 target/i386/kvm/kvm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.27.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F
  2022-07-12  2:12 [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
@ 2022-07-12  2:12 ` Xiaoyao Li
  2022-07-12  2:12 ` [PATCH 2/2] i386/cpuid: Remove subleaf constraint on " Xiaoyao Li
  2022-11-02  0:49 ` [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
  2 siblings, 0 replies; 5+ messages in thread
From: Xiaoyao Li @ 2022-07-12  2:12 UTC (permalink / raw)
  To: Paolo Bonzini, Marcelo Tosatti; +Cc: qemu-devel, xiaoyao.li

Decrease array index cpuid_i when CPUID leaf 1F is skipped, otherwise it
will get an all zero'ed CPUID entry with leaf 0 and subleaf 0. It
conflicts with correct leaf 0.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 target/i386/kvm/kvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index b8578882c12b..a0b412a1129f 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -1831,6 +1831,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
         }
         case 0x1f:
             if (env->nr_dies < 2) {
+                cpuid_i--;
                 break;
             }
             /* fallthrough */
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] i386/cpuid: Remove subleaf constraint on CPUID leaf 1F
  2022-07-12  2:12 [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
  2022-07-12  2:12 ` [PATCH 1/2] i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F Xiaoyao Li
@ 2022-07-12  2:12 ` Xiaoyao Li
  2022-11-02  0:49 ` [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
  2 siblings, 0 replies; 5+ messages in thread
From: Xiaoyao Li @ 2022-07-12  2:12 UTC (permalink / raw)
  To: Paolo Bonzini, Marcelo Tosatti; +Cc: qemu-devel, xiaoyao.li

No such constraint that subleaf index needs to be less than 64.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 target/i386/kvm/kvm.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index a0b412a1129f..3efa524b4b93 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -1843,10 +1843,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
                     break;
                 }
 
-                if (i == 0x1f && j == 64) {
-                    break;
-                }
-
                 c->function = i;
                 c->flags = KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
                 c->index = j;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup
  2022-07-12  2:12 [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
  2022-07-12  2:12 ` [PATCH 1/2] i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F Xiaoyao Li
  2022-07-12  2:12 ` [PATCH 2/2] i386/cpuid: Remove subleaf constraint on " Xiaoyao Li
@ 2022-11-02  0:49 ` Xiaoyao Li
  2023-06-07  6:33   ` Xiaoyao Li
  2 siblings, 1 reply; 5+ messages in thread
From: Xiaoyao Li @ 2022-11-02  0:49 UTC (permalink / raw)
  To: Paolo Bonzini, Marcelo Tosatti; +Cc: qemu-devel

On 7/12/2022 10:12 AM, Xiaoyao Li wrote:
> The issue that fixed by Patch 1 looks fatal though it doesn't appear on
> KVM because KVM always searches with assending order and hit with the
> correct cpuid leaf 0.
> 
> Patch 2 removes the wrong constraint on CPUID leaf 1f

Kindly ping.

> Xiaoyao Li (2):
>    i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F
>    i386/cpuid: Remove subleaf constraint on CPUID leaf 1F
> 
>   target/i386/kvm/kvm.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup
  2022-11-02  0:49 ` [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
@ 2023-06-07  6:33   ` Xiaoyao Li
  0 siblings, 0 replies; 5+ messages in thread
From: Xiaoyao Li @ 2023-06-07  6:33 UTC (permalink / raw)
  To: Paolo Bonzini, Marcelo Tosatti; +Cc: qemu-devel

On 11/2/2022 8:49 AM, Xiaoyao Li wrote:
> On 7/12/2022 10:12 AM, Xiaoyao Li wrote:
>> The issue that fixed by Patch 1 looks fatal though it doesn't appear on
>> KVM because KVM always searches with assending order and hit with the
>> correct cpuid leaf 0.
>>
>> Patch 2 removes the wrong constraint on CPUID leaf 1f
> 
> Kindly ping.

ping it one more time.

Does it need a rebase and resend?

>> Xiaoyao Li (2):
>>    i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F
>>    i386/cpuid: Remove subleaf constraint on CPUID leaf 1F
>>
>>   target/i386/kvm/kvm.c | 5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>>
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-07  6:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12  2:12 [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
2022-07-12  2:12 ` [PATCH 1/2] i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F Xiaoyao Li
2022-07-12  2:12 ` [PATCH 2/2] i386/cpuid: Remove subleaf constraint on " Xiaoyao Li
2022-11-02  0:49 ` [PATCH 0/2] i386/cpuid: Minor fixes for CPUID leaf 1f setup Xiaoyao Li
2023-06-07  6:33   ` Xiaoyao Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).