Skip to content

fix(cpu): give each processor the slot its own APIC ID register names - #803

Merged
MasterLaplace merged 3 commits into
mainfrom
fix/792-each-processor-its-own-slot
Nov 8, 2026
Merged

MasterLaplace merged 3 commits into
mainfrom
fix/792-each-processor-its-own-slot

Conversation

@MasterLaplace

Copy link
Copy Markdown
Owner

What

cpu_topology_get_logical_slot gives each processor the slot its own APIC ID register names. It read one identifier recorded on the bootstrap processor, so every processor got slot 0 and the heap's first domain.

  • Before the local APICs run (apic_is_running), only the bootstrap processor runs, and it keeps the recorded identifier.
  • An identifier without a slot gives CPU_TOPOLOGY_NO_SLOT instead of being registered.
  • The docs of cpu_topology_get_local_apic_id and its setter now say the bootstrap processor's.

Two heap tests relied on the bug: each application processor's start-up blocks landed in domain 0, leaving domain 1 empty. They now empty domain 1 first.

Verify

  • Red on main: the_running_processor_keeps_the_slot_of_its_own_register and every_processor_finds_its_own_slot.
  • Server: q35 861/0, -cpu max 863/0, -smp 4 861/0, pc 855/0, -smp 1 856/0. Satellite: q35 711/0, pc -cpu max 706/0.
  • 3 of 4 mutants fail a test. apic_is_running always true survives: on QEMU the early read names no slot, which callers treat as slot 0.
  • Every budget within tolerance; server tick +0.03 %.

Not in it

Closes #792

@MasterLaplace MasterLaplace added the type:bug Something does not do what it promises label Nov 8, 2026
@MasterLaplace MasterLaplace self-assigned this Nov 8, 2026
@github-project-automation github-project-automation Bot moved this to To review in Laplace Nov 8, 2026
@MasterLaplace
MasterLaplace merged commit 2c1c2db into main Nov 8, 2026
10 checks passed
@MasterLaplace
MasterLaplace deleted the fix/792-each-processor-its-own-slot branch November 8, 2026 19:50
@github-project-automation github-project-automation Bot moved this from To review to Done in Laplace Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something does not do what it promises

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

cpu_topology_get_logical_slot gives every processor the bootstrap processor's slot

1 participant