From: Jon Hunter <jonathanh@nvidia.com>
To: Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org
Cc: ardb@kernel.org, catalin.marinas@arm.com, james.morse@arm.com,
joey.gouly@arm.com, maz@kernel.org, will@kernel.org,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v2 6/8] arm64: alternatives: have callbacks take a cap
Date: Tue, 27 Sep 2022 10:31:39 +0100 [thread overview]
Message-ID: <3cecc3a5-30b0-f0bd-c3de-9e09bd21909b@nvidia.com> (raw)
In-Reply-To: <20220912162210.3626215-7-mark.rutland@arm.com>
Hi Mark,
On 12/09/2022 17:22, Mark Rutland wrote:
> Today, callback alternatives are special-cased within
> __apply_alternatives(), and are applied alongside patching for system
> capabilities as ARM64_NCAPS is not part of the boot_capabilities feature
> mask.
>
> This special-casing is less than ideal. Giving special meaning to
> ARM64_NCAPS for this requires some structures and loops to use
> ARM64_NCAPS + 1 (AKA ARM64_NPATCHABLE), while others use ARM64_NCAPS.
> It's also not immediately clear callback alternatives are only applied
> when applying alternatives for system-wide features.
>
> To make this a bit clearer, changes the way that callback alternatives
> are identified to remove the special-casing of ARM64_NCAPS, and to allow
> callback alternatives to be associated with a cpucap as with all other
> alternatives.
>
> New cpucaps, ARM64_ALWAYS_BOOT and ARM64_ALWAYS_SYSTEM are added which
> are always detected alongside boot cpu capabilities and system
> capabilities respectively. All existing callback alternatives are made
> to use ARM64_ALWAYS_SYSTEM, and so will be patched at the same point
> during the boot flow as before.
>
> Subsequent patches will make more use of these new cpucaps.
>
> There should be no functional change as a result of this patch.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Joey Gouly <joey.gouly@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Will Deacon <will@kernel.org>
> ---
> arch/arm64/include/asm/alternative-macros.h | 18 +++++++++-----
> arch/arm64/include/asm/assembler.h | 10 ++++----
> arch/arm64/include/asm/cpufeature.h | 4 +---
> arch/arm64/include/asm/kvm_mmu.h | 5 ++--
> arch/arm64/kernel/alternative.c | 26 +++++++++++----------
> arch/arm64/kernel/cpufeature.c | 19 +++++++++++++--
> arch/arm64/kernel/entry.S | 8 +++----
> arch/arm64/kvm/hyp/hyp-entry.S | 4 ++--
> arch/arm64/tools/cpucaps | 2 ++
> 9 files changed, 60 insertions(+), 36 deletions(-)
>
> diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h
> index 7e157ab6cd505..189c31be163ce 100644
> --- a/arch/arm64/include/asm/alternative-macros.h
> +++ b/arch/arm64/include/asm/alternative-macros.h
> @@ -2,10 +2,16 @@
> #ifndef __ASM_ALTERNATIVE_MACROS_H
> #define __ASM_ALTERNATIVE_MACROS_H
>
> +#include <linux/const.h>
> +
> #include <asm/cpucaps.h>
> #include <asm/insn-def.h>
>
> -#define ARM64_CB_PATCH ARM64_NCAPS
> +#define ARM64_CB_BIT (UL(1) << 15)
> +
> +#if ARM64_NCAPS >= ARM64_CB_BIT
> +#error "cpucaps have overflown ARM64_CB_BIT"
> +#endif
Some of our builders are failing and bisect is pointing to this commit.
Looks like they don't like the above and I see the following errors ...
CC arch/arm64/kvm/hyp/vhe/debug-sr.o
/tmp/ccY3kbki.s: Assembler messages:
/tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1600: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1600: Error: junk at end of line, first unrecognized
character is `L'
/tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1723: Error: found 'L', expected: ')'
/tmp/ccY3kbki.s:1723: Error: junk at end of line, first unrecognized
character is `L'
scripts/Makefile.build:249: recipe for target
'arch/arm64/kvm/hyp/vhe/debug-sr.o' failed
Seems that it does not like the 'UL' macro for some reason. Any thoughts?
Thanks
Jon
--
nvpublic
next parent reply other threads:[~2022-09-27 9:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220912162210.3626215-1-mark.rutland@arm.com>
[not found] ` <20220912162210.3626215-7-mark.rutland@arm.com>
2022-09-27 9:31 ` Jon Hunter [this message]
2022-09-29 9:53 ` [PATCH v2 6/8] arm64: alternatives: have callbacks take a cap Jon Hunter
2022-09-29 10:10 ` Ard Biesheuvel
2022-09-29 10:48 ` Jon Hunter
2022-09-29 10:47 ` Mark Rutland
2022-09-29 11:01 ` Jon Hunter
2022-09-29 11:09 ` Mark Rutland
2022-09-29 13:37 ` Jon Hunter
2022-09-29 14:38 ` Mark Rutland
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=3cecc3a5-30b0-f0bd-c3de-9e09bd21909b@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--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