Skip to content

Add processor-topology test hooks#311

Open
Alan-Jowett wants to merge 1 commit into
mainfrom
alanjo/hot-add-usersim
Open

Add processor-topology test hooks#311
Alan-Jowett wants to merge 1 commit into
mainfrom
alanjo/hot-add-usersim

Conversation

@Alan-Jowett

Copy link
Copy Markdown
Member

This pull request introduces a new processor change notification mechanism to the kernel emulation layer, allowing components to register for and respond to processor addition events. It also adds the ability to override and manage the active processor count, improving flexibility for testing and simulation scenarios. The most important changes are grouped below.

Processor Change Notification System:

  • Added the KE_PROCESSOR_CHANGE_NOTIFY_STATE enum, KE_PROCESSOR_CHANGE_NOTIFY_CONTEXT struct, and related callback type and registration/deregistration APIs (KeRegisterProcessorChangeCallback, KeDeregisterProcessorChangeCallback). This enables clients to register callbacks that are notified of processor add events, including start, complete, and failure states. (inc/usersim/ke.h, src/ke.cpp) [1] [2] [3]
  • Implemented internal tracking for registered processor change callbacks, including thread-safe registration/deregistration and event notification logic. (src/ke.cpp) [1] [2]

Active Processor Count Management:

  • Added APIs to set and reset the active processor count override (usersim_set_active_processor_count, usersim_reset_active_processor_count), and updated KeQueryActiveProcessorCountEx to respect the override if set. This allows dynamic simulation of different processor counts. (inc/usersim/ke.h, src/ke.cpp) [1] [2] [3]

Processor Addition Notification Helpers:

  • Added helper APIs to notify the system of processor add start, complete, and failure events (usersim_notify_processor_add_start, usersim_notify_processor_add_complete, usersim_notify_processor_add_failure), which in turn trigger the registered callbacks. (inc/usersim/ke.h, src/ke.cpp) [1] [2]

General Code Quality:

  • Included <algorithm> for use in callback deregistration logic. (src/ke.cpp)

These changes collectively provide a robust infrastructure for simulating processor topology changes and allow other components to react to such events in a controlled and testable manner.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant