acrn-hypervisor/hypervisor/common
Wu Zhou 6a430de814 hv: remove CPU frequency control from guests
The design of ACRN CPU performance management is to let hardware
do the autonomous frequency selection(or set to a fixed value),
and remove guest's ability to control CPU frequency.

This patch is to remove guest's ability to control CPU frequency by
removing the guests' HWP/EIST CPUIDs and blocking the related MSR
accesses. Including:
  - Remove CPUID.06H:EAX[7..11] (HWP)
  - Remove CPUID.01H:ECX[7] (EIST)
  - Inject #GP(0) upon accesses to MSR_IA32_PM_ENABLE,
    MSR_IA32_HWP_CAPABILITIES, MSR_IA32_HWP_REQUEST,
    MSR_IA32_HWP_STATUS, MSR_IA32_HWP_INTERRUPT,
    MSR_IA32_HWP_REQUEST_PKG
  - Emulate MSR_IA32_PERF_CTL. Value written to MSR_IA32_PERF_CTL
    is just stored for reading. This is like how the native
    environment would behavior when EIST is disabled from BIOS.
  - Emulate MSR_IA32_PERF_STATUS by filling it with base frequency
    state. This is consistent with Windows, which displays current
    frequency as base frequency when running in VM.
  - Hide the IA32_MISC_ENABLE bit 16 (EIST enable) from guests.
    This bit is dependent to CPUID.01H:ECX[7] according to SDM.
  - Remove CPID.06H:ECX[0] (hardware coordination feedback)
  - Inject #GP(0) upon accesses to IA32_MPERF, IA32_APERF

Also DM do not need to generate _PSS/_PPC for post-launched VMs
anymore. This is done by letting hypercall HC_PM_GET_CPU_STATE sub
command ACRN_PMCMD_GET_PX_CNT and ACRN_PMCMD_GET_PX_DATA return (-1).

Tracked-On: #8168
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-21 03:48:58 +08:00
..
delay.c hv/mod_timer: separate delay functions from the timer module 2021-05-18 16:43:28 +08:00
efi_mmap.c HV: fix build issue on RELEASE version 2021-11-16 19:01:44 +08:00
event.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
hv_main.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
hypercall.c hv: remove CPU frequency control from guests 2022-09-21 03:48:58 +08:00
irq.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
ptdev.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
sched_bvt.c hv: sched: fix bug when reboot vm 2022-08-05 02:39:54 +08:00
sched_iorr.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
sched_noop.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
sched_prio.c hv: add priority based scheduler 2021-09-24 09:32:18 +08:00
schedule.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
softirq.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
ticks.c hv/mod_timer: split tsc handling code from timer. 2021-05-18 16:43:28 +08:00
timer.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
trusty_hypercall.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vm_load.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00