From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH] kvm/x86 : avoid shifting signed 32-bit value by 31 bits Date: Mon, 15 Oct 2018 10:30:43 -0700 Message-ID: <32ae2c96-51da-304f-9fc0-d531979eff97@zytor.com> References: <201810080904344038939@zte.com.cn> <717c02f3-bb36-33c4-a463-f5759fde30fd@zytor.com> <08fd066f-e6c5-f82c-544f-536e9f29e6f3@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 To: Paolo Bonzini , peng.hao2@zte.com.cn, richard.weiyang@gmail.com Return-path: In-Reply-To: <08fd066f-e6c5-f82c-544f-536e9f29e6f3@redhat.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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