From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/vmx: fix vmx_is_singlestep_supported return value Date: Mon, 24 Aug 2015 23:55:29 +0100 Message-ID: <55DBA0E1.5090903@citrix.com> References: <1440446133-1244-1-git-send-email-tamas@tklengyel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1440446133-1244-1-git-send-email-tamas@tklengyel.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: Tamas K Lengyel , xen-devel@lists.xen.org Cc: kevin.tian@intel.com, keir@xen.org, jun.nakajima@intel.com, eddie.dong@intel.com, jbeulich@suse.com, Tamas K Lengyel , wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On 24/08/2015 20:55, Tamas K Lengyel wrote: > The function supposed to return a boolean but instead it returned > the value 0x8000000 which is the Intel internal flag for MTF. This has > caused various checks using this function to falsely report no MTF > capability. Ouch. Given than bool_t is current signed char, that won't be of much use. > > Signed-off-by: Tamas K Lengyel > --- > xen/arch/x86/hvm/vmx/vmx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c > index 999defe..35bcd79 100644 > --- a/xen/arch/x86/hvm/vmx/vmx.c > +++ b/xen/arch/x86/hvm/vmx/vmx.c > @@ -1768,7 +1768,7 @@ static void vmx_enable_msr_exit_interception(struct domain *d) > > static bool_t vmx_is_singlestep_supported(void) > { > - return cpu_has_monitor_trap_flag; > + return cpu_has_monitor_trap_flag ? 1 : 0; Prevailing style would tend towards !!cpu_has_monitor_trap_flag Either way, Reviewed-by: Andrew Cooper > } > > static void vmx_vcpu_update_eptp(struct vcpu *v)