Skip to content

Commit a581f50

Browse files
binbinwu1Eddie Dong
authored andcommitted
hv: vmsr: enable msr ia32_misc_enable emulation
Add MSR_IA32_MISC_ENABLE to emulated_guest_msrs to enable the emulation. Init MSR_IA32_MISC_ENABLE for guest. Tracked-On: #2834 Signed-off-by: Binbin Wu <binbin.wu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 8e310e6 commit a581f50

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

hypervisor/arch/x86/guest/vmcs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ static void init_guest_vmx(struct acrn_vcpu *vcpu, uint64_t cr0, uint64_t cr3,
9292
load_segment(ectx->tr, VMX_GUEST_TR);
9393
load_segment(ectx->ldtr, VMX_GUEST_LDTR);
9494

95+
/* init guest ia32_misc_enable value for guest read */
96+
vcpu_set_guest_msr(vcpu, MSR_IA32_MISC_ENABLE, msr_read(MSR_IA32_MISC_ENABLE));
97+
9598
/* fixed values */
9699
exec_vmwrite32(VMX_GUEST_IA32_SYSENTER_CS, 0U);
97100
exec_vmwrite(VMX_GUEST_IA32_SYSENTER_ESP, 0UL);

hypervisor/arch/x86/guest/vmsr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static const uint32_t emulated_guest_msrs[NUM_GUEST_MSRS] = {
4848

4949
MSR_IA32_MCG_CAP,
5050
MSR_IA32_MCG_STATUS,
51+
MSR_IA32_MISC_ENABLE,
5152
};
5253

5354
#define NUM_MTRR_MSRS 13U

hypervisor/include/arch/x86/guest/vcpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ struct ext_context {
214214
#define SECURE_WORLD 1
215215

216216
#define NUM_WORLD_MSRS 2U
217-
#define NUM_COMMON_MSRS 9U
217+
#define NUM_COMMON_MSRS 10U
218218
#define NUM_GUEST_MSRS (NUM_WORLD_MSRS + NUM_COMMON_MSRS)
219219

220220
#define EOI_EXIT_BITMAP_SIZE 256U

0 commit comments

Comments
 (0)