Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi If _ENABLED flag of ACPI_SRAT_TYPE_CPU_AFFINITY...



details:   https://anonhg.NetBSD.org/src/rev/3769f4475291
branches:  trunk
changeset: 826384:3769f4475291
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Aug 31 08:45:03 2017 +0000

description:
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.

diffstat:

 sys/dev/acpi/acpi_srat.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r a956bc14e283 -r 3769f4475291 sys/dev/acpi/acpi_srat.c
--- a/sys/dev/acpi/acpi_srat.c  Thu Aug 31 08:36:32 2017 +0000
+++ b/sys/dev/acpi/acpi_srat.c  Thu Aug 31 08:45:03 2017 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/kmem.h>
@@ -190,6 +190,8 @@
                                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 @@
                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 @@
 
                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



Home | Main Index | Thread Index | Old Index