lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aT50oZIGp9CAMQad@gmail.com>
Date: Sun, 14 Dec 2025 09:26:09 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Nikolay Borisov <nik.borisov@...e.com>
Cc: linux-kernel@...r.kernel.org, Andy Shevchenko <andy@...nel.org>,
	Arnd Bergmann <arnd@...nel.org>, Borislav Petkov <bp@...en8.de>,
	Juergen Gross <jgross@...e.com>, "H . Peter Anvin" <hpa@...or.com>,
	Kees Cook <keescook@...omium.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Mike Rapoport <rppt@...nel.org>,
	Paul Menzel <pmenzel@...gen.mpg.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	David Woodhouse <dwmw@...zon.co.uk>
Subject: [PATCH 33/32] x86/boot/e820: Use <linux/sizes.h> symbols for literals

* Nikolay Borisov <nik.borisov@...e.com> wrote:

> > +static bool __init e820_device_region(enum e820_type type, struct resource *res)
> >   {
> > -	/* this is the legacy bios/dos rom-shadow + mmio region */
> > +	/* This is the legacy BIOS/DOS ROM-shadow + MMIO region: */
> >	if (res->start < (1ULL<<20))
>
> nit: While at it, change this to also use SZ_1M define rather than this
> shift.

Yeah - I've put these cleanups into a separate patch, see attached.

Thanks,

	Ingo


==================>
Subject: [PATCH] x86/boot/e820: Use <linux/sizes.h> symbols for literals

Use the human-readable SZ_* constants.

Suggested-by: Nikolay Borisov <nik.borisov@...e.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Link: https://patch.msgid.link/92a15c2d-055c-4f4e-b232-32030a8e5e54@suse.com
---
 arch/x86/kernel/e820.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index d1b1786d006b..97b54bd0f482 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -617,7 +617,7 @@ __init static void e820__update_table_kexec(void)
 	e820__update_table(e820_table_kexec);
 }
 
-#define MAX_GAP_END 0x100000000ull
+#define MAX_GAP_END SZ_4G
 
 /*
  * Search for a gap in the E820 memory space from 0 to MAX_GAP_END (4GB).
@@ -696,7 +696,7 @@ __init void e820__setup_pci_gap(void)
 		pr_err("Cannot find an available gap in the 32-bit address range\n");
 		pr_err("PCI devices with unassigned 32-bit BARs may not work!\n");
 #else
-		max_gap_start = 0x10000000;
+		max_gap_start = SZ_256M;
 #endif
 	}
 
@@ -1080,7 +1080,7 @@ __initdata static struct resource *e820_res;
 __init static bool e820_device_region(enum e820_type type, struct resource *res)
 {
 	/* This is the legacy BIOS/DOS ROM-shadow + MMIO region: */
-	if (res->start < (1ULL<<20))
+	if (res->start < SZ_1M)
 		return false;
 
 	/*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ