summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKohei Enju <enju.kohei@fujitsu.com>2026-10-14 11:43:23 +0900
committerCatalin Marinas <catalin.marinas@arm.com>2026-10-14 11:34:54 +0100
commitc83237edf0adb8f8cbd9859841bbca5acc00fc11 (patch)
tree91c836d16e9f0d03e67ef167caa3422364bd7ca0 /include/linux
parentc6e78a4080a3b310a9f61db778d6dee7bc646cb7 (diff)
downloadlinux-c83237edf0adb8f8cbd9859841bbca5acc00fc11.tar.gz
linux-c83237edf0adb8f8cbd9859841bbca5acc00fc11.zip
arm64: rsi: Correct type of realm_config::hash_algo
The RMM specification (DEN0137, B5.5.10 and B5.5.19) defines RsiHashAlgorithm as an 8-bit enumeration, stored at offset 0x8 of RsiRealmConfig, with the unused bits of the structure being MBZ. However, realm_config::hash_algo is declared as unsigned long. For an RMM that zeroes the unused bits, the wider type gives the same value. An RMM that only writes the low byte (as TF-RMM currently does) leaves bytes 1-7 with whatever the guest buffer contained, so a comparison of the 64-bit field against RSI_HASH_SHA_* can fail. Nothing in mainline reads the field yet, but the proposed Realm measurement register support does. Declare the field as u8 so the guest only depends on the byte the specification defines. The struct size and the offsets of the other fields do not change. Link: https://lore.kernel.org/all/20260413084957.327661-4-sami.mujawar@arm.com/ Fixes: b880a80011f5 ("arm64: rsi: Add RSI definitions") Signed-off-by: Kohei Enju <enju.kohei@fujitsu.com> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/arm-smccc-rsi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/arm-smccc-rsi.h b/include/linux/arm-smccc-rsi.h
index fddb77986f70..cca881ddfdba 100644
--- a/include/linux/arm-smccc-rsi.h
+++ b/include/linux/arm-smccc-rsi.h
@@ -128,7 +128,7 @@ struct realm_config {
union {
struct {
unsigned long ipa_bits; /* Width of IPA in bits */
- unsigned long hash_algo; /* Hash algorithm */
+ u8 hash_algo; /* Hash algorithm */
};
u8 pad[0x200];
};