From 287fff2eb11167842544e440e2d7dd3b4144e6f2 Mon Sep 17 00:00:00 2001 From: msaitoh Date: Thu, 31 Aug 2017 08:45:03 +0000 Subject: [PATCH] If _ENABLED flag of ACPI_SRAT_TYPE_CPU_AFFINITY, ACPI_SRAT_TYPE_MEMORY_AFFINITY or ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY isn't set, don't use the table. --- sys/dev/acpi/acpi_srat.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpi/acpi_srat.c b/sys/dev/acpi/acpi_srat.c index 495800349638..a24d653c7c79 100644 --- a/sys/dev/acpi/acpi_srat.c +++ b/sys/dev/acpi/acpi_srat.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_srat.c,v 1.3 2010/03/05 14:00:17 jruoho Exp $ */ +/* $NetBSD: acpi_srat.c,v 1.4 2017/08/31 08:45:03 msaitoh Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_srat.c,v 1.3 2010/03/05 14:00:17 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_srat.c,v 1.4 2017/08/31 08:45:03 msaitoh Exp $"); #include #include @@ -190,6 +190,8 @@ acpisrat_parse(void) continue; srat_cpu = (ACPI_SRAT_CPU_AFFINITY *)subtable; + if ((srat_cpu->Flags & ACPI_SRAT_CPU_ENABLED) == 0) + break; nodeid = (srat_cpu->ProximityDomainHi[2] << 24) | (srat_cpu->ProximityDomainHi[1] << 16) | (srat_cpu->ProximityDomainHi[0] << 8) | @@ -210,6 +212,8 @@ acpisrat_parse(void) case ACPI_SRAT_TYPE_MEMORY_AFFINITY: srat_mem = (ACPI_SRAT_MEM_AFFINITY *)subtable; nodeid = srat_mem->ProximityDomain; + if ((srat_mem->Flags & ACPI_SRAT_MEM_ENABLED) == 0) + break; mementry = mem_alloc(); if (mementry == NULL) @@ -224,6 +228,8 @@ acpisrat_parse(void) case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: srat_x2apic = (ACPI_SRAT_X2APIC_CPU_AFFINITY *)subtable; + if ((srat_x2apic->Flags & ACPI_SRAT_CPU_ENABLED) == 0) + break; nodeid = srat_x2apic->ProximityDomain; /* This table entry overrides