Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31545 )
Change subject: acpi: Sort the reported APIC-IDs in the MADT table ......................................................................
Patch Set 4: Code-Review+1
(1 comment)
Patch Set 3:
Patch Set 3:
(1 comment)
Does this have a time penalty?
I am pretty sure it is the one the sorting algorithm has, and it surely depends on the number of CPUs.
It's bound by CONFIG_MAX_CPUS which (AFAICS) is at most 48 in our tree, in serengeti_cheetah_fam10. That would mean ~2500 swaps at most in highly localized code and data.
I guess we can deal with that when it becomes an issue? I have the suspicion that using timsort (another stable sort) won't fare much better on our data set because of setup and copying costs (whereas bubble sort works in-place).
https://review.coreboot.org/#/c/31545/4/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/31545/4/src/arch/x86/acpi.c@162 PS4, Line 162: apic_ids add a bounds check for the array. It _should_ never happen, but...