From: "Jan Beulich" Subject: [PATCH 1/4] VMX: fix DebugCtl MSR clearing Date: Tue, 12 Aug 2014 10:14:02 +0100 Message-ID: <53E9F6FA020000780002B722@mail.emea.novell.com> References: <53E9F5A0020000780002B70C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartC2F075CA.1__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XH89g-00084H-TU for xen-devel@lists.xenproject.org; Tue, 12 Aug 2014 09:14:09 +0000 In-Reply-To: <53E9F5A0020000780002B70C@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Kevin Tian , Eddie Dong , Jun Nakajima List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartC2F075CA.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The previous shortcut was wrong, as it bypassed the necessary vmwrite: All we really want to avoid if the guest writes zero is to add the MSR to the host-load list. Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2246,8 +2246,6 @@ static int vmx_msr_write_intercept(unsig int i, rc =3D 0; uint64_t supported =3D IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF= ; =20 - if ( !msr_content ) - break; if ( msr_content & ~supported ) { /* Perhaps some other bits are supported in vpmu. */ @@ -2267,12 +2265,10 @@ static int vmx_msr_write_intercept(unsig } =20 if ( (rc < 0) || - (vmx_add_host_load_msr(msr) < 0) ) + (msr_content && (vmx_add_host_load_msr(msr) < 0)) ) hvm_inject_hw_exception(TRAP_machine_check, 0); else - { __vmwrite(GUEST_IA32_DEBUGCTL, msr_content); - } =20 break; } --=__PartC2F075CA.1__= Content-Type: text/plain; name="VMX-debuctl-clearing.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="VMX-debuctl-clearing.patch" VMX: fix DebugCtl MSR clearing=0A=0AThe previous shortcut was wrong, as it = bypassed the necessary vmwrite:=0AAll we really want to avoid if the guest = writes zero is to add the MSR=0Ato the host-load list.=0A=0ASigned-off-by: = Jan Beulich =0A=0A--- a/xen/arch/x86/hvm/vmx/vmx.c=0A+++= b/xen/arch/x86/hvm/vmx/vmx.c=0A@@ -2246,8 +2246,6 @@ static int vmx_msr_wr= ite_intercept(unsig=0A int i, rc =3D 0;=0A uint64_t = supported =3D IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;=0A =0A- = if ( !msr_content )=0A- break;=0A if ( msr_content & = ~supported )=0A {=0A /* Perhaps some other bits are = supported in vpmu. */=0A@@ -2267,12 +2265,10 @@ static int vmx_msr_write_in= tercept(unsig=0A }=0A =0A if ( (rc < 0) ||=0A- = (vmx_add_host_load_msr(msr) < 0) )=0A+ (msr_content && = (vmx_add_host_load_msr(msr) < 0)) )=0A hvm_inject_hw_exception(= TRAP_machine_check, 0);=0A else=0A- {=0A = __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);=0A- }=0A =0A = break;=0A }=0A --=__PartC2F075CA.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartC2F075CA.1__=--