hv: vmsr: handle guest msr ia32_misc_enable read/write

Guest MSR_IA32_MISC_ENABLE read simply returns the value set by guest.
Guest MSR_IA32_MISC_ENABLE write:
- Clear EFER.NXE if MSR_IA32_MISC_ENABLE_XD_DISABLE set.
- MSR_IA32_MISC_ENABLE_MONITOR_ENA:
  Allow guest to control this feature when HV doesn't use this feature and hw has no bug.

vcpuid update according to the change of the msr will be covered in following patch.

Tracked-On: #2834
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Binbin Wu
2019-04-30 10:44:54 +08:00
committed by Eddie Dong
parent a0a6eb43c4
commit f0d06165d3
3 changed files with 71 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ struct cpuinfo_x86 {
};
bool has_monitor_cap(void);
bool monitor_cap_buggy(void);
bool is_apicv_advanced_feature_supported(void);
bool pcpu_has_cap(uint32_t bit);
bool pcpu_has_vmx_ept_cap(uint32_t bit_mask);