acrn-hypervisor/hypervisor/arch/x86
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
..
boot Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
configs Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
guest hv: remove CPU frequency control from guests 2022-09-21 03:48:58 +08:00
lib hv: shell: improve console to modify input easier 2022-07-28 23:31:43 +08:00
seed Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
cpu.c hv: change 'DISABLED' settings to 'ENABLED' 2022-08-17 09:23:33 +08:00
cpu_caps.c hv: cve hotfix: Disable RRSBA on platform using retpoline 2022-07-22 09:38:41 +08:00
cpu_state_tbl.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
e820.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
exception.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
gdt.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
idt.S Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
init.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
ioapic.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
irq.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
lapic.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
mmu.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
nmi.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
notify.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
page.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
pagetable.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
platform_caps.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
pm.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
rdt.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
rtcm.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
sched.S Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
security.c hv: change 'DISABLED' settings to 'ENABLED' 2022-08-17 09:23:33 +08:00
sgx.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
trampoline.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
tsc.c hv: tsc: start HPET counter before calibration 2022-09-15 03:14:01 +08:00
tsc_deadline_timer.c HV: arch: fix a violation of coding guideline C-TY-24 2021-11-04 18:15:47 +08:00
vmx.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vtd.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
wakeup.S Update copyright year range in code headers 2022-07-15 11:48:35 +08:00