diff mbox

arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419

Message ID 1444325555-32108-1-git-send-email-will.deacon@arm.com
State Accepted
Commit b6dd8e0719c0d2d01429639a11b7bc2677de240c
Headers show

Commit Message

Will Deacon Oct. 8, 2015, 5:32 p.m. UTC
Commit df057cc7b4fa ("arm64: errata: add module build workaround for
erratum #843419") sets CFLAGS_MODULE to ensure that the large memory
model is used by the compiler when building kernel modules.

However, CFLAGS_MODULE is an environment variable and intended to be
overridden on the command line, which appears to be the case with the
Ubuntu kernel packaging system, so use KBUILD_CFLAGS_MODULE instead.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reported-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Catalin Marinas Oct. 8, 2015, 5:47 p.m. UTC | #1
On Thu, Oct 08, 2015 at 06:32:35PM +0100, Will Deacon wrote:
> Commit df057cc7b4fa ("arm64: errata: add module build workaround for
> erratum #843419") sets CFLAGS_MODULE to ensure that the large memory
> model is used by the compiler when building kernel modules.
> 
> However, CFLAGS_MODULE is an environment variable and intended to be
> overridden on the command line, which appears to be the case with the
> Ubuntu kernel packaging system, so use KBUILD_CFLAGS_MODULE instead.
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Reported-by: Dann Frazier <dann.frazier@canonical.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Just you case you forgot, I think you also need:

Fixes: df057cc7b4fa ("arm64: errata: add module build workaround for erratum #843419")
Cc: <stable@vger.kernel.org>
Will Deacon Oct. 8, 2015, 5:49 p.m. UTC | #2
On Thu, Oct 08, 2015 at 06:47:50PM +0100, Catalin Marinas wrote:
> On Thu, Oct 08, 2015 at 06:32:35PM +0100, Will Deacon wrote:
> > Commit df057cc7b4fa ("arm64: errata: add module build workaround for
> > erratum #843419") sets CFLAGS_MODULE to ensure that the large memory
> > model is used by the compiler when building kernel modules.
> > 
> > However, CFLAGS_MODULE is an environment variable and intended to be
> > overridden on the command line, which appears to be the case with the
> > Ubuntu kernel packaging system, so use KBUILD_CFLAGS_MODULE instead.
> > 
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Reported-by: Dann Frazier <dann.frazier@canonical.com>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
> 
> Just you case you forgot, I think you also need:
> 
> Fixes: df057cc7b4fa ("arm64: errata: add module build workaround for erratum #843419")
> Cc: <stable@vger.kernel.org>

Yup, got those suckers locally :)

Will
dann frazier Oct. 8, 2015, 7:44 p.m. UTC | #3
On Thu, Oct 8, 2015 at 10:32 AM, Will Deacon <will.deacon@arm.com> wrote:
> Commit df057cc7b4fa ("arm64: errata: add module build workaround for
> erratum #843419") sets CFLAGS_MODULE to ensure that the large memory
> model is used by the compiler when building kernel modules.
>
> However, CFLAGS_MODULE is an environment variable and intended to be
> overridden on the command line, which appears to be the case with the
> Ubuntu kernel packaging system, so use KBUILD_CFLAGS_MODULE instead.

Oh - didn't notice you'd beat me to it :)

> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Reported-by: Dann Frazier <dann.frazier@canonical.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>

fwiw, I did a full Ubuntu build w/ this and can confirm modules load again.

Tested-by: dann frazier <dann.frazier@canonical.com>

> ---
>  arch/arm64/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index f9914d7c1bb0..d10b5d483022 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -42,7 +42,7 @@ endif
>  CHECKFLAGS     += -D__aarch64__
>
>  ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
> -CFLAGS_MODULE  += -mcmodel=large
> +KBUILD_CFLAGS_MODULE   += -mcmodel=large
>  endif
>
>  # Default value
> --
> 2.1.4
>
diff mbox

Patch

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f9914d7c1bb0..d10b5d483022 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -42,7 +42,7 @@  endif
 CHECKFLAGS	+= -D__aarch64__
 
 ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
-CFLAGS_MODULE	+= -mcmodel=large
+KBUILD_CFLAGS_MODULE	+= -mcmodel=large
 endif
 
 # Default value