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

Re: [XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT


  • To: Simon Gaiser <simon@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 7 Aug 2023 11:06:09 +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=/Y8nVWJdUc/lyHm/tgeOSEdjT7RtdH9eMDYPuqSa3rE=; b=kasr89fgBSzQyHpKIsQhLuqt1+6U9wvUQlXWKMhWudNyLwHYsfOdTwaInZzsKrtmakGuhgAEp8nedGwXQcOUskTCTNyJcQPlP8WHutakh7CGw3tjltYSy912hgwK+T+lUi5xsQOHQfVf2VStPeRjh5tTeC3AYpVs5pclS5uHzqLbfbSIafJh3ccFkaZHoSSOxYVH3Bh3HyUQ14mFIo8cRHQqFagh68SndpPCAX8861A3SSMzWnLTK/hfobQsA6y19KA2GbZtBlXkF7g8vg6+TKRKpJi3+RSGPvQpAjUd4DVo5iguoFC+B3SbmD5gMwVxcpRtgmDpF5LSyah1wUtmiQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dPCiNR8Tn0D0D+9WSXr3AmbBD0b2lMWf9aZwt3gBo5YcYSUV9I91eDNCS2Fo089eM+I2cJ4x9lyyGTebsERKEIVVjZPPDeVIzWp3GwErpMGFB1q9o2w0vhedNQmz+2CVCemKsIoGvIjY0EYP2IKbysJ8Ek8fhkZQXOxv3SDCF5gZT5PxbJylhaca/k8KRfGDjs3+ymEB+rbJYwUGc48I9qhthYoUcRSi7CiQUgBDcn1XKf1nq9rTpiwjOH5g3xR9v4WCePysPKHWJqHjNqWNFba0/YH66ptjozBLvVZnmS3Eclw82Xzv3NwX/26HcwKiaqgICIr9d+HprYbJg9swxw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 07 Aug 2023 10:06:25 +0000
  • Ironport-data: A9a23:37v0EKoeosql6muRwoCsuGKZx1ReBmL6ZBIvgKrLsJaIsI4StFCzt garIBmPO6yKYmSmftkladmz9h9T7ZCDmNQ1TwU5rCxgRH9B9ZuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weOzydNV/rzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXADEEaAGprP6k/IO+YNdT3vgBIvX3O6pK7xmMzRmBZRonabbqZvySoPpnhnI3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeWraYKIEjCJbZw9ckKwj 2TK5WnmRDodM8SS02Gt+XOwnO7f2yj8Xer+EZXhr6430AHNnzB75Bs+TEf4oKiVsVCCZddjD 2ES+g90gI0p3Rn+JjX6d1jiyJKehTYHWt9XFcU77h+M0ave5wuFBmkCQSVFYdZgv8gzLRQ62 1nMk973CDhHtLyOVWnb5rqStSm1OyUeMSkFfyBsZQkP7sTnoYozpgnSVdslG6mw5vXqHRngz jbMqzIx750WhNQO3r+2/njGhSytvZnDSgMp5gTRUXmh5wk/b4mgD7FE8nDe5PdEaYOGFF+Iu SFcn9DEtbhTS5aQiCaKXeMBWqmz4OqIOyHdhlgpGIQ98zOq+DioeoU4DCxCGXqF+/0sIVfBC HI/cysIjHOPFBNGtZNKXr8=
  • Ironport-hdrordr: A9a23:In3Xa6HGiWxckGW3pLqERceALOsnbusQ8zAXPo5KKCC9Ffbo8f xG/c5rsiMc7Qx6ZJhOo7290cW7LU80sKQFgrX409+ZLXXbUSiTXfxfBbKL+UyeJ8SGzJ8i6U 4DSchD4azLfDxHZJ3BkXCF+r8bqbHtzEnrv5a9854Kd25XgspbnmJE42igfHGebTM2dKYRJd 6z5tdnuzHlQngedMK9b0N1JdTrlpnklI/GfRVDPBIs6BCPgTS0gYSKaCSw71MxUy5v3bxnym TOkxX46qK/99m3xwTRzXW71eUkpPLRjvVCGe2RgYwuJjLghh3AXvUYZ5SOsCopoOam9VYtl8 OkmWZRA/hO
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07/08/2023 11:01 am, Andrew Cooper wrote:
> On 07/08/2023 10:38 am, Simon Gaiser wrote:
>> It seems some firmwares put dummy entries in the ACPI MADT table for non
>> existing processors. On my NUC11TNHi5 those have the invalid APIC ID
>> 0xff. Linux already has code to handle those cases both in
>> acpi_parse_lapic [1] as well as in acpi_parse_x2apic [2]. So add the
>> same check to Xen.
>>
>> Note that on some older (2nd gen Core i) laptop of mine I also saw dummy
>> entries with a valid APIC ID. Linux would still ignore those because
>> they have !ACPI_MADT_ENABLED && !ACPI_MADT_ONLINE_CAPABLE. But in Xen
>> this check is only active for madt_revision >= 5. But since this version
>> check seems to be intentionally I leave that alone.
> I recall there being a discussion over this, ultimately with the version
> check being removed.  IIRC it was a defacto standard used for a long
> time prior to actually getting written into the ACPI spec, so does exist
> in practice in older MADTs.
>
> Otherwise LGTM.  I'd suggest dropping this paragraph as it's not related
> to the change.  It will also help if we do decide to follow up and drop
> the MADT version check.
>
>> Link: 
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f3bf1dbe64b62a2058dd1944c00990df203e8e7a
>>  # [1]
>> Link: 
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=10daf10ab154e31237a8c07242be3063fb6a9bf4
>>  # [2]
> https://git.kernel.org/torvalds/c/$SHA
>
> Somewhat less verbose. https://korg.docs.kernel.org/git-url-shorteners.html
>
>> Signed-off-by: Simon Gaiser <simon@xxxxxxxxxxxxxxxxxxxxxx>
>> ---
>>  xen/arch/x86/acpi/boot.c | 14 ++++++++++----
>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
>> index 54b72d716b..4a62822fa9 100644
>> --- a/xen/arch/x86/acpi/boot.c
>> +++ b/xen/arch/x86/acpi/boot.c
>> @@ -87,14 +87,17 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, 
>> const unsigned long end)
>>      if (BAD_MADT_ENTRY(processor, end))
>>              return -EINVAL;
>>  
>> +    /* Ignore entries with invalid apicid */
> x2apic ID.

Oh, and I forgot to say.  I'm happy to fix all of this up on commit if
you're happy.

~Andrew



 


Rackspace

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