]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
x86: vmx: Clear IA32_DEBUGCTL only on hard reset
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 18 May 2015 10:53:59 +0000 (12:53 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 22 May 2015 04:52:42 +0000 (06:52 +0200)
According to the spec, this MSR (like most) remain unchanged on INIT. As
it's cheap to conform to this, follow that rule.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/x86/vmx.c

index 93a47647fbd3dac05674764f4a40ee36df4e18ba..622668ea9d38649a712d973be3fbbb39f41e97f3 100644 (file)
@@ -775,6 +775,9 @@ static void vmx_vcpu_reset(unsigned int sipi_vector)
        if (sipi_vector == APIC_BSP_PSEUDO_SIPI) {
                val = 0xfff0;
                sipi_vector = 0xf0;
+
+               /* only cleared on hard reset */
+               ok &= vmcs_write64(GUEST_IA32_DEBUGCTL, 0);
        }
        ok &= vmcs_write64(GUEST_RIP, val);
 
@@ -830,7 +833,6 @@ static void vmx_vcpu_reset(unsigned int sipi_vector)
        ok &= vmcs_write64(GUEST_SYSENTER_ESP, 0);
 
        ok &= vmcs_write64(GUEST_DR7, 0x00000400);
-       ok &= vmcs_write64(GUEST_IA32_DEBUGCTL, 0);
 
        ok &= vmcs_write32(GUEST_ACTIVITY_STATE, GUEST_ACTIVITY_ACTIVE);
        ok &= vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, 0);