Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCHv3 4/4] ARM: kprobes: make more tests conditional

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


arnd at arndb

Aug 22, 2012, 11:41 AM

Post #1 of 7 (122 views)
Permalink
[PATCHv3 4/4] ARM: kprobes: make more tests conditional

On Wednesday 22 August 2012, Nicolas Pitre wrote:
> On Wed, 22 Aug 2012, Arnd Bergmann wrote:
> > >
> > > The ldrex/strex instructions are available on ARMv6. It's only the d
> > > variants (strexd/ldrexd) which are only available from ARMv6k.
> >
> > Ok. How is the version below then? I haven't tested this one yet.
>
> In fact, I think the b variants are ARMv6k+ as well. Only the plain
> (non b non d) variants are available on ARMv6.

Ok, third attempt then. This leaves ldrex for ARMv6 but marks
{st,ld}rex{b,h,d} as V6K specific (which includes ARMv7).

Arnd

8<-----
From 6eab418c61c18393006f30d189e2f28d6e403040 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd [at] arndb>
Date: Thu, 16 Aug 2012 07:49:31 +0000
Subject: [PATCH] ARM: kprobes: make more tests conditional

The mls instruction is not available in ARMv6K or below, so we
should make the test conditional on at least ARMv7. ldrexd/strexd
are available in ARMv6K or ARMv7, which we can test by checking
the CONFIG_CPU_32v6K symbol. Just testing for ARMv6 is not enough.

/tmp/ccuMTZ8D.s: Assembler messages:
/tmp/ccuMTZ8D.s:22188: Error: selected processor does not support ARM mode `mls r0,r1,r2,r3'
/tmp/ccuMTZ8D.s:22222: Error: selected processor does not support ARM mode `mlshi r7,r8,r9,r10'
/tmp/ccuMTZ8D.s:22252: Error: selected processor does not support ARM mode `mls lr,r1,r2,r13'

Signed-off-by: Arnd Bergmann <arnd [at] arndb>
Cc: Jon Medhurst <tixy [at] yxit>
Cc: Russell King <rmk+kernel [at] arm>
Cc: Nicolas Pitre <nicolas.pitre [at] linaro>
Cc: Leif Lindholm <leif.lindholm [at] arm>
---
arch/arm/kernel/kprobes-test-arm.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
index 38c1a3b..58dd6c3 100644
--- a/arch/arm/kernel/kprobes-test-arm.c
+++ b/arch/arm/kernel/kprobes-test-arm.c
@@ -367,9 +367,11 @@ void kprobe_arm_test_cases(void)
TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")

+#if __LINUX_ARM_ARCH__ >= 7
TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
+#endif
TEST_UNSUPPORTED(".word 0xe06f3291 @ mls pc, r1, r2, r3")
TEST_UNSUPPORTED(".word 0xe060329f @ mls r0, pc, r2, r3")
TEST_UNSUPPORTED(".word 0xe0603f91 @ mls r0, r1, pc, r3")
@@ -456,6 +458,7 @@ void kprobe_arm_test_cases(void)
TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */
#if __LINUX_ARM_ARCH__ >= 6
TEST_UNSUPPORTED("ldrex r2, [sp]")
+#ifdef CONFIG_CPU_32v6K
TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
TEST_UNSUPPORTED("strexb r0, r2, [sp]")
@@ -463,6 +466,7 @@ void kprobe_arm_test_cases(void)
TEST_UNSUPPORTED("strexh r0, r2, [sp]")
TEST_UNSUPPORTED("ldrexh r2, [sp]")
#endif
+#endif
TEST_GROUP("Extra load/store instructions")

TEST_RPR( "strh r",0, VAL1,", [r",1, 48,", -r",2, 24,"]")
--
1.7.10



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


nicolas.pitre at linaro

Aug 22, 2012, 12:43 PM

Post #2 of 7 (120 views)
Permalink
Re: [PATCHv3 4/4] ARM: kprobes: make more tests conditional [In reply to]

On Wed, 22 Aug 2012, Arnd Bergmann wrote:

> On Wednesday 22 August 2012, Nicolas Pitre wrote:
> > On Wed, 22 Aug 2012, Arnd Bergmann wrote:
> > > >
> > > > The ldrex/strex instructions are available on ARMv6. It's only the d
> > > > variants (strexd/ldrexd) which are only available from ARMv6k.
> > >
> > > Ok. How is the version below then? I haven't tested this one yet.
> >
> > In fact, I think the b variants are ARMv6k+ as well. Only the plain
> > (non b non d) variants are available on ARMv6.
>
> Ok, third attempt then. This leaves ldrex for ARMv6 but marks
> {st,ld}rex{b,h,d} as V6K specific (which includes ARMv7).
>
> Arnd
>
> 8<-----
> From 6eab418c61c18393006f30d189e2f28d6e403040 Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd [at] arndb>
> Date: Thu, 16 Aug 2012 07:49:31 +0000
> Subject: [PATCH] ARM: kprobes: make more tests conditional
>
> The mls instruction is not available in ARMv6K or below, so we
> should make the test conditional on at least ARMv7. ldrexd/strexd
> are available in ARMv6K or ARMv7, which we can test by checking
> the CONFIG_CPU_32v6K symbol. Just testing for ARMv6 is not enough.
>
> /tmp/ccuMTZ8D.s: Assembler messages:
> /tmp/ccuMTZ8D.s:22188: Error: selected processor does not support ARM mode `mls r0,r1,r2,r3'
> /tmp/ccuMTZ8D.s:22222: Error: selected processor does not support ARM mode `mlshi r7,r8,r9,r10'
> /tmp/ccuMTZ8D.s:22252: Error: selected processor does not support ARM mode `mls lr,r1,r2,r13'
>
> Signed-off-by: Arnd Bergmann <arnd [at] arndb>
> Cc: Jon Medhurst <tixy [at] yxit>
> Cc: Russell King <rmk+kernel [at] arm>
> Cc: Nicolas Pitre <nicolas.pitre [at] linaro>
> Cc: Leif Lindholm <leif.lindholm [at] arm>

Acked-by: Nicolas Pitre <nico [at] linaro>


> ---
> arch/arm/kernel/kprobes-test-arm.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
> index 38c1a3b..58dd6c3 100644
> --- a/arch/arm/kernel/kprobes-test-arm.c
> +++ b/arch/arm/kernel/kprobes-test-arm.c
> @@ -367,9 +367,11 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
> TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
>
> +#if __LINUX_ARM_ARCH__ >= 7
> TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
> TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
> TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
> +#endif
> TEST_UNSUPPORTED(".word 0xe06f3291 @ mls pc, r1, r2, r3")
> TEST_UNSUPPORTED(".word 0xe060329f @ mls r0, pc, r2, r3")
> TEST_UNSUPPORTED(".word 0xe0603f91 @ mls r0, r1, pc, r3")
> @@ -456,6 +458,7 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */
> #if __LINUX_ARM_ARCH__ >= 6
> TEST_UNSUPPORTED("ldrex r2, [sp]")
> +#ifdef CONFIG_CPU_32v6K
> TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
> TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
> TEST_UNSUPPORTED("strexb r0, r2, [sp]")
> @@ -463,6 +466,7 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED("strexh r0, r2, [sp]")
> TEST_UNSUPPORTED("ldrexh r2, [sp]")
> #endif
> +#endif
> TEST_GROUP("Extra load/store instructions")
>
> TEST_RPR( "strh r",0, VAL1,", [r",1, 48,", -r",2, 24,"]")
> --
> 1.7.10
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


tixy at yxit

Aug 22, 2012, 4:51 PM

Post #3 of 7 (116 views)
Permalink
Re: [PATCHv3 4/4] ARM: kprobes: make more tests conditional [In reply to]

On Wed, 2012-08-22 at 18:41 +0000, Arnd Bergmann wrote:
> On Wednesday 22 August 2012, Nicolas Pitre wrote:
> > On Wed, 22 Aug 2012, Arnd Bergmann wrote:
> > > >
> > > > The ldrex/strex instructions are available on ARMv6. It's only the d
> > > > variants (strexd/ldrexd) which are only available from ARMv6k.
> > >
> > > Ok. How is the version below then? I haven't tested this one yet.
> >
> > In fact, I think the b variants are ARMv6k+ as well. Only the plain
> > (non b non d) variants are available on ARMv6.
>
> Ok, third attempt then. This leaves ldrex for ARMv6 but marks
> {st,ld}rex{b,h,d} as V6K specific (which includes ARMv7).

ARMv7 does set CPU_32v6K, because arch/arm/mm/Kconfig has

config CPU_V7
bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
select CPU_32v6K
select CPU_32v7

but this seems more for peripheral reasons not because all the various
CPU configs systematically select the earlier architecture variants,
e.g. CPU_V7 doesn't select CPU_32v6.

So I would have been inclined to test for

#if defined(CONFIG_CPU_32v6K) || (__LINUX_ARM_ARCH__ >= 7)

but as the current patch is functionally correct I'm not going to
suggest a v4 patch :-)

If you do feel so inclined for a v4 however ;-) you could also make the
mls part of the patch tidier by moving the added #endif to instead
terminate the preceding "#if __LINUX_ARM_ARCH__ >= 6", i.e.

@@ -367,8 +367,10 @@ void kprobe_arm_test_cases(void)
TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
+#endif

+#if __LINUX_ARM_ARCH__ >= 7
TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")


this looks funny in patch form, but the resulting source file is more
consistent with other conditional tests.


> Arnd
>
> 8<-----
> From 6eab418c61c18393006f30d189e2f28d6e403040 Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd [at] arndb>
> Date: Thu, 16 Aug 2012 07:49:31 +0000
> Subject: [PATCH] ARM: kprobes: make more tests conditional
>
> The mls instruction is not available in ARMv6K or below, so we
> should make the test conditional on at least ARMv7. ldrexd/strexd
> are available in ARMv6K or ARMv7, which we can test by checking
> the CONFIG_CPU_32v6K symbol. Just testing for ARMv6 is not enough.
>
> /tmp/ccuMTZ8D.s: Assembler messages:
> /tmp/ccuMTZ8D.s:22188: Error: selected processor does not support ARM mode `mls r0,r1,r2,r3'
> /tmp/ccuMTZ8D.s:22222: Error: selected processor does not support ARM mode `mlshi r7,r8,r9,r10'
> /tmp/ccuMTZ8D.s:22252: Error: selected processor does not support ARM mode `mls lr,r1,r2,r13'
>
> Signed-off-by: Arnd Bergmann <arnd [at] arndb>
> Cc: Jon Medhurst <tixy [at] yxit>
> Cc: Russell King <rmk+kernel [at] arm>
> Cc: Nicolas Pitre <nicolas.pitre [at] linaro>
> Cc: Leif Lindholm <leif.lindholm [at] arm>
> ---
> arch/arm/kernel/kprobes-test-arm.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
> index 38c1a3b..58dd6c3 100644
> --- a/arch/arm/kernel/kprobes-test-arm.c
> +++ b/arch/arm/kernel/kprobes-test-arm.c
> @@ -367,9 +367,11 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
> TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
>
> +#if __LINUX_ARM_ARCH__ >= 7
> TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
> TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
> TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
> +#endif
> TEST_UNSUPPORTED(".word 0xe06f3291 @ mls pc, r1, r2, r3")
> TEST_UNSUPPORTED(".word 0xe060329f @ mls r0, pc, r2, r3")
> TEST_UNSUPPORTED(".word 0xe0603f91 @ mls r0, r1, pc, r3")
> @@ -456,6 +458,7 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */
> #if __LINUX_ARM_ARCH__ >= 6
> TEST_UNSUPPORTED("ldrex r2, [sp]")
> +#ifdef CONFIG_CPU_32v6K
> TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
> TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
> TEST_UNSUPPORTED("strexb r0, r2, [sp]")
> @@ -463,6 +466,7 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED("strexh r0, r2, [sp]")
> TEST_UNSUPPORTED("ldrexh r2, [sp]")
> #endif
> +#endif
> TEST_GROUP("Extra load/store instructions")
>
> TEST_RPR( "strh r",0, VAL1,", [r",1, 48,", -r",2, 24,"]")


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


arnd at arndb

Aug 23, 2012, 5:09 AM

Post #4 of 7 (116 views)
Permalink
Re: [PATCHv4 4/4] ARM: kprobes: make more tests conditional [In reply to]

On Wednesday 22 August 2012, Tixy wrote:

> If you do feel so inclined for a v4 however ;-) you could also make the
> mls part of the patch tidier by moving the added #endif to instead
> terminate the preceding "#if __LINUX_ARM_ARCH__ >= 6", i.e.
>
> @@ -367,8 +367,10 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
> TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
> +#endif
>
> +#if __LINUX_ARM_ARCH__ >= 7
> TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
> TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
> TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
>
>
> this looks funny in patch form, but the resulting source file is more
> consistent with other conditional tests.

Ok, here we go.

Arnd


commit abfef4db8731591fbb721262bd4712662aaa6d14
Author: Arnd Bergmann <arnd [at] arndb>
Date: Thu Aug 16 07:49:31 2012 +0000

ARM: kprobes: make more tests conditional

The mls instruction is not available in ARMv6K or below, so we
should make the test conditional on at least ARMv7. ldrexd/strexd
are available in ARMv6K or ARMv7, which we can test by checking
the CONFIG_CPU_32v6K symbol.

/tmp/ccuMTZ8D.s: Assembler messages:
/tmp/ccuMTZ8D.s:22188: Error: selected processor does not support ARM mode `mls r0,r1,r2,r3'
/tmp/ccuMTZ8D.s:22222: Error: selected processor does not support ARM mode `mlshi r7,r8,r9,r10'
/tmp/ccuMTZ8D.s:22252: Error: selected processor does not support ARM mode `mls lr,r1,r2,r13'

Signed-off-by: Arnd Bergmann <arnd [at] arndb>
Cc: Jon Medhurst <tixy [at] yxit>
Cc: Russell King <rmk+kernel [at] arm>
Cc: Nicolas Pitre <nicolas.pitre [at] linaro>
Cc: Leif Lindholm <leif.lindholm [at] arm>

diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
index 38c1a3b..8393129 100644
--- a/arch/arm/kernel/kprobes-test-arm.c
+++ b/arch/arm/kernel/kprobes-test-arm.c
@@ -366,7 +366,9 @@ void kprobe_arm_test_cases(void)
TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3")
TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
+#endif

+#if __LINUX_ARM_ARCH__ >= 7
TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
@@ -456,6 +458,8 @@ void kprobe_arm_test_cases(void)
TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */
#if __LINUX_ARM_ARCH__ >= 6
TEST_UNSUPPORTED("ldrex r2, [sp]")
+#endif
+#if (__LINUX_ARM_ARCH__ >= 7) || defined(CONFIG_CPU_32v6K)
TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
TEST_UNSUPPORTED("strexb r0, r2, [sp]")
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


will.deacon at arm

Aug 23, 2012, 5:25 AM

Post #5 of 7 (115 views)
Permalink
Re: [PATCHv3 4/4] ARM: kprobes: make more tests conditional [In reply to]

On Thu, Aug 23, 2012 at 12:51:01AM +0100, Tixy wrote:
> On Wed, 2012-08-22 at 18:41 +0000, Arnd Bergmann wrote:
> > On Wednesday 22 August 2012, Nicolas Pitre wrote:
> > > On Wed, 22 Aug 2012, Arnd Bergmann wrote:
> > > > >
> > > > > The ldrex/strex instructions are available on ARMv6. It's only the d
> > > > > variants (strexd/ldrexd) which are only available from ARMv6k.
> > > >
> > > > Ok. How is the version below then? I haven't tested this one yet.
> > >
> > > In fact, I think the b variants are ARMv6k+ as well. Only the plain
> > > (non b non d) variants are available on ARMv6.
> >
> > Ok, third attempt then. This leaves ldrex for ARMv6 but marks
> > {st,ld}rex{b,h,d} as V6K specific (which includes ARMv7).
>
> ARMv7 does set CPU_32v6K, because arch/arm/mm/Kconfig has
>
> config CPU_V7
> bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
> select CPU_32v6K
> select CPU_32v7
>
> but this seems more for peripheral reasons not because all the various
> CPU configs systematically select the earlier architecture variants,
> e.g. CPU_V7 doesn't select CPU_32v6.
>
> So I would have been inclined to test for
>
> #if defined(CONFIG_CPU_32v6K) || (__LINUX_ARM_ARCH__ >= 7)

FWIW, the selection of the optimised atomic64 implementation for ARM (which
uses the double-word exclusive instructions) boils down to CONFIG_CPU_32v6K,
so I think the additional __LINUX_ARM_ARCH__ check is probably overkill.

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


tixy at yxit

Aug 23, 2012, 10:28 AM

Post #6 of 7 (116 views)
Permalink
Re: [PATCHv4 4/4] ARM: kprobes: make more tests conditional [In reply to]

On Thu, 2012-08-23 at 12:09 +0000, Arnd Bergmann wrote:
> commit abfef4db8731591fbb721262bd4712662aaa6d14
> Author: Arnd Bergmann <arnd [at] arndb>
> Date: Thu Aug 16 07:49:31 2012 +0000
>
> ARM: kprobes: make more tests conditional
>
> The mls instruction is not available in ARMv6K or below, so we
> should make the test conditional on at least ARMv7. ldrexd/strexd
> are available in ARMv6K or ARMv7, which we can test by checking
> the CONFIG_CPU_32v6K symbol.
>
> /tmp/ccuMTZ8D.s: Assembler messages:
> /tmp/ccuMTZ8D.s:22188: Error: selected processor does not support ARM mode `mls r0,r1,r2,r3'
> /tmp/ccuMTZ8D.s:22222: Error: selected processor does not support ARM mode `mlshi r7,r8,r9,r10'
> /tmp/ccuMTZ8D.s:22252: Error: selected processor does not support ARM mode `mls lr,r1,r2,r13'
>
> Signed-off-by: Arnd Bergmann <arnd [at] arndb>
> Cc: Jon Medhurst <tixy [at] yxit>
> Cc: Russell King <rmk+kernel [at] arm>
> Cc: Nicolas Pitre <nicolas.pitre [at] linaro>
> Cc: Leif Lindholm <leif.lindholm [at] arm>

Thanks for your indulgence :-) With the white-space damage fixed...

Acked-by: Jon Medhurst <tixy [at] yxit>

I test built this for v6, v6k and v7 before and after applying the patch
to verify if behaves as expected, so you can add my Tested-by if you
want.

I also tried a v4 platform (forgot we supported those) and there will be
a patch coming to fix that...


> diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
> index 38c1a3b..8393129 100644
> --- a/arch/arm/kernel/kprobes-test-arm.c
> +++ b/arch/arm/kernel/kprobes-test-arm.c
> @@ -366,7 +366,9 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3")
> TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
> TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
> +#endif
>
> +#if __LINUX_ARM_ARCH__ >= 7
> TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
> TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
> TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
> @@ -456,6 +458,8 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */
> #if __LINUX_ARM_ARCH__ >= 6
> TEST_UNSUPPORTED("ldrex r2, [sp]")
> +#endif
> +#if (__LINUX_ARM_ARCH__ >= 7) || defined(CONFIG_CPU_32v6K)
> TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
> TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
> TEST_UNSUPPORTED("strexb r0, r2, [sp]")


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


nicolas.pitre at linaro

Aug 23, 2012, 11:04 AM

Post #7 of 7 (114 views)
Permalink
Re: [PATCHv4 4/4] ARM: kprobes: make more tests conditional [In reply to]

On Thu, 23 Aug 2012, Arnd Bergmann wrote:

> On Wednesday 22 August 2012, Tixy wrote:
>
> > If you do feel so inclined for a v4 however ;-) you could also make the
> > mls part of the patch tidier by moving the added #endif to instead
> > terminate the preceding "#if __LINUX_ARM_ARCH__ >= 6", i.e.
> >
> > @@ -367,8 +367,10 @@ void kprobe_arm_test_cases(void)
> > TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
> > TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
> > +#endif
> >
> > +#if __LINUX_ARM_ARCH__ >= 7
> > TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
> > TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
> > TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
> >
> >
> > this looks funny in patch form, but the resulting source file is more
> > consistent with other conditional tests.
>
> Ok, here we go.
>
> Arnd
>
>
> commit abfef4db8731591fbb721262bd4712662aaa6d14
> Author: Arnd Bergmann <arnd [at] arndb>
> Date: Thu Aug 16 07:49:31 2012 +0000
>
> ARM: kprobes: make more tests conditional
>
> The mls instruction is not available in ARMv6K or below, so we
> should make the test conditional on at least ARMv7. ldrexd/strexd
> are available in ARMv6K or ARMv7, which we can test by checking
> the CONFIG_CPU_32v6K symbol.
>
> /tmp/ccuMTZ8D.s: Assembler messages:
> /tmp/ccuMTZ8D.s:22188: Error: selected processor does not support ARM mode `mls r0,r1,r2,r3'
> /tmp/ccuMTZ8D.s:22222: Error: selected processor does not support ARM mode `mlshi r7,r8,r9,r10'
> /tmp/ccuMTZ8D.s:22252: Error: selected processor does not support ARM mode `mls lr,r1,r2,r13'
>
> Signed-off-by: Arnd Bergmann <arnd [at] arndb>
> Cc: Jon Medhurst <tixy [at] yxit>
> Cc: Russell King <rmk+kernel [at] arm>
> Cc: Nicolas Pitre <nicolas.pitre [at] linaro>
> Cc: Leif Lindholm <leif.lindholm [at] arm>

Acked-by: Nicolas Pitre <nico [at] linaro>


>
> diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
> index 38c1a3b..8393129 100644
> --- a/arch/arm/kernel/kprobes-test-arm.c
> +++ b/arch/arm/kernel/kprobes-test-arm.c
> @@ -366,7 +366,9 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3")
> TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
> TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
> +#endif
>
> +#if __LINUX_ARM_ARCH__ >= 7
> TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
> TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
> TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
> @@ -456,6 +458,8 @@ void kprobe_arm_test_cases(void)
> TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */
> #if __LINUX_ARM_ARCH__ >= 6
> TEST_UNSUPPORTED("ldrex r2, [sp]")
> +#endif
> +#if (__LINUX_ARM_ARCH__ >= 7) || defined(CONFIG_CPU_32v6K)
> TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
> TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
> TEST_UNSUPPORTED("strexb r0, r2, [sp]")
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.