[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>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Aug 2023 12:13:25 +0200
  • 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=1TL3SuqiL/U8QplvnRFiosj3Muf1Pmyzyij/ftdbvSw=; b=L8naNky6YqL9QZFxzgvwVdfqQklCn4I/k/TTSVoiZoJTWz8VXY5lvIS+Qy+i1oIeLNv1q9Gd0+cowvGu7aGtNkFo9SElHVjaZEmmzo6RydpbP/aVomg8yZ/OsaD9pPZJWlSwnWIDWWx8Obrf3DHk4Bj/zXKo9Whyc9mY8Wsjj9gW6weKQht03sDVLXptdg2CNWjluHnL4DaRYwjwmHsBbIiJk1NcX1Al4pL1N9hTcfihOiCzvDH6h1hLw4S71jSWOIYL2fFC15W2yHokqPZQjn0JFm6btmrjC8ZlDqCbGQO2XTVNBD/UrMrIKu/G/x/oFsJFsRf8xEzQroqW4tuwvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J2WVDbHpNT9nPkkerPnwGeepGx49zwJv3qm7vdhHAmokvUuAxKmXXKMDS0cSvrMASfMLBXAifMGk0K0Pj/Rw6POU1v8RuuzOsMaw6Bmfb5teuaYNySH4k0cV7oJ2iwC+desrcn+r57MAIAwZqk0Fbmd8Hd2UX6tFz4IZVq7QxhbH8QRWfV/JScJKmZIBG3uYQ2sL53YQB47PrbuSamR0AscS7YheNH/h1J9UN2Lmd2KZH+zOfB6ZcTgFdsppbisWVEmXFekIyGWAti6YH0Y1jz2RtM52F555c8EApjTiZk5Z00FmkWZTxjUB+BqbiucUuaCPCkIYU3/Ro7ThIoaI3g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 07 Aug 2023 10:13:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.08.2023 11:38, 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.

I'm afraid it doesn't become clear to me what problem you're trying to
solve.

> --- 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 */
> +     if (processor->local_apic_id == 0xffffffff)
> +             return 0;
> +
>       /* Don't register processors that cannot be onlined. */
>       if (madt_revision >= 5 &&
>           !(processor->lapic_flags & ACPI_MADT_ENABLED) &&
>           !(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
>               return 0;
>  
> -     if ((processor->lapic_flags & ACPI_MADT_ENABLED) ||
> -         processor->local_apic_id != 0xffffffff || opt_cpu_info) {
> +     if ((processor->lapic_flags & ACPI_MADT_ENABLED) || opt_cpu_info) {
>               acpi_table_print_madt_entry(header);
>               log = true;
>       }

In particular you're now suppressing log messages which may be relevant.

The one issue that I'm aware of (and that I use a local hack to deal
with; see bottom) is excess verbosity.

Jan

--- unstable.orig/xen/arch/x86/mpparse.c
+++ unstable/xen/arch/x86/mpparse.c
@@ -809,8 +809,13 @@ int mp_register_lapic(u32 id, bool enabl
        };
        
        if (MAX_APICS <= id) {
-               printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
-                       id, MAX_APICS);
+               static u32 max_warn = -1;
+
+               if (id <= max_warn) {
+                       printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
+                              id, MAX_APICS);
+                       max_warn = id - 1;
+               }
                return -EINVAL;
        }
 




 


Rackspace

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