]> www.infradead.org Git - users/hch/configfs.git/commit
LoongArch: For all possible CPUs setup logical-physical CPU mapping
authorHuacai Chen <chenhuacai@loongson.cn>
Tue, 12 Nov 2024 08:35:36 +0000 (16:35 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Tue, 12 Nov 2024 08:35:36 +0000 (16:35 +0800)
commita6654a40a852a4ca18aacced4cf5ca87997818d7
tree9d3b3803ef3a9223de270e7504a07842e9d0b17a
parent2d5404caa8c7bb5c4e0435f94b28834ae5456623
LoongArch: For all possible CPUs setup logical-physical CPU mapping

In order to support ACPI-based physical CPU hotplug, we suppose for all
"possible" CPUs cpu_logical_map() can work. Because some drivers want to
use cpu_logical_map() for all "possible" CPUs, while currently we only
setup logical-physical mapping for "present" CPUs. This lack of mapping
also causes cpu_to_node() cannot work for hot-added CPUs.

All "possible" CPUs are listed in MADT, and the "present" subset is
marked as ACPI_MADT_ENABLED. To setup logical-physical CPU mapping for
all possible CPUs and keep present CPUs continuous in cpu_present_mask,
we parse MADT twice. The first pass handles CPUs with ACPI_MADT_ENABLED
and the second pass handles CPUs without ACPI_MADT_ENABLED.

The global flag (cpu_enumerated) is removed because acpi_map_cpu() calls
cpu_number_map() rather than set_processor_mask() now.

Reported-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/acpi.c
arch/loongarch/kernel/smp.c