All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	peng.hao2@zte.com.cn, richard.weiyang@gmail.com
Cc: penghao122@sina.com.cn, rkrcmar@redhat.com, tglx@linutronix.de,
	mingo@redhat.com, joro@8bytes.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH] kvm/x86 : avoid shifting signed 32-bit value by 31 bits
Date: Mon, 15 Oct 2018 10:30:43 -0700	[thread overview]
Message-ID: <32ae2c96-51da-304f-9fc0-d531979eff97@zytor.com> (raw)
In-Reply-To: <08fd066f-e6c5-f82c-544f-536e9f29e6f3@redhat.com>

On 10/15/18 10:23 AM, Paolo Bonzini wrote:
> 
> Even for a value from a 32-bit register?  That would be _BIT, which
> doesn't exist.
> 

Just use _BITUL(). gcc is smart enough to know that that the resulting value
is representable in 32 bits.

Or if you really care, submit a patch to create _BITU(), but I don't
personally see much of a point.

	-hpa



      reply	other threads:[~2018-10-15 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 17:47 [PATCH] kvm/x86 : avoid shifting signed 32-bit value by 31 bits Peng Hao
2018-10-06  2:11 ` Wei Yang
     [not found]   ` <201810061131044868733@zte.com.cn>
2018-10-06  7:08     ` Wei Yang
     [not found]       ` <201810080904344038939@zte.com.cn>
2018-10-08  2:25         ` Wei Yang
2018-10-15 17:12           ` Paolo Bonzini
2018-10-15 17:16         ` H. Peter Anvin
2018-10-15 17:23           ` Paolo Bonzini
2018-10-15 17:30             ` H. Peter Anvin [this message]

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=32ae2c96-51da-304f-9fc0-d531979eff97@zytor.com \
    --to=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peng.hao2@zte.com.cn \
    --cc=penghao122@sina.com.cn \
    --cc=richard.weiyang@gmail.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.