The section B4.4.2 'RsiHostCall type' of the RMM specification version A-bet0 specifies the Imm field in HostCallArgs structure as a 16 bit wide value and the offset for the gprs[0] field is 0x8, which means the 6 bytes after the Imm field are padded.
Therefore, define the Imm field as UINT16 and add an additional field UINT8 Reserved1[6] for padding. Also update the RsiHostCall() to initialise the Reserved1 field to zero. Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org> Cc: Leif Lindholm <quic_llind...@quicinc.com> Cc: Gerd Hoffmann <kra...@redhat.com> Signed-off-by: Sami Mujawar <sami.muja...@arm.com> --- ArmVirtPkg/Include/Library/ArmCcaRsiLib.h | 4 +++- ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h index db1ae5b4c1a6475a275ce6be3383ea933ec9af20..af4be275d37f0376335de5344f9626c9a92c70d2 100644 --- a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h +++ b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h @@ -85,7 +85,9 @@ typedef struct RealmConfig { See Section 4.4.2 RsiHostCall type, RMM Specification, version A-bet0 */ typedef struct HostCallArgs { - UINT64 Imm; + UINT16 Imm; + UINT8 Reserved1[6]; + UINT64 Gprs0; UINT64 Gprs1; UINT64 Gprs2; diff --git a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c index 79a65300f05af665b3afebe2a8f8b1f6faf76f23..dc41e77b55f4369e89592b5437e525baf80aa0b3 100644 --- a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c +++ b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c @@ -519,6 +519,7 @@ RsiHostCall ( STATIC_ASSERT (sizeof (HOST_CALL_ARGS) == SIZE_4KB); // Clear the reserved fields + ZeroMem (&Args->Reserved1, sizeof (Args->Reserved1)); ZeroMem (&Args->Reserved, sizeof (Args->Reserved)); ZeroMem (&SmcCmd, sizeof (SmcCmd)); -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117693): https://edk2.groups.io/g/devel/message/117693 Mute This Topic: https://groups.io/mt/105483432/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-