lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 Oct 2019 12:09:24 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Ilya Leoshkevich <iii@...ux.ibm.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        linux-s390@...r.kernel.org,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH] mm/sparse.c: mark populate_section_memmap as __meminit

On 28.10.19 17:55, Ilya Leoshkevich wrote:
> Building the kernel on s390 with -Og produces the following warning:
> 
> WARNING: vmlinux.o(.text+0x28dabe): Section mismatch in reference from the function populate_section_memmap() to the function .meminit.text:__populate_section_memmap()
> The function populate_section_memmap() references
> the function __meminit __populate_section_memmap().
> This is often because populate_section_memmap lacks a __meminit
> annotation or the annotation of __populate_section_memmap is wrong.
> 
> While -Og is not supported, in theory this might still happen with
> another compiler or on another architecture. So fix this by using the
> correct section annotations.
> 
> Signed-off-by: Ilya Leoshkevich <iii@...ux.ibm.com>
> ---
>   mm/sparse.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/sparse.c b/mm/sparse.c
> index f6891c1992b1..0f1f36443a96 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -448,7 +448,7 @@ static unsigned long __init section_map_size(void)
>   	return PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION);
>   }
>   
> -struct page __init *__populate_section_memmap(unsigned long pfn,
> +struct page __meminit *__populate_section_memmap(unsigned long pfn,
>   		unsigned long nr_pages, int nid, struct vmem_altmap *altmap)
>   {
>   	unsigned long size = section_map_size();
> @@ -647,7 +647,7 @@ void offline_mem_sections(unsigned long start_pfn, unsigned long end_pfn)
>   #endif
>   
>   #ifdef CONFIG_SPARSEMEM_VMEMMAP
> -static struct page *populate_section_memmap(unsigned long pfn,
> +static struct page * __meminit populate_section_memmap(unsigned long pfn,
>   		unsigned long nr_pages, int nid, struct vmem_altmap *altmap)
>   {
>   	return __populate_section_memmap(pfn, nr_pages, nid, altmap);
> @@ -669,7 +669,7 @@ static void free_map_bootmem(struct page *memmap)
>   	vmemmap_free(start, end, NULL);
>   }
>   #else
> -struct page *populate_section_memmap(unsigned long pfn,
> +struct page * __meminit populate_section_memmap(unsigned long pfn,
>   		unsigned long nr_pages, int nid, struct vmem_altmap *altmap)
>   {
>   	struct page *page, *ret;
> 

So mm/sparse-vmemmap.c:__populate_section_memmap() already has this 
annotation. I guess it's the right thing to do as 
populate_section_memmap() is called from

static struct page * __meminit section_activate()

Acked-by: David Hildenbrand <david@...hat.com>

-- 

Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ