Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175275102
D59551.id186629.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D59551.id186629.diff
View Options
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -163,6 +163,8 @@
static int acpi_cpu_resume(device_t dev);
static int acpi_pcpu_get_id(device_t dev, uint32_t acpi_id,
u_int *cpu_id);
+static void acpi_cpu_madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg);
+static bool acpi_cpu_enabled_in_madt(uint32_t acpi_id);
static struct resource_list *acpi_cpu_get_rlist(device_t dev, device_t child);
static device_t acpi_cpu_add_child(device_t dev, u_int order, const char *name,
int unit);
@@ -284,9 +286,10 @@
}
}
if (acpi_pcpu_get_id(dev, acpi_id, &cpu_id) != 0) {
- if (bootverbose && (type != ACPI_TYPE_PROCESSOR || acpi_id != 255))
- printf("ACPI: Processor %s (ACPI ID %u) ignored\n",
- acpi_name(acpi_get_handle(dev)), acpi_id);
+ if (bootverbose && (type != ACPI_TYPE_PROCESSOR || acpi_id != 255) &&
+ acpi_cpu_enabled_in_madt(acpi_id))
+ printf("ACPI: Processor %s (ACPI ID %u) enabled but not online, "
+ "ignored\n", acpi_name(handle), acpi_id);
return (ENXIO);
}
@@ -584,6 +587,62 @@
return (ESRCH);
}
+struct acpi_cpu_madt_check {
+ uint32_t acpi_id;
+ bool enabled;
+};
+
+static void
+acpi_cpu_madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg)
+{
+ struct acpi_cpu_madt_check *check = arg;
+ uint32_t id, flags;
+
+ switch (entry->Type) {
+ case ACPI_MADT_TYPE_LOCAL_APIC:
+ id = ((ACPI_MADT_LOCAL_APIC *)entry)->ProcessorId;
+ flags = ((ACPI_MADT_LOCAL_APIC *)entry)->LapicFlags;
+ break;
+ case ACPI_MADT_TYPE_LOCAL_X2APIC:
+ id = ((ACPI_MADT_LOCAL_X2APIC *)entry)->Uid;
+ flags = ((ACPI_MADT_LOCAL_X2APIC *)entry)->LapicFlags;
+ break;
+ case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
+ id = ((ACPI_MADT_GENERIC_INTERRUPT *)entry)->Uid;
+ flags = ((ACPI_MADT_GENERIC_INTERRUPT *)entry)->Flags;
+ break;
+ case ACPI_MADT_TYPE_RINTC:
+ id = ((ACPI_MADT_RINTC *)entry)->Uid;
+ flags = ((ACPI_MADT_RINTC *)entry)->Flags;
+ break;
+ default:
+ return;
+ }
+ if (id == check->acpi_id && (flags & ACPI_MADT_ENABLED) != 0)
+ check->enabled = true;
+}
+
+static bool
+acpi_cpu_enabled_in_madt(uint32_t acpi_id)
+{
+ static ACPI_TABLE_MADT *madt;
+ struct acpi_cpu_madt_check check = {
+ .acpi_id = acpi_id,
+ };
+ ACPI_TABLE_HEADER *hdr;
+
+ if (madt == NULL) {
+ if (ACPI_FAILURE(AcpiGetTable(ACPI_SIG_MADT, 1, &hdr)))
+ return (false);
+ madt = (ACPI_TABLE_MADT *)hdr;
+ /* Retain the table reference for subsequent processor probes. */
+ }
+
+ acpi_walk_subtables(madt + 1,
+ (char *)madt + madt->Header.Length, acpi_cpu_madt_handler, &check);
+ return (check.enabled);
+}
+
static struct resource_list *
acpi_cpu_get_rlist(device_t dev, device_t child)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 10, 3:46 PM (4 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38925622
Default Alt Text
D59551.id186629.diff (2 KB)
Attached To
Mode
D59551: acpi_cpu: only report unmapped processor objects enabled in the MADT
Attached
Detach File
Event Timeline
Log In to Comment