From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: arch/x86/kvm/svm.c:3600: possible bad operator ? Date: Mon, 23 May 2016 16:52:21 +0200 Message-ID: <57431925.9030307@redhat.com> References: <6cfe6b6e-c423-60c3-00d1-1ff781f3a9aa@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: Paolo Bonzini , David Binderman , joro@8bytes.org, rkrcmar@redhat.com, kvm@vger.kernel.org, dcb314@hotmail.com, Suravee Suthikulpanit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50211 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752867AbcEWOw0 (ORCPT ); Mon, 23 May 2016 10:52:26 -0400 In-Reply-To: <6cfe6b6e-c423-60c3-00d1-1ff781f3a9aa@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 23.05.2016 13:42, Paolo Bonzini wrote: >=20 > On 23/05/2016 13:22, David Binderman wrote: >> Hello there, >> >> arch/x86/kvm/svm.c:3600:45: warning: logical =E2=80=98and=E2=80=99 a= pplied to >> non-boolean constant [-Wlogical-op] >> >> Source code is >> >> u32 index =3D svm->vmcb->control.exit_info_2 && 0xFF; >> >> Maybe better code >> >> u32 index =3D svm->vmcb->control.exit_info_2 & 0xFF; >=20 > Yes, there's a bug there. However it's only affecting a tracepoint, > which is why it probably wasn't noticed. This define in the same file also looks quite suspicious: #define AVIC_HPA_MASK ~((0xFFFULL << 52) || 0xFFF) Strange that you did not get a warning on that one, too? Thomas