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

Re: [PATCH 1/3] acpi/processor: fix evaluating _PDC method when running as Xen dom0


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Nov 2022 15:51:58 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=xSZcEztiLzwU5is5DeASIufqgCPwdgIddl565ZM4GGg=; b=ej0fz81qnsKeb8ji87w4pptrf2crZPVStg4KrB576jVe6kNqIM2PD2ugvJ/ICEIsscfbeJHbQuAvqEiC7aGYWxWgHnx5AilF5nlfpQnF6Ir3ZtTDSwqciq+uv9OsP+4Y0n4q+37JsPkOnKB8D0dSiR/gkYSVPXJzWSct/g/J3oQZeBzop1IJdUsSJZGa+zsQeeHC/JA4U8g7Rro5RgA4Xd7rP3hsFSUH39qVhqoFjZ6A+KUxjuJDX5kN1/Rmpr0t9PGhFSnEUGWYOkVkGuMmInRprAju+8ASnFVAkoWZDWRVqPljzAYQ7VY8dZWqSYbaeyDOXz3buGET83xRpnN2oA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GwqsWwykpeERZjTrOKPKvPnUGAGfRD5RqV7xPoonMCqh/aamOa+XfTBMprUlBdXwj5EKYBvgzpu9b1JNf6QmiNCHum2Iko0PwYCHjYt1Vf1tWaLc4NGIkA9+Hl+i8JgYcg4WSgi4ynz/0ht6pc9yyzDzIfsyCZQ9pNdXXMwD1arVlD2c8flc5PZl4BSGRP7sAvKHlILiGKk5iMf/ZKAlVyKDxFpqbhLUfjdRY5GAXhuiNcyT+Qbsai7XpSMjVdVl+Xe+Wo8DV7H76CHs9Gf9NdIIxrVKXeMeo1fhmElDRx5/TI41xDsGFjkDu/ECGnPhh385+fHYOCk9xxYR15G7SA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, jgross@xxxxxxxx, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, Len Brown <lenb@xxxxxxxxxx>, linux-acpi@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
  • Delivery-date: Mon, 21 Nov 2022 14:52:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.11.2022 15:29, Roger Pau Monné wrote:
> On Mon, Nov 21, 2022 at 03:02:30PM +0100, Jan Beulich wrote:
>> On 21.11.2022 11:21, Roger Pau Monne wrote:
>>> @@ -47,6 +49,15 @@ static bool __init 
>>> processor_physically_present(acpi_handle handle)
>>>             return false;
>>>     }
>>>  
>>> +   if (xen_initial_domain())
>>> +           /*
>>> +            * When running as a Xen dom0 the number of processors Linux
>>> +            * sees can be different from the real number of processors on
>>> +            * the system, and we still need to execute _PDC for all of
>>> +            * them.
>>> +            */
>>> +           return xen_processor_present(acpi_id);
>>> +
>>>     type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
>>>     cpuid = acpi_get_cpuid(handle, type, acpi_id);
>>
>> We had to deal with this in our XenoLinux forward ports as well, but at
>> the time it appeared upstream I decided to make use of acpi_get_apicid()
>> (which meanwhile was renamed to acpi_get_phys_id()). Wouldn't than be an
>> option, eliminating the need for a Xen-specific new function?
> 
> While this would work for PV, it won't work on a PVH dom0, since the
> ACPI MADT table is not the native one in that case, and thus the
> Processor UIDs in the MADT don't match the ones in the Processor
> objects/devices.

I wonder whether we can actually get away with this difference long term.
I've gone back and looked at the commit introducing the code to build the
replacement MADT, but there's no mention of either the reason for the
changed numbering or the reason for limiting MADT entries to just the
number of CPUs Dom0 will have. (Clearly we need distinct APIC IDs, at
least until Xen becomes more flexible / correct in this regard. And
clearly we'd need to "invent" ACPI IDs in case Dom0 had more vCPU-s than
there are pCPU-s.)

Jan



 


Rackspace

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