Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Improve CPUID module #470

Merged
merged 3 commits into from
Oct 17, 2022
Merged

Improve CPUID module #470

merged 3 commits into from
Oct 17, 2022

Conversation

wcwang
Copy link
Contributor

@wcwang wcwang commented Oct 10, 2022

Improve the implementation of CPUID module

  • Add sub-leaf to extend support for more features
  • Add elementary operations for specified x86 feature bit in guest CPUID, including checking, setting and clearing, as well as implement some reverse parse functions for the feature key
  • Adjust the implementation for CPUID.07H

Some CPUID instructions require the subleaf support. Enable the subleaf
of CPUID instruction to expand the support of more features.

* Add the subleaf into CPUID manager and cache the supported CPUID
  instructions with the subleaf enabling during the guest
  initialization
* Add the subleaf into CPUID controller and support to set features by
  searching both leaf and subleaf
* Adjust the algorithm of executing CPUID instruction and add the
  support of uncached CPUID values

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Implement functions to check, set and clear the status of the x86
feature bit for the guest CPUID instruction.

* Reversely parse the leaf, subleaf, register and bit values from the
  feature key
* Implement the functions to check and update the feature status
* Provide an internal interface to check whether the guest has a
  specific feature

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Adjust the implementation for CPUID.07H, including caching host and
guest values.

* Add X86_FEATURE_ERMS definition for
  CPUID.(EAX=07H,ECX=0):EBX.ERMS[bit 9], which is the currently
  supported feature in CPUID.(EAX=07H, ECX=0)
* CPUID.(EAX=07H, ECX=1) is not supported so far

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
@wcwang wcwang merged commit 859197f into master Oct 17, 2022
@wcwang wcwang deleted the cpuid-ext branch October 17, 2022 09:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants