[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:01:22 +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=e10eSy39/Azale1Jz+5xNO8QXko76iTOBQhrrYFt31I=; b=iF4bFeKyfwrDpjLJdei8Kz7zCz633Fs5+cZOKyq48bjeLoy3aQSpjQlNmOgFHX7PrxgQnzDgOx71DYpfxxGdJ0R8KLWZ6M8riDkiCNLX7mTYkjYttfI0zkfdbEIJIv2+S8dwpJW5Qqw2F5i920zAUjmgRTdbCV7ON3DXzveeKrt8YbQp/LnDi8zvryBTYMVej83E3m+bl8X+cXxFXQKbUKFfYmORyTLi1lsnP9rcx6BCFvht9NIcRRslc+zeQOqsFrMZGLoiWFlztYRwA+jCWtnUQ3hcZsSlURht93s7J4XioIZ+7z+kWWkaWNBmKpU/t5uhZVhN1XOVo8LVc6ymXA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P3DWacrXDcdaygw0eRBcQurR0Ar6xaOP0V5KiQpSW6TM6/qMU8lAwcZGgX2STUSvvP2O0azHjCHDOB35ZKKMpo06yc91E0jzPnmXoa0TbhcXPGXVRFBsEnEmH+mF7UurFT+kmCTSQITJ3UHls4hUQDWx9G5NbM7CvEOyDBsBMARwHinJfIqoSq2K+nYr87f3RS603Q8mhxyDonpl6VL4CkA9ppjZkZcbTuggNG7hR+OxI630aPFcvXDUujMHaQXeHsPvAvQKxbCIcq5OHwgrv4XWtkS1i0glxCxE9FXD/rmabZ0eiJ8wfKZLBIIJgyN915m7mjF1FXvE2nPDtOP5+A==
  • 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:01:43 +0000
  • Ironport-data: A9a23:A0yNSKvl2qYJNIYX2cWYKTMSRefnVLRfMUV32f8akzHdYApBsoF/q tZmKWyGMv/cNmv3edx/Ydizp0sCsZDcy4BlHgc6rn0xFnhD+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5A+GySFOZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwcmk0Piim1vOKwKOWbq53t956IczFI9ZK0p1g5Wmx4fcOZ7nmGvyPyfoGmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osj/60b4G9lt+iHK25mm6xo G7c8nu/KRYdLNGFkhKO8262h/+JliT+MG4XPOTir6U32QXCmwT/DjUcSXyG/9qlk3eBBeNHL 2tK3HFyl689oRnDot7VGkfQTGS/lgUdXt1WO+w89gCWy6DQ7hqZB24LVTpIYpots8pebSwn0 BqFks3kARRrsaaJUjSN+7GMtzSwNCMJa2gYakcsTwEI/t3iq4EblQ/UQ5BoF6vdpsLxMSH9x XaNtidWr7Aal8sCzai41VHBnTO3p5LNQxI15wPYRWas5EVyY4vNWmCzwV3S7PIFIIPHSFCE5 SEAg5LHs7tICoyRniuQRulLBKuu+/uOLDzbhxhoAoUl8DOuvXWkeOi8/Q1DGaugCe5cEReBX aMZkVo5CEN7VJdyUZJKXg==
  • Ironport-hdrordr: A9a23:V8tKraCDoGFJ42XlHelo55DYdb4zR+YMi2TDt3oddfU1SL38qy nKpp4mPHDP5wr5NEtPpTniAtjjfZq/z/5ICOAqVN/PYOCPggCVxepZnOjfKlPbehEX9oRmpN 1dm6oVMqyMMbCt5/yKnDVRELwbsaa6GLjDv5a785/0JzsaE52J6W1Ce2GmO3wzfiZqL7wjGq GR48JWzgDQAkj+PqyAdx84t/GonayzqK7b
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

~Andrew



 


Rackspace

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