From: "Jan Beulich" Subject: Re: [PATCH 3/4] VMX: allow RTM advanced debugging to be used by guests Date: Tue, 12 Aug 2014 11:40:14 +0100 Message-ID: <53EA0B2E020000780002B833@mail.emea.novell.com> References: <53E9F5A0020000780002B70C@mail.emea.novell.com> <53E9F7C6020000780002B740@mail.emea.novell.com> <53E9E7A5.6080704@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XH9V3-0003Ez-Cu for xen-devel@lists.xenproject.org; Tue, 12 Aug 2014 10:40:17 +0000 In-Reply-To: <53E9E7A5.6080704@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Kevin Tian , Keir Fraser , Eddie Dong , Jun Nakajima List-Id: xen-devel@lists.xenproject.org >>> On 12.08.14 at 12:08, wrote: > On 12/08/14 10:17, Jan Beulich wrote: >> All that is needed here is allowing the respective DebugCtl MSR bit to >> be set by the guest. >> >> At once - even if PV guests can't currently use it due to missing >> DebugCtl MSR virtualization - make the respective adjustments to >> debugreg.h. >> >> Signed-off-by: Jan Beulich >> >> --- a/xen/arch/x86/hvm/vmx/vmx.c >> +++ b/xen/arch/x86/hvm/vmx/vmx.c >> @@ -2246,6 +2246,8 @@ static int vmx_msr_write_intercept(unsig >> int i, rc = 0; >> uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF; >> >> + if ( boot_cpu_has(X86_FEATURE_RTM) ) >> + supported |= IA32_DEBUGCTLMSR_RTM; > > This supported bitmask is runtime constant. Is it worth precalculating > it, rather than reevaluating each time DEBUGCTL is written to? If the calculation was expensive ... Jan