|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 03/12] x86: Add cpu_vendor() as a wrapper for the host's CPU vendor
On Wed Feb 11, 2026 at 5:04 PM CET, Jan Beulich wrote:
> On 06.02.2026 17:15, Alejandro Vallejo wrote:
>> --- a/xen/arch/x86/cpu/common.c
>> +++ b/xen/arch/x86/cpu/common.c
>> @@ -328,7 +328,11 @@ void __init early_cpu_init(bool verbose)
>> *(u32 *)&c->x86_vendor_id[4] = edx;
>>
>> c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
>> - switch (c->x86_vendor) {
>> + if ( c->x86_vendor != cpu_vendor() )
>
> When we introduce new functions to Linux-style files, nowadays we take
> the liberty and make them Xen-style right away. In entirely Linux-
> style functions the style should remain consistently Linux'es, though.
>
Seeing how I added the tabs I did intend to do that.
Muscle memory and all. Will correct on the next one.
>> + panic("CPU vendor not compiled-in: %s",
>> + x86_cpuid_vendor_to_str(c->x86_vendor));
>
> This will be somewhat awkward when c->x86_vendor is UNKNOWN.
Which only happens on virtualised or imaginary CPUs. In either case you know
what you're running on and the information is not particularly useful. The
important part is the "this hypervisor cannot run on your vendor. Enable it
there".
>
> There'll also be a degenerate case, but I'll comment on that on the
> earlier patch causing that.
>
>> --- a/xen/arch/x86/include/asm/cpufeature.h
>> +++ b/xen/arch/x86/include/asm/cpufeature.h
>> @@ -14,6 +14,7 @@
>> #include <asm/cpu-policy.h>
>> #include <asm/cpuid.h>
>> #include <xen/lib/x86/cpu-policy.h>
>> +#include <asm/x86-vendors.h>
>
> Nit: Can the asm/-s please all stay together?
Sure, I didn't notice the xen/ because of the lack of a blank line.
>
> Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |