lkml.org 
[lkml]   [2022]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 8/8] vfio/pci: Add the support for PCI D3cold state
From
On 5/10/2022 7:00 PM, Jason Gunthorpe wrote:
> On Tue, May 10, 2022 at 06:56:02PM +0530, Abhishek Sahu wrote:
>>> We can add a directive to enforce an alignment regardless of the field
>>> size. I believe the feature ioctl header is already going to be eight
>>> byte aligned, so it's probably not strictly necessary, but Jason seems
>>> to be adding more of these directives elsewhere, so probably a good
>>> idea regardless. Thanks,
>
>> So, should I change it like
>>
>> __u8 low_power_state __attribute__((aligned(8)));
>>
>> Or
>>
>> __aligned_u64 low_power_state
>
> You should be explicit about padding, add a reserved to cover the gap.
>
> Jasno


Thanks Jason.

So, I need to make it like following. Correct ?

__u8 low_power_state;
__u8 reserved[7];

It seems, then this aligned attribute should not be required.

Thanks,
Abhishek

\
 
 \ /
  Last update: 2022-05-12 14:28    [W:0.149 / U:1.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site