Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
@ 2026-11-29 16:53 Heiko Carstens
  2026-11-29 16:59 ` sashiko-bot
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Heiko Carstens @ 2026-11-29 16:53 UTC (permalink / raw)
  To: Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger
  Cc: Mike Rapoport, linux-kernel, linux-s390

With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
kernel mapping permissions" if the identity mapping contains holes, e.g.
standby memory. __set_memory_4k() is called for [0, ident_map_size),
which may include holes, and change_page_attr() returns -EINVAL for the
first empty page table entry, which was silently ignored before [1].

Fix this by skipping empty entries if the range is within the identity
mapping, similar to x86.

Note: the fixes tag points to the commit which reveals this bug, but it
exists since much longer. Nobody noticed so far, since hardly anybody
uses debug_pagealloc, and also hardly anybody has configurations with
holes within the identity mapping.

Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
 arch/s390/mm/pageattr.c | 53 +++++++++++++++++++++++++++++++----------
 1 file changed, 41 insertions(+), 12 deletions(-)

diff --git a/arch/s390/mm/pageattr.c b/arch/s390/mm/pageattr.c
index 80e834e8b8e1..e744a61651b9 100644
--- a/arch/s390/mm/pageattr.c
+++ b/arch/s390/mm/pageattr.c
@@ -76,6 +76,13 @@ static void pgt_set(unsigned long *old, unsigned long new, unsigned long addr,
 	}
 }
 
+static bool is_identity_range(unsigned long addr, unsigned long end)
+{
+	unsigned long identity_end = __identity_base + ident_map_size;
+
+	return addr >= __identity_base && end <= identity_end;
+}
+
 static int walk_pte_level(pmd_t *pmdp, unsigned long addr, unsigned long end,
 			  unsigned long flags)
 {
@@ -86,8 +93,11 @@ static int walk_pte_level(pmd_t *pmdp, unsigned long addr, unsigned long end,
 	ptep = pte_offset_kernel(pmdp, addr);
 	do {
 		new = ptep_get(ptep);
-		if (pte_none(new))
-			return -EINVAL;
+		if (pte_none(new)) {
+			if (!is_identity_range(addr, addr + PAGE_SIZE))
+				return -EINVAL;
+			goto skip;
+		}
 		if (flags & SET_MEMORY_RO)
 			new = pte_wrprotect(new);
 		else if (flags & SET_MEMORY_RW)
@@ -103,6 +113,7 @@ static int walk_pte_level(pmd_t *pmdp, unsigned long addr, unsigned long end,
 			new = set_pte_bit(new, PAGE_KERNEL);
 		}
 		pgt_set((unsigned long *)ptep, pte_val(new), addr, CRDTE_DTT_PAGE);
+skip:
 		ptep++;
 		addr += PAGE_SIZE;
 	} while (addr < end);
@@ -172,9 +183,12 @@ static int walk_pmd_level(pud_t *pudp, unsigned long addr, unsigned long end,
 	pmdp = pmd_offset(pudp, addr);
 	do {
 		pmd = pmdp_get(pmdp);
-		if (pmd_none(pmd))
-			return -EINVAL;
 		next = pmd_addr_end(addr, end);
+		if (pmd_none(pmd)) {
+			if (!is_identity_range(addr, next))
+				return -EINVAL;
+			goto skip;
+		}
 		if (pmd_leaf(pmd)) {
 			need_split  = !!(flags & SET_MEMORY_4K);
 			need_split |= !!(addr & ~PMD_MASK);
@@ -191,6 +205,7 @@ static int walk_pmd_level(pud_t *pudp, unsigned long addr, unsigned long end,
 			if (rc)
 				return rc;
 		}
+skip:
 		pmdp++;
 		addr = next;
 	} while (addr < end);
@@ -260,9 +275,12 @@ static int walk_pud_level(p4d_t *p4d, unsigned long addr, unsigned long end,
 	pudp = pud_offset(p4d, addr);
 	do {
 		pud = pudp_get(pudp);
-		if (pud_none(pud))
-			return -EINVAL;
 		next = pud_addr_end(addr, end);
+		if (pud_none(pud)) {
+			if (!is_identity_range(addr, next))
+				return -EINVAL;
+			goto skip;
+		}
 		if (pud_leaf(pud)) {
 			need_split  = !!(flags & SET_MEMORY_4K);
 			need_split |= !!(addr & ~PUD_MASK);
@@ -277,6 +295,7 @@ static int walk_pud_level(p4d_t *p4d, unsigned long addr, unsigned long end,
 		} else {
 			rc = walk_pmd_level(pudp, addr, next, flags);
 		}
+skip:
 		pudp++;
 		addr = next;
 	} while (addr < end && !rc);
@@ -292,10 +311,14 @@ static int walk_p4d_level(pgd_t *pgd, unsigned long addr, unsigned long end,
 
 	p4dp = p4d_offset(pgd, addr);
 	do {
-		if (p4d_none(p4dp_get(p4dp)))
-			return -EINVAL;
 		next = p4d_addr_end(addr, end);
+		if (p4d_none(p4dp_get(p4dp))) {
+			if (!is_identity_range(addr, next))
+				return -EINVAL;
+			goto skip;
+		}
 		rc = walk_pud_level(p4dp, addr, next, flags);
+skip:
 		p4dp++;
 		addr = next;
 	} while (addr < end && !rc);
@@ -308,18 +331,24 @@ static int change_page_attr(unsigned long addr, unsigned long end,
 			    unsigned long flags)
 {
 	unsigned long next;
-	int rc = -EINVAL;
 	pgd_t *pgdp;
+	int rc = 0;
 
 	pgdp = pgd_offset_k(addr);
 	do {
-		if (pgd_none(pgdp_get(pgdp)))
-			break;
 		next = pgd_addr_end(addr, end);
+		if (pgd_none(pgdp_get(pgdp))) {
+			if (!is_identity_range(addr, next))
+				return -EINVAL;
+			goto skip;
+		}
 		rc = walk_p4d_level(pgdp, addr, next, flags);
 		if (rc)
 			break;
-	} while (pgdp++, addr = next, addr < end && !rc);
+skip:
+		pgdp++;
+		addr = next;
+	} while (addr < end && !rc);
 	return rc;
 }
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
  2026-11-29 16:53 [PATCH] s390/mm: Skip holes in identity mapping in set_memory() Heiko Carstens
@ 2026-11-29 16:59 ` sashiko-bot
  2026-12-01 11:02 ` Mike Rapoport
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-29 16:59 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-s390, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] s390/mm: malformed Fixes: trailer with trailing [1] footnote
  marker
--

commit 2f3a9264d9b84b1e4a21e89ed758296d9558f69a
Author: Heiko Carstens <hca@linux.ibm.com>

> s390/mm: Skip holes in identity mapping in set_memory()
>
> With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
> kernel mapping permissions" if the identity mapping contains holes, e.g.
> standby memory. __set_memory_4k() is called for [0, ident_map_size),
> which may include holes, and change_page_attr() returns -EINVAL for the
> first empty page table entry, which was silently ignored before [1].
>
> Fix this by skipping empty entries if the range is within the identity
> mapping, similar to x86.
>
> Note: the fixes tag points to the commit which reveals this bug, but it
> exists since much longer. Nobody noticed so far, since hardly anybody
> uses debug_pagealloc, and also hardly anybody has configurations with
> holes within the identity mapping.
>
> Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

[Severity: Low]
The trailing "[1]" footnote marker on the Fixes: line breaks commit-parsing
and stable-backport tools that expect the canonical trailer format.  Please
drop the marker from the trailer line:

  Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129165327.1188117-1-hca@linux.ibm.com?part=1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
  2026-11-29 16:53 [PATCH] s390/mm: Skip holes in identity mapping in set_memory() Heiko Carstens
  2026-11-29 16:59 ` sashiko-bot
@ 2026-12-01 11:02 ` Mike Rapoport
  2026-12-01 12:41 ` Alexander Gordeev
  2026-12-03 11:55 ` Mikhail Zaslonko
  3 siblings, 0 replies; 7+ messages in thread
From: Mike Rapoport @ 2026-12-01 11:02 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger, linux-kernel, linux-s390

On Sun, Nov 29, 2026 at 05:53:27PM +0100, Heiko Carstens wrote:
> With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
> kernel mapping permissions" if the identity mapping contains holes, e.g.
> standby memory. __set_memory_4k() is called for [0, ident_map_size),
> which may include holes, and change_page_attr() returns -EINVAL for the
> first empty page table entry, which was silently ignored before [1].
> 
> Fix this by skipping empty entries if the range is within the identity
> mapping, similar to x86.
 
> Note: the fixes tag points to the commit which reveals this bug, but it
> exists since much longer. Nobody noticed so far, since hardly anybody
> uses debug_pagealloc, and also hardly anybody has configurations with
> holes within the identity mapping.
> 
> Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
>  arch/s390/mm/pageattr.c | 53 +++++++++++++++++++++++++++++++----------
>  1 file changed, 41 insertions(+), 12 deletions(-)

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
  2026-11-29 16:53 [PATCH] s390/mm: Skip holes in identity mapping in set_memory() Heiko Carstens
  2026-11-29 16:59 ` sashiko-bot
  2026-12-01 11:02 ` Mike Rapoport
@ 2026-12-01 12:41 ` Alexander Gordeev
  2026-12-03 11:55 ` Mikhail Zaslonko
  3 siblings, 0 replies; 7+ messages in thread
From: Alexander Gordeev @ 2026-12-01 12:41 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Sven Schnelle, Vasily Gorbik, Christian Borntraeger,
	Mike Rapoport, linux-kernel, linux-s390

On Sun, Nov 29, 2026 at 05:53:27PM +0100, Heiko Carstens wrote:
> With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
> kernel mapping permissions" if the identity mapping contains holes, e.g.
> standby memory. __set_memory_4k() is called for [0, ident_map_size),
> which may include holes, and change_page_attr() returns -EINVAL for the
> first empty page table entry, which was silently ignored before [1].
> 
> Fix this by skipping empty entries if the range is within the identity
> mapping, similar to x86.
> 
> Note: the fixes tag points to the commit which reveals this bug, but it
> exists since much longer. Nobody noticed so far, since hardly anybody
> uses debug_pagealloc, and also hardly anybody has configurations with
> holes within the identity mapping.
> 
> Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> ---
>  arch/s390/mm/pageattr.c | 53 +++++++++++++++++++++++++++++++----------
>  1 file changed, 41 insertions(+), 12 deletions(-)

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
  2026-11-29 16:53 [PATCH] s390/mm: Skip holes in identity mapping in set_memory() Heiko Carstens
                   ` (2 preceding siblings ...)
  2026-12-01 12:41 ` Alexander Gordeev
@ 2026-12-03 11:55 ` Mikhail Zaslonko
  2026-12-03 15:38   ` Mikhail Zaslonko
  3 siblings, 1 reply; 7+ messages in thread
From: Mikhail Zaslonko @ 2026-12-03 11:55 UTC (permalink / raw)
  To: Heiko Carstens, Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger
  Cc: linux-s390



On 29-Nov-26 17:53, Heiko Carstens wrote:
> With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
> kernel mapping permissions" if the identity mapping contains holes, e.g.
> standby memory. __set_memory_4k() is called for [0, ident_map_size),
> which may include holes, and change_page_attr() returns -EINVAL for the
> first empty page table entry, which was silently ignored before [1].
> 
> Fix this by skipping empty entries if the range is within the identity
> mapping, similar to x86.
> 
> Note: the fixes tag points to the commit which reveals this bug, but it
> exists since much longer. Nobody noticed so far, since hardly anybody
> uses debug_pagealloc, and also hardly anybody has configurations with
> holes within the identity mapping.
> 
> Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> ---
>  arch/s390/mm/pageattr.c | 53 +++++++++++++++++++++++++++++++----------
>  1 file changed, 41 insertions(+), 12 deletions(-)

Hello Heiko,

it seems I was fixing the same issue within my crashkernel CMA series for s390:
a kdump kernel that uses the CMA memory of the crashed kernel always has a
hole in its identity mapping, so the series depends on this fix.
I used the approach that splits each memory range separately in vmem_map_init().
But this approach seems better. I will drop my fix from crashkernel CMA v2
series and refer to this one.

Acked-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
  2026-12-03 11:55 ` Mikhail Zaslonko
@ 2026-12-03 15:38   ` Mikhail Zaslonko
  2026-12-03 16:06     ` Heiko Carstens
  0 siblings, 1 reply; 7+ messages in thread
From: Mikhail Zaslonko @ 2026-12-03 15:38 UTC (permalink / raw)
  To: Heiko Carstens, Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger
  Cc: linux-s390



On 03-Dec-26 12:55, Mikhail Zaslonko wrote:
> 
> 
> On 29-Nov-26 17:53, Heiko Carstens wrote:
>> With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
>> kernel mapping permissions" if the identity mapping contains holes, e.g.
>> standby memory. __set_memory_4k() is called for [0, ident_map_size),
>> which may include holes, and change_page_attr() returns -EINVAL for the
>> first empty page table entry, which was silently ignored before [1].
>>
>> Fix this by skipping empty entries if the range is within the identity
>> mapping, similar to x86.
>>
>> Note: the fixes tag points to the commit which reveals this bug, but it
>> exists since much longer. Nobody noticed so far, since hardly anybody
>> uses debug_pagealloc, and also hardly anybody has configurations with
>> holes within the identity mapping.
>>
>> Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
>> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
>> ---
>>  arch/s390/mm/pageattr.c | 53 +++++++++++++++++++++++++++++++----------
>>  1 file changed, 41 insertions(+), 12 deletions(-)
> 
> Hello Heiko,
> 
> it seems I was fixing the same issue within my crashkernel CMA series for s390:
> a kdump kernel that uses the CMA memory of the crashed kernel always has a
> hole in its identity mapping, so the series depends on this fix.
> I used the approach that splits each memory range separately in vmem_map_init().
> But this approach seems better. I will drop my fix from crashkernel CMA v2
> series and refer to this one.
> 
> Acked-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>

I tested the patch on master. Without it, a z/VM guest defined with
DEF STOR CONFIG 0.2G 4G.4G and debug_pagealloc=on panics during boot
when it frees the first page above the hole:

00: [    0.228998] addressing exception: 0005 ilc:2 [#1]SMP DEBUG_PAGEALLOC                                                               
00: [    0.229218] Modules linked in:                                                                                                     
00: [    0.229448] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 7.4.0-rc5-master-00103-gd06ce6f1eb5e #34 PREEMPT(undef)                 
00: [    0.229683] Hardware name: IBM 3931 A01 703 (z/VM 7.4.0)                                                                           
00: [    0.229919] Krnl PSW : 0404c00180000000 0000031f94fd4e52 (__kernel_map_pages+0x2c2/0x330)                                          
00: [    0.230168]            R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3                                                
00: [    0.230404] Krnl GPRS: 0000031f94e84000 0000000100400000 0000029500000000 0000000100400000                                         
00: [    0.230620]            0000000100000100 0000000000000080 0000000100400000 0000031f9695d270                                         
00: [    0.230855]            0000031f9695d290 0000000000000000 0000029504010000 0000000000000400                                         
00: [    0.231088]            0000000000001000 0000031f96815f00 0000031f95378576 0000031f96723c10                                         
00: [    0.231330] Krnl Code:                                                                                                             
00: [    0.231581]            0000031f94fd4e44: b9e90063     sgrk %r6,%r3,%r0                                                             
00: [    0.231806]            0000031f94fd4e48: e36070080008 ag %r6,8(%r7)                                                                
00: [    0.232025]       PGM >0000031f94fd4e4e: b2210061     ipte %r6,%r1,%r0,0                                                           
00: [    0.232269]       PSW >0000031f94fd4e52: e30070000004 lg %r0,0(%r7)                                                                
00: [    0.232523]            0000031f94fd4e58: 41303008     la %r3,8(%r3)                                                                
00: [    0.232750]            0000031f94fd4e5c: a71b1000     aghi %r1,4096                                                                
00: [    0.232989]            0000031f94fd4e60: b9040063     lgr %r6,%r3                                                                  
00: [    0.233239]            0000031f94fd4e64: ec3000084065 clgrj %r3,%r0,4,0000031f94fd4e74                              
00: [    0.233586] Call Trace:                                                                                                            
00: [    0.234212]  [<0000031f94fd4e52>] __kernel_map_pages+0x2c2/0x330                                                                   
00: [    0.234652]  [<0000031f95378576>] __free_pages_ok+0x1b6/0x670                                                                      
00: [    0.235117]  [<0000031f9698690a>] free_low_memory_core_early+0x22a/0x2b0                                                           
00: [    0.235676]  [<0000031f969874cc>] memblock_free_all+0x5c/0x80                                                                      
00: [    0.235968]  [<0000031f969834e4>] mm_core_init+0x174/0x1a0                                                                         
00: [    0.236368]  [<0000031f9695f536>] start_kernel+0x41e/0x6f8                                                                         
00: [    0.237093]  [<0000031f94f8402e>] startup_continue+0x2e/0x40 

The cause is the same one you described: __set_memory_4k() stops at the first
hole and the result is ignored, so everything above it keeps its large
mappings. __kernel_map_pages() then treats a large mapping as a page
table.

But I think the Fixes tag should have this commit instead (4634f260683b
is not in master):
 Fixes: edc1e4b6e265 ("s390/vmem: split pages when debug pagealloc is enabled")

With your patch applied on master the same guest boots fine with
debug_pagealloc=on.

Tested-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
  2026-12-03 15:38   ` Mikhail Zaslonko
@ 2026-12-03 16:06     ` Heiko Carstens
  0 siblings, 0 replies; 7+ messages in thread
From: Heiko Carstens @ 2026-12-03 16:06 UTC (permalink / raw)
  To: Mikhail Zaslonko
  Cc: Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger, linux-s390

On Thu, Dec 03, 2026 at 04:38:22PM +0100, Mikhail Zaslonko wrote:
> On 03-Dec-26 12:55, Mikhail Zaslonko wrote:
> > On 29-Nov-26 17:53, Heiko Carstens wrote:
> >> With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
> >> kernel mapping permissions" if the identity mapping contains holes, e.g.
> >> standby memory. __set_memory_4k() is called for [0, ident_map_size),
> >> which may include holes, and change_page_attr() returns -EINVAL for the
> >> first empty page table entry, which was silently ignored before [1].
> >>
> >> Fix this by skipping empty entries if the range is within the identity
> >> mapping, similar to x86.
> >>
> >> Note: the fixes tag points to the commit which reveals this bug, but it
> >> exists since much longer. Nobody noticed so far, since hardly anybody
> >> uses debug_pagealloc, and also hardly anybody has configurations with
> >> holes within the identity mapping.
> >>
> >> Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
> >> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> >> ---
> >>  arch/s390/mm/pageattr.c | 53 +++++++++++++++++++++++++++++++----------
> >>  1 file changed, 41 insertions(+), 12 deletions(-)
...
> > 
> > Hello Heiko,
> > 
> > it seems I was fixing the same issue within my crashkernel CMA series for s390:
> > a kdump kernel that uses the CMA memory of the crashed kernel always has a
> > hole in its identity mapping, so the series depends on this fix.
> > I used the approach that splits each memory range separately in vmem_map_init().
> > But this approach seems better. I will drop my fix from crashkernel CMA v2
> > series and refer to this one.
> > 
> > Acked-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
> 
> I tested the patch on master. Without it, a z/VM guest defined with
> DEF STOR CONFIG 0.2G 4G.4G and debug_pagealloc=on panics during boot
> when it frees the first page above the hole:
> 
> 00: [    0.228998] addressing exception: 0005 ilc:2 [#1]SMP DEBUG_PAGEALLOC                                                               
> 00: [    0.229218] Modules linked in:                                                                                                     
> 00: [    0.229448] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 7.4.0-rc5-master-00103-gd06ce6f1eb5e #34 PREEMPT(undef)                 
> 00: [    0.229683] Hardware name: IBM 3931 A01 703 (z/VM 7.4.0)                                                                           
> 00: [    0.229919] Krnl PSW : 0404c00180000000 0000031f94fd4e52 (__kernel_map_pages+0x2c2/0x330)                                          
> 00: [    0.230168]            R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3                                                
> 00: [    0.230404] Krnl GPRS: 0000031f94e84000 0000000100400000 0000029500000000 0000000100400000                                         
> 00: [    0.230620]            0000000100000100 0000000000000080 0000000100400000 0000031f9695d270                                         
> 00: [    0.230855]            0000031f9695d290 0000000000000000 0000029504010000 0000000000000400                                         
> 00: [    0.231088]            0000000000001000 0000031f96815f00 0000031f95378576 0000031f96723c10                                         
> 00: [    0.231330] Krnl Code:                                                                                                             
> 00: [    0.231581]            0000031f94fd4e44: b9e90063     sgrk %r6,%r3,%r0                                                             
> 00: [    0.231806]            0000031f94fd4e48: e36070080008 ag %r6,8(%r7)                                                                
> 00: [    0.232025]       PGM >0000031f94fd4e4e: b2210061     ipte %r6,%r1,%r0,0                                                           
> 00: [    0.232269]       PSW >0000031f94fd4e52: e30070000004 lg %r0,0(%r7)                                                                

Oh, cool, nice to see that the new markers in disassembly actually do work :)

> 00: [    0.232523]            0000031f94fd4e58: 41303008     la %r3,8(%r3)                                                                
> 00: [    0.232750]            0000031f94fd4e5c: a71b1000     aghi %r1,4096                                                                
> 00: [    0.232989]            0000031f94fd4e60: b9040063     lgr %r6,%r3                                                                  
> 00: [    0.233239]            0000031f94fd4e64: ec3000084065 clgrj %r3,%r0,4,0000031f94fd4e74                              
> 00: [    0.233586] Call Trace:                                                                                                            
> 00: [    0.234212]  [<0000031f94fd4e52>] __kernel_map_pages+0x2c2/0x330                                                                   
> 00: [    0.234652]  [<0000031f95378576>] __free_pages_ok+0x1b6/0x670                                                                      
> 00: [    0.235117]  [<0000031f9698690a>] free_low_memory_core_early+0x22a/0x2b0                                                           
> 00: [    0.235676]  [<0000031f969874cc>] memblock_free_all+0x5c/0x80                                                                      
> 00: [    0.235968]  [<0000031f969834e4>] mm_core_init+0x174/0x1a0                                                                         
> 00: [    0.236368]  [<0000031f9695f536>] start_kernel+0x41e/0x6f8                                                                         
> 00: [    0.237093]  [<0000031f94f8402e>] startup_continue+0x2e/0x40 
> 
> The cause is the same one you described: __set_memory_4k() stops at the first
> hole and the result is ignored, so everything above it keeps its large
> mappings. __kernel_map_pages() then treats a large mapping as a page
> table.
> 
> But I think the Fixes tag should have this commit instead (4634f260683b
> is not in master):
>  Fixes: edc1e4b6e265 ("s390/vmem: split pages when debug pagealloc is enabled")
> 
> With your patch applied on master the same guest boots fine with
> debug_pagealloc=on.
> 
> Tested-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>

Yes, I thought it wasn't worth to backport it, since nobody is using
debug_pagealloc, but you have proven me wrong. Alexander, it might
make sense to add the tags from Mikhail, and adjust the Fixes tag.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-12-03 16:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 16:53 [PATCH] s390/mm: Skip holes in identity mapping in set_memory() Heiko Carstens
2026-11-29 16:59 ` sashiko-bot
2026-12-01 11:02 ` Mike Rapoport
2026-12-01 12:41 ` Alexander Gordeev
2026-12-03 11:55 ` Mikhail Zaslonko
2026-12-03 15:38   ` Mikhail Zaslonko
2026-12-03 16:06     ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox