Re: [PATCH v5 1/5] hyperv: Define struct hv_output_get_vp_registers
From: Wei Liu <wei.liu@kernel.org>
Date: 2025-01-08 07:34:14
Also in:
lkml
On Mon, Jan 06, 2025 at 12:24:32PM -0800, Roman Kisel wrote:
On 1/6/2025 9:37 AM, Michael Kelley wrote:quoted
From: Roman Kisel <redacted> Sent: Monday, December 30, 2024 10:10 AM[...]quoted
These bit field definitions don't look right. We want to "fill up" the field size, so that we're explicit about each bit, and not leave it to the compiler to add padding (which __packed tells the compiler not to do). So in aggregate, the "u64" bit fields should account for all 64 bits, but here you account for only 32 bits. There are two ways to fix this: u32 interruption_pending : 1; u32 interruption_type: 1; u32 reserved : 30; u32 error_code; Or u64 interruption_pending : 1; u64 interruption_type: 1; u64 reserved : 30; u64 error_code : 32; Nuno -- your thoughts?Quite a blunder on my side! Thank you very much for your help :) GDB is my witness: (gdb) ptype /o union hv_arm64_pending_synthetic_exception_event /* offset | size */ type = union hv_arm64_pending_synthetic_exception_event { /* 16 */ u64 as_uint64[2]; /* 13 */ struct { /* 0: 0 | 4 */ u32 event_pending : 1; /* 0: 1 | 4 */ u32 event_type : 3; /* 0: 4 | 4 */ u32 reserved : 4; /* 1 | 4 */ u32 exception_type; /* 5 | 8 */ u64 context; /* total size (bytes): 13 */ }; /* total size (bytes): 16 */ } which looks messed up to me to put it mildly. Will fix next time.
We are pretty close to the next merge window (~2 weeks). Can you please resend a version this week or early next week? Nuno, if you have any comments on this series, now it is the time to share them. Thanks, Wei.