]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: Correct handling of MADT table CPUs
authorSimon Glass <sjg@chromium.org>
Tue, 22 Sep 2020 18:45:31 +0000 (12:45 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 25 Sep 2020 03:27:23 +0000 (11:27 +0800)
At present if hyperthreading is disabled the CPU numbering is not
sequential. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/x86/lib/acpi_table.c

index 86a9a35cb25a2b184a982c10e846009134e12e1f..5876355afe26000f4cd42ab74a62efd83434e184 100644 (file)
@@ -66,14 +66,17 @@ int acpi_create_madt_lapics(u32 current)
 {
        struct udevice *dev;
        int total_length = 0;
+       int cpu_num = 0;
 
        for (uclass_find_first_device(UCLASS_CPU, &dev);
             dev;
             uclass_find_next_device(&dev)) {
                struct cpu_platdata *plat = dev_get_parent_platdata(dev);
-               int length = acpi_create_madt_lapic(
-                               (struct acpi_madt_lapic *)current,
-                               plat->cpu_id, plat->cpu_id);
+               int length;
+
+               length = acpi_create_madt_lapic(
+                       (struct acpi_madt_lapic *)current, cpu_num++,
+                       plat->cpu_id);
                current += length;
                total_length += length;
        }