Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 mpacpi_config_cpu(): Xen with a PVH dom0 re...



details:   https://anonhg.NetBSD.org/src/rev/567e1a9e62dd
branches:  trunk
changeset: 374007:567e1a9e62dd
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Mar 24 12:25:28 2023 +0000

description:
mpacpi_config_cpu(): Xen with a PVH dom0 reports x2apic->LocalApicId
below 0xff, which causes a panic later because no CPUs are attached.
Accept the bogus LocalApicId value for VM_GUEST_XENPVH.

diffstat:

 sys/arch/x86/x86/mpacpi.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r a552599a92bf -r 567e1a9e62dd sys/arch/x86/x86/mpacpi.c
--- a/sys/arch/x86/x86/mpacpi.c Fri Mar 24 12:22:52 2023 +0000
+++ b/sys/arch/x86/x86/mpacpi.c Fri Mar 24 12:25:28 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpacpi.c,v 1.109 2022/01/22 11:49:17 thorpej Exp $     */
+/*     $NetBSD: mpacpi.c,v 1.110 2023/03/24 12:25:28 bouyer Exp $      */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.109 2022/01/22 11:49:17 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.110 2023/03/24 12:25:28 bouyer Exp $");
 
 #include "acpica.h"
 #include "opt_acpi.h"
@@ -396,8 +396,9 @@ mpacpi_config_cpu(ACPI_SUBTABLE_HEADER *
                /* ACPI spec: "Logical processors with APIC ID values
                 * less than 255 must use the Processor Local APIC
                 * structure to convey their APIC information to OSPM."
+                * But Xen with PVH dom0 breaks this ACPI spec.
                 */
-               if (x2apic->LocalApicId <= 0xff) {
+               if (x2apic->LocalApicId <= 0xff && vm_guest != VM_GUEST_XENPVH) {
                        printf("bogus MADT X2APIC entry (id = 0x%"PRIx32")\n",
                            x2apic->LocalApicId);
                        break;



Home | Main Index | Thread Index | Old Index