Add processor-topology test hooks#311
Open
Alan-Jowett wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
KE_PROCESSOR_CHANGE_NOTIFY_STATEenum,KE_PROCESSOR_CHANGE_NOTIFY_CONTEXTstruct, 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]src/ke.cpp) [1] [2]Active Processor Count Management:
usersim_set_active_processor_count,usersim_reset_active_processor_count), and updatedKeQueryActiveProcessorCountExto 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:
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:
<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.