Thumb2 support

I copied beaglebone to .config, configured it, and tried to 'make
uImage' but I got:

arch/arm/boot/compressed/head.S:127: Error: selected processor does
not support requested special purpose register -- `mrs r2,cpsr'
arch/arm/boot/compressed/head.S:134: Error: selected processor does
not support requested special purpose register -- `mrs r2,cpsr'
arch/arm/boot/compressed/head.S:136: Error: selected processor does
not support requested special purpose register -- `msr cpsr_c,r2'

I then did 'make mrproper', copied beaglebone back to .config, and
tried to 'make uImage' but I get:

CHK include/linux/version.h
  CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALL scripts/checksyscalls.sh
  CHK include/generated/compile.h
  CC arch/arm/kernel/kprobes-thumb.o
arch/arm/kernel/kprobes-thumb.c: In function 't16_emulate_loregs_rwflags':
arch/arm/kernel/kprobes-thumb.c:1090:2: error: can't find a register
in class 'GENERAL_REGS' while reloading 'asm'
arch/arm/kernel/kprobes-thumb.c:1090:2: error: 'asm' operand has
impossible constraints
make[1]: *** [arch/arm/kernel/kprobes-thumb.o] Error 1

I can't seem to Google my way to victory in either case, but I did
gather that this could be related to my toolchain.

# gcc-config -l
[1] armv7a-softfp-linux-gnueabi-4.5.4 *

That "beaglebone" config, has thumb2 enabled by default, so unless you
have a very recent compiler from angstrom/linaro it isn't going to
work very well.. (or disable the thumb2 option in the config..)

It does compile if I disable thumb2, but I've been told that
binutils-2.22-r1 should compile thumb2 just fine and that the above
error ("selected processor does not support") indicates that I need to
specify a different -march. Do the patches need to be adjusted?

- Grant

I copied beaglebone to .config, configured it, and tried to 'make
uImage' but I got:

arch/arm/boot/compressed/head.S:127: Error: selected processor does
not support requested special purpose register -- `mrs r2,cpsr'
arch/arm/boot/compressed/head.S:134: Error: selected processor does
not support requested special purpose register -- `mrs r2,cpsr'
arch/arm/boot/compressed/head.S:136: Error: selected processor does
not support requested special purpose register -- `msr cpsr_c,r2'

That "beaglebone" config, has thumb2 enabled by default, so unless you
have a very recent compiler from angstrom/linaro it isn't going to
work very well.. (or disable the thumb2 option in the config..)

It does compile if I disable thumb2, but I've been told that
binutils-2.22-r1 should compile thumb2 just fine and that the above
error ("selected processor does not support") indicates that I need to
specify a different -march. Do the patches need to be adjusted?

- Grant

Is -march=armv7-a still correct when compiling the kernel with thumb2 support?

- Grant

I copied beaglebone to .config, configured it, and tried to 'make
uImage' but I got:

arch/arm/boot/compressed/head.S:127: Error: selected processor does
not support requested special purpose register -- `mrs r2,cpsr'
arch/arm/boot/compressed/head.S:134: Error: selected processor does
not support requested special purpose register -- `mrs r2,cpsr'
arch/arm/boot/compressed/head.S:136: Error: selected processor does
not support requested special purpose register -- `msr cpsr_c,r2'

That "beaglebone" config, has thumb2 enabled by default, so unless you
have a very recent compiler from angstrom/linaro it isn't going to
work very well.. (or disable the thumb2 option in the config..)

I can compile binutils-2.23.51.0.1 on the Beaglebone, but not
2.23.51.0.2 or 2.23.51.0.3. I can compile the 3.6 kernel with thumb2
support with 2.23.51.0.1.

- Grant

I dont know if you want compile the kernel with thumb2 instruction ?
or
make user application run with thumb2 instruction and have the kernel support it ?

As I know , By default , for performance issure, kernel will not use thumb or thumb2 instruction .

You can see where is defined of -mno-thumb-interwork in Makefile.

hope it be helpful

2012/10/21 Grant <emailgrant@gmail.com>

I dont know if you want compile the kernel with thumb2 instruction ?
or
make user application run with thumb2 instruction and have the kernel
support it ?

As I know , By default , for performance issure, kernel will not use thumb
or thumb2 instruction .

You can see where is defined of -mno-thumb-interwork in Makefile.

hope it be helpful

I was trying to compile the kernel with thumb2 instructions by
enabling CONFIG_THUMB2_KERNEL. I was able to do so with
binutils-2.23.51.0.1 installed. Should CONFIG_THUMB2_KERNEL generally
increase performance?

- Grant

Grant <emailgrant@gmail.com> writes:

I dont know if you want compile the kernel with thumb2 instruction ?
or make user application run with thumb2 instruction and have the
kernel support it ?

As I know , By default , for performance issure, kernel will not use thumb
or thumb2 instruction .

You can see where is defined of -mno-thumb-interwork in Makefile.

hope it be helpful

I was trying to compile the kernel with thumb2 instructions by
enabling CONFIG_THUMB2_KERNEL. I was able to do so with
binutils-2.23.51.0.1 installed. Should CONFIG_THUMB2_KERNEL generally
increase performance?

I would expect it to make very little difference.