• Ofir Bitton's avatar
    habanalabs: Fix alignment issue in cpucp_info structure · 763a0b4d
    Ofir Bitton authored
    Because the device CPU compiler aligns structures to 8 bytes,
    struct cpucp_info has an alignment issue as some parts
    in the structure are not aligned to 8 bytes.
    It is preferred that we explicitly insert placeholders inside
    the structure to avoid confusion
    
    in order to validate this scenario, we printed both pointers:
    
    __u8 cpucp_version[VERSION_MAX_LEN]; (0xffff899c67ed4cbc)
    __le64 dram_size;                    (0xffff899c67ed4d40)
    
    we see difference of 132 bytes although the first array
    is only 128 bytes long, Meaning compiler added a 4 byte padding.
    Signed-off-by: default avatarOfir Bitton <obitton@habana.ai>
    Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
    763a0b4d
cpucp_if.h 12.9 KB