Skip to content

Conversation

@olivereanderson
Copy link

@olivereanderson olivereanderson commented Jan 26, 2026

WIP: Do not review

TODO:

  • Complete the adaptation of the profile generation tool (almost there)
  • Regenerate CPU profiles on real hardware
  • Fix error handling and logging
  • Test on real hardware
  • Nice PR description :)

In preparation for making CPU profiles MSR aware we prepare for having
two pieces of data associated with a CPU profile: CPUID and MSR
adjustments. We thus rename the pre-existing CpuProfileData struct
to CpuIdProfileData and adapt the CPU profile generation tool
accordingly.

We also make the CPU profile generation tool write directly to file
and automatically introduce the required license file as well. This
makes the profile generation process more convenient.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
@olivereanderson olivereanderson force-pushed the cpu-profiles-msr branch 2 times, most recently from b7687cc to a743da6 Compare January 29, 2026 09:19
In order to generate CPU profiles we also need definitions and policies
for MSR-based features, as some CPU features are exposed through MSRs
rather than CPUID.

This commit introduces the MSR analogues of the data structures we
previously introduced for CPUID definitions.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
@olivereanderson olivereanderson force-pushed the cpu-profiles-msr branch 2 times, most recently from dd108ac to 84bef85 Compare January 30, 2026 15:10
We introduce MSR-based feature definitions for Intel CPUs that will be
utilized by the upcoming CPU profile generation tool.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
In order for live migrations to be safe it is necessary to ensure that
the destination VM exposes MSR-based features compatible with those
of the source VM. These checks have been omitted from CHV thus far,
but we introduce them here for Intel CPUs.

Our checks provide logs at the error level and debug level. The
former aims to provide the minimal amount of information required to
investigate the problem further, while the debug logs provide (much)
more convenience when debugging.

We will also incorporate these checks in the context of CPU profiles in
a later commit.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
In order to apply CPU profiles we need to modify the MSR-based features
according to the profile. The first step is to obtain these MSR-based
features from the hypervisor as introduced in this commit.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
We introduce functionality related to adjusting MSR-based features
according to the CPU profile.

The functionality introduced here will be utilized in a follow up
commit.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
We record the necessary MSR-based feature modifications that need to be
set in the `CpuManager` and make sure to set these MSR values upon
vCPU configuration.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
We adapt the CPU profile generation tool to also take the MSR-based
features into account.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
We regenare the CPU profiles and include the MSR-related data.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant