]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/arm: Introduce a initcall to update cpu_hwcaps by serror_op
authorWei Chen <Wei.Chen@arm.com>
Wed, 5 Apr 2017 09:09:10 +0000 (17:09 +0800)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 5 Apr 2017 19:12:24 +0000 (12:12 -0700)
In the later patches of this series, we want to use the alternative
patching framework to avoid synchronizing serror_op in every entries
and exits. So we define a new cpu feature "SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT"
for serror_op. When serror_op is not equal to SERROR_DIVERSE, this
feature will be set to cpu_hwcaps.

Currently, the default serror_op is SERROR_DIVERSE, if we want to
change the serror_op value we have to place the serror parameter
in command line. It seems no problem to update cpu_hwcaps directly
in the serror parameter parsing function.

While the default option will be diverse today, this may change in the
future. So we introduce this initcall to guarantee the cpu_hwcaps can be
updated no matter the serror parameter is placed in the command line
or not.

Signed-off-by: Wei Chen <Wei.Chen@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c
xen/include/asm-arm/cpufeature.h

index 41955afaccd5427941ed6c0337763df966bb5c33..1e130fbbcb0161e030fd7c73eed3e7b96ecf5118 100644 (file)
@@ -162,6 +162,15 @@ static void __init parse_serrors_behavior(const char *str)
 }
 custom_param("serrors", parse_serrors_behavior);
 
+static int __init update_serrors_cpu_caps(void)
+{
+    if ( serrors_op != SERRORS_DIVERSE )
+        cpus_set_cap(SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT);
+
+    return 0;
+}
+__initcall(update_serrors_cpu_caps);
+
 void init_traps(void)
 {
     /* Setup Hyp vector base */
index c0a25ae13eabcc15a0f0ab30b4ac69b1ab8fc699..9eb72e1522928dfe34edd223154272ac58c96d2b 100644 (file)
@@ -40,8 +40,9 @@
 #define ARM32_WORKAROUND_766422 2
 #define ARM64_WORKAROUND_834220 3
 #define LIVEPATCH_FEATURE   4
+#define SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT 5
 
-#define ARM_NCAPS           5
+#define ARM_NCAPS           6
 
 #ifndef __ASSEMBLY__