diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-03-03 18:12:09 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-03-03 18:12:09 +0000 |
| commit | a1e1a021b49f5257d8908aa9b8c2ee9c083e674c (patch) | |
| tree | 93ef124e1b628ee20eeafa085adb154385d41c8e /recipes-extended/xen | |
| parent | a37eb96a8f0c3cfe375bc7528a105c92a5ff3af5 (diff) | |
| download | meta-virtualization-a1e1a021b49f5257d8908aa9b8c2ee9c083e674c.tar.gz | |
xen/4.21: fix arm64 build with the most recent binutils
The upgrade of binutils in OE core broke the xen build on
arm64 due to unsupported instructions.
We cherry-pick a patch from xen master to fix the issue.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/xen')
| -rw-r--r-- | recipes-extended/xen/files/0001-ARM-Drop-ThumbEE-support.patch | 108 | ||||
| -rw-r--r-- | recipes-extended/xen/xen-tools_4.21.bb | 1 | ||||
| -rw-r--r-- | recipes-extended/xen/xen_4.21.bb | 1 |
3 files changed, 110 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/0001-ARM-Drop-ThumbEE-support.patch b/recipes-extended/xen/files/0001-ARM-Drop-ThumbEE-support.patch new file mode 100644 index 00000000..13bdb5a6 --- /dev/null +++ b/recipes-extended/xen/files/0001-ARM-Drop-ThumbEE-support.patch | |||
| @@ -0,0 +1,108 @@ | |||
| 1 | From 5bbe1fe413f9d6a841b0bc70db024b1398391630 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrew Cooper <andrew.cooper3@citrix.com> | ||
| 3 | Date: Wed, 3 Dec 2025 17:00:04 +0000 | ||
| 4 | Subject: [PATCH] ARM: Drop ThumbEE support | ||
| 5 | |||
| 6 | Hans reports that Xen no longer builds on Debian unstable/sid: | ||
| 7 | |||
| 8 | Assembler messages: | ||
| 9 | {standard input}:474: Error: unknown or missing system register name at operand 1 -- `msr TEECR32_EL1,x0' | ||
| 10 | {standard input}:480: Error: unknown or missing system register name at operand 1 -- `msr TEEHBR32_EL1,x0' | ||
| 11 | {standard input}:488: Error: unknown or missing system register name at operand 2 -- `mrs x0,TEECR32_EL1' | ||
| 12 | {standard input}:494: Error: unknown or missing system register name at operand 2 -- `mrs x0,TEEHBR32_EL1' | ||
| 13 | make[5]: *** [Rules.mk:249: arch/arm/domain.o] Error 1 | ||
| 14 | |||
| 15 | This turns out to be an intentional change in binutils. ThumbEE was dropped | ||
| 16 | ahead of ARM v8 (i.e. AArch64). | ||
| 17 | |||
| 18 | Xen supports ARM v7+virt extensions so in principle we could #ifdef | ||
| 19 | CONFIG_ARM_32 to keep it working. However, there was apparently no use of | ||
| 20 | ThumbEE outside of demo code, so simply drop it. | ||
| 21 | |||
| 22 | On ThumbEE capable hardware, unconditionally trap ThumbEE instructions, and | ||
| 23 | drop the context switching logic for TEE{CR,HBR}32. | ||
| 24 | |||
| 25 | Upstream-Status: Backport [commit 5bbe1fe413f9d6a841b0bc70db024b1398391630] | ||
| 26 | |||
| 27 | Reported-by: Hans van Kranenburg <hans@knorrie.org> | ||
| 28 | Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> | ||
| 29 | Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com> | ||
| 30 | --- | ||
| 31 | xen/arch/arm/domain.c | 12 ------------ | ||
| 32 | xen/arch/arm/include/asm/domain.h | 1 - | ||
| 33 | xen/arch/arm/include/asm/processor.h | 1 + | ||
| 34 | xen/arch/arm/traps.c | 4 ++-- | ||
| 35 | 4 files changed, 3 insertions(+), 15 deletions(-) | ||
| 36 | |||
| 37 | diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c | ||
| 38 | index ab78444335..3e32a15cac 100644 | ||
| 39 | --- a/xen/arch/arm/domain.c | ||
| 40 | +++ b/xen/arch/arm/domain.c | ||
| 41 | @@ -111,12 +111,6 @@ static void ctxt_switch_from(struct vcpu *p) | ||
| 42 | p->arch.cntkctl = READ_SYSREG(CNTKCTL_EL1); | ||
| 43 | virt_timer_save(p); | ||
| 44 | |||
| 45 | - if ( is_32bit_domain(p->domain) && cpu_has_thumbee ) | ||
| 46 | - { | ||
| 47 | - p->arch.teecr = READ_SYSREG(TEECR32_EL1); | ||
| 48 | - p->arch.teehbr = READ_SYSREG(TEEHBR32_EL1); | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | #ifdef CONFIG_ARM_32 | ||
| 52 | p->arch.joscr = READ_CP32(JOSCR); | ||
| 53 | p->arch.jmcr = READ_CP32(JMCR); | ||
| 54 | @@ -244,12 +238,6 @@ static void ctxt_switch_to(struct vcpu *n) | ||
| 55 | WRITE_SYSREG(n->arch.tpidrro_el0, TPIDRRO_EL0); | ||
| 56 | WRITE_SYSREG(n->arch.tpidr_el1, TPIDR_EL1); | ||
| 57 | |||
| 58 | - if ( is_32bit_domain(n->domain) && cpu_has_thumbee ) | ||
| 59 | - { | ||
| 60 | - WRITE_SYSREG(n->arch.teecr, TEECR32_EL1); | ||
| 61 | - WRITE_SYSREG(n->arch.teehbr, TEEHBR32_EL1); | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | #ifdef CONFIG_ARM_32 | ||
| 65 | WRITE_CP32(n->arch.joscr, JOSCR); | ||
| 66 | WRITE_CP32(n->arch.jmcr, JMCR); | ||
| 67 | diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h | ||
| 68 | index af3e168374..758ad807e4 100644 | ||
| 69 | --- a/xen/arch/arm/include/asm/domain.h | ||
| 70 | +++ b/xen/arch/arm/include/asm/domain.h | ||
| 71 | @@ -211,7 +211,6 @@ struct arch_vcpu | ||
| 72 | register_t hcr_el2; | ||
| 73 | register_t mdcr_el2; | ||
| 74 | |||
| 75 | - uint32_t teecr, teehbr; /* ThumbEE, 32-bit guests only */ | ||
| 76 | #ifdef CONFIG_ARM_32 | ||
| 77 | /* | ||
| 78 | * ARMv8 only supports a trivial implementation on Jazelle when in AArch32 | ||
| 79 | diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h | ||
| 80 | index ed56746368..1a48c9ff3b 100644 | ||
| 81 | --- a/xen/arch/arm/include/asm/processor.h | ||
| 82 | +++ b/xen/arch/arm/include/asm/processor.h | ||
| 83 | @@ -411,6 +411,7 @@ | ||
| 84 | |||
| 85 | /* HSTR Hyp. System Trap Register */ | ||
| 86 | #define HSTR_T(x) ((_AC(1,U)<<(x))) /* Trap Cp15 c<x> */ | ||
| 87 | +#define HSTR_TTEE (_AC(1,U)<<16) /* Trap ThumbEE */ | ||
| 88 | |||
| 89 | /* HDCR Hyp. Debug Configuration Register */ | ||
| 90 | #define HDCR_TDRA (_AC(1,U)<<11) /* Trap Debug ROM access */ | ||
| 91 | diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c | ||
| 92 | index 2bc3e1df04..040c0f2e0d 100644 | ||
| 93 | --- a/xen/arch/arm/traps.c | ||
| 94 | +++ b/xen/arch/arm/traps.c | ||
| 95 | @@ -158,8 +158,8 @@ void init_traps(void) | ||
| 96 | WRITE_SYSREG(HDCR_TDRA|HDCR_TDOSA|HDCR_TDA|HDCR_TPM|HDCR_TPMCR, | ||
| 97 | MDCR_EL2); | ||
| 98 | |||
| 99 | - /* Trap CP15 c15 used for implementation defined registers */ | ||
| 100 | - WRITE_SYSREG(HSTR_T(15), HSTR_EL2); | ||
| 101 | + /* Trap CP15 c15 used for implementation defined registers, and ThumbEE. */ | ||
| 102 | + WRITE_SYSREG(HSTR_T(15) | (cpu_has_thumbee ? HSTR_TTEE : 0), HSTR_EL2); | ||
| 103 | |||
| 104 | WRITE_SYSREG(get_default_cptr_flags(), CPTR_EL2); | ||
| 105 | |||
| 106 | -- | ||
| 107 | 2.43.0 | ||
| 108 | |||
diff --git a/recipes-extended/xen/xen-tools_4.21.bb b/recipes-extended/xen/xen-tools_4.21.bb index fb7576d9..e6281669 100644 --- a/recipes-extended/xen/xen-tools_4.21.bb +++ b/recipes-extended/xen/xen-tools_4.21.bb | |||
| @@ -9,6 +9,7 @@ SRC_URI = " \ | |||
| 9 | file://0001-libxl_nocpuid-fix-build-error.patch \ | 9 | file://0001-libxl_nocpuid-fix-build-error.patch \ |
| 10 | file://0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch \ | 10 | file://0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch \ |
| 11 | file://0001-tests-vpci-drop-explicit-g-use.patch \ | 11 | file://0001-tests-vpci-drop-explicit-g-use.patch \ |
| 12 | file://0001-ARM-Drop-ThumbEE-support.patch \ | ||
| 12 | " | 13 | " |
| 13 | 14 | ||
| 14 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" | 15 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" |
diff --git a/recipes-extended/xen/xen_4.21.bb b/recipes-extended/xen/xen_4.21.bb index 7148a17e..4c0b1581 100644 --- a/recipes-extended/xen/xen_4.21.bb +++ b/recipes-extended/xen/xen_4.21.bb | |||
| @@ -7,6 +7,7 @@ SRC_URI = " \ | |||
| 7 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ | 7 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ |
| 8 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ | 8 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ |
| 9 | file://0001-libxl_nocpuid-fix-build-error.patch \ | 9 | file://0001-libxl_nocpuid-fix-build-error.patch \ |
| 10 | file://0001-ARM-Drop-ThumbEE-support.patch \ | ||
| 10 | " | 11 | " |
| 11 | 12 | ||
| 12 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" | 13 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" |
