[RFC,28/28] HACK: Accept prototype RMI versions
Commit Message
The upstream RMM currently advertises the major version of an internal
prototype (v56.0) rather than the expected version from the RMM
architecture specification (v1.0).
Add a config option to enable support for the prototype RMI v56.0.
Signed-off-by: Steven Price <steven.price@arm.com>
---
arch/arm64/include/asm/rmi_smc.h | 7 +++++++
arch/arm64/kvm/Kconfig | 8 ++++++++
arch/arm64/kvm/rme.c | 8 ++++++++
3 files changed, 23 insertions(+)
@@ -6,6 +6,13 @@
#ifndef __ASM_RME_SMC_H
#define __ASM_RME_SMC_H
+#ifdef CONFIG_RME_USE_PROTOTYPE_HACKS
+
+// Allow the prototype RMI version
+#define PROTOTYPE_RMI_ABI_MAJOR_VERSION 56
+
+#endif /* CONFIG_RME_USE_PROTOTYPE_HACKS */
+
#include <linux/arm-smccc.h>
#define SMC_RxI_CALL(func) \
@@ -58,6 +58,14 @@ config NVHE_EL2_DEBUG
If unsure, say N.
+config RME_USE_PROTOTYPE_HACKS
+ bool "Allow RMM prototype version numbers"
+ default y
+ help
+ For compatibility with the the current RMM code allow versions
+ numbers from a prototype implementation as well as the expected
+ version number from the RMM specification.
+
config PROTECTED_NVHE_STACKTRACE
bool "Protected KVM hypervisor stacktraces"
depends on NVHE_EL2_DEBUG
@@ -67,6 +67,14 @@ static int rmi_check_version(void)
version_major = RMI_ABI_VERSION_GET_MAJOR(res.a0);
version_minor = RMI_ABI_VERSION_GET_MINOR(res.a0);
+#ifdef PROTOTYPE_RMI_ABI_MAJOR_VERSION
+ // Support the prototype
+ if (version_major == PROTOTYPE_RMI_ABI_MAJOR_VERSION) {
+ kvm_err("Using prototype RMM support (version %d.%d)\n",
+ version_major, version_minor);
+ return 0;
+ }
+#endif
if (version_major != RMI_ABI_MAJOR_VERSION) {
kvm_err("Unsupported RMI ABI (version %d.%d) we support %d\n",
version_major, version_minor,