linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Mike Rapoport <rppt@kernel.org>,
	linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
	Arnd Bergmann <arnd@kernel.org>,
	Andy Shevchenko <andy@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Davide Ciminaghi <ciminaghi@gnudd.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	kvm@vger.kernel.org, x86@kernel.org
Subject: Re: [tip: x86/urgent] x86/e820: Discard high memory that can't be addressed by 32-bit systems
Date: Wed, 16 Apr 2025 09:51:53 +0200	[thread overview]
Message-ID: <Z_9hmdMTP3wpB3Cc@gmail.com> (raw)
In-Reply-To: <Z_9ZblhCgEeTgGQ8@gmail.com>


* Ingo Molnar <mingo@kernel.org> wrote:

> 
> * Dave Hansen <dave.hansen@intel.com> wrote:
> 
> > On 4/15/25 00:18, Mike Rapoport wrote:
> > >> How about we reuse 'MAX_NONPAE_PFN' like this:
> > >>
> > >> 	if (IS_ENABLED(CONFIG_X86_32))
> > >> 		memblock_remove(PFN_PHYS(MAX_NONPAE_PFN), -1);
> > >>
> > >> Would that make the connection more obvious?
> > > Yes, that's better. Here's the updated patch:
> > 
> > Looks, great. Thanks for the update and the quick turnaround on the
> > first one after the bug report!
> > 
> > Tested-by: Dave Hansen <dave.hansen@intel.com>
> > Acked-by: Dave Hansen <dave.hansen@intel.com>
> 
> I've amended the fix in tip:x86/urgent accordingly and added your tags, 
> thanks!

So I had to apply the fix below as well, due to this build failure on 
x86-defconfig:

  arch/x86/kernel/e820.c:1307:42: error: ‘MAX_NONPAE_PFN’ undeclared (first use in this function); did you mean ‘MAX_DMA_PFN’?

IS_ENABLED(CONFIG_X86_32) can only be used when the code is 
syntactically correct on !CONFIG_X86_32 kernels too - which it wasn't.

So I went for the straightforward #ifdef block instead.

Thanks,

	Ingo

===========>
 arch/x86/kernel/e820.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index de6238886cb2..c984be8ee060 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1299,13 +1299,14 @@ void __init e820__memblock_setup(void)
 		memblock_add(entry->addr, entry->size);
 	}
 
+#ifdef CONFIG_X86_32
 	/*
 	 * Discard memory above 4GB because 32-bit systems are limited to 4GB
 	 * of memory even with HIGHMEM.
 	 */
-	if (IS_ENABLED(CONFIG_X86_32))
-		memblock_remove(PFN_PHYS(MAX_NONPAE_PFN), -1);
+	memblock_remove(PFN_PHYS(MAX_NONPAE_PFN), -1);
+#endif
 
 	/* Throw away partial pages: */
 	memblock_trim_memory(PAGE_SIZE);

  reply	other threads:[~2025-04-16  7:51 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 10:30 [PATCH 00/11] x86: 32-bit cleanups Arnd Bergmann
2024-12-04 10:30 ` [PATCH 01/11] x86/Kconfig: Geode CPU has cmpxchg8b Arnd Bergmann
2024-12-04 10:30 ` [PATCH 02/11] x86: drop 32-bit "bigsmp" machine support Arnd Bergmann
2024-12-04 10:30 ` [PATCH 03/11] x86: Kconfig.cpu: split out 64-bit atom Arnd Bergmann
2024-12-04 13:16   ` Thomas Gleixner
2024-12-04 15:55     ` H. Peter Anvin
2024-12-04 18:21       ` Andy Shevchenko
2024-12-04 10:30 ` [PATCH 04/11] x86: split CPU selection into 32-bit and 64-bit Arnd Bergmann
2024-12-04 18:31   ` Andy Shevchenko
2024-12-04 21:18     ` Arnd Bergmann
2024-12-04 10:30 ` [PATCH 05/11] x86: remove HIGHMEM64G support Arnd Bergmann
2024-12-04 13:29   ` Brian Gerst
2024-12-04 13:43     ` Arnd Bergmann
2024-12-04 14:02       ` Brian Gerst
2024-12-04 15:00         ` Brian Gerst
2024-12-04 15:58         ` H. Peter Anvin
2024-12-04 15:53       ` H. Peter Anvin
2024-12-04 16:37     ` H. Peter Anvin
2024-12-04 16:55       ` Arnd Bergmann
2024-12-04 18:37         ` Andy Shevchenko
2024-12-04 21:14           ` Arnd Bergmann
2025-04-11 23:44   ` Dave Hansen
2025-04-12  8:39     ` Ingo Molnar
2025-04-12 10:05     ` Mike Rapoport
2025-04-12 10:44       ` Arnd Bergmann
2025-04-12 19:48       ` Ingo Molnar
2025-04-13  8:08         ` [PATCH] x86/e820: discard high memory that can't be addressed by 32-bit systems Mike Rapoport
2025-04-13  9:23           ` [tip: x86/urgent] x86/e820: Discard " tip-bot2 for Mike Rapoport (Microsoft)
2025-04-14 14:19             ` Dave Hansen
2025-04-15  7:18               ` Mike Rapoport
2025-04-15 13:43                 ` Dave Hansen
2025-04-16  7:17                   ` Ingo Molnar
2025-04-16  7:51                     ` Ingo Molnar [this message]
2025-04-16  7:24           ` tip-bot2 for Mike Rapoport (Microsoft)
2025-04-16  8:16           ` tip-bot2 for Mike Rapoport (Microsoft)
2025-04-17 16:22           ` [PATCH] x86/e820: discard " Nathan Chancellor
2025-04-18  6:33             ` Ingo Molnar
2025-04-18  9:01               ` Mike Rapoport
2025-04-18 12:59                 ` Ingo Molnar
2025-04-18 19:25                   ` Mike Rapoport
2025-04-18 19:29                     ` Dave Hansen
2025-04-18 19:49           ` Guenter Roeck
2025-04-12 10:40     ` [PATCH 05/11] x86: remove HIGHMEM64G support Arnd Bergmann
2024-12-04 10:30 ` [PATCH 06/11] x86: drop SWIOTLB and PHYS_ADDR_T_64BIT for PAE Arnd Bergmann
2024-12-04 18:41   ` Andy Shevchenko
2024-12-04 20:52     ` Arnd Bergmann
2024-12-05  7:59       ` Andy Shevchenko
2024-12-04 10:30 ` [PATCH 07/11] x86: drop support for CONFIG_HIGHPTE Arnd Bergmann
2024-12-04 10:30 ` [PATCH 08/11] x86: document X86_INTEL_MID as 64-bit-only Arnd Bergmann
2024-12-04 18:55   ` Andy Shevchenko
2024-12-04 20:38     ` Arnd Bergmann
2024-12-05  8:03       ` Andy Shevchenko
2024-12-06 11:23     ` Ferry Toth
2024-12-06 14:27       ` Arnd Bergmann
2024-12-04 10:30 ` [PATCH 09/11] x86: rework CONFIG_GENERIC_CPU compiler flags Arnd Bergmann
2024-12-04 15:36   ` Tor Vic
2024-12-04 17:51     ` Arnd Bergmann
2024-12-04 17:09   ` Nathan Chancellor
2024-12-04 17:52     ` Arnd Bergmann
2024-12-04 18:10   ` Linus Torvalds
2024-12-04 19:43     ` Arnd Bergmann
2024-12-04 23:33       ` Linus Torvalds
2024-12-05  8:13         ` Andy Shevchenko
2024-12-05 10:09           ` Arnd Bergmann
2024-12-05 11:17             ` Andy Shevchenko
2024-12-05 11:58               ` Arnd Bergmann
2024-12-05 12:35                 ` Jason A. Donenfeld
2024-12-05  9:46         ` Arnd Bergmann
2024-12-05 10:01           ` Andy Shevchenko
2024-12-05 10:47             ` Arnd Bergmann
2024-12-05  8:07       ` Andy Shevchenko
2024-12-06 13:56   ` David Laight
2024-12-04 10:30 ` [PATCH 10/11] x86: remove old STA2x11 support Arnd Bergmann
2024-12-05  7:35   ` Davide Ciminaghi
2024-12-04 10:30 ` [PATCH 11/11] x86: drop 32-bit KVM host support Arnd Bergmann
2024-12-04 15:30   ` Sean Christopherson
2024-12-04 16:33     ` Arnd Bergmann
     [not found] <20250413080858.743221-1-rppt@kernel.org # discussion and submission>
2025-04-19 15:00 ` [tip: x86/urgent] x86/e820: Discard high memory that can't be addressed by 32-bit systems tip-bot2 for Mike Rapoport (Microsoft)

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=Z_9hmdMTP3wpB3Cc@gmail.com \
    --to=mingo@kernel.org \
    --cc=andy@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=ciminaghi@gnudd.com \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rppt@kernel.org \
    --cc=seanjc@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).