public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Shreenidhi Shedi <yesshedi@gmail.com>
Cc: x86@kernel.org, amakhalov@vmware.com,
	Shreenidhi Shedi <sshedi@vmware.com>,
	pv-drivers@vmware.com, dave.hansen@linux.intel.com,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, mingo@redhat.com,
	hpa@zytor.com, tglx@linutronix.de
Subject: Re: [PATCH v1] x86/vmware: use unsigned integer for shifting
Date: Fri, 20 May 2022 13:52:02 +0200	[thread overview]
Message-ID: <YoeA4pf5OWxfjE0J@zn.tnic> (raw)
In-Reply-To: <20220520114712.595583-1-sshedi@vmware.com>

On Fri, May 20, 2022 at 05:17:12PM +0530, Shreenidhi Shedi wrote:
> Shifting signed 32-bit value by 31 bits is implementation-defined
> behaviour. Using unsigned is better option for this.
> 
> Fixes: 4cca6ea04d31 ("x86/apic: Allow x2apic without IR on VMware platform")
> 
> Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
> Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>

This is not how this is done - you need to set your author email
properly in git so that it adds your From: ... @vmware.com> instead of
having two SOBs.

> ---
>  arch/x86/kernel/cpu/vmware.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
> index c04b933f48d3..7f44ea073436 100644
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -28,6 +28,7 @@
>  #include <linux/cpu.h>
>  #include <linux/reboot.h>
>  #include <linux/static_call.h>
> +#include <linux/bits.h>
>  #include <asm/div64.h>
>  #include <asm/x86_init.h>
>  #include <asm/hypervisor.h>
> @@ -476,8 +477,8 @@ static bool __init vmware_legacy_x2apic_available(void)
>  {
>  	uint32_t eax, ebx, ecx, edx;
>  	VMWARE_CMD(GETVCPU_INFO, eax, ebx, ecx, edx);
> -	return (eax & (1 << VMWARE_CMD_VCPU_RESERVED)) == 0 &&
> -	       (eax & (1 << VMWARE_CMD_LEGACY_X2APIC)) != 0;
> +	return (eax & BIT(VMWARE_CMD_VCPU_RESERVED)) == 0 &&
> +	       (eax & BIT(VMWARE_CMD_LEGACY_X2APIC)) != 0;
						    ^^^^^^^^

You did hurry too much with sending a new version.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

       reply	other threads:[~2022-05-20 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220520114712.595583-1-sshedi@vmware.com>
2022-05-20 11:52 ` Borislav Petkov [this message]
     [not found]   ` <f05264ce-e90f-0b1a-4796-ec1f3b75c09c@gmail.com>
2022-05-20 14:10     ` [PATCH v1] x86/vmware: use unsigned integer for shifting Borislav Petkov

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=YoeA4pf5OWxfjE0J@zn.tnic \
    --to=bp@alien8.de \
    --cc=amakhalov@vmware.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pv-drivers@vmware.com \
    --cc=sshedi@vmware.com \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=yesshedi@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox