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

Add CPUID manager for guest CPUID instructions #335

Merged
merged 5 commits into from
Nov 24, 2020
Merged

Add CPUID manager for guest CPUID instructions #335

merged 5 commits into from
Nov 24, 2020

Conversation

wcwang
Copy link
Contributor

@wcwang wcwang commented Nov 24, 2020

Optimizes the implementation of setting CPUID feature. It supports to manage guest supported CPUID leaves and configurable leaves, and adds support for setting two CPUID leaves.

  • Adds CPUID manager to manage the supported guest CPUID instructions
  • Adds CPUID controller to control the user's settings for CPUID leaves
  • Enables support for guest CPUID instructions CPUID.15H and CPUID.16H
  • Optimizes the calculation of host supported features' cache
  • Caches the supported guest CPUID values

Signed-off-by: Wenchao Wang wenchao.wang@intel.com

Add CPUID controller to control the user's settings for CPUID leaves,
including the management of the configurable leaves, the validity
checking and adjustment of input values.

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Optimize host supported features cache algorithm during HAXM
initialization.

* Simplify the storage type for both host and guest supported features
* Improve the calculation method of host supported features to be more
  efficient

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Add CPUID manager to manage the supported guest CPUID instructions. For
the leaves in the manager list, if the execution function is specified,
the return values of the host CPUID instruction will be overwritten; If
not specified, the host values will be returned directly. For the leaves
not in the manager list, it will return that those CPUID instructions
are not supported.

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Cache the supported guest CPUID instruction values in the initialization
phase to avoid repeated calculations each time a guest CPUID instruction
is executed. The supported guest CPUID leaves are managed by the CPUID
manager, and the cache memory size is dynamically calculated. When
setting the CPUID values, modify the cached values directly.

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Enable support for guest CPUID instructions CPUID.15H and CPUID.16H.

* Add CPUID.15H and CPUID.16H into CPUID manager as the supported guest
  CPUID instructions
* Add CPUID.15H and CPUID.16H into CPUID controller to allow user to
  set their values
* Adjust maximum return value of basic CPUID information to 0x16

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
@hyuan3 hyuan3 merged commit a19ddbd into master Nov 24, 2020
@wcwang wcwang deleted the cpuid-ext branch November 24, 2020 08:33
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