hv: vMSR: minor fix about rdmsr_vmexit_handler
Specifying a reserved or unimplemented MSR address in ECX for rdmsr will cause a
general protection exception. In this case, we should not change the contents of
registers EDX:EAX.
@@ -713,9 +713,11 @@ int32_t rdmsr_vmexit_handler(struct acrn_vcpu *vcpu)
}
}
+ if (err == 0) {
/* Store the MSR contents in RAX and RDX */
vcpu_set_gpreg(vcpu, CPU_REG_RAX, v & 0xffffffffU);
vcpu_set_gpreg(vcpu, CPU_REG_RDX, v >> 32U);
+ }
TRACE_2L(TRACE_VMEXIT_RDMSR, msr, v);
