ARM: Drop ThumbEE support
PATCH 1/1 ARM: Drop ThumbEE support
It was reported that Xen no longer builds on Debian Trixie:
Assembler messages:
{standard input}:474: Error: unknown or missing system register name at operand 1 -- msr TEECR32_EL1,x0' {standard input}:480: Error: unknown or missing system register name at operand 1 -- msr TEEHBR32_EL1,x0' {standard input}:488: Error: unknown or missing system register name at operand 2 -- mrs x0,TEECR32_EL1' {standard input}:494: Error: unknown or missing system register name at operand 2 -- mrs x0,TEEHBR32_EL1' make[5]: *** [Rules.mk:249: arch/arm/domain.o] Error 1
This turns out to be an intentional change in bintuils. ThumbEE was dropped from the architecture and doesn't exist in v8 (i.e. AArch64).
Xen supports v7+virt extentions so in principle we could #ifdef CONFIG_ARM_32 to keep it working, but there was apparently no use of ThumbEE outside of demo code, so simply drop it.
---
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Hans van Kranenburg <[email protected]>
CC: Maximilian Engelhardt <[email protected]>
There's been no movement on this and it's urgent. This (cross)compiles for me, but is the sum total of testing it's had.
Bintuils link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=8c0024ca8f6c01fc45f081f5ef11c9a6a1c24eb0
--- xen/arch/arm/domain.c | 12 ------------ xen/arch/arm/include/asm/cpufeature.h | 1 - xen/arch/arm/include/asm/domain.h | 1 - xen/arch/arm/setup.c | 3 +-- 4 files changed, 1 insertion(+), 16 deletions(-)
xen/arch/arm/domain.c +0 -12
@@ -111,12 +111,6 @@ static void ctxt_switch_from(struct vcpu *p) p->arch.cntkctl =READ_SYSREG (CNTKCTL_EL1 );virt_timer_save (p); -if (is_32bit_domain (p->domain) && cpu_has_thumbee ) - { - p->arch.teecr =READ_SYSREG (TEECR32_EL1 ); - p->arch.teehbr =READ_SYSREG (TEEHBR32_EL1 ); - } -#ifdef CONFIG_ARM_32 p->arch.joscr =READ_CP32 (JOSCR ); p->arch.jmcr =READ_CP32 (JMCR );
@@ -244,12 +238,6 @@ static void ctxt_switch_to(struct vcpu *n)WRITE_SYSREG (n->arch.tpidrro_el0,TPIDRRO_EL0 );WRITE_SYSREG (n->arch.tpidr_el1,TPIDR_EL1 ); -if (is_32bit_domain (n->domain) && cpu_has_thumbee ) - { -WRITE_SYSREG (n->arch.teecr,TEECR32_EL1 ); -WRITE_SYSREG (n->arch.teehbr,TEEHBR32_EL1 ); - } -#ifdef CONFIG_ARM_32 WRITE_CP32 (n->arch.joscr,JOSCR );WRITE_CP32 (n->arch.jmcr,JMCR );
xen/arch/arm/include/asm/cpufeature.h +0 -1
@@ -29,7 +29,6 @@#define cpu_has_thumb (boot_cpu_feature32(thumb) >= 1)#define cpu_has_thumb2 (boot_cpu_feature32(thumb) >= 3)#define cpu_has_jazelle (boot_cpu_feature32(jazelle) > 0) -#define cpu_has_thumbee (boot_cpu_feature32(thumbee) == 1)#define cpu_has_aarch32 (cpu_has_arm || cpu_has_thumb)#ifdef CONFIG_ARM64_SVE
xen/arch/arm/include/asm/domain.h +0 -1
@@ -211,7 +211,6 @@ struct arch_vcpuregister_t hcr_el2;register_t mdcr_el2; -uint32_t teecr, teehbr;/* ThumbEE, 32-bit guests only */ #ifdef CONFIG_ARM_32 /* * ARMv8 only supports a trivial implementation on Jazelle when in AArch32
xen/arch/arm/setup.c +1 -2
@@ -172,12 +172,11 @@ static void __init processor_id(void)printk ("32-bit Execution:\n" );printk (" Processor Features: %" PRIregister":%" PRIregister"\n" , system_cpuinfo.pfr32.bits[0 ], system_cpuinfo.pfr32.bits[1 ]); -printk (" Instruction Sets:%s%s%s%s%s%s\n" , +printk (" Instruction Sets:%s%s%s%s%s\n" , cpu_has_aarch32 ?" AArch32" :"" , cpu_has_arm ?" A32" :"" , cpu_has_thumb ?" Thumb" :"" , cpu_has_thumb2 ?" Thumb-2" :"" , - cpu_has_thumbee ?" ThumbEE" :"" , cpu_has_jazelle ?" Jazelle" :"" ); printk(" Extensions:%s%s\n", cpu_has_gentimer ? " GenericTimer" : "",
base-commit: 62bd4c2a8ee809c181d47098583270dc9db9300e
Signature · 1 line
2.39.5
Hi Andrew,
Quoted 1 line · Andrew Cooper
It was reported that Xen no longer builds on Debian Trixie:
The FTBFS is on Debian *unstable/sid*.
The build on Debian 13 Trixie is OK.
Quoted 7 lines
Assembler messages:
{standard input}:474: Error: unknown or missing system register name at operand 1 --msr TEECR32_EL1,x0' {standard input}:480: Error: unknown or missing system register name at operand 1 --msr TEEHBR32_EL1,x0' {standard input}:488: Error: unknown or missing system register name at operand 2 --mrs x0,TEECR32_EL1' {standard input}:494: Error: unknown or missing system register name at operand 2 --mrs x0,TEEHBR32_EL1' make[5]: *** [Rules.mk:249:arch/arm/domain.o] Error 1
Quoted 8 lines
This turns out to be an intentional change in bintuils. ThumbEE was dropped from the architecture and doesn't exist in v8 (i.e. AArch64).
Xen supports v7+virt extentions so in principle we could #ifdef
CONFIG_ARM_32to keep it working, but there was apparently no use of ThumbEE outside of demo code, so simply drop it.Reported-by Hans van Kranenburg <[email protected]>
Thanks!
I have just applied the patch here and have now successfully built the Debian Xen packages using Debian unstable/sid build chroot on the arm64 Debian VM that I have here on my work macbook.
Hans
Quoted 16 lines
Signed-off-by Andrew Cooper <[email protected]>---
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Hans van Kranenburg <[email protected]>
CC: Maximilian Engelhardt <[email protected]>There's been no movement on this and it's urgent. This (cross)compiles for me, but is the sum total of testing it's had.
Bintuils link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=8c0024ca8f6c01fc45f081f5ef11c9a6a1c24eb0
[...]
Quoted 7 lines · Hans van Kranenburg
Hi Andrew,
Quoted 1 line · Andrew Cooper
It was reported that Xen no longer builds on Debian Trixie:
The FTBFS is on Debian *unstable/sid*.
The build on Debian 13 Trixie is OK.
Ah ok. I can tweak that.
Quoted 15 lines
Quoted 15 lines
Assembler messages:
{standard input}:474: Error: unknown or missing system register name at operand 1 --msr TEECR32_EL1,x0' {standard input}:480: Error: unknown or missing system register name at operand 1 --msr TEEHBR32_EL1,x0' {standard input}:488: Error: unknown or missing system register name at operand 2 --mrs x0,TEECR32_EL1' {standard input}:494: Error: unknown or missing system register name at operand 2 --mrs x0,TEEHBR32_EL1' make[5]: *** [Rules.mk:249:arch/arm/domain.o] Error 1This turns out to be an intentional change in bintuils. ThumbEE was dropped from the architecture and doesn't exist in v8 (i.e. AArch64).
Xen supports v7+virt extentions so in principle we could #ifdef
CONFIG_ARM_32to keep it working, but there was apparently no use of ThumbEE outside of demo code, so simply drop it.
Quoted 6 lines
Quoted 1 line
Reported-by Hans van Kranenburg <[email protected]>Thanks!
I have just applied the patch here and have now successfully built the Debian Xen packages using Debian unstable/sid build chroot on the arm64 Debian VM that I have here on my work macbook.
Assuming that the maintainers are happy, can I translate this into a Tested-by tag?
~Andrew
Quoted 27 lines · Andrew Cooper
Quoted 7 lines · Hans van Kranenburg
Hi Andrew,
Quoted 1 line · Andrew Cooper
It was reported that Xen no longer builds on Debian Trixie:
The FTBFS is on Debian *unstable/sid*.
The build on Debian 13 Trixie is OK.
Ah ok. I can tweak that.
Quoted 16 lines
Quoted 16 lines
Assembler messages:
{standard input}:474: Error: unknown or missing system register name at operand 1 --msr TEECR32_EL1,x0' {standard input}:480: Error: unknown or missing system register name at operand 1 --msr TEEHBR32_EL1,x0' {standard input}:488: Error: unknown or missing system register name at operand 2 --mrs x0,TEECR32_EL1' {standard input}:494: Error: unknown or missing system register name at operand 2 --mrs x0,TEEHBR32_EL1' make[5]: *** [Rules.mk:249:arch/arm/domain.o] Error 1This turns out to be an intentional change in bintuils. ThumbEE was dropped from the architecture and doesn't exist in v8 (i.e. AArch64).
Xen supports v7+virt extentions so in principle we could #ifdef
CONFIG_ARM_32to keep it working, but there was apparently no use of ThumbEE outside of demo code, so simply drop it.Reported-by Hans van Kranenburg <[email protected]>
Quoted 8 lines
Quoted 5 lines
Thanks!
I have just applied the patch here and have now successfully built the Debian Xen packages using Debian unstable/sid build chroot on the arm64 Debian VM that I have here on my work macbook.
Assuming that the maintainers are happy, can I translate this into a Tested-by tag?
Well, it builds, but if it behaves, I do not know, since I don't have an easy way to boot the arm64 packages here.
So, if a Build-Tested-by also exists, that one would be fine :D
Hans
Hi Andrew,
Quoted 10 lines · Andrew Cooper
It was reported that Xen no longer builds on Debian Trixie:
Assembler messages:
{standard input}:474: Error: unknown or missing system register name at operand 1 --msr TEECR32_EL1,x0' {standard input}:480: Error: unknown or missing system register name at operand 1 --msr TEEHBR32_EL1,x0' {standard input}:488: Error: unknown or missing system register name at operand 2 --mrs x0,TEECR32_EL1' {standard input}:494: Error: unknown or missing system register name at operand 2 --mrs x0,TEEHBR32_EL1' make[5]: *** [Rules.mk:249:arch/arm/domain.o] Error 1This turns out to be an intentional change in bintuils. ThumbEE was dropped
typo: s/binuils/binutils/
Quoted 3 lines
from the architecture and doesn't exist in v8 (i.e. AArch64).
Xen supports v7+virt extentions so in principle we could #ifdef
CONFIG_ARM_32
typo: s/extentions/extensions/
Quoted 2 lines
to keep it working, but there was apparently no use of ThumbEE outside of demo code, so simply drop it.
I am in favor of dropping support for ThumbEE for guest. But I am not sure I understand this comment. Are you saying there are no processors supporting ThumbEE where Xen would run? Asking because below, you are removing code to context switch the ThumbEE registers. But I don't see any code that would ensure the registers are trapping (i.e. HSTR.TEE is set). So wouldn't this result to a cross-VM leak on those processors?
If we really don't want to support CPU where ThumbEE is available, then we should check that "cpu_has_thumbee" is 0.
Cheers,
Signature · 1 line
Julien Grall
Quoted 9 lines · Julien Grall
Hi Andrew,
Quoted 3 lines · Andrew Cooper
to keep it working, but there was apparently no use of ThumbEE outside of demo
code, so simply drop it.I am in favor of dropping support for ThumbEE for guest. But I am not sure I understand this comment.
There's no production use of ThumbEE known to ARM.
Quoted 8 lines
Are you saying there are no processors supporting ThumbEE where Xen would run? Asking because below, you are removing code to context switch the ThumbEE registers. But I don't see any code that would ensure the registers are trapping (i.e. HSTR.TEE is set). So wouldn't this result to a cross-VM leak on those processors?
If we really don't want to support CPU where ThumbEE is available, then we should check that "
cpu_has_thumbee" is 0.
The registers exist in ARM v7 only. They do not exist in ARM v8.
I suppose yes this change would result in a cross-VM leak on hardware supporting ThumbEE.
Can HSTR.TTEE be set unilaterally, or does it need gating on cpu_has_thumbee?
Is setting HSTR.TTEE sufficient to cause an undefined instruction exception to be thrown back at a guest which goes poking? (I guess this is really "will the default do the right thing")
I'll freely admit that I'm out of my depth here, but the build failure does need fixing.
~Andrew
Quoted 27 lines · Andrew Cooper
Quoted 8 lines · Julien Grall
Hi Andrew,
Quoted 3 lines · Andrew Cooper
to keep it working, but there was apparently no use of ThumbEE outside of demo
code, so simply drop it.I am in favor of dropping support for ThumbEE for guest. But I am not sure I understand this comment.
There's no production use of ThumbEE known to ARM.
Quoted 8 lines
Are you saying there are no processors supporting ThumbEE where Xen would run? Asking because below, you are removing code to context switch the ThumbEE registers. But I don't see any code that would ensure the registers are trapping (i.e. HSTR.TEE is set). So wouldn't this result to a cross-VM leak on those processors?
If we really don't want to support CPU where ThumbEE is available, then we should check that "
cpu_has_thumbee" is 0.The registers exist in ARM v7 only. They do not exist in ARM v8.
I suppose yes this change would result in a cross-VM leak on hardware supporting ThumbEE.
Can HSTR.TTEE be set unilaterally, or does it need gating on
cpu_has_thumbee?
Quoted 6 lines
Is setting HSTR.TTEE sufficient to cause an undefined instruction exception to be thrown back at a guest which goes poking? (I guess this is really "will the default do the right thing")
I'll freely admit that I'm out of my depth here, but the build failure does need fixing.
e.g.
xen/arch/arm/include/asm/processor.h +0 -0
@@ -411,6 +411,7 @@
/* HSTR Hyp. System Trap Register */
#define HSTR_T(x) ((_AC(1,U)<<(x))) /* Trap Cp15 c<x> */ +#define HSTR_TTEE (_AC(1,U)<<16) /* Trap ThumbEE */
/* HDCR Hyp. Debug Configuration Register */
#define HDCR_TDRA (_AC(1,U)<<11) /* Trap Debug ROM access */
xen/arch/arm/traps.c +0 -0
@@ -158,8 +158,8 @@ void init_traps(void)
WRITE_SYSREG(HDCR_TDRA|HDCR_TDOSA|HDCR_TDA|HDCR_TPM|HDCR_TPMCR, MDCR_EL2);
- /* Trap CP15 c15 used for implementation defined registers */ - WRITE_SYSREG(HSTR_T(15), HSTR_EL2);
+ /* Trap CP15 c15 used for implementation defined registers, and ThumbEE. */ + WRITE_SYSREG(HSTR_T(15) | (cpu_has_thumbee ? HSTR_TTEE : 0), HSTR_EL2);
WRITE_SYSREG(get_default_cptr_flags(), CPTR_EL2);
Hi Andrew,
Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Julien Grall
Hi Andrew,
On 03/12/2025 17:16, Andrew Cooper wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
to keep it working, but there was apparently no use of ThumbEE outside of demo
code, so simply drop it.I am in favor of dropping support for ThumbEE for guest. But I am not sure I understand this comment.
There's no production use of ThumbEE known to ARM.
Interesting. The Arm Arm is less assertive and in fact confusing, the latest spec released in 2018 (ARM DDI 0406C.d) has the following:
"
From the publication of issue C.a of this manual, ARM deprecates any use of the ThumbEE instruction set.
[...]
ThumbEE is both the name of the instruction set and the name of the extension that provides support for that instruction set. The ThumbEE Extension is:
• Required in implementations of the ARMv7-A profile.
"
I have also checked the TRM of the Cortex-A15 (one of the Armv7 CPU we used to have in the CI before gitlab) and it supports ThumbEE. So I think we need to additional diff you sent in this patch.
Quoted 10 lines
Quoted 9 lines
Are you saying there are no processors supporting ThumbEE where Xen would run? Asking because below, you are removing code to context switch the ThumbEE registers. But I don't see any code that would ensure the registers are trapping (i.e. HSTR.TEE is set). So wouldn't this result to a cross-VM leak on those processors?
If we really don't want to support CPU where ThumbEE is available, then we should check that "
cpu_has_thumbee" is 0.
Quoted 7 lines
The registers exist in ARM v7 only. They do not exist in ARM v8.
I suppose yes this change would result in a cross-VM leak on hardware supporting ThumbEE.
Can HSTR.TTEE be set unilaterally, or does it need gating on
cpu_has_thumbee?
From my understanding of the Armv7 specification, the bit doesn't need to be gated. The Armv8 specification suggest it is RES0 so in theory it could be used in the future. So the diff you sent is correct.
Quoted 4 lines
Is setting HSTR.TTEE sufficient to cause an undefined instruction exception to be thrown back at a guest which goes poking? (I guess this is really "will the default do the right thing")
I believe so. The default behavior in Xen is to inject an undefined exception if it can't handle a trap.
Quoted 3 lines
I'll freely admit that I'm out of my depth here, but the build failure does need fixing.
I agree. Do we need to include the fix in 4.19 (I think Jan asked to cut it tomorrow)? Thanks for sending the patch!
Cheers,
Signature · 1 line
Julien Grall
Hi Andrew and Julien,
R52 which i think is one of the few Arm CPUs that some people are looking at using 32bit instructions support Thumb-2 but not ThumbEE.
ThumbEE has been deprecated so I think Andrews changes (including the one that traps any ThumbEE usage which is definitely required) are Ok.
Even on Cortex A15, I am not that sure that many people actually used ThumbEE.
Regards
Bertrand
Quoted 62 lines · Julien Grall
Hi Andrew,
Quoted 11 lines · Andrew Cooper
Quoted 9 lines · Julien Grall
Hi Andrew,
Quoted 3 lines · Andrew Cooper
to keep it working, but there was apparently no use of ThumbEE outside of demo
code, so simply drop it.I am in favor of dropping support for ThumbEE for guest. But I am not sure I understand this comment.
There's no production use of ThumbEE known to ARM.
Interesting. The Arm Arm is less assertive and in fact confusing, the latest spec released in 2018 (ARM DDI 0406C.d) has the following:
"
From the publication of issue C.a of this manual, ARM deprecates any use of the ThumbEE instruction set.[...]
ThumbEE is both the name of the instruction set and the name of the extension that provides support for that instruction set. The ThumbEE Extension is:
• Required in implementations of the ARMv7-A profile.
"I have also checked the TRM of the Cortex-A15 (one of the Armv7 CPU we used to have in the CI before gitlab) and it supports ThumbEE. So I think we need to additional diff you sent in this patch.
Quoted 6 lines
Quoted 6 lines
Are you saying there are no processors supporting ThumbEE where Xen would run? Asking because below, you are removing code to context switch the ThumbEE registers. But I don't see any code that would ensure the registers are trapping (i.e. HSTR.TEE is set). So wouldn't this result to a cross-VM leak on those processors?
Quoted 7 lines
Quoted 2 lines
If we really don't want to support CPU where ThumbEE is available, then we should check that "
cpu_has_thumbee" is 0.The registers exist in ARM v7 only. They do not exist in ARM v8. I suppose yes this change would result in a cross-VM leak on hardware supporting ThumbEE.
Can HSTR.TTEE be set unilaterally, or does it need gating oncpu_has_thumbee?From my understanding of the Armv7 specification, the bit doesn't need to be gated. The Armv8 specification suggest it is RES0 so in theory it could be used in the future. So the diff you sent is correct.
Quoted 3 lines
Is setting HSTR.TTEE sufficient to cause an undefined instruction exception to be thrown back at a guest which goes poking? (I guess this is really "will the default do the right thing")
I believe so. The default behavior in Xen is to inject an undefined exception if it can't handle a trap.
Quoted 2 lines
I'll freely admit that I'm out of my depth here, but the build failure does need fixing.
I agree. Do we need to include the fix in 4.19 (I think Jan asked to cut it tomorrow)? Thanks for sending the patch!
Cheers,
Signature · 1 line
Julien Grall
Quoted 2 lines · Julien Grall
I agree. Do we need to include the fix in 4.19 (I think Jan asked to cut it tomorrow)? Thanks for sending the patch!
Too late for 4.19.4 now, but 4.19.5 can still get it once ready.
Jan