[PATCH 03/29] x86/boot/e820: Simplify the PPro Erratum #50 workaround

Ingo Molnar posted 29 patches 7 months, 4 weeks ago
There is a newer version of this series
[PATCH 03/29] x86/boot/e820: Simplify the PPro Erratum #50 workaround
Posted by Ingo Molnar 7 months, 4 weeks ago
No need to print out the table - users won't really be able
to tell much from it anyway and the messages around this
erratum are unnecessarily obtuse.

Instead clearly inform the user that a 256 kB hole is being
punched in their memory map at the 1.75 GB physical address.

Not that there are many PPro users left. :-)

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Shevchenko <andy@kernel.org>
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/x86/kernel/setup.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 9d2a13b37833..83cc265140c0 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -988,11 +988,9 @@ void __init setup_arch(char **cmdline_p)
 	trim_bios_range();
 #ifdef CONFIG_X86_32
 	if (ppro_with_ram_bug()) {
-		e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM,
-				  E820_TYPE_RESERVED);
+		pr_info("Applying PPro RAM bug workaround: punching 256 kB hole at 1.75 GB physical.\n");
+		e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM, E820_TYPE_RESERVED);
 		e820__update_table(e820_table);
-		printk(KERN_INFO "fixed physical RAM map:\n");
-		e820__print_table("bad_ppro");
 	}
 #else
 	early_gart_iommu_check();
-- 
2.45.2
Re: [PATCH 03/29] x86/boot/e820: Simplify the PPro Erratum #50 workaround
Posted by Andy Shevchenko 7 months, 3 weeks ago
Mon, Apr 21, 2025 at 08:51:43PM +0200, Ingo Molnar kirjoitti:
> No need to print out the table - users won't really be able
> to tell much from it anyway and the messages around this
> erratum are unnecessarily obtuse.
> 
> Instead clearly inform the user that a 256 kB hole is being
> punched in their memory map at the 1.75 GB physical address.
> 
> Not that there are many PPro users left. :-)

...

> +		e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM, E820_TYPE_RESERVED);

Perhaps, 0x40000ULL --> SZ_256K ?

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH 03/29] x86/boot/e820: Simplify the PPro Erratum #50 workaround
Posted by Ingo Molnar 7 months ago
* Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> Mon, Apr 21, 2025 at 08:51:43PM +0200, Ingo Molnar kirjoitti:
> > No need to print out the table - users won't really be able
> > to tell much from it anyway and the messages around this
> > erratum are unnecessarily obtuse.
> > 
> > Instead clearly inform the user that a 256 kB hole is being
> > punched in their memory map at the 1.75 GB physical address.
> > 
> > Not that there are many PPro users left. :-)
> 
> ...
> 
> > +		e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM, E820_TYPE_RESERVED);
> 
> Perhaps, 0x40000ULL --> SZ_256K ?

Indeed! I folded in the change below.

Thanks,

	Ingo

==============================>
 arch/x86/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a1e2d64bb28d..f40dffc3e014 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -985,7 +985,7 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_X86_32
 	if (ppro_with_ram_bug()) {
 		pr_info("Applying PPro RAM bug workaround: punching 256 kB hole at 1.75 GB physical.\n");
-		e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM, E820_TYPE_RESERVED);
+		e820__range_update(0x70000000ULL, SZ_256K, E820_TYPE_RAM, E820_TYPE_RESERVED);
 		e820__update_table(e820_table);
 	}
 #else