Skip to content

Commit

Permalink
powerpc/mm: Update the memory limit based on direct mapping restrictions
Browse files Browse the repository at this point in the history
memory limit value specified by the user are further updated such that
the value is 16MB aligned. This is because hash translation mode use
16MB as direct mapping page size. Make sure we update the global
variable 'memory_limit' with the 16MB aligned value such that all kernel
components will see the new aligned value of the memory limit.

Signed-off-by: Aneesh Kumar K.V (IBM) <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/[email protected]
  • Loading branch information
kvaneesh authored and mpe committed Apr 19, 2024
1 parent f94f5ac commit 5a799af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,6 @@ static inline void save_fscr_to_task(void) {}

void __init early_init_devtree(void *params)
{
phys_addr_t limit;

DBG(" -> early_init_devtree(%px)\n", params);

Expand Down Expand Up @@ -850,8 +849,8 @@ void __init early_init_devtree(void *params)
memory_limit = 0;

/* Align down to 16 MB which is large page size with hash page translation */
limit = ALIGN_DOWN(memory_limit ?: memblock_phys_mem_size(), SZ_16M);
memblock_enforce_memory_limit(limit);
memory_limit = ALIGN_DOWN(memory_limit ?: memblock_phys_mem_size(), SZ_16M);
memblock_enforce_memory_limit(memory_limit);

#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_PPC_4K_PAGES)
if (!early_radix_enabled())
Expand Down

0 comments on commit 5a799af

Please sign in to comment.