Re: [PATCH v6 08/11] misc: amd-sbi: Add support for CPUID protocol

From: Gupta, Akshay
Date: Tue Mar 25 2025 - 09:21:30 EST



On 3/24/2025 8:59 PM, Arnd Bergmann wrote:
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


On Mon, Mar 24, 2025, at 15:58, Akshay Gupta wrote:

struct apml_message {
/*
* [0]...[3] mailbox 32bit input
+ * cpuid,
+ * [4][5] cpuid: thread
+ * [6] cpuid: ext function & read eax/ebx or ecx/edx
+ * [7:0] -> bits [7:4] -> ext function &
+ * bit [0] read eax/ebx or ecx/edx
* [7] read/write functionality
*/
union {
+ __u64 cpu_msr_in;
__u32 mb_in[2];
__u8 reg_in[8];
} data_in;
This changes the alignment of the structure and makes
it incompatible between 32-bit and 64-bit userspace
when there is an odd number of 32-bit words in it.

Arnd
Ack, I will add explicit padding of __u32 padding[2] in the end in the structure.