Patch "sparc32: Limit memblock allocation to low memory" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sparc32: Limit memblock allocation to low memory

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sparc32-limit-memblock-allocation-to-low-memory.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 41eb0a85d01ef907a3908c0f944d432c8719c003
Author: Andreas Larsson <andreas@xxxxxxxxxxx>
Date:   Fri Feb 5 14:20:31 2021 +0100

    sparc32: Limit memblock allocation to low memory
    
    [ Upstream commit bda166930c37604ffa93f2425426af6921ec575a ]
    
    Commit cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0 changed sparc32 to use
    memblocks instead of bootmem, but also made high memory available via
    memblock allocation which does not work together with e.g. phys_to_virt
    and can lead to kernel panic.
    
    This changes back to only low memory being allocatable in the early
    stages, now using memblock allocation.
    
    Signed-off-by: Andreas Larsson <andreas@xxxxxxxxxxx>
    Acked-by: Mike Rapoport <rppt@xxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index 92634d4e440c..89a9244f2cf0 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -199,6 +199,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
 	size = memblock_phys_mem_size() - memblock_reserved_size();
 	*pages_avail = (size >> PAGE_SHIFT) - high_pages;
 
+	/* Only allow low memory to be allocated via memblock allocation */
+	memblock_set_current_limit(max_low_pfn << PAGE_SHIFT);
+
 	return max_pfn;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux