mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Dionna Glaze <dionnaglaze@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH] kvm: x86: use a uapi-friendly macro for BIT
Date: Tue, 12 Dec 2023 07:27:45 -0800	[thread overview]
Message-ID: <ZXh78TApz80DAWUb@google.com> (raw)
In-Reply-To: <20231207001142.3617856-1-dionnaglaze@google.com>

On Thu, Dec 07, 2023, Dionna Glaze wrote:
> Change uapi header uses of BIT to instead use the uapi/linux/const.h bit
> macros, since BIT is not defined in uapi headers.
> 
> The PMU mask uses _BITUL since it targets a 32 bit flag field, whereas
> the longmode definition is meant for a 64 bit flag field.
> 
> Cc: Sean Christophersen <seanjc@google.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> 
> Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
> ---
>  arch/x86/include/uapi/asm/kvm.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
> index 1a6a1f987949..a8955efeef09 100644
> --- a/arch/x86/include/uapi/asm/kvm.h
> +++ b/arch/x86/include/uapi/asm/kvm.h
> @@ -7,6 +7,7 @@
>   *
>   */
>  
> +#include <linux/const.h>
>  #include <linux/types.h>
>  #include <linux/ioctl.h>
>  #include <linux/stddef.h>
> @@ -526,7 +527,7 @@ struct kvm_pmu_event_filter {
>  #define KVM_PMU_EVENT_ALLOW 0
>  #define KVM_PMU_EVENT_DENY 1
>  
> -#define KVM_PMU_EVENT_FLAG_MASKED_EVENTS BIT(0)
> +#define KVM_PMU_EVENT_FLAG_MASKED_EVENTS _BITUL(0)

It's not just BIT(), won't BIT_ULL() and GENMASK_ULL() also be problematic?  And
sadly, I don't see an existing equivalent for GENMASK_ULL().

  reply	other threads:[~2023-12-12 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  0:11 Dionna Glaze
2023-12-12 15:27 ` Sean Christopherson [this message]
2023-12-12 16:07   ` 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=ZXh78TApz80DAWUb@google.com \
    --to=seanjc@google.com \
    --cc=dionnaglaze@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®