diff options
author | Thomas Gleixner <[email protected]> | 2024-03-22 19:56:38 +0100 |
---|---|---|
committer | Borislav Petkov (AMD) <[email protected]> | 2024-03-23 12:35:56 +0100 |
commit | 5e25eb25dae9fa0700bbe42aff0e2f105fcd096a (patch) | |
tree | 6a1a5f5c2bc342f86bcf8e42e560229ca90532c5 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | 7af541cee1e0eb48c6eb439bc6309175339fa96f (diff) |
x86/topology: Handle the !APIC case gracefully
If there is no local APIC enumerated and registered then the topology
bitmaps are empty. Therefore, topology_init_possible_cpus() will die with
a division by zero exception.
Prevent this by registering a fake APIC id to populate the topology
bitmap. This also allows to use all topology query interfaces
unconditionally. It does not affect the actual APIC code because either
the local APIC address was not registered or no local APIC could be
detected.
Fixes: f1f758a80516 ("x86/topology: Add a mechanism to track topology via APIC IDs")
Reported-by: Guenter Roeck <[email protected]>
Reported-by: Linus Torvalds <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions