linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Denis Nikitin <denik@chromium.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Manoj Gupta <manojgupta@google.com>,
	David Brazdil <dbrazdil@google.com>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: nvhe: Disable profile optimization
Date: Tue, 20 Sep 2022 10:33:56 +0100	[thread overview]
Message-ID: <877d1yl797.wl-maz@kernel.org> (raw)
In-Reply-To: <20220920082005.2459826-1-denik@chromium.org>

Hi Denis,

On Tue, 20 Sep 2022 09:20:05 +0100,
Denis Nikitin <denik@chromium.org> wrote:
> 
> Kernel build with -fprofile-sample-use raises the following failure:
> 
> error: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.tmp.o: Unexpected SHT_REL
> section ".rel.llvm.call-graph-profile"

How is this flag provided? I don't see any occurrence of it in the
kernel so far.

> 
> SHT_REL is generated by the latest lld, see
> https://reviews.llvm.org/rGca3bdb57fa1ac98b711a735de048c12b5fdd8086.

Is this part of a released toolchain? If so, can you spell out the
first version where this occurs?

> Disable profile optimization in kvm/nvhe to fix the build with
> AutoFDO.

It'd be good to at least mention how AutoFDO and -fprofile-sample-use
relate to each other.

> 
> Signed-off-by: Denis Nikitin <denik@chromium.org>
> ---
>  arch/arm64/kvm/hyp/nvhe/Makefile | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile
> index b5c5119c7396..6a6188374a52 100644
> --- a/arch/arm64/kvm/hyp/nvhe/Makefile
> +++ b/arch/arm64/kvm/hyp/nvhe/Makefile
> @@ -89,6 +89,9 @@ quiet_cmd_hypcopy = HYPCOPY $@
>  # Remove ftrace, Shadow Call Stack, and CFI CFLAGS.
>  # This is equivalent to the 'notrace', '__noscs', and '__nocfi' annotations.
>  KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_CFI), $(KBUILD_CFLAGS))
> +# Profile optimization creates SHT_REL section '.llvm.call-graph-profile' for
> +# the hot code. SHT_REL is currently not supported by the KVM tools.

'KVM tools' seems vague. Maybe call out the actual helper that
processes the relocations?

> +KBUILD_CFLAGS += $(call cc-option,-fno-profile-sample-use,-fno-profile-use)

Why adding these options instead of filtering out the offending option
as it is done just above?

Also, is this the only place the kernel fails to compile? The EFI stub
does similar things AFAIR, and could potentially fail the same way.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

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

  reply	other threads:[~2022-09-20  9:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20  8:20 [PATCH] KVM: arm64: nvhe: Disable profile optimization Denis Nikitin
2022-09-20  9:33 ` Marc Zyngier [this message]
2022-09-21  0:08   ` Denis Nikitin
2022-09-21  6:02     ` Denis Nikitin
2022-09-21 17:25       ` Marc Zyngier
2022-09-22  5:31 ` [PATCH v2] KVM: arm64: nvhe: Fix build with " Denis Nikitin
2022-09-22 10:37   ` Marc Zyngier
2022-09-23  5:01     ` Denis Nikitin
     [not found]       ` <CAH=Qcsi3aQ51AsAE0WmAH9VmpqjOaQQt=ru5Nav4+d8F3fMPwQ@mail.gmail.com>
2022-09-29 16:13         ` Denis Nikitin
2022-10-06 16:28           ` Denis Nikitin
2022-10-09  2:20             ` Marc Zyngier
2022-10-11  2:15               ` Denis Nikitin
2022-10-13 11:09                 ` Marc Zyngier
2022-10-13 19:02                   ` Denis Nikitin

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=877d1yl797.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alexandru.elisei@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=dbrazdil@google.com \
    --cc=denik@chromium.org \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manojgupta@google.com \
    --cc=ndesaulniers@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).