linux/drivers
Linus Torvalds ca7e917769 Rework of APIC enumeration and topology evaluation:
The current implementation has a couple of shortcomings:
 
   - It fails to handle hybrid systems correctly.
 
   - The APIC registration code which handles CPU number assignents is in
     the middle of the APIC code and detached from the topology evaluation.
 
   - The various mechanisms which enumerate APICs, ACPI, MPPARSE and guest
     specific ones, tweak global variables as they see fit or in case of
     XENPV just hack around the generic mechanisms completely.
 
   - The CPUID topology evaluation code is sprinkled all over the vendor
     code and reevaluates global variables on every hotplug operation.
 
   - There is no way to analyze topology on the boot CPU before bringing up
     the APs. This causes problems for infrastructure like PERF which needs
     to size certain aspects upfront or could be simplified if that would be
     possible.
 
   - The APIC admission and CPU number association logic is incomprehensible
     and overly complex and needs to be kept around after boot instead of
     completing this right after the APIC enumeration.
 
 This update addresses these shortcomings with the following changes:
 
   - Rework the CPUID evaluation code so it is common for all vendors and
     provides information about the APIC ID segments in a uniform way
     independent of the number of segments (Thread, Core, Module, ..., Die,
     Package) so that this information can be computed instead of rewriting
     global variables of dubious value over and over.
 
   - A few cleanups and simplifcations of the APIC, IO/APIC and related
     interfaces to prepare for the topology evaluation changes.
 
   - Seperation of the parser stages so the early evaluation which tries to
     find the APIC address can be seperately overridden from the late
     evaluation which enumerates and registers the local APIC as further
     preparation for sanitizing the topology evaluation.
 
   - A new registration and admission logic which
 
      - encapsulates the inner workings so that parsers and guest logic
        cannot longer fiddle in it
 
      - uses the APIC ID segments to build topology bitmaps at registration
        time
 
      - provides a sane admission logic
 
      - allows to detect the crash kernel case, where CPU0 does not run on
        the real BSP, automatically. This is required to prevent sending
        INIT/SIPI sequences to the real BSP which would reset the whole
        machine. This was so far handled by a tedious command line
        parameter, which does not even work in nested crash scenarios.
 
      - Associates CPU number after the enumeration completed and prevents
        the late registration of APICs, which was somehow tolerated before.
 
   - Converting all parsers and guest enumeration mechanisms over to the
     new interfaces.
 
     This allows to get rid of all global variable tweaking from the parsers
     and enumeration mechanisms and sanitizes the XEN[PV] handling so it can
     use CPUID evaluation for the first time.
 
   - Mopping up existing sins by taking the information from the APIC ID
     segment bitmaps.
 
     This evaluates hybrid systems correctly on the boot CPU and allows for
     cleanups and fixes in the related drivers, e.g. PERF.
 
 The series has been extensively tested and the minimal late fallout due to
 a broken ACPI/MADT table has been addressed by tightening the admission
 logic further.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmXuDawTHHRnbHhAbGlu
 dXRyb25peC5kZQAKCRCmGPVMDXSYobE7EACngItF+UOTCoCV6och2lL6HVoIdZD1
 Y5oaAgD+WzQSz/lBkH6b9kZSyvjlMo6O9GlnGX+ii+VUnijDp4VrspnxbJDaKEq3
 gOfsSg2Tk+ps50HqMcZawjjBYJb/TmvKwEV2XuzIBPOONSWLNjvN7nBSzLl1eF9/
 8uCE39/8aB5K3GXryRyXdo2uLu6eHTVC0aYFu/kLX1/BbVqF5NMD3sz9E9w8+D/U
 MIIMEMXy4Fn+P2o0vVH+gjUlwI76mJbB1WqCX/sqbVacXrjl3KfNJRiisTFIOOYV
 8o+rIV0ef5X9xmZqtOXAdyZQzj++Gwmz9+4TU1M4YHtS7UkYn6AluOjvVekCc+gc
 qXE3WhqKfCK2/carRMLQxAMxNeRylkZG+Wuv1Qtyjpe9JX2dTqtems0f4DMp9DKf
 b7InO3z39kJanpqcUG2Sx+GWanetfnX+0Ho2Moqu6Xi+2ATr1PfMG/Wyr5/WWOfV
 qApaHSTwa+J43mSzP6BsXngEv085EHSGM5tPe7u46MCYFqB21+bMl+qH82KjMkOe
 c6uZovFQMmX2WBlqJSYGVCH+Jhgvqq8HFeRs19Hd4enOt3e6LE3E74RBVD1AyfLV
 1b/m8tYB/o871ZlEZwDCGVrV/LNnA7PxmFpq5ZHLpUt39g2/V0RH1puBVz1e97pU
 YsTT7hBCUYzgjQ==
 =/5oR
 -----END PGP SIGNATURE-----

Merge tag 'x86-apic-2024-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 APIC updates from Thomas Gleixner:
 "Rework of APIC enumeration and topology evaluation.

  The current implementation has a couple of shortcomings:

   - It fails to handle hybrid systems correctly.

   - The APIC registration code which handles CPU number assignents is
     in the middle of the APIC code and detached from the topology
     evaluation.

   - The various mechanisms which enumerate APICs, ACPI, MPPARSE and
     guest specific ones, tweak global variables as they see fit or in
     case of XENPV just hack around the generic mechanisms completely.

   - The CPUID topology evaluation code is sprinkled all over the vendor
     code and reevaluates global variables on every hotplug operation.

   - There is no way to analyze topology on the boot CPU before bringing
     up the APs. This causes problems for infrastructure like PERF which
     needs to size certain aspects upfront or could be simplified if
     that would be possible.

   - The APIC admission and CPU number association logic is
     incomprehensible and overly complex and needs to be kept around
     after boot instead of completing this right after the APIC
     enumeration.

  This update addresses these shortcomings with the following changes:

   - Rework the CPUID evaluation code so it is common for all vendors
     and provides information about the APIC ID segments in a uniform
     way independent of the number of segments (Thread, Core, Module,
     ..., Die, Package) so that this information can be computed instead
     of rewriting global variables of dubious value over and over.

   - A few cleanups and simplifcations of the APIC, IO/APIC and related
     interfaces to prepare for the topology evaluation changes.

   - Seperation of the parser stages so the early evaluation which tries
     to find the APIC address can be seperately overridden from the late
     evaluation which enumerates and registers the local APIC as further
     preparation for sanitizing the topology evaluation.

   - A new registration and admission logic which

       - encapsulates the inner workings so that parsers and guest logic
         cannot longer fiddle in it

       - uses the APIC ID segments to build topology bitmaps at
         registration time

       - provides a sane admission logic

       - allows to detect the crash kernel case, where CPU0 does not run
         on the real BSP, automatically. This is required to prevent
         sending INIT/SIPI sequences to the real BSP which would reset
         the whole machine. This was so far handled by a tedious command
         line parameter, which does not even work in nested crash
         scenarios.

       - Associates CPU number after the enumeration completed and
         prevents the late registration of APICs, which was somehow
         tolerated before.

   - Converting all parsers and guest enumeration mechanisms over to the
     new interfaces.

     This allows to get rid of all global variable tweaking from the
     parsers and enumeration mechanisms and sanitizes the XEN[PV]
     handling so it can use CPUID evaluation for the first time.

   - Mopping up existing sins by taking the information from the APIC ID
     segment bitmaps.

     This evaluates hybrid systems correctly on the boot CPU and allows
     for cleanups and fixes in the related drivers, e.g. PERF.

  The series has been extensively tested and the minimal late fallout
  due to a broken ACPI/MADT table has been addressed by tightening the
  admission logic further"

* tag 'x86-apic-2024-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (76 commits)
  x86/topology: Ignore non-present APIC IDs in a present package
  x86/apic: Build the x86 topology enumeration functions on UP APIC builds too
  smp: Provide 'setup_max_cpus' definition on UP too
  smp: Avoid 'setup_max_cpus' namespace collision/shadowing
  x86/bugs: Use fixed addressing for VERW operand
  x86/cpu/topology: Get rid of cpuinfo::x86_max_cores
  x86/cpu/topology: Provide __num_[cores|threads]_per_package
  x86/cpu/topology: Rename topology_max_die_per_package()
  x86/cpu/topology: Rename smp_num_siblings
  x86/cpu/topology: Retrieve cores per package from topology bitmaps
  x86/cpu/topology: Use topology logical mapping mechanism
  x86/cpu/topology: Provide logical pkg/die mapping
  x86/cpu/topology: Simplify cpu_mark_primary_thread()
  x86/cpu/topology: Mop up primary thread mask handling
  x86/cpu/topology: Use topology bitmaps for sizing
  x86/cpu/topology: Let XEN/PV use topology from CPUID/MADT
  x86/xen/smp_pv: Count number of vCPUs early
  x86/cpu/topology: Assign hotpluggable CPUIDs during init
  x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug
  x86/topology: Add a mechanism to track topology via APIC IDs
  ...
2024-03-11 15:45:55 -07:00
..
accel accel/ivpu: Don't enable any tiles by default on VPU40xx 2024-02-20 16:56:21 +01:00
accessibility
acpi ACPI fix for 6.8-rc7 2024-02-28 12:20:00 -08:00
amba
android binder: signal epoll threads of self-work 2024-01-31 14:08:28 -08:00
ata ata: libata-core: Do not call ata_dev_power_set_standby() twice 2024-02-21 19:09:17 +01:00
atm atm: idt77252: fix a memleak in open_card_ubr0 2024-02-03 12:46:13 +00:00
auxdisplay drm-next for 6.8: 2024-01-12 11:32:19 -08:00
base Updates for the MSI interrupt subsystem and RISC-V initial MSI support: 2024-03-11 14:03:03 -07:00
bcma
block for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
bluetooth Bluetooth: qca: Fix triggering coredump implementation 2024-02-28 09:50:51 -05:00
bus bus: imx-weim: fix valid range check 2024-02-06 14:10:47 +08:00
cache cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback() 2024-02-21 16:24:10 +00:00
cdrom cdrom: gdrom: Convert to platform remove callback returning void 2024-03-07 11:53:30 -07:00
cdx cdx: Unlock on error path in rescan_store() 2024-01-04 17:01:14 +01:00
char TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
clk clk: samsung: clk-gs101: comply with the new dt cmu_misc clock names 2024-01-22 11:40:12 +01:00
clocksource treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
comedi comedi: comedi_test: Prevent timers rescheduling during deletion 2024-03-05 14:21:45 +00:00
connector connector/cn_proc: revert "connector: Fix proc_event_num_listeners count not cleared" 2024-02-13 11:15:44 +01:00
counter counter: fix privdata alignment 2024-02-16 18:51:00 -05:00
cpufreq cpufreq: intel_pstate: fix pstate limits enforcement for adjust_perf call back 2024-02-24 15:01:59 +01:00
cpuidle cpuidle: haltpoll: Do not enable interrupts when entering idle 2023-12-29 18:08:18 +01:00
crypto crypto: rk3288 - Fix use after free in unprepare 2024-03-01 18:33:29 +08:00
cxl cxl/acpi: Fix load failures due to single window creation failure 2024-02-20 22:58:05 -08:00
dax New code for 6.8: 2024-01-10 08:45:22 -08:00
dca
devfreq
dio
dma Updates for the MSI interrupt subsystem and RISC-V initial MSI support: 2024-03-11 14:03:03 -07:00
dma-buf dma-buf: heaps: Don't track CMA dma-buf pages under RssFile 2024-01-31 19:54:58 +05:30
dpll dpll: move all dpll<>netdev helpers to dpll code 2024-03-05 18:36:42 -08:00
edac x86/cpu/amd: Provide a separate accessor for Node ID 2024-02-15 22:07:37 +01:00
eisa
extcon
firewire firewire: ohci: prevent leak of left-over IRQ on unbind 2024-03-06 22:35:22 +09:00
firmware RISC-V firmware drivers for v6.9 2024-03-06 07:42:08 +01:00
fpga Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
fsi
gnss TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
gpio gpio: fix resource unwinding order in error path 2024-03-01 09:33:30 +01:00
gpu Rework of APIC enumeration and topology evaluation: 2024-03-11 15:45:55 -07:00
greybus TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
hid HID: wacom: generic: Avoid reporting a serial of '0' to userspace 2024-02-13 11:40:23 +01:00
hsi
hte
hv Drivers: hv: vmbus: make hv_bus const 2024-03-03 02:32:35 +00:00
hwmon Rework of APIC enumeration and topology evaluation: 2024-03-11 15:45:55 -07:00
hwspinlock
hwtracing
i2c i2c: aspeed: Fix the dummy irq expected print 2024-03-08 10:10:27 +01:00
i3c i3c: master: cdns: Update maximum prescaler value for i2c clock 2024-01-08 00:51:36 +01:00
idle Power management updates for 6.8-rc1 2024-01-09 16:32:11 -08:00
iio iio: accel: adxl367: fix I2C FIFO data register 2024-02-25 14:31:14 +00:00
infiniband RDMA/srpt: fix function pointer cast warnings 2024-02-14 11:15:54 +02:00
input Input updates for v6.8-rc7 2024-03-08 13:06:35 -08:00
interconnect interconnect: qcom: x1e80100: Add missing ACV enable_mask 2024-02-04 23:36:06 +02:00
iommu Updates for the MSI interrupt subsystem and RISC-V initial MSI support: 2024-03-11 14:03:03 -07:00
ipack TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
irqchip Updates for the MSI interrupt subsystem and RISC-V initial MSI support: 2024-03-11 14:03:03 -07:00
isdn
leds - New Drivers 2024-01-17 15:25:27 -08:00
macintosh
mailbox irqchip: Convert all platform MSI users to the new API 2024-02-15 17:55:40 +01:00
mcb
md for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
media media: pwm-ir-tx: Depend on CONFIG_HIGH_RES_TIMERS 2024-02-01 13:49:39 +01:00
memory IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
memstick mspro_block: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:59:31 -07:00
message
mfd TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
misc mei: gsc_proxy: match component when GSC is on different bus 2024-03-05 14:30:09 +00:00
mmc for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
most
mtd for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
mux mux: mmio: use reg property when parent device is not a syscon 2024-01-04 17:01:14 +01:00
net net: pds_core: Fix possible double free in error handling path 2024-03-07 12:03:19 +01:00
nfc
ntb
nubus nubus: Make nubus_bus_type static and constant 2024-01-03 13:33:59 +01:00
nvdimm pmem: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:58:24 -07:00
nvme for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
nvmem nvmem: include bit index in cell sysfs file name 2024-02-14 16:28:16 +01:00
of Devicetree fix for v6.8, part 2: 2024-03-01 17:18:35 -08:00
opp OPP: Rename 'rate_clk_single' 2024-01-05 15:55:41 +05:30
parisc parisc/power: Fix power soft-off button emulation on qemu 2024-01-07 22:59:16 +01:00
parport
pci PCI/MSI: Prevent MSI hardware interrupt number truncation 2024-02-19 16:11:01 +01:00
pcmcia
peci
perf Updates for the MSI interrupt subsystem and RISC-V initial MSI support: 2024-03-11 14:03:03 -07:00
phy phy: qcom-qmp-combo: fix type-c switch registration 2024-03-06 20:37:37 +05:30
pinctrl pinctrl: don't put the reference to GPIO device in pinctrl_pins_show() 2024-02-29 14:36:40 +01:00
platform Rework of APIC enumeration and topology evaluation: 2024-03-11 15:45:55 -07:00
pmdomain pmdomain: qcom: rpmhpd: Fix enabled_corner aggregation 2024-02-28 16:31:45 +01:00
pnp More ACPI updates for 6.8-rc1 2024-01-17 14:37:40 -08:00
power power: supply: bq27xxx-i2c: Do not free non existing IRQ 2024-02-16 23:42:38 +01:00
powercap x86/cpu/topology: Rename topology_max_die_per_package() 2024-02-15 22:07:45 +01:00
pps
ps3
ptp treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
pwm pwm: jz4740: Don't use dev_err_probe() in .request() 2024-01-12 18:25:05 +01:00
rapidio rapidio/tsi721: fix kernel-doc warnings 2023-12-20 15:02:57 -08:00
ras
regulator regulator: rk808: fix LDO range on RK806 2024-03-04 14:54:32 +00:00
remoteproc
reset SoC: driver updates for 6.8 2024-01-11 11:31:46 -08:00
rpmsg
rtc rtc: test: Fix invalid format specifier. 2024-02-27 16:26:48 -07:00
s390 for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
sbus
scsi for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
sh maple: make maple_bus_type static and const 2024-01-04 14:37:17 +01:00
siox
slimbus
soc A reset fix for host1x, a resource leak fix and a probe fix for aux-hpd, 2024-03-01 13:13:06 +10:00
soundwire soundwire updates for 6.7 2024-01-18 17:08:31 -08:00
spi spi: cs42l43: Don't limit native CS to the first chip select 2024-03-06 17:44:28 +00:00
spmi
ssb
staging Char/Misc changes for 6.8-rc5 2024-02-17 08:52:38 -08:00
target vfs-6.9.super 2024-03-11 10:52:34 -07:00
tc
tee tee: optee: Fix kernel panic caused by incorrect error handling 2024-03-04 09:49:03 +01:00
thermal x86/cpu/topology: Rename topology_max_die_per_package() 2024-02-15 22:07:45 +01:00
thunderbolt thunderbolt: Fix for v6.8-rc7 2024-03-02 19:47:01 +01:00
tty Revert "tty: serial: simplify qcom_geni_serial_send_chunk_fifo()" 2024-03-05 13:40:34 +00:00
ufs Updates for the MSI interrupt subsystem and RISC-V initial MSI support: 2024-03-11 14:03:03 -07:00
uio uio: Fix use-after-free in uio_open 2024-01-04 17:03:47 +01:00
usb workqueue: BH workqueue conversions for v6.9 2024-03-11 13:05:19 -07:00
vdpa virtio: features, fixes 2024-01-18 16:44:03 -08:00
vfio VFIO updates for v6.8-rc1 2024-01-18 15:57:25 -08:00
vhost virtio: features, fixes 2024-01-18 16:44:03 -08:00
video hyperv-fixes for v6.8 2024-03-05 12:38:50 -08:00
virt Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
virtio virtio: features, fixes 2024-01-18 16:44:03 -08:00
w1 w1: ds2433: add support for ds28ec20 eeprom 2023-12-20 09:25:25 +01:00
watchdog linux-watchdog 6.8-rc1 tag 2024-01-12 13:32:30 -08:00
xen xen/events: close evtchn after mapping cleanup 2024-02-13 10:12:47 +01:00
zorro
Kconfig
Makefile fbdev/intelfb: Remove driver 2024-01-12 12:38:37 +01:00