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]
Message-ID: <ZMvefmB6unOE+OPB@arm.com>
Date:   Thu, 3 Aug 2023 18:06:06 +0100
From:   Catalin Marinas <catalin.marinas@....com>
To:     Zhang Jianhua <chris.zjh@...wei.com>
Cc:     will@...nel.org, mark.rutland@....com, ryan.roberts@....com,
        joey.gouly@....com, ardb@...nel.org, anshuman.khandual@....com,
        bhe@...hat.com, thunder.leizhen@...wei.com, broonie@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next v3] arm64: fix build warning for
 ARM64_MEMSTART_SHIFT

On Tue, Jul 25, 2023 at 08:24:04PM +0000, Zhang Jianhua wrote:
> When building with W=1, the following warning occurs.
> 
> arch/arm64/include/asm/kernel-pgtable.h:129:41: error: "PUD_SHIFT" is not defined, evaluates to 0 [-Werror=undef]
>   129 | #define ARM64_MEMSTART_SHIFT            PUD_SHIFT
>       |                                         ^~~~~~~~~
> arch/arm64/include/asm/kernel-pgtable.h:142:5: note: in expansion of macro ‘ARM64_MEMSTART_SHIFT’
>   142 | #if ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS
>       |     ^~~~~~~~~~~~~~~~~~~~
> 
> The reason is that PUD_SHIFT isn't defined if CONFIG_PGTABLE_LEVELS == 3
> and CONFIG_VA_BITS == 39.

The correct description is that the generic PUD_SHIFT isn't defined for
asm files, we still have it defined for C files (there's an #ifndef
__ASSEMBLY__ guard).

> Now move the macro ARM64_MEMSTART_SHIFT and
> ARM64_MEMSTART_ALIGN to arch/arm64/mm/init.c where it is used to avoid
> this issue, and also there is no other place to call these two macro.
> 
> Signed-off-by: Zhang Jianhua <chris.zjh@...wei.com>

This fix works for me. I'll leave it to Will for 6.6 as apart from the
warning with W=1, there's no other issue (ARM64_MEMSTART_* are not used
in any asm files).

Reviewed-by: Catalin Marinas <catalin.marinas@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ