[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230127112932.38045-29-steven.price@arm.com>
Date: Fri, 27 Jan 2023 11:29:32 +0000
From: Steven Price <steven.price@....com>
To: kvm@...r.kernel.org, kvmarm@...ts.linux.dev
Cc: Steven Price <steven.price@....com>,
Catalin Marinas <catalin.marinas@....com>,
Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
James Morse <james.morse@....com>,
Oliver Upton <oliver.upton@...ux.dev>,
Suzuki K Poulose <suzuki.poulose@....com>,
Zenghui Yu <yuzenghui@...wei.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Joey Gouly <joey.gouly@....com>,
Alexandru Elisei <alexandru.elisei@....com>,
Christoffer Dall <christoffer.dall@....com>,
Fuad Tabba <tabba@...gle.com>, linux-coco@...ts.linux.dev
Subject: [RFC PATCH 28/28] HACK: Accept prototype RMI versions
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@....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(+)
diff --git a/arch/arm64/include/asm/rmi_smc.h b/arch/arm64/include/asm/rmi_smc.h
index 16ff65090f3a..d6bbd7d92b8f 100644
--- a/arch/arm64/include/asm/rmi_smc.h
+++ b/arch/arm64/include/asm/rmi_smc.h
@@ -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) \
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
index 05da3c8f7e88..13858a5047fd 100644
--- a/arch/arm64/kvm/Kconfig
+++ b/arch/arm64/kvm/Kconfig
@@ -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
diff --git a/arch/arm64/kvm/rme.c b/arch/arm64/kvm/rme.c
index 1eb76cbee267..894060635226 100644
--- a/arch/arm64/kvm/rme.c
+++ b/arch/arm64/kvm/rme.c
@@ -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,
--
2.34.1
Powered by blists - more mailing lists