mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: 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>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Sean Christopherson <seanjc@google.com>,
	Wangyang Guo <wangyang.guo@intel.com>,
	Krzysztof Piecuch <piecuch@protonmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/tsc: Fix early boot crash with bare tsc_early_khz parameter
Date: Wed, 11 Nov 2026 15:41:11 +0100	[thread overview]
Message-ID: <avR-h8GxJPauXE_C@kernel.org> (raw)
In-Reply-To: <720cfc7d-69a7-4fc6-aaba-e9d89f3a1055@intel.com>

On Tue, Nov 10, 2026 at 11:44:55AM -0800, Dave Hansen wrote:
> On 11/10/26 07:05, Thorsten Blum wrote:
> >  static int __init tsc_early_khz_setup(char *buf)
> >  {
> > +	if (!buf)
> > +		return -EINVAL;
> > +
> >  	return kstrtouint(buf, 0, &tsc_early_khz);
> >  }
> 
> This _seems_ like the kind of thing that should ideally just be done in
> kstrtouint().
> 
> Is there a reason we can't just do what kstrtobool() does when handed
> buf=NULL?

I don't see a technical reason why we couldn't, but that would
potentially change the behavior of every kstrto*() caller and be a
broader change than this fix.

Here NULL is expected (for params without the '=' separator), so I kept
the check local to match other early_param handlers that use kstrto*(),
e.g., set_corruption_check(), set_corruption_check_period(), and
parse_mtrr_spare_reg().

      reply	other threads:[~2026-11-11 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 15:05 Thorsten Blum
2026-11-10 19:44 ` Dave Hansen
2026-11-11 14:41   ` Thorsten Blum [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=avR-h8GxJPauXE_C@kernel.org \
    --to=blum@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=piecuch@protonmail.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --cc=wangyang.guo@intel.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®