linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Arnd Bergmann <arnd@kernel.org>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Arnd Bergmann <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andy Shevchenko <andy@kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Sean Christopherson <seanjc@google.com>,
	Davide Ciminaghi <ciminaghi@gnudd.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 05/11] x86: remove HIGHMEM64G support
Date: Sat, 12 Apr 2025 13:05:59 +0300	[thread overview]
Message-ID: <Z_o7B_vDPRL03iSN@kernel.org> (raw)
In-Reply-To: <08b63835-121d-4adc-8f03-e68f0b0cabdf@intel.com>

On Fri, Apr 11, 2025 at 04:44:13PM -0700, Dave Hansen wrote:
> Has anyone run into any problems on 6.15-rc1 with this stuff?
> 
> 0xf75fe000 is the mem_map[] entry for the first page >4GB. It obviously
> wasn't allocated, thus the oops. Looks like the memblock for the >4GB
> memory didn't get removed although the pgdats seem correct.

That's apparently because of 6faea3422e3b ("arch, mm: streamline HIGHMEM
freeing"). 
Freeing of high memory was clamped to the end of ZONE_HIGHMEM which is 4G
and after 6faea3422e3b there's no more clamping, so memblock_free_all()
tries to free memory >4G as well.
 
> I'll dig into it some more. Just wanted to make sure there wasn't a fix
> out there already.

This should fix it.

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 57120f0749cc..4b24c0ccade4 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1300,6 +1300,8 @@ void __init e820__memblock_setup(void)
 		memblock_add(entry->addr, entry->size);
 	}
 
+	memblock_remove(PFN_PHYS(max_pfn), -1);
+
 	/* Throw away partial pages: */
 	memblock_trim_memory(PAGE_SIZE);
 
> The way I'm triggering this is booting qemu with a 32-bit PAE kernel,
> and "-m 4096" (or more).
> 
> > [    0.003806] Warning: only 4GB will be used. Support for for CONFIG_HIGHMEM64G was removed!
> ...
> > [    0.561310] BUG: unable to handle page fault for address: f75fe000
> > [    0.562226] #PF: supervisor write access in kernel mode
> > [    0.562947] #PF: error_code(0x0002) - not-present page
> > [    0.563653] *pdpt = 0000000002da2001 *pde = 000000000300c067 *pte = 0000000000000000 
> > [    0.564728] Oops: Oops: 0002 [#1] SMP NOPTI
> > [    0.565315] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.15.0-rc1-00288-ge618ee89561b-dirty #311 PREEMPT(undef) 
> > [    0.567428] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
> > [    0.568777] EIP: __free_pages_core+0x3c/0x74
> > [    0.569378] Code: c3 d3 e6 83 ec 10 89 44 24 08 89 74 24 04 c7 04 24 c6 32 3a c2 89 55 f4 e8 a9 11 45 fe 85 f6 8b 55 f4 74 19 89 d8 31 c9 66 90 <0f> ba 30 0d c7 40 1c 00 00 00 00 41 83 c0 28 39 ce 75 ed 8b 03 c1
> > [    0.571943] EAX: f75fe000 EBX: f75fe000 ECX: 00000000 EDX: 0000000a
> > [    0.572806] ESI: 00000400 EDI: 00500000 EBP: c247becc ESP: c247beb4
> > [    0.573776] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00210046
> > [    0.574606] CR0: 80050033 CR2: f75fe000 CR3: 02da6000 CR4: 000000b0
> > [    0.575464] Call Trace:
> > [    0.575816]  memblock_free_pages+0x11/0x2c
> > [    0.576392]  memblock_free_all+0x2ce/0x3a0
> > [    0.576955]  mm_core_init+0xf5/0x320
> > [    0.577423]  start_kernel+0x296/0x79c
> > [    0.577950]  ? set_init_arg+0x70/0x70
> > [    0.578478]  ? load_ucode_bsp+0x13c/0x1a8
> > [    0.579059]  i386_start_kernel+0xad/0xb0
> > [    0.579614]  startup_32_smp+0x151/0x154
> > [    0.580100] Modules linked in:
> > [    0.580358] CR2: 00000000f75fe000
> > [    0.580630] ---[ end trace 0000000000000000 ]---
> > [    0.581111] EIP: __free_pages_core+0x3c/0x74
> > [    0.581455] Code: c3 d3 e6 83 ec 10 89 44 24 08 89 74 24 04 c7 04 24 c6 32 3a c2 89 55 f4 e8 a9 11 45 fe 85 f6 8b 55 f4 74 19 89 d8 31 c9 66 90 <0f> ba 30 0d c7 40 1c 00 00 00 00 41 83 c0 28 39 ce 75 ed 8b 03 c1
> > [    0.584767] EAX: f75fe000 EBX: f75fe000 ECX: 00000000 EDX: 0000000a
> > [    0.585651] ESI: 00000400 EDI: 00500000 EBP: c247becc ESP: c247beb4
> > [    0.586530] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00210046
> > [    0.587480] CR0: 80050033 CR2: f75fe000 CR3: 02da6000 CR4: 000000b0
> > [    0.588344] Kernel panic - not syncing: Attempted to kill the idle task!
> > [    0.589435] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---
> 
> > [    0.561310] BUG: unable to handle page fault for address: f75fe000
> > [    0.562226] #PF: supervisor write access in kernel mode
> > [    0.562947] #PF: error_code(0x0002) - not-present page
> > [    0.563653] *pdpt = 0000000002da2001 *pde = 000000000300c067 *pte = 0000000000000000 
> > [    0.564728] Oops: Oops: 0002 [#1] SMP NOPTI
> > [    0.565315] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.15.0-rc1-00288-ge618ee89561b-dirty #311 PREEMPT(undef) 
> > [    0.567428] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
> > [    0.568777] EIP: __free_pages_core+0x3c/0x74
> > [    0.569378] Code: c3 d3 e6 83 ec 10 89 44 24 08 89 74 24 04 c7 04 24 c6 32 3a c2 89 55 f4 e8 a9 11 45 fe 85 f6 8b 55 f4 74 19 89 d8 31 c9 66 90 <0f> ba 30 0d c7 40 1c 00 00 00 00 41 83 c0 28 39 ce 75 ed 8b 03 c1
> > [    0.571943] EAX: f75fe000 EBX: f75fe000 ECX: 00000000 EDX: 0000000a
> > [    0.572806] ESI: 00000400 EDI: 00500000 EBP: c247becc ESP: c247beb4
> > [    0.573776] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00210046
> > [    0.574606] CR0: 80050033 CR2: f75fe000 CR3: 02da6000 CR4: 000000b0
> > [    0.575464] Call Trace:
> > [    0.575816]  memblock_free_pages+0x11/0x2c
> > [    0.576392]  memblock_free_all+0x2ce/0x3a0
> > [    0.576955]  mm_core_init+0xf5/0x320
> > [    0.577423]  start_kernel+0x296/0x79c
> > [    0.577950]  ? set_init_arg+0x70/0x70
> > [    0.578478]  ? load_ucode_bsp+0x13c/0x1a8
> > [    0.579059]  i386_start_kernel+0xad/0xb0
> > [    0.579614]  startup_32_smp+0x151/0x154
> > [    0.580100] Modules linked in:
> > [    0.580358] CR2: 00000000f75fe000
> > [    0.580630] ---[ end trace 0000000000000000 ]---
> > [    0.581111] EIP: __free_pages_core+0x3c/0x74
> > [    0.581455] Code: c3 d3 e6 83 ec 10 89 44 24 08 89 74 24 04 c7 04 24 c6 32 3a c2 89 55 f4 e8 a9 11 45 fe 85 f6 8b 55 f4 74 19 89 d8 31 c9 66 90 <0f> ba 30 0d c7 40 1c 00 00 00 00 41 83 c0 28 39 ce 75 ed 8b 03 c1
> > [    0.584767] EAX: f75fe000 EBX: f75fe000 ECX: 00000000 EDX: 0000000a
> > [    0.585651] ESI: 00000400 EDI: 00500000 EBP: c247becc ESP: c247beb4
> > [    0.586530] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00210046
> > [    0.587480] CR0: 80050033 CR2: f75fe000 CR3: 02da6000 CR4: 000000b0
> > [    0.588344] Kernel panic - not syncing: Attempted to kill the idle task!
> > [    0.589435] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

-- 
Sincerely yours,
Mike.

  parent reply	other threads:[~2025-04-12 10:06 UTC|newest]

Thread overview: 77+ 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 [this message]
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
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

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_o7B_vDPRL03iSN@kernel.org \
    --to=rppt@kernel.org \
    --cc=andy@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=bp@alien8.de \
    --cc=ciminaghi@gnudd.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --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).