[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ARM: Drop ThumbEE support


  • To: Julien Grall <julien@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 3 Dec 2025 18:58:11 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+VOw19oPxPeUS0+sH/lI69fnuoxBZpca3sCNMKXEH5U=; b=OA4LIV5fEH62Xo+mUHrO4KCK1LSuWjgdXEx3HYjUtINH71qwoODm/QXPrQkK5sJfSShA/+saJCzpR972dtRd2Iq0vJ5PeOVL+d4VwltUVyMx7B9hpnPFReE/sYUfyXl9ksALYJlFNbT5vrr/yO3kaFrDaZrm3tJm9hJKC04hvZ91Um1JqBmgwezVlVJZiIOM+WI+KiWocscTsQP1sHyUGUCpC/M+qhcg3Bni+ntGbm4BretNhEHGbf/P6CJzHpI3OkE3FxYxkIrMnGiiBBuF9GtF7W1DXH4sWqQmc6oDFqYSj+yTvVvbZV9TJWFuiWQve/ogJeQMU4wbiTwKKVEENg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IR1NpYpESKgEn+CKItNANiVepkD/uXHty3IsHmWmEmGIcqwcuVXzKVox2u3eUnsTS6WLS2xLiLfVxQ6z9K66rGFGkRD9sP/SfYexDRKkQffZ4cqqQLgT49OE6G12b/Rn6WAUV+D4iydtwL9gnORiA0YOPyGIyBWTgkOnin2aWqlFoKZhB64W5BAE+5CMoVLI8qnlEUL07MSamnsjfpnuCvpt+C3on0t4pLKm3yHMUEcvgBqreNsHY6JRG0UQCFVgq70EujMxXjmcRJVaFvXqO7vXs9sTWgufSB34UQEKf/8s4vgHhtI/uUhzEVQQU+nZQmO4Bbr4iBYrP95FGybWvg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, Hans van Kranenburg <hans@xxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Maximilian Engelhardt <maxi@xxxxxxxxxxxxx>
  • Delivery-date: Wed, 03 Dec 2025 18:58:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03/12/2025 6:49 pm, Andrew Cooper wrote:
> On 03/12/2025 6:23 pm, Julien Grall wrote:
>> Hi Andrew,
>>
>> On 03/12/2025 17:16, Andrew Cooper wrote:
>>> 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.
>
>> 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.

e.g.

diff --git a/xen/arch/arm/include/asm/processor.h 
b/xen/arch/arm/include/asm/processor.h
index 92c8bc1a3125..ec23fd098b63 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -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 */
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 2bc3e1df0416..040c0f2e0db1 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -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);




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.