[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 21 Nov 2022 16:09:32 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=xJAV3gu9bvonr8L5L+A08ezmPNN3r1cKnnOY5J8L51Y=; b=cknetg0hP9CTL0I0JA32Q/n4nwiZn2cL+7w43rY2bkhAq9Hte9RnxXPgn7nVcUIQipt/6zfH81ZH7Ou8iGDw2q6n2bnWChHTQA61r7PCogpHD1jEI8Umv9PsMNVYMcA1DjOVNxZBz3WM3ohSG5zSUYam9kVmh8IBldrMDpFy0MXhsV5L+XWILJiIXSLwuOJsZASNA+VtpLBiWZh4Ve4X89j1PPS4nYywj3fg5flNsEcd8nkQN8kc+G3T8LYHSDsQK89dHhr615FAuP2+bEdspA/cIFlTJHTrauG9osVrrwlOySg+0VECGgYzlaNPLF4UwcvqBFS4yfkmy3XHlBJDmg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YOTO6nrLm4F2c9bVccIENHRkp2uFoO5G+KZl6fapw29fvllb1CCw3noHm6O6QLBADjgFPKWYjJBOFjSvyMdVVJvg1PwmA4mOZwvUf4GlY1gfq/FLgeO549n7C1ni5S6Je6X3VbtRfrgERru36iWtY4VTOEYWtfgi9exzPOWLPWRxsK64/0ML0hY1iP+reEBNTZbRCCnbg2WuuH3DA/8anPw2eZNpDUKLBBW/65q1eNauF6LpkVkEzUw9D5+L6UWWRda3eXNxu9jVAlz3WZs1QbyJA22D91zNq/X1H6BKlJESm1kVMUg/r2PcAmStOea+9c/1kgADS7eHkmVvBcX33A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.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 15:10:05 +0000
  • Ironport-data: A9a23:cWUvpax7FqovEdqJYf96t+cjxirEfRIJ4+MujC+fZmUNrF6WrkUEn GIXCGmAa/3bamv0eY0gYNmy9k9Uv5bWz4BmTFc9/iAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTbaeYUidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw//F+U0HUMja4mtC5AVnP6kT5TcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KWRV0 OwzBj43VBbdjtL15ZaZS7A3rNt2eaEHPKtH0p1h5RfwKK9+BLrlHODN79Ie2yosjMdTG/qYf 9AedTdkc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UXxPF4w541esMmJ 5j7ia8jd56HBnAlCPy65zhUAxrrFO9pT4HnfQIh3JSfIMCYPt6rJAZ/mlSDJAcdRiKobwPIa 1LNoXx9fxWeVSVYzTwuXRu+sWlWjAJEhKPUiE5y7mo+gkTuEo841oTxcQZkHtF3ok6UYN46+ PNNbktvK1ST+cNBJgNStspcI+SMCjgUBjMOGWdLRDMD6ccIU/ArJbx/fEc+PyqQpoV15E/8a 6xH2+wjVRCO34GNPf+n6Giqnv2MSeAtHXWu41jDqFCy/zBrOGBC1zHdLgs+/HQ0cn3TPerH8 pbA6gmc8MLHVGeZ7qh4DeOKqW6CUNuJPH96exLLG6mk4bsFrDAkND9XbL6GIfNeAxUKV8XRE FzEQTOGA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Nov 21, 2022 at 03:51:58PM +0100, Jan Beulich wrote:
> 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.)

Linux when running in PVH/HVM mode uses the ACPI Processor UID in the
MADT as the vCPU ID, so attempting to re-use the native UIDs doesn't
work.

We could expand the dom0 crafted MADT to make sure all the native ACPI
Processor UIDs are present in the crafted MADT, by adding them as not
present entries, but that seems more like a bodge than a proper
solution.  Even then those X2APIC entries would appear as offline by
the current checks, and thus won't get _PDC evaluated either.

Thanks, Roger.



 


Rackspace

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