* [PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency
@ 2022-06-13 21:01 Mark Brown
2022-06-23 17:47 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-06-13 21:01 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon; +Cc: linux-arm-kernel, Mark Brown
Currently when restoring signal state we check to see if SVE is supported
in restore_sigframe() but check to see if SVE is supported inside
restore_sve_fpsimd_context(). This makes no real difference since SVE is
always supported in systems with SME but looks a bit untidy and makes
things slightly harder to follow, move the SVE check next to the SME one
in restore_sve_fpsimd_context().
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm64/kernel/signal.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index 23dd4c3bcfed..0d5a9eb43085 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -281,6 +281,9 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
vl = task_get_sme_vl(current);
} else {
+ if (!system_supports_sve())
+ return -EINVAL;
+
vl = task_get_sve_vl(current);
}
@@ -652,14 +655,10 @@ static int restore_sigframe(struct pt_regs *regs,
if (!user.fpsimd)
return -EINVAL;
- if (user.sve) {
- if (!system_supports_sve())
- return -EINVAL;
-
+ if (user.sve)
err = restore_sve_fpsimd_context(&user);
- } else {
+ else
err = restore_fpsimd_context(user.fpsimd);
- }
}
if (err == 0 && system_supports_sme() && user.za)
--
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] 5+ messages in thread
* Re: [PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency
2022-06-13 21:01 [PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency Mark Brown
@ 2022-06-23 17:47 ` Will Deacon
2022-06-24 13:28 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2022-06-23 17:47 UTC (permalink / raw)
To: Mark Brown; +Cc: Catalin Marinas, linux-arm-kernel
On Mon, Jun 13, 2022 at 10:01:33PM +0100, Mark Brown wrote:
> Currently when restoring signal state we check to see if SVE is supported
> in restore_sigframe() but check to see if SVE is supported inside
> restore_sve_fpsimd_context(). This makes no real difference since SVE is
> always supported in systems with SME but looks a bit untidy and makes
> things slightly harder to follow, move the SVE check next to the SME one
> in restore_sve_fpsimd_context().
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> arch/arm64/kernel/signal.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
> index 23dd4c3bcfed..0d5a9eb43085 100644
> --- a/arch/arm64/kernel/signal.c
> +++ b/arch/arm64/kernel/signal.c
> @@ -281,6 +281,9 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
>
> vl = task_get_sme_vl(current);
> } else {
> + if (!system_supports_sve())
> + return -EINVAL;
> +
> vl = task_get_sve_vl(current);
> }
>
> @@ -652,14 +655,10 @@ static int restore_sigframe(struct pt_regs *regs,
> if (!user.fpsimd)
> return -EINVAL;
>
> - if (user.sve) {
> - if (!system_supports_sve())
> - return -EINVAL;
> -
> + if (user.sve)
> err = restore_sve_fpsimd_context(&user);
This breaks the allnoconfig build for me:
ld.lld: error: undefined symbol: restore_sve_fpsimd_context
>>> referenced by signal.c
>>> kernel/signal.o:(__arm64_sys_rt_sigreturn) in archive arch/arm64/built-in.a
make: *** [Makefile:1164: vmlinux] Error 1
Will
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency
2022-06-23 17:47 ` Will Deacon
@ 2022-06-24 13:28 ` Mark Brown
2022-06-24 14:10 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-06-24 13:28 UTC (permalink / raw)
To: Will Deacon; +Cc: Catalin Marinas, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 624 bytes --]
On Thu, Jun 23, 2022 at 06:47:38PM +0100, Will Deacon wrote:
> This breaks the allnoconfig build for me:
> ld.lld: error: undefined symbol: restore_sve_fpsimd_context
> >>> referenced by signal.c
> >>> kernel/signal.o:(__arm64_sys_rt_sigreturn) in archive arch/arm64/built-in.a
> make: *** [Makefile:1164: vmlinux] Error 1
I can't reproduce that here - could you confirm exactly what tree you
applied against and what toolchain you're using? I'm normally using
clang 15 at the minute, 14 seems fine too, and applied against both
-next and v5.19-rc3 all of which are building an allnoconfig happily for
me.
[-- 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] 5+ messages in thread
* Re: [PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency
2022-06-24 13:28 ` Mark Brown
@ 2022-06-24 14:10 ` Will Deacon
2022-06-24 14:19 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2022-06-24 14:10 UTC (permalink / raw)
To: Mark Brown; +Cc: Catalin Marinas, linux-arm-kernel
On Fri, Jun 24, 2022 at 02:28:07PM +0100, Mark Brown wrote:
> On Thu, Jun 23, 2022 at 06:47:38PM +0100, Will Deacon wrote:
>
> > This breaks the allnoconfig build for me:
>
> > ld.lld: error: undefined symbol: restore_sve_fpsimd_context
> > >>> referenced by signal.c
> > >>> kernel/signal.o:(__arm64_sys_rt_sigreturn) in archive arch/arm64/built-in.a
> > make: *** [Makefile:1164: vmlinux] Error 1
>
> I can't reproduce that here - could you confirm exactly what tree you
> applied against and what toolchain you're using? I'm normally using
> clang 15 at the minute, 14 seems fine too, and applied against both
> -next and v5.19-rc3 all of which are building an allnoconfig happily for
> me.
I can reproduce the issue with just this patch applied on top of -rc3.
I'll give your v2 a try, bu FWIW I'm using clang 12.0.6 and building
using:
$ make LLVM=1 ARCH=arm64 mrproper allnoconfig
$ make LLVM=1 ARCH=arm64 -j100
Will
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency
2022-06-24 14:10 ` Will Deacon
@ 2022-06-24 14:19 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-06-24 14:19 UTC (permalink / raw)
To: Will Deacon; +Cc: Catalin Marinas, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 760 bytes --]
On Fri, Jun 24, 2022 at 03:10:46PM +0100, Will Deacon wrote:
> On Fri, Jun 24, 2022 at 02:28:07PM +0100, Mark Brown wrote:
> > I can't reproduce that here - could you confirm exactly what tree you
> > applied against and what toolchain you're using? I'm normally using
> > clang 15 at the minute, 14 seems fine too, and applied against both
> > -next and v5.19-rc3 all of which are building an allnoconfig happily for
> > me.
> I can reproduce the issue with just this patch applied on top of -rc3.
> I'll give your v2 a try, bu FWIW I'm using clang 12.0.6 and building
> using:
Ah, clang 12 is pretty old by clang standards and that .6 suggests it's
probably some Android version. I can reproduce with upstream clang 12,
my fix does seem to work for me.
[-- 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] 5+ messages in thread
end of thread, other threads:[~2022-06-24 14:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13 21:01 [PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency Mark Brown
2022-06-23 17:47 ` Will Deacon
2022-06-24 13:28 ` Mark Brown
2022-06-24 14:10 ` Will Deacon
2022-06-24 14:19 ` Mark Brown
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.