From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
David Binderman <linuxdev.baldrick@gmail.com>,
joro@8bytes.org, rkrcmar@redhat.com, kvm@vger.kernel.org,
dcb314@hotmail.com,
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Subject: Re: arch/x86/kvm/svm.c:3600: possible bad operator ?
Date: Mon, 23 May 2016 16:52:21 +0200 [thread overview]
Message-ID: <57431925.9030307@redhat.com> (raw)
In-Reply-To: <6cfe6b6e-c423-60c3-00d1-1ff781f3a9aa@redhat.com>
On 23.05.2016 13:42, Paolo Bonzini wrote:
>
> On 23/05/2016 13:22, David Binderman wrote:
>> Hello there,
>>
>> arch/x86/kvm/svm.c:3600:45: warning: logical ‘and’ applied to
>> non-boolean constant [-Wlogical-op]
>>
>> Source code is
>>
>> u32 index = svm->vmcb->control.exit_info_2 && 0xFF;
>>
>> Maybe better code
>>
>> u32 index = svm->vmcb->control.exit_info_2 & 0xFF;
>
> 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
next prev parent reply other threads:[~2016-05-23 14:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-23 11:22 arch/x86/kvm/svm.c:3600: possible bad operator ? David Binderman
2016-05-23 11:42 ` Paolo Bonzini
2016-05-23 14:52 ` Thomas Huth [this message]
2016-05-23 15:05 ` David Binderman
2016-05-23 15:11 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57431925.9030307@redhat.com \
--to=thuth@redhat.com \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=dcb314@hotmail.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linuxdev.baldrick@gmail.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.