* [PATCH v1] kselftest/arm64: Use preferred form for predicate load/stores
@ 2022-11-17 11:41 Mark Brown
2022-11-17 11:52 ` Mark Rutland
2022-11-18 19:40 ` Will Deacon
0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2022-11-17 11:41 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Shuah Khan
Cc: linux-arm-kernel, linux-kselftest, Mark Brown
The preferred form of the str/ldr for predicate registers with an immediate
of zero is to omit the zero, and the clang built in assembler rejects the
zero immediate. Drop the immediate.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
tools/testing/selftests/arm64/abi/syscall-abi-asm.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/arm64/abi/syscall-abi-asm.S b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S
index b523c21c2278..acd5e9f3bc0b 100644
--- a/tools/testing/selftests/arm64/abi/syscall-abi-asm.S
+++ b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S
@@ -153,7 +153,7 @@ do_syscall:
// Only set a non-zero FFR, test patterns must be zero since the
// syscall should clear it - this lets us handle FA64.
ldr x2, =ffr_in
- ldr p0, [x2, #0]
+ ldr p0, [x2]
ldr x2, [x2, #0]
cbz x2, 2f
wrffr p0.b
@@ -298,7 +298,7 @@ do_syscall:
cbz x2, 1f
ldr x2, =ffr_out
rdffr p0.b
- str p0, [x2, #0]
+ str p0, [x2]
1:
// Restore callee saved registers x19-x30
base-commit: 30a0b95b1335e12efef89dd78518ed3e4a71a763
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kselftest/arm64: Use preferred form for predicate load/stores
2022-11-17 11:41 [PATCH v1] kselftest/arm64: Use preferred form for predicate load/stores Mark Brown
@ 2022-11-17 11:52 ` Mark Rutland
2022-11-17 12:52 ` Mark Brown
2022-11-18 19:40 ` Will Deacon
1 sibling, 1 reply; 4+ messages in thread
From: Mark Rutland @ 2022-11-17 11:52 UTC (permalink / raw)
To: Mark Brown
Cc: Catalin Marinas, Will Deacon, Shuah Khan, linux-arm-kernel,
linux-kselftest
On Thu, Nov 17, 2022 at 11:41:30AM +0000, Mark Brown wrote:
> The preferred form of the str/ldr for predicate registers with an immediate
> of zero is to omit the zero, and the clang built in assembler rejects the
> zero immediate. Drop the immediate.
Rejecting that outright seems like a bug in clang, given there are legitimate
reasons to write code that way (e.g. using asm-offsets style definitions); has
that been reported so that it can be fixed?
Regardless, the patch itself looks fine, and I don't mean to block this as-is!
Thanks,
Mark.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> tools/testing/selftests/arm64/abi/syscall-abi-asm.S | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/arm64/abi/syscall-abi-asm.S b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S
> index b523c21c2278..acd5e9f3bc0b 100644
> --- a/tools/testing/selftests/arm64/abi/syscall-abi-asm.S
> +++ b/tools/testing/selftests/arm64/abi/syscall-abi-asm.S
> @@ -153,7 +153,7 @@ do_syscall:
> // Only set a non-zero FFR, test patterns must be zero since the
> // syscall should clear it - this lets us handle FA64.
> ldr x2, =ffr_in
> - ldr p0, [x2, #0]
> + ldr p0, [x2]
> ldr x2, [x2, #0]
> cbz x2, 2f
> wrffr p0.b
> @@ -298,7 +298,7 @@ do_syscall:
> cbz x2, 1f
> ldr x2, =ffr_out
> rdffr p0.b
> - str p0, [x2, #0]
> + str p0, [x2]
> 1:
>
> // Restore callee saved registers x19-x30
>
> base-commit: 30a0b95b1335e12efef89dd78518ed3e4a71a763
> --
> 2.30.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kselftest/arm64: Use preferred form for predicate load/stores
2022-11-17 11:52 ` Mark Rutland
@ 2022-11-17 12:52 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-11-17 12:52 UTC (permalink / raw)
To: Mark Rutland
Cc: Catalin Marinas, Will Deacon, Shuah Khan, linux-arm-kernel,
linux-kselftest
[-- Attachment #1.1: Type: text/plain, Size: 567 bytes --]
On Thu, Nov 17, 2022 at 11:52:22AM +0000, Mark Rutland wrote:
> On Thu, Nov 17, 2022 at 11:41:30AM +0000, Mark Brown wrote:
> > The preferred form of the str/ldr for predicate registers with an immediate
> > of zero is to omit the zero, and the clang built in assembler rejects the
> > zero immediate. Drop the immediate.
> Rejecting that outright seems like a bug in clang, given there are legitimate
> reasons to write code that way (e.g. using asm-offsets style definitions); has
> that been reported so that it can be fixed?
I believe it's been reported, yes.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kselftest/arm64: Use preferred form for predicate load/stores
2022-11-17 11:41 [PATCH v1] kselftest/arm64: Use preferred form for predicate load/stores Mark Brown
2022-11-17 11:52 ` Mark Rutland
@ 2022-11-18 19:40 ` Will Deacon
1 sibling, 0 replies; 4+ messages in thread
From: Will Deacon @ 2022-11-18 19:40 UTC (permalink / raw)
To: Mark Brown, Shuah Khan, Catalin Marinas
Cc: kernel-team, Will Deacon, linux-arm-kernel, linux-kselftest
On Thu, 17 Nov 2022 11:41:30 +0000, Mark Brown wrote:
> The preferred form of the str/ldr for predicate registers with an immediate
> of zero is to omit the zero, and the clang built in assembler rejects the
> zero immediate. Drop the immediate.
>
>
Applied to arm64 (for-next/selftests), thanks!
[1/1] kselftest/arm64: Use preferred form for predicate load/stores
https://git.kernel.org/arm64/c/284d2b44a8cc
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-18 19:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-17 11:41 [PATCH v1] kselftest/arm64: Use preferred form for predicate load/stores Mark Brown
2022-11-17 11:52 ` Mark Rutland
2022-11-17 12:52 ` Mark Brown
2022-11-18 19:40 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox