Skip to content

Commit af5304a

Browse files
chleroympe
authored andcommitted
powerpc/code-patching: Remove init_mem_is_free
A new state has been added by commit d2635f2 ("mm: create a new system state and fix core_kernel_text()"). That state tells when initmem is about to be released and is redundant with init_mem_is_free. Remove init_mem_is_free. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/ad8c3ccb39c8edaa89fd3eda1cc7218baea1cde5.1638446239.git.christophe.leroy@csgroup.eu
1 parent edecd2d commit af5304a

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

arch/powerpc/include/asm/setup.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ extern void ppc_printk_progress(char *s, unsigned short hex);
99

1010
extern unsigned int rtas_data;
1111
extern unsigned long long memory_limit;
12-
extern bool init_mem_is_free;
1312
extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
1413

1514
struct device_node;

arch/powerpc/lib/code-patching.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <asm/tlbflush.h>
1616
#include <asm/page.h>
1717
#include <asm/code-patching.h>
18-
#include <asm/setup.h>
1918
#include <asm/inst.h>
2019

2120
static int __patch_instruction(u32 *exec_addr, ppc_inst_t instr, u32 *patch_addr)
@@ -187,7 +186,7 @@ static int do_patch_instruction(u32 *addr, ppc_inst_t instr)
187186
int patch_instruction(u32 *addr, ppc_inst_t instr)
188187
{
189188
/* Make sure we aren't patching a freed init section */
190-
if (init_mem_is_free && init_section_contains(addr, 4))
189+
if (system_state >= SYSTEM_FREEING_INITMEM && init_section_contains(addr, 4))
191190
return 0;
192191

193192
return do_patch_instruction(addr, instr);

arch/powerpc/mm/mem.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <mm/mmu_decl.h>
2727

2828
unsigned long long memory_limit;
29-
bool init_mem_is_free;
3029

3130
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
3231
EXPORT_SYMBOL(empty_zero_page);
@@ -312,7 +311,6 @@ void free_initmem(void)
312311
{
313312
ppc_md.progress = ppc_printk_progress;
314313
mark_initmem_nx();
315-
init_mem_is_free = true;
316314
free_initmem_default(POISON_FREE_INITMEM);
317315
}
318316

0 commit comments

Comments
 (0)