[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 08/12] x86/acpi: Migrate vendor checks to cpu_vendor()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Thu, 12 Feb 2026 16:34:40 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MeB3jl45216Tb9wmhjc1qsJK8CK25FqNZlvx38O8AIg=; b=bvup8b4p8PwKvqZwgtLNhdNaDmCM5d8s5xRl7rLkr9KrD3Yr07OmlmZoo00kfVXeV6HSWYz0AJyVmUrORZsOWKdQqRnYKX7v+6XBSd1swj7L5xmVhRuPt4RQ+ZDZPc0hjJB71lRydPTBz2xqUBjOHCiSBSZQhLDUq+4iBW60+yK+Xy22n0vYfDb6QRLZyULZbLzNcLij/F4UROqIda4FDr5L3on8fClg9LOTD8JvReN2mPHW3Ylp9O5SP+QeO/WnZ96GrN0AU01ygOOsIU3Q6Lj62IszPl5+b8FWCTbp3yTtVAXnDlgH/bSYhKQxaK7ANzGXeSf3uakRtM7Dgqkspw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V+cftdzfPAp4XdOZxZ9x3QFh/ksThVaZWR5Olzt5FHJv7NqM832N9XpNlK99+tmmdvg3YMl2RAHsejsppH2MXcmtP0m/APvRAAtKTsNi4HFoPDwdx5VvfHXqZLfRfw44NFN/T13XPHLjCFIZOEdPBHqlXLUFJ/csr3JwWTC12OGj7pWCpk/PaumQVpiA3QWx3FJi8kcKZmVKIBCeQetrcUQxERuun/wseW/tdzOcs+mdtG0V6IJNNJcxGIveDq6NXiObPqIOlHd4KaxSVUjrbrw0aapANZ+6SaOO4MVRqK01me397wIEi3+T3y2AfrktxjZ8P1Er1xXf3JvAI8Rj8g==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 12 Feb 2026 15:35:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu Feb 12, 2026 at 12:52 PM CET, Jan Beulich wrote:
> On 06.02.2026 17:15, Alejandro Vallejo wrote:
>> --- a/xen/arch/x86/acpi/cpu_idle.c
>> +++ b/xen/arch/x86/acpi/cpu_idle.c
>> @@ -178,7 +178,7 @@ static void cf_check do_get_hw_residencies(void *arg)
>>      struct cpuinfo_x86 *c = &current_cpu_data;
>>      struct hw_residencies *hw_res = arg;
>>  
>> -    if ( c->x86_vendor != X86_VENDOR_INTEL || c->x86 != 6 )
>> +    if ( !(cpu_vendor() & X86_VENDOR_INTEL) || c->x86 != 6 )
>>          return;
>>  
>>      switch ( c->x86_model )
>> @@ -915,8 +915,7 @@ void cf_check acpi_dead_idle(void)
>>              mwait(cx->address, 0);
>>          }
>>      }
>> -    else if ( (current_cpu_data.x86_vendor &
>> -               (X86_VENDOR_AMD | X86_VENDOR_HYGON)) &&
>> +    else if ( cpu_vendor() & (X86_VENDOR_AMD | X86_VENDOR_HYGON) &&
>
> While we certainly make that assumption, shouldn't you add explicit checks
> that APs' vendors match the BSP's, in order to be able to also replace
> current_cpu_data uses? Or do we have such a check, and I'm merely overlooking
> it?
>
> Jan

In generic_identify()

        c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
        if (boot_cpu_data.x86_vendor != c->x86_vendor)
                printk(XENLOG_ERR "CPU%u vendor %u mismatch against BSP %u\n",
                       smp_processor_id(), c->x86_vendor,
                       boot_cpu_data.x86_vendor);

But I'm not sure why this is not a panic() (I thought it was). Such check
triggering can only mean a Hypervisor bug and a security hole.

Do you see a problem with s/printk/panic/ here?

Cheers,
Alejandro



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.