All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Zhang Jianhua <chris.zjh@huawei.com>
Cc: will@kernel.org, mark.rutland@arm.com, ryan.roberts@arm.com,
	joey.gouly@arm.com, ardb@kernel.org, anshuman.khandual@arm.com,
	bhe@redhat.com, thunder.leizhen@huawei.com, broonie@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next v3] arm64: fix build warning for ARM64_MEMSTART_SHIFT
Date: Thu, 3 Aug 2023 18:06:06 +0100	[thread overview]
Message-ID: <ZMvefmB6unOE+OPB@arm.com> (raw)
In-Reply-To: <20230725202404.3470111-1-chris.zjh@huawei.com>

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@huawei.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@arm.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Zhang Jianhua <chris.zjh@huawei.com>
Cc: will@kernel.org, mark.rutland@arm.com, ryan.roberts@arm.com,
	joey.gouly@arm.com, ardb@kernel.org, anshuman.khandual@arm.com,
	bhe@redhat.com, thunder.leizhen@huawei.com, broonie@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next v3] arm64: fix build warning for ARM64_MEMSTART_SHIFT
Date: Thu, 3 Aug 2023 18:06:06 +0100	[thread overview]
Message-ID: <ZMvefmB6unOE+OPB@arm.com> (raw)
In-Reply-To: <20230725202404.3470111-1-chris.zjh@huawei.com>

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@huawei.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@arm.com>

  reply	other threads:[~2023-08-03 17:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 20:24 [PATCH -next v3] arm64: fix build warning for ARM64_MEMSTART_SHIFT Zhang Jianhua
2023-08-03 17:06 ` Catalin Marinas [this message]
2023-08-03 17:06   ` Catalin Marinas
2023-08-04  6:24   ` Anshuman Khandual
2023-08-04  6:24     ` Anshuman Khandual
2023-08-04  6:39     ` zhangjianhua (E)
2023-08-04  6:39       ` zhangjianhua (E)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZMvefmB6unOE+OPB@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=ardb@kernel.org \
    --cc=bhe@redhat.com \
    --cc=broonie@kernel.org \
    --cc=chris.zjh@huawei.com \
    --cc=joey.gouly@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ryan.roberts@arm.com \
    --cc=thunder.leizhen@huawei.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.