From: Kevin Koster <lkml@ombertech.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Oerg866 <oerg866@googlemail.com>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86/microcode: Fix crashes on early 486 CPUs due to usage of 'cpuid'.
Date: Mon, 7 Apr 2025 09:58:48 +1000 [thread overview]
Message-ID: <20250407095848.7933a358c9f450fe03fb8234@ombertech.com> (raw)
In-Reply-To: <20250406190253.GAZ_LP3RPZInWKcHN7@fat_crate.local>
On Sun, 6 Apr 2025 21:02:53 +0200
Borislav Petkov <bp@alien8.de> wrote:
> On Sun, Apr 06, 2025 at 05:46:33PM +1000, Kevin Koster wrote:
> > But if I move "cpuid_1_eax = native_cpuid_eax(1);" to after the
> > microcode_loader_disabled() check in amd.c, like in the first
> > patch, it boots fine!
>
> Yeah, I noticed that too last night. Here's a hopefully better
> version after I ran it on my 32-bit Atom - I don't have your old rust
There is the 86box emulator which Eric Voirin suggested before for
reproducing this issue, although that adds the uncertainty of whether
the emulator matches real hardware behaviour.
> and maybe you should simply throw it in the garbage - that thing is
> probably not worth the electricity it uses to power up... :-)
Well my testing modern Linux on 486s was originally prompted by people
on the Tiny Core Linux forums finding compatibility issues with old
PCs. But I like to know Linux really works on the hardware it's built
for, and I'm not much better, writing this now on a Pentium 1.
[snip]
> diff --git a/arch/x86/kernel/cpu/microcode/amd.c
> b/arch/x86/kernel/cpu/microcode/amd.c index
> b61028cf5c8a..dda7f0d409e9 100644
> --- a/arch/x86/kernel/cpu/microcode/amd.c
> +++ b/arch/x86/kernel/cpu/microcode/amd.c
> @@ -1099,7 +1099,7 @@ static int __init save_microcode_in_initrd(void)
> enum ucode_state ret;
> struct cpio_data cp;
>
> - if (dis_ucode_ldr || c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10)
> + if (microcode_loader_disabled() || c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10)
return 0;
Still fails unless the native_cpuid_eax(1) call is moved under here. After that
change, it boots fine.
next prev parent reply other threads:[~2025-04-06 22:58 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 6:29 Oerg866
2024-10-19 9:49 ` Borislav Petkov
2024-10-19 14:06 ` Oerg866
2025-04-05 2:03 ` Kevin Koster
2025-04-05 9:32 ` Borislav Petkov
2025-04-05 20:33 ` H. Peter Anvin
2025-04-05 20:50 ` Borislav Petkov
2025-04-05 21:03 ` Borislav Petkov
2025-04-06 6:40 ` Kevin Koster
2025-04-06 7:46 ` Kevin Koster
2025-04-06 19:02 ` Borislav Petkov
2025-04-06 23:58 ` Kevin Koster [this message]
2025-04-07 10:29 ` Borislav Petkov
2025-04-07 14:21 ` Kevin Koster
2025-04-07 13:55 ` Borislav Petkov
2025-04-07 14:28 ` Oerg866
2025-04-08 10:37 ` Maciej W. Rozycki
2025-04-08 17:22 ` [PATCH] x86/microcode: Consolidate the loader enablement Borislav Petkov
2025-04-09 7:51 ` Kevin Koster
2025-04-10 11:53 ` Thomas Gleixner
2025-04-11 11:07 ` Borislav Petkov
2025-04-14 9:59 ` [PATCH -v2] x86/microcode: Consolidate the loader enablement checking Borislav Petkov
2025-04-14 10:48 ` Ingo Molnar
2025-04-14 11:26 ` Borislav Petkov
2025-05-03 10:51 ` David Laight
2025-04-30 19:16 ` Thomas Gleixner
2025-05-02 16:22 ` Borislav Petkov
2025-05-02 19:15 ` Thomas Gleixner
2025-04-07 14:38 ` [PATCH] x86/microcode: Fix crashes on early 486 CPUs due to usage of 'cpuid' H. Peter Anvin
2025-04-07 23:20 ` Kevin Koster
2025-04-07 18:10 ` David Laight
2025-04-07 14:36 ` H. Peter Anvin
2025-04-08 10:16 ` Maciej W. Rozycki
2025-04-08 10:31 ` Borislav Petkov
2025-04-08 12:29 ` Maciej W. Rozycki
2025-04-08 17:28 ` Borislav Petkov
2025-04-06 16:49 ` H. Peter Anvin
2025-05-03 15:14 ` [tip: x86/urgent] x86/microcode: Consolidate the loader enablement checking tip-bot2 for Borislav Petkov (AMD)
2025-05-04 6:14 ` Ingo Molnar
2025-05-05 5:15 ` [PATCH] x86/microcode: Add microcode_loader_disabled() storage class for the !CONFIG_MICROCODE case Ingo Molnar
2025-05-05 5:32 ` [tip: x86/microcode] " tip-bot2 for Ingo Molnar
2025-05-05 7:27 ` tip-bot2 for Ingo Molnar
2025-05-05 7:47 ` [PATCH] " Borislav Petkov
2025-05-06 10:57 ` Ingo Molnar
2025-05-06 12:19 ` Borislav Petkov
2025-05-06 10:44 ` [tip: x86/urgent] x86/microcode: Consolidate the loader enablement checking tip-bot2 for Borislav Petkov (AMD)
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=20250407095848.7933a358c9f450fe03fb8234@ombertech.com \
--to=lkml@ombertech.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oerg866@googlemail.com \
--cc=tglx@linutronix.de \
--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®