mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Naveen N Rao <naveen@kernel.org>
To: Gal Pressman <gal@nvidia.com>
Cc: Sean Christopherson <seanjc@google.com>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@kernel.org>,
	 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	 kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Dragos Tatulea <dtatulea@nvidia.com>
Subject: Re: [PATCH 1/2] KVM: SVM: Fix UBSAN warning when reading avic parameter
Date: Wed, 25 Feb 2026 11:57:03 +0530	[thread overview]
Message-ID: <aZ6UJyaBr6XExhsv@blrnaveerao1> (raw)
In-Reply-To: <3c2969a9-c58a-4935-9d53-f3d6f3343b21@nvidia.com>

On Tue, Feb 24, 2026 at 11:18:01AM +0200, Gal Pressman wrote:
> On 23/02/2026 18:38, Naveen N Rao wrote:
> > On Tue, Feb 10, 2026 at 08:46:20AM +0200, Gal Pressman wrote:
> >>  
> >> +static int avic_param_get(char *buffer, const struct kernel_param *kp)
> >> +{
> >> +	int val = *(int *)kp->arg;
> >> +
> >> +	if (val == AVIC_AUTO_MODE)
> >> +		return sysfs_emit(buffer, "auto\n");
> > 
> > My preference would be to return 'N' here, so that this continues to 
> > return a boolean value when read.
> 
> I guess the boolean conversion used to return 'Y' before this patch, why
> is 'N' better?

Because that would reflect the state of AVIC more accurately:
- in the case of kvm-amd module still being loaded, AVIC has not yet 
  been enabled, and
- in the case of a non-AMD system, AVIC is not enabled and is not 
  active.

Also, note that AVIC used to default to 'N' until recently.


- Naveen


  reply	other threads:[~2026-02-25  6:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  6:46 [PATCH 0/2] KVM: x86: Fix UBSAN bool warnings in module parameters Gal Pressman
2026-02-10  6:46 ` [PATCH 1/2] KVM: SVM: Fix UBSAN warning when reading avic parameter Gal Pressman
2026-02-23 16:38   ` Naveen N Rao
2026-02-24  9:18     ` Gal Pressman
2026-02-25  6:27       ` Naveen N Rao [this message]
2026-02-25  6:48         ` Gal Pressman
2026-02-10  6:46 ` [PATCH 2/2] KVM: x86/mmu: Fix UBSAN warning when reading nx_huge_pages parameter Gal Pressman

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=aZ6UJyaBr6XExhsv@blrnaveerao1 \
    --to=naveen@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dtatulea@nvidia.com \
    --cc=gal@nvidia.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --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®