[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230127112758.37891-15-steven.price@arm.com>
Date: Fri, 27 Jan 2023 11:27:58 +0000
From: Steven Price <steven.price@....com>
To: kvmarm@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org
Cc: Steven Price <steven.price@....com>,
Catalin Marinas <catalin.marinas@....com>,
Ard Biesheuvel <ardb@...nel.org>,
Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
James Morse <james.morse@....com>,
Oliver Upton <oliver.upton@...ux.dev>,
Zenghui Yu <yuzenghui@...wei.com>,
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 14/14] HACK: Accept prototype RSI version
The upstream RMM currently advertises the major version of an internal
prototype (v12.0) rather than the expected version from the RMM
architecture specification (v1.0).
Add a config option to enable support for the prototype RSI v12.0.
Signed-off-by: Steven Price <steven.price@....com>
---
arch/arm64/include/asm/rsi_smc.h | 2 ++
arch/arm64/kernel/rsi.c | 5 +++++
arch/arm64/kvm/Kconfig | 8 ++++++++
3 files changed, 15 insertions(+)
diff --git a/arch/arm64/include/asm/rsi_smc.h b/arch/arm64/include/asm/rsi_smc.h
index bc0cdd83f164..baf07f905353 100644
--- a/arch/arm64/include/asm/rsi_smc.h
+++ b/arch/arm64/include/asm/rsi_smc.h
@@ -29,6 +29,8 @@
#define RSI_ABI_VERSION ((RSI_ABI_VERSION_MAJOR << 16) | \
RSI_ABI_VERSION_MINOR)
+#define RSI_LEGACY_ABI_VERSION 0xc0000
+
#define RSI_ABI_VERSION_GET_MAJOR(_version) ((_version) >> 16)
#define RSI_ABI_VERSION_GET_MINOR(_version) ((_version) & 0xFFFF)
diff --git a/arch/arm64/kernel/rsi.c b/arch/arm64/kernel/rsi.c
index 1cc292826f2b..45b26f23e706 100644
--- a/arch/arm64/kernel/rsi.c
+++ b/arch/arm64/kernel/rsi.c
@@ -41,6 +41,11 @@ static bool rsi_version_matches(void)
RSI_ABI_VERSION_GET_MAJOR(ver),
RSI_ABI_VERSION_GET_MINOR(ver));
+#ifdef CONFIG_RME_USE_PROTOTYPE_HACKS
+ if (ver == RSI_LEGACY_ABI_VERSION)
+ return true;
+#endif
+
return (ver >= RSI_ABI_VERSION &&
RSI_ABI_VERSION_GET_MAJOR(ver) == RSI_ABI_VERSION_MAJOR);
}
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
--
2.34.1
Powered by blists - more mailing lists