xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/arm: Warn user on cpu errata 832075
@ 2020-10-14 10:41 Bertrand Marquis
  2020-10-14 11:11 ` Julien Grall
  2020-10-14 11:35 ` Andrew Cooper
  0 siblings, 2 replies; 15+ messages in thread
From: Bertrand Marquis @ 2020-10-14 10:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Stefano Stabellini, Julien Grall, Volodymyr Babchuk

When a Cortex A57 processor is affected by CPU errata 832075, a guest
not implementing the workaround for it could deadlock the system.
Add a warning during boot informing the user that only trusted guests
should be executed on the system.
An equivalent warning is already given to the user by KVM on cores
affected by this errata.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/cpuerrata.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 6c09017515..8f9ab6dde1 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -240,6 +240,26 @@ static int enable_ic_inv_hardening(void *data)
 
 #endif
 
+#ifdef CONFIG_ARM64_ERRATUM_832075
+
+static int warn_device_load_acquire_errata(void *data)
+{
+    static bool warned = false;
+
+    if ( !warned )
+    {
+        warning_add("This CPU is affected by the errata 832075.\n"
+                    "Guests without required CPU erratum workarounds\n"
+                    "can deadlock the system!\n"
+                    "Only trusted guests should be used on this system.\n");
+        warned = true;
+    }
+
+    return 0;
+}
+
+#endif
+
 #ifdef CONFIG_ARM_SSBD
 
 enum ssbd_state ssbd_state = ARM_SSBD_RUNTIME;
@@ -419,6 +439,7 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .capability = ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE,
         MIDR_RANGE(MIDR_CORTEX_A57, 0x00,
                    (1 << MIDR_VARIANT_SHIFT) | 2),
+        .enable = warn_device_load_acquire_errata,
     },
 #endif
 #ifdef CONFIG_ARM64_ERRATUM_834220
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-10-21  9:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 10:41 [PATCH] xen/arm: Warn user on cpu errata 832075 Bertrand Marquis
2020-10-14 11:11 ` Julien Grall
2020-10-14 16:00   ` Bertrand Marquis
2020-10-14 20:46     ` Stefano Stabellini
2020-10-14 11:35 ` Andrew Cooper
2020-10-14 16:03   ` Bertrand Marquis
2020-10-14 17:22     ` Julien Grall
2020-10-14 21:15       ` Stefano Stabellini
2020-10-15 10:10         ` Bertrand Marquis
2020-10-15 18:05           ` Stefano Stabellini
2020-10-21  9:03             ` Julien Grall
2020-10-21  9:44               ` Bertrand Marquis
2020-10-21  9:46                 ` Julien Grall
2020-10-21  9:52                   ` Bertrand Marquis
2020-10-14 17:13   ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).