Skip to content

Commit bde709a

Browse files
Mauricio Faria de Oliveirampe
authored andcommitted
powerpc/mm: Fix section mismatch warning in stop_machine_change_mapping()
Fix the warning messages for stop_machine_change_mapping(), and a number of other affected functions in its call chain. All modified functions are under CONFIG_MEMORY_HOTPLUG, so __meminit is okay (keeps them / does not discard them). Boot-tested on powernv/power9/radix-mmu and pseries/power8/hash-mmu. $ make -j$(nproc) CONFIG_DEBUG_SECTION_MISMATCH=y vmlinux ... MODPOST vmlinux.o WARNING: vmlinux.o(.text+0x6b130): Section mismatch in reference from the function stop_machine_change_mapping() to the function .meminit.text:create_physical_mapping() The function stop_machine_change_mapping() references the function __meminit create_physical_mapping(). This is often because stop_machine_change_mapping lacks a __meminit annotation or the annotation of create_physical_mapping is wrong. WARNING: vmlinux.o(.text+0x6b13c): Section mismatch in reference from the function stop_machine_change_mapping() to the function .meminit.text:create_physical_mapping() The function stop_machine_change_mapping() references the function __meminit create_physical_mapping(). This is often because stop_machine_change_mapping lacks a __meminit annotation or the annotation of create_physical_mapping is wrong. ... Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent d6fbe1c commit bde709a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

arch/powerpc/mm/mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ int __weak remove_section_mapping(unsigned long start, unsigned long end)
127127
return -ENODEV;
128128
}
129129

130-
int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
130+
int __meminit arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
131131
bool want_memblock)
132132
{
133133
unsigned long start_pfn = start >> PAGE_SHIFT;
@@ -148,7 +148,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
148148
}
149149

150150
#ifdef CONFIG_MEMORY_HOTREMOVE
151-
int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
151+
int __meminit arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
152152
{
153153
unsigned long start_pfn = start >> PAGE_SHIFT;
154154
unsigned long nr_pages = size >> PAGE_SHIFT;

arch/powerpc/mm/pgtable-book3s64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ void mmu_cleanup_all(void)
155155
}
156156

157157
#ifdef CONFIG_MEMORY_HOTPLUG
158-
int create_section_mapping(unsigned long start, unsigned long end)
158+
int __meminit create_section_mapping(unsigned long start, unsigned long end)
159159
{
160160
if (radix_enabled())
161161
return radix__create_section_mapping(start, end);
162162

163163
return hash__create_section_mapping(start, end);
164164
}
165165

166-
int remove_section_mapping(unsigned long start, unsigned long end)
166+
int __meminit remove_section_mapping(unsigned long start, unsigned long end)
167167
{
168168
if (radix_enabled())
169169
return radix__remove_section_mapping(start, end);

arch/powerpc/mm/pgtable-radix.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ struct change_mapping_params {
695695
unsigned long aligned_end;
696696
};
697697

698-
static int stop_machine_change_mapping(void *data)
698+
static int __meminit stop_machine_change_mapping(void *data)
699699
{
700700
struct change_mapping_params *params =
701701
(struct change_mapping_params *)data;
@@ -742,7 +742,7 @@ static void remove_pte_table(pte_t *pte_start, unsigned long addr,
742742
/*
743743
* clear the pte and potentially split the mapping helper
744744
*/
745-
static void split_kernel_mapping(unsigned long addr, unsigned long end,
745+
static void __meminit split_kernel_mapping(unsigned long addr, unsigned long end,
746746
unsigned long size, pte_t *pte)
747747
{
748748
unsigned long mask = ~(size - 1);
@@ -835,7 +835,7 @@ static void remove_pud_table(pud_t *pud_start, unsigned long addr,
835835
}
836836
}
837837

838-
static void remove_pagetable(unsigned long start, unsigned long end)
838+
static void __meminit remove_pagetable(unsigned long start, unsigned long end)
839839
{
840840
unsigned long addr, next;
841841
pud_t *pud_base;
@@ -863,12 +863,12 @@ static void remove_pagetable(unsigned long start, unsigned long end)
863863
radix__flush_tlb_kernel_range(start, end);
864864
}
865865

866-
int __ref radix__create_section_mapping(unsigned long start, unsigned long end)
866+
int __meminit radix__create_section_mapping(unsigned long start, unsigned long end)
867867
{
868868
return create_physical_mapping(start, end);
869869
}
870870

871-
int radix__remove_section_mapping(unsigned long start, unsigned long end)
871+
int __meminit radix__remove_section_mapping(unsigned long start, unsigned long end)
872872
{
873873
remove_pagetable(start, end);
874874
return 0;
@@ -888,7 +888,7 @@ int __meminit radix__vmemmap_create_mapping(unsigned long start,
888888
}
889889

890890
#ifdef CONFIG_MEMORY_HOTPLUG
891-
void radix__vmemmap_remove_mapping(unsigned long start, unsigned long page_size)
891+
void __meminit radix__vmemmap_remove_mapping(unsigned long start, unsigned long page_size)
892892
{
893893
remove_pagetable(start, start + page_size);
894894
}

0 commit comments

Comments
 (0)