On 22/05/2024 16:52, Steven Price wrote:
On 15/05/2024 12:10, Catalin Marinas wrote:
On Fri, Apr 12, 2024 at 09:42:12AM +0100, Steven Price wrote:
diff --git a/arch/arm64/include/asm/rsi_cmds.h b/arch/arm64/include/asm/rsi_cmds.h
index b4cbeafa2f41..c1850aefe54e 100644
--- a/arch/arm64/include/asm/rsi_cmds.h
+++ b/arch/arm64/include/asm/rsi_cmds.h
@@ -10,6 +10,9 @@
#include <asm/rsi_smc.h>
+#define GRANULE_SHIFT 12
+#define GRANULE_SIZE (_AC(1, UL) << GRANULE_SHIFT)
The name is too generic and it goes into a header file. Also maybe move
it to rsi.h, and use it for other definitions like rsi_config struct
size and alignment.
The realm config structure although it 'happens to be' granule sized
isn't really required to be - so I think it would be a bit confusing to
specify that.
The struct realm_config must be aligned to GRANULE_SIZE and the argument
must be as such aligned.
There are only two other interfaces that require this:
* RSI_IPA_STATE_GET - completely unused so far
* RSI_ATTESTATION_TOKEN_CONTINUE - the buffer has to be contained with
a granule, so it affects the maximum length per operation.
I'll rename to RSI_GRANULE_{SHIFT,SIZE}, but I'm not sure it really
That looks good to me.
Suzuki
belongs in rsi.h because none of that functionality cares about the
granule size (indeed the driver in the following patch doesn't include
rsi.h).
Thanks,
Steve