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] [day] [month] [year] [list]
Date:   Thu, 13 Jul 2017 00:49:58 -0700
From:   Dan Williams <dan.j.williams@...el.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Arnd Bergmann <arnd@...db.de>, Linux MM <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure

On Thu, Jul 13, 2017 at 12:04 AM, Geert Uytterhoeven
<geert@...ux-m68k.org> wrote:
> Hi Dan,
>
> On Thu, Jul 13, 2017 at 2:29 AM, Dan Williams <dan.j.williams@...el.com> wrote:
>> On Tue, Jul 11, 2017 at 11:57 PM, Geert Uytterhoeven
>> <geert@...ux-m68k.org> wrote:
>>> With gcc 4.1.2:
>>>
>>>     mm/memory.o: In function `create_huge_pmd':
>>>     memory.c:(.text+0x93e): undefined reference to `do_huge_pmd_anonymous_page'
>>>
>>> Converting transparent_hugepage_enabled() from a macro to a static
>>> inline function reduced the ability of the compiler to remove unused
>>> code.
>>>
>>> Fix this by marking create_huge_pmd() inline.
>>>
>>> Fixes: 16981d763501c0e0 ("mm: improve readability of transparent_hugepage_enabled()")
>>> Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
>>> ---
>>> Interestingly, create_huge_pmd() is emitted in the assembler output, but
>>> never called.
>>> ---
>>>  mm/memory.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/mm/memory.c b/mm/memory.c
>>> index cbb57194687e393a..0e517be91a89e162 100644
>>> --- a/mm/memory.c
>>> +++ b/mm/memory.c
>>> @@ -3591,7 +3591,7 @@ static int do_numa_page(struct vm_fault *vmf)
>>>         return 0;
>>>  }
>>>
>>> -static int create_huge_pmd(struct vm_fault *vmf)
>>> +static inline int create_huge_pmd(struct vm_fault *vmf)
>>>  {
>>
>> This seems fragile, what if the kernel decides to ignore the inline
>> hint? If it must be inlined to avoid compile errors then it should be
>> __always_inline, right?
>
> With gcc-4, "inline" is already #define'd to
> #define inline inline           __attribute__((always_inline,unused)) notrace

Ah, ok.

Acked-by: Dan Williams <dan.j.williams@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ