mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Ihor Solodrai <ihor.solodrai@linux.dev>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>, Thomas Gleixner <tglx@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	bpf@vger.kernel.org, kasan-dev@googlegroups.com,
	linux-mm@kvack.org, kernel-team@meta.com
Subject: Re: [PATCH v2 2/5] x86/cpu: Initialize boot CPU cpuinfo defaults early
Date: Mon, 14 Sep 2026 19:31:15 -0700	[thread overview]
Message-ID: <20260915023115.GFaqit8zcWHGkAdHD5@fat_crate.local> (raw)
In-Reply-To: <20260814235134.3461435-3-ihor.solodrai@linux.dev>

On Fri, Aug 14, 2026 at 04:51:31PM -0700, Ihor Solodrai wrote:
> early_identify_cpu() clears the capability array, the CPUID table and
> extended_cpuid_level, but the architectural defaults for the rest of
> struct cpuinfo_x86 are set only later, in identify_cpu().

And I would've stopped here. I don't think we care too much about a CPU which
doesn't enumerate CLFLUSH. Or is there an aspect I am missing.

I mean, you can say something along the lines that now things like
->x86_cache_alignment are more correct but I don't think you need to go that
much into detail.

> On x86_64 x86_clflush_size defaults to 64. Until that default is
> applied it reads as zero, which get_cpu_address_sizes() interprets as
> "not enumerated" and replaces with 32. So on a CPU which does not
> enumerate CLFLUSH the boot CPU runs with an x86_clflush_size and an
> x86_cache_alignment of 32 until identify_cpu() resets them to 64.
> 
> Use the same defaults from the start, so that the boot CPU does not
> depend on a later reset to end up with the right ones.
> 
> The values the boot CPU ends up with do not change. Early users of
> cache_line_size() on a CPU which does not enumerate CLFLUSH now see the
> architectural 64 instead of the 32 fallback, which is what they should
> have been seeing all along.
> 
> This change comes before the last patch because that one removes the
> reset: without the defaults established here the boot CPU would be
> left at 32 instead of 64 on an x86_64 CPU which does not enumerate
> CLFLUSH.

This paragraph goes...

> 
> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
> ---

... here, after the "---" delimiter as it doesn't really belong in the commit
message.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2026-09-15  2:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 23:51 [PATCH v2 0/5] x86/cpu: Refactor identify_cpu() Ihor Solodrai
2026-08-14 23:51 ` [PATCH v2 1/5] x86/cpu: Factor init_cpu_info() out of identify_cpu() Ihor Solodrai
2026-09-10  2:32   ` Borislav Petkov
2026-08-14 23:51 ` [PATCH v2 2/5] x86/cpu: Initialize boot CPU cpuinfo defaults early Ihor Solodrai
2026-09-15  2:31   ` Borislav Petkov [this message]
2026-09-15 16:34     ` Ihor Solodrai
2026-09-15 23:44       ` Borislav Petkov
2026-08-14 23:51 ` [PATCH v2 3/5] x86/cpu: Inline generic_identify() into identify_cpu() Ihor Solodrai
2026-08-14 23:51 ` [PATCH v2 4/5] x86/cpu: Move 32-bit SEP setup " Ihor Solodrai
2026-08-17 12:14   ` Nikolay Borisov
2026-08-14 23:51 ` [PATCH v2 5/5] x86/cpu: Don't transiently clear the boot CPU's capabilities Ihor Solodrai

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=20260915023115.GFaqit8zcWHGkAdHD5@fat_crate.local \
    --to=bp@alien8.de \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=kasan-dev@googlegroups.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=ryabinin.a.a@gmail.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®