From: Will Deacon <will@kernel.org>
To: Sami Tolvanen <samitolvanen@google.com>
Cc: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Ard Biesheuvel <ardb@kernel.org>,
Kees Cook <keescook@chromium.org>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: Don't use cbz/adr with external symbols
Date: Mon, 8 Mar 2021 14:38:16 +0000 [thread overview]
Message-ID: <20210308143815.GA26312@willie-the-truck> (raw)
In-Reply-To: <20210305202124.3768527-1-samitolvanen@google.com>
On Fri, Mar 05, 2021 at 12:21:24PM -0800, Sami Tolvanen wrote:
> allmodconfig + CONFIG_LTO_CLANG_THIN=y fails to build due to following
> linker errors:
>
> ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21CC):
> relocation R_AARCH64_CONDBR19 out of range: 2031220 is not in
> [-1048576, 1048575]; references hyp_panic
> >>> defined in vmlinux.o
>
> ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21E0):
> relocation R_AARCH64_ADR_PREL_LO21 out of range: 2031200 is not in
> [-1048576, 1048575]; references hyp_panic
> >>> defined in vmlinux.o
>
> This is because with LTO, the compiler ends up placing hyp_panic()
> more than 1MB away from __guest_enter(). Use an unconditional branch
> and adr_l instead to fix the issue.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1317
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Suggested-by: Marc Zyngier <maz@kernel.org>
> Suggested-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> ---
> arch/arm64/kvm/hyp/entry.S | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Acked-by: Will Deacon <will@kernel.org>
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: Sami Tolvanen <samitolvanen@google.com>
Cc: Kees Cook <keescook@chromium.org>, Marc Zyngier <maz@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
Nathan Chancellor <nathan@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH] KVM: arm64: Don't use cbz/adr with external symbols
Date: Mon, 8 Mar 2021 14:38:16 +0000 [thread overview]
Message-ID: <20210308143815.GA26312@willie-the-truck> (raw)
In-Reply-To: <20210305202124.3768527-1-samitolvanen@google.com>
On Fri, Mar 05, 2021 at 12:21:24PM -0800, Sami Tolvanen wrote:
> allmodconfig + CONFIG_LTO_CLANG_THIN=y fails to build due to following
> linker errors:
>
> ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21CC):
> relocation R_AARCH64_CONDBR19 out of range: 2031220 is not in
> [-1048576, 1048575]; references hyp_panic
> >>> defined in vmlinux.o
>
> ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21E0):
> relocation R_AARCH64_ADR_PREL_LO21 out of range: 2031200 is not in
> [-1048576, 1048575]; references hyp_panic
> >>> defined in vmlinux.o
>
> This is because with LTO, the compiler ends up placing hyp_panic()
> more than 1MB away from __guest_enter(). Use an unconditional branch
> and adr_l instead to fix the issue.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1317
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Suggested-by: Marc Zyngier <maz@kernel.org>
> Suggested-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> ---
> arch/arm64/kvm/hyp/entry.S | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Acked-by: Will Deacon <will@kernel.org>
Will
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: Sami Tolvanen <samitolvanen@google.com>
Cc: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Ard Biesheuvel <ardb@kernel.org>,
Kees Cook <keescook@chromium.org>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: Don't use cbz/adr with external symbols
Date: Mon, 8 Mar 2021 14:38:16 +0000 [thread overview]
Message-ID: <20210308143815.GA26312@willie-the-truck> (raw)
In-Reply-To: <20210305202124.3768527-1-samitolvanen@google.com>
On Fri, Mar 05, 2021 at 12:21:24PM -0800, Sami Tolvanen wrote:
> allmodconfig + CONFIG_LTO_CLANG_THIN=y fails to build due to following
> linker errors:
>
> ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21CC):
> relocation R_AARCH64_CONDBR19 out of range: 2031220 is not in
> [-1048576, 1048575]; references hyp_panic
> >>> defined in vmlinux.o
>
> ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21E0):
> relocation R_AARCH64_ADR_PREL_LO21 out of range: 2031200 is not in
> [-1048576, 1048575]; references hyp_panic
> >>> defined in vmlinux.o
>
> This is because with LTO, the compiler ends up placing hyp_panic()
> more than 1MB away from __guest_enter(). Use an unconditional branch
> and adr_l instead to fix the issue.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1317
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Suggested-by: Marc Zyngier <maz@kernel.org>
> Suggested-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> ---
> arch/arm64/kvm/hyp/entry.S | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Acked-by: Will Deacon <will@kernel.org>
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-03-08 14:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 20:21 [PATCH] KVM: arm64: Don't use cbz/adr with external symbols Sami Tolvanen
2021-03-05 20:21 ` Sami Tolvanen
2021-03-05 20:21 ` Sami Tolvanen
2021-03-05 20:22 ` Kees Cook
2021-03-05 20:22 ` Kees Cook
2021-03-05 20:22 ` Kees Cook
2021-03-07 4:35 ` Nathan Chancellor
2021-03-07 4:35 ` Nathan Chancellor
2021-03-07 4:35 ` Nathan Chancellor
2021-03-08 14:38 ` Will Deacon [this message]
2021-03-08 14:38 ` Will Deacon
2021-03-08 14:38 ` Will Deacon
2021-03-09 8:49 ` Marc Zyngier
2021-03-09 8:49 ` Marc Zyngier
2021-03-09 8:49 ` Marc Zyngier
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=20210308143815.GA26312@willie-the-truck \
--to=will@kernel.org \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=keescook@chromium.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=samitolvanen@google.com \
--cc=suzuki.poulose@arm.com \
/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.