]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
accel/habanalabs: separate nonce from max_size in cpucp_packet struct
authorDani Liberman <dliberman@habana.ai>
Mon, 11 Mar 2024 16:31:10 +0000 (18:31 +0200)
committerOfir Bitton <obitton@habana.ai>
Sun, 23 Jun 2024 06:53:04 +0000 (09:53 +0300)
In struct cpucp_packet both nonce and data_max_size members are in an
union overlapping each other. This is a problem as they both are used
in attestation and info_signed packets.
The solution here is to move the nonce member to a different union under
the same structure.

Signed-off-by: Dani Liberman <dliberman@habana.ai>
Reviewed-by: Ofir Bitton <obitton@habana.ai>
Signed-off-by: Ofir Bitton <obitton@habana.ai>
include/linux/habanalabs/cpucp_if.h

index 1ac1d68193e3402a2765ad8f44683591db5da25b..0913415243e84bc33ca6bacd21fd902432a8f165 100644 (file)
@@ -859,9 +859,6 @@ struct cpucp_packet {
                 * result cannot be used to hold general purpose data.
                 */
                __le32 status_mask;
-
-               /* random, used once number, for security packets */
-               __le32 nonce;
        };
 
        union {
@@ -870,6 +867,9 @@ struct cpucp_packet {
 
                /* For Generic packet sub index */
                __le32 pkt_subidx;
+
+               /* random, used once number, for security packets */
+               __le32 nonce;
        };
 };