public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Borislav Petkov <bp@alien8.de>, KVM <kvm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kvm: Fix CR3_PCID_INVD type on 32-bit
Date: Wed, 21 Jan 2015 15:59:23 +0100	[thread overview]
Message-ID: <54BFBECB.1030306@redhat.com> (raw)
In-Reply-To: <1421311496-18028-1-git-send-email-bp@alien8.de>



On 15/01/2015 09:44, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> arch/x86/kvm/emulate.c: In function ‘check_cr_write’:
> arch/x86/kvm/emulate.c:3552:4: warning: left shift count >= width of type
>     rsvd = CR3_L_MODE_RESERVED_BITS & ~CR3_PCID_INVD;
> 
> happens because sizeof(UL) on 32-bit is 4 bytes but we shift it 63 bits
> to the left.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  arch/x86/include/asm/kvm_host.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index d89c6b828c96..a8d07a060136 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -51,7 +51,7 @@
>  			  | X86_CR0_NW | X86_CR0_CD | X86_CR0_PG))
>  
>  #define CR3_L_MODE_RESERVED_BITS 0xFFFFFF0000000000ULL
> -#define CR3_PCID_INVD		 (1UL << 63)
> +#define CR3_PCID_INVD		 BIT_64(63)
>  #define CR4_RESERVED_BITS                                               \
>  	(~(unsigned long)(X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | X86_CR4_DE\
>  			  | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE     \
> 

Applied, thanks.

Paolo

      reply	other threads:[~2015-01-21 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15  8:44 [PATCH] kvm: Fix CR3_PCID_INVD type on 32-bit Borislav Petkov
2015-01-21 14:59 ` Paolo Bonzini [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=54BFBECB.1030306@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@alien8.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox