lkml.org 
[lkml]   [2016]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [Linux-ima-devel] [PATCH 1/7] ima: on soft reboot, restore the measurement list
Date
From: Linuxppc-dev [mailto:linuxppc-dev-bounces+david.laight=aculab.com@lists.ozlabs.org] On Behalf Of
> > > So given what you have above, you'd use something like:
> > >
> > > struct ima_kexec_hdr {
> > > u16 version;
> > > u16 _reserved0;
> > > u32 _reserved1;
> > > u64 buffer_size;
> > > u64 count;
> > > };
> > >
> > > cheers
> >
> > Thanks, I'll make this change.
>
> I would suggest:
>
> struct ima_kexec_hdr {
> u64 buffer_size;
> u64 count;
> u16 version;
> };
>
> and let the compiler add the proper padding, depending on the architecture. On
> 32bit machine we'll have 4 bytes smaller allocations (compared to 64bit) while
> retaining the same functionality.

AAAArrrrgggg.....

That doesn't work for 32bit applications on 64bit hosts.
The extra bytes will make 0 difference to the allocation cost and
lots to the processing.

David

\
 
 \ /
  Last update: 2016-08-11 00:01    [W:0.079 / U:1.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site