public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* abidiff handling of migrations to flex arrays
@ 2023-10-25 23:31 John Moon
  2023-10-27 10:14 ` Dodji Seketeli
  0 siblings, 1 reply; 3+ messages in thread
From: John Moon @ 2023-10-25 23:31 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: Satya Durga Srinivasu Prabhala, Trilok Soni, libabigail

Hi Dodji,

I was reviewing notes that Greg KH gave me in the last revision of the 
script.

https://lore.kernel.org/lkml/2023041136-donator-faceplate-5f91@gregkh/

Notably, this section:

>>  Addition/use of flex arrays:
>>    - include/uapi/linux/rseq.h (f7b01bb0b57f)
>>    - include/uapi/scsi/scsi_bsg_mpi3mr.h (c6f2e6b6eaaf)
> 
> That is not a breakage, that's a tool problem.
> 
>>  Type change:
>>    - include/uapi/scsi/scsi_bsg_ufs.h (3f5145a615238)
> 
> Again, not a real breakage, size is still the same.
> 
>>  Additions into existing struct:
>>    - include/uapi/drm/amdgpu_drm.h (b299221faf9b)
>>    - include/uapi/linux/perf_event.h (09519ec3b19e)
>>    - include/uapi/linux/virtio_blk.h (95bfec41bd3d)
> 
> Adding data to the end of a structure is a well-known way to extend the
> api, in SOME instances if it is used properly.
> 
> So again, not a break.

If we look at these examples, we can now effectively suppress all of 
them except for include/uapi/scsi/scsi_bsg_mpi3mr.h (c6f2e6b6eaaf).

https://github.com/torvalds/linux/commit/c6f2e6b6eaaf883df482cb94f302acad9b80a2a4

Basically, the change takes a struct which ends in a "fake flex array" 
and turns it into a real flex array:

struct foo {
         int x;
         int y;
         int end[1];
};

...

struct foo {
         int x;
         int y;
         int end[];
};

abidiff flags this change with:

   [C] 'struct foo' changed:
     type size changed from 96 to 64 (in bits)
     1 data member change:
       type of 'int end[1]' changed:
         type name changed from 'int[1]' to 'int[]'
         array type size changed from 32 to 'unknown'
         array type subrange 1 changed length from 1 to 'unknown'

These sorts of changes are all over the kernel since they recently 
decided to move to using flex arrays and are continuing to make updates 
similar to this one.

I tried looking through the docs and couldn't find a way to suppress 
this kind of change. Do you know of a way to do it using the existing 
suppressions? I think semantically we're trying to suppress "changes 
which take an array of size 1 and turn it into a flex array".

Thanks,
John

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-27 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 23:31 abidiff handling of migrations to flex arrays John Moon
2023-10-27 10:14 ` Dodji Seketeli
2023-10-27 17:51   ` John Moon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).