All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform
@ 2017-03-02 20:02 Andrew Cooper
  2017-03-03  9:52 ` Jan Beulich
  2017-03-03 10:40 ` Andrew Cooper
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Cooper @ 2017-03-02 20:02 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Jan Beulich

c/s 5cecf60f4 "x86/cpuid: Handle leaf 0x1 in guest_cpuid()" causes Linux 4.10
to crash during boot.

It turns out to be because of the reported apic_id, which was altered to be
more consistent across guests.  Revert back to the previous behaviour, by
limiting the apic_id adjustment to HVM guests only.  Whomever gets to fixes
topology representation is going to have a lot of fun with non-power-of-2 AMD
boxes.

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/x86/cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 0dd35dc..d6f6b88 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -749,7 +749,8 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
     case 0x1:
         /* TODO: Rework topology logic. */
         res->b &= 0x00ffffffu;
-        res->b |= (v->vcpu_id * 2) << 24;
+        if ( has_hvm_container_domain(d) )
+            res->b |= (v->vcpu_id * 2) << 24;
 
         /* TODO: Rework vPMU control in terms of toolstack choices. */
         if ( vpmu_available(v) &&
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform
  2017-03-02 20:02 [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform Andrew Cooper
@ 2017-03-03  9:52 ` Jan Beulich
  2017-03-03 10:40 ` Andrew Cooper
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2017-03-03  9:52 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Xen-devel

>>> On 02.03.17 at 21:02, <andrew.cooper3@citrix.com> wrote:
> c/s 5cecf60f4 "x86/cpuid: Handle leaf 0x1 in guest_cpuid()" causes Linux 4.10
> to crash during boot.
> 
> It turns out to be because of the reported apic_id, which was altered to be
> more consistent across guests.  Revert back to the previous behaviour, by
> limiting the apic_id adjustment to HVM guests only.  Whomever gets to fixes
> topology representation is going to have a lot of fun with non-power-of-2 AMD
> boxes.
> 
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform
  2017-03-02 20:02 [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform Andrew Cooper
  2017-03-03  9:52 ` Jan Beulich
@ 2017-03-03 10:40 ` Andrew Cooper
  2017-03-03 10:47   ` Sander Eikelenboom
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2017-03-03 10:40 UTC (permalink / raw)
  To: Sander Eikelenboom; +Cc: Jan Beulich, Xen-devel

On 02/03/17 20:02, Andrew Cooper wrote:
> c/s 5cecf60f4 "x86/cpuid: Handle leaf 0x1 in guest_cpuid()" causes Linux 4.10
> to crash during boot.
>
> It turns out to be because of the reported apic_id, which was altered to be
> more consistent across guests.  Revert back to the previous behaviour, by
> limiting the apic_id adjustment to HVM guests only.  Whomever gets to fixes
> topology representation is going to have a lot of fun with non-power-of-2 AMD
> boxes.
>
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Sorry I forgot to CC you this.  (I keep forgetting that git doesn't
understand Reported-by when collecting its CC list.)

Would you mind double checking this patch please?

~Andrew

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> ---
>  xen/arch/x86/cpuid.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
> index 0dd35dc..d6f6b88 100644
> --- a/xen/arch/x86/cpuid.c
> +++ b/xen/arch/x86/cpuid.c
> @@ -749,7 +749,8 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
>      case 0x1:
>          /* TODO: Rework topology logic. */
>          res->b &= 0x00ffffffu;
> -        res->b |= (v->vcpu_id * 2) << 24;
> +        if ( has_hvm_container_domain(d) )
> +            res->b |= (v->vcpu_id * 2) << 24;
>  
>          /* TODO: Rework vPMU control in terms of toolstack choices. */
>          if ( vpmu_available(v) &&


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform
  2017-03-03 10:40 ` Andrew Cooper
@ 2017-03-03 10:47   ` Sander Eikelenboom
  2017-03-03 10:48     ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Sander Eikelenboom @ 2017-03-03 10:47 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Jan Beulich, Xen-devel

On 03/03/17 11:40, Andrew Cooper wrote:
> On 02/03/17 20:02, Andrew Cooper wrote:
>> c/s 5cecf60f4 "x86/cpuid: Handle leaf 0x1 in guest_cpuid()" causes Linux 4.10
>> to crash during boot.
>>
>> It turns out to be because of the reported apic_id, which was altered to be
>> more consistent across guests.  Revert back to the previous behaviour, by
>> limiting the apic_id adjustment to HVM guests only.  Whomever gets to fixes
>> topology representation is going to have a lot of fun with non-power-of-2 AMD
>> boxes.
>>
>> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Sorry I forgot to CC you this.  (I keep forgetting that git doesn't
> understand Reported-by when collecting its CC list.)
> 
> Would you mind double checking this patch please?

Sure (but it will take till somewhere this evening CET though).

--
Sander

> ~Andrew
> 
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> ---
>>  xen/arch/x86/cpuid.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
>> index 0dd35dc..d6f6b88 100644
>> --- a/xen/arch/x86/cpuid.c
>> +++ b/xen/arch/x86/cpuid.c
>> @@ -749,7 +749,8 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
>>      case 0x1:
>>          /* TODO: Rework topology logic. */
>>          res->b &= 0x00ffffffu;
>> -        res->b |= (v->vcpu_id * 2) << 24;
>> +        if ( has_hvm_container_domain(d) )
>> +            res->b |= (v->vcpu_id * 2) << 24;
>>  
>>          /* TODO: Rework vPMU control in terms of toolstack choices. */
>>          if ( vpmu_available(v) &&
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform
  2017-03-03 10:47   ` Sander Eikelenboom
@ 2017-03-03 10:48     ` Andrew Cooper
  2017-03-03 19:00       ` Sander Eikelenboom
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2017-03-03 10:48 UTC (permalink / raw)
  To: Sander Eikelenboom; +Cc: Jan Beulich, Xen-devel

On 03/03/17 10:47, Sander Eikelenboom wrote:
> On 03/03/17 11:40, Andrew Cooper wrote:
>> On 02/03/17 20:02, Andrew Cooper wrote:
>>> c/s 5cecf60f4 "x86/cpuid: Handle leaf 0x1 in guest_cpuid()" causes Linux 4.10
>>> to crash during boot.
>>>
>>> It turns out to be because of the reported apic_id, which was altered to be
>>> more consistent across guests.  Revert back to the previous behaviour, by
>>> limiting the apic_id adjustment to HVM guests only.  Whomever gets to fixes
>>> topology representation is going to have a lot of fun with non-power-of-2 AMD
>>> boxes.
>>>
>>> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Sorry I forgot to CC you this.  (I keep forgetting that git doesn't
>> understand Reported-by when collecting its CC list.)
>>
>> Would you mind double checking this patch please?
> Sure (but it will take till somewhere this evening CET though).

No problem.  Thanks.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform
  2017-03-03 10:48     ` Andrew Cooper
@ 2017-03-03 19:00       ` Sander Eikelenboom
  0 siblings, 0 replies; 6+ messages in thread
From: Sander Eikelenboom @ 2017-03-03 19:00 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Jan Beulich, Xen-devel

On 03/03/17 11:48, Andrew Cooper wrote:
> On 03/03/17 10:47, Sander Eikelenboom wrote:
>> On 03/03/17 11:40, Andrew Cooper wrote:
>>> On 02/03/17 20:02, Andrew Cooper wrote:
>>>> c/s 5cecf60f4 "x86/cpuid: Handle leaf 0x1 in guest_cpuid()" causes Linux 4.10
>>>> to crash during boot.
>>>>
>>>> It turns out to be because of the reported apic_id, which was altered to be
>>>> more consistent across guests.  Revert back to the previous behaviour, by
>>>> limiting the apic_id adjustment to HVM guests only.  Whomever gets to fixes
>>>> topology representation is going to have a lot of fun with non-power-of-2 AMD
>>>> boxes.
>>>>
>>>> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Sorry I forgot to CC you this.  (I keep forgetting that git doesn't
>>> understand Reported-by when collecting its CC list.)
>>>
>>> Would you mind double checking this patch please?
>> Sure (but it will take till somewhere this evening CET though).
> 
> No problem.  Thanks.
> 
> ~Andrew
> 
Hi Andrew,

Just tested and it works fine.
Thanks again !

--
Sander

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-03-03 19:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 20:02 [PATCH] x86/cpuid: Fix booting on AMD Phenom 6-core platform Andrew Cooper
2017-03-03  9:52 ` Jan Beulich
2017-03-03 10:40 ` Andrew Cooper
2017-03-03 10:47   ` Sander Eikelenboom
2017-03-03 10:48     ` Andrew Cooper
2017-03-03 19:00       ` Sander Eikelenboom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.