Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-09-13 Thread Benno Lossin
On 13.09.24 00:37, Sami Tolvanen wrote: > Hi, > > On Thu, Sep 12, 2024 at 2:58 PM Benno Lossin wrote: >> >> On 12.09.24 22:58, Sami Tolvanen wrote: >>> That's an interesting point. Is the problem that you cannot assign >>> arbitrary values to the Rust enum that bindgen generates, or is using >>>

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-09-12 Thread Sami Tolvanen
Hi, On Thu, Sep 12, 2024 at 2:58 PM Benno Lossin wrote: > > On 12.09.24 22:58, Sami Tolvanen wrote: > > That's an interesting point. Is the problem that you cannot assign > > arbitrary values to the Rust enum that bindgen generates, or is using > > a #define the problem? We could probably just ma

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-09-12 Thread Benno Lossin
On 12.09.24 22:58, Sami Tolvanen wrote: > Hi Benno, > > On Thu, Sep 12, 2024 at 11:08 AM Benno Lossin wrote: >> >> On 12.09.24 18:06, Sami Tolvanen wrote: >>> >>> I thought about this a bit and I wonder if we need a separate >>> mechanism for that, or is it sufficient to just #define any addition

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-09-12 Thread Sami Tolvanen
Hi Benno, On Thu, Sep 12, 2024 at 11:08 AM Benno Lossin wrote: > > On 12.09.24 18:06, Sami Tolvanen wrote: > > > > I thought about this a bit and I wonder if we need a separate > > mechanism for that, or is it sufficient to just #define any additional > > hidden values you want to add instead of

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-09-12 Thread Benno Lossin
On 12.09.24 18:06, Sami Tolvanen wrote: > On Wed, Sep 11, 2024 at 4:43 AM Petr Pavlu wrote: >> >> On 8/31/24 02:05, Sami Tolvanen wrote: >>> On Fri, Aug 30, 2024 at 9:34 AM Miroslav Benes wrote: yes, this is one of the approaches we use in SLES. We add kabi paddings to some structu

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-09-12 Thread Sami Tolvanen
On Wed, Sep 11, 2024 at 4:43 AM Petr Pavlu wrote: > > On 8/31/24 02:05, Sami Tolvanen wrote: > > On Fri, Aug 30, 2024 at 9:34 AM Miroslav Benes wrote: > >> > >> yes, this is one of the approaches we use in SLES. We add kabi paddings > >> to some structures in advance (see [1] as a random example)

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-09-11 Thread Petr Pavlu
On 8/31/24 02:05, Sami Tolvanen wrote: > On Fri, Aug 30, 2024 at 9:34 AM Miroslav Benes wrote: >> >> yes, this is one of the approaches we use in SLES. We add kabi paddings >> to some structures in advance (see [1] as a random example) and then use >> it later if needed. >> >> It is not the only a

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-30 Thread Sami Tolvanen
Hi Miroslav, On Fri, Aug 30, 2024 at 9:34 AM Miroslav Benes wrote: > > yes, this is one of the approaches we use in SLES. We add kabi paddings > to some structures in advance (see [1] as a random example) and then use > it later if needed. > > It is not the only approach. Much more often we do no

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-30 Thread Miroslav Benes
Hi, On Thu, 15 Aug 2024, Sami Tolvanen wrote: > Distributions that want to maintain a stable kABI need the ability to > add reserved fields to kernel data structures that they anticipate > will be modified during the ABI support timeframe, either by LTS > updates or backports. > > With genksyms,

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-24 Thread Benno Lossin
On 23.08.24 21:17, Sami Tolvanen wrote: > On Thu, Aug 22, 2024 at 11:53 PM Greg Kroah-Hartman > wrote: >> >> On Thu, Aug 22, 2024 at 12:00:15PM +, Benno Lossin wrote: Here's one example in the android tree where 4 64bit fields are reserved for future abi changes: https

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-24 Thread Benno Lossin
On 23.08.24 01:53, Greg Kroah-Hartman wrote: > On Thu, Aug 22, 2024 at 12:00:15PM +, Benno Lossin wrote: >>> Here's one example in the android tree where 4 64bit fields are reserved >>> for future abi changes: >>> >>> https://android.googlesource.com/kernel/common/+/refs/heads/android12-5.

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-23 Thread Sami Tolvanen
On Thu, Aug 22, 2024 at 11:53 PM Greg Kroah-Hartman wrote: > > On Thu, Aug 22, 2024 at 12:00:15PM +, Benno Lossin wrote: > > > Here's one example in the android tree where 4 64bit fields are reserved > > > for future abi changes: > > > > > > https://android.googlesource.com/kernel/common/

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-22 Thread Greg Kroah-Hartman
On Thu, Aug 22, 2024 at 12:00:15PM +, Benno Lossin wrote: > > Here's one example in the android tree where 4 64bit fields are reserved > > for future abi changes: > > > > https://android.googlesource.com/kernel/common/+/refs/heads/android12-5.10/include/linux/fs.h#421 > > > > And here's a

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-22 Thread Benno Lossin
On 22.08.24 09:29, Greg Kroah-Hartman wrote: > On Thu, Aug 22, 2024 at 05:55:32AM +, Benno Lossin wrote: >> On 22.08.24 01:29, Greg Kroah-Hartman wrote: >>> On Wed, Aug 21, 2024 at 11:31:25AM +, Benno Lossin wrote: On 20.08.24 22:03, Matthew Maurer wrote: >>> The way `KAbiReserved`

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-22 Thread Greg Kroah-Hartman
On Thu, Aug 22, 2024 at 05:55:32AM +, Benno Lossin wrote: > On 22.08.24 01:29, Greg Kroah-Hartman wrote: > > On Wed, Aug 21, 2024 at 11:31:25AM +, Benno Lossin wrote: > >> On 20.08.24 22:03, Matthew Maurer wrote: > > The way `KAbiReserved` is implemented is via a `union` (maybe a bit >

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-21 Thread Benno Lossin
On 22.08.24 01:29, Greg Kroah-Hartman wrote: > On Wed, Aug 21, 2024 at 11:31:25AM +, Benno Lossin wrote: >> On 20.08.24 22:03, Matthew Maurer wrote: > The way `KAbiReserved` is implemented is via a `union` (maybe a bit > ironic, considering what I said in my other replies, but in this c

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-21 Thread Greg Kroah-Hartman
On Wed, Aug 21, 2024 at 11:31:25AM +, Benno Lossin wrote: > On 20.08.24 22:03, Matthew Maurer wrote: > >>> The way `KAbiReserved` is implemented is via a `union` (maybe a bit > >>> ironic, considering what I said in my other replies, but in this case, > >>> we would provide a safe abstraction o

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-21 Thread Sami Tolvanen
On Wed, Aug 21, 2024 at 4:31 AM Benno Lossin wrote: > > On 20.08.24 22:03, Matthew Maurer wrote: > >>> The way `KAbiReserved` is implemented is via a `union` (maybe a bit > >>> ironic, considering what I said in my other replies, but in this case, > >>> we would provide a safe abstraction over thi

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-21 Thread Benno Lossin
On 20.08.24 22:03, Matthew Maurer wrote: >>> The way `KAbiReserved` is implemented is via a `union` (maybe a bit >>> ironic, considering what I said in my other replies, but in this case, >>> we would provide a safe abstraction over this `union`, thus avoiding >>> exposing users of this type to `un

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-20 Thread Matthew Maurer
> > The way `KAbiReserved` is implemented is via a `union` (maybe a bit > > ironic, considering what I said in my other replies, but in this case, > > we would provide a safe abstraction over this `union`, thus avoiding > > exposing users of this type to `unsafe`): > > > > #[repr(C)] > > pu

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-20 Thread Sami Tolvanen
On Mon, Aug 19, 2024 at 10:17 PM Benno Lossin wrote: > > On 19.08.24 21:38, Sami Tolvanen wrote: > > > > This definitely looks cleaner than unions in Rust, but how would this > > scheme be visible in DWARF? You might also need to expand the annotation > > to allow replacing one reserved field with

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-19 Thread Benno Lossin
On 19.08.24 21:38, Sami Tolvanen wrote: > Hi Benno, > > On Sat, Aug 17, 2024 at 01:19:55PM +, Benno Lossin wrote: >> >> For this use-case (the one in the patch), I don't really know if we want >> to copy the approach from C. Do we even support exporting kABI from >> Rust? If yes, then we I wou

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-19 Thread Benno Lossin
On 19.08.24 20:25, Greg Kroah-Hartman wrote: > On Sat, Aug 17, 2024 at 01:19:55PM +, Benno Lossin wrote: >> On 17.08.24 09:41, Greg Kroah-Hartman wrote: >>> On Fri, Aug 16, 2024 at 08:50:53AM -0700, Sami Tolvanen wrote: On Fri, Aug 16, 2024 at 12:20 AM Greg Kroah-Hartman wrote: >

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-19 Thread Sami Tolvanen
Hi Benno, On Sat, Aug 17, 2024 at 01:19:55PM +, Benno Lossin wrote: > > For this use-case (the one in the patch), I don't really know if we want > to copy the approach from C. Do we even support exporting kABI from > Rust? If yes, then we I would recommend we tag it in the source code > inste

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-19 Thread Greg Kroah-Hartman
On Sat, Aug 17, 2024 at 01:19:55PM +, Benno Lossin wrote: > On 17.08.24 09:41, Greg Kroah-Hartman wrote: > > On Fri, Aug 16, 2024 at 08:50:53AM -0700, Sami Tolvanen wrote: > >> On Fri, Aug 16, 2024 at 12:20 AM Greg Kroah-Hartman > >> wrote: > >>> On Thu, Aug 15, 2024 at 05:39:20PM +, Sami

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-17 Thread Benno Lossin
On 17.08.24 09:41, Greg Kroah-Hartman wrote: > On Fri, Aug 16, 2024 at 08:50:53AM -0700, Sami Tolvanen wrote: >> On Fri, Aug 16, 2024 at 12:20 AM Greg Kroah-Hartman >> wrote: >>> On Thu, Aug 15, 2024 at 05:39:20PM +, Sami Tolvanen wrote: >>> Especially as I have no idea how you are going to do

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-17 Thread Greg Kroah-Hartman
On Fri, Aug 16, 2024 at 08:50:53AM -0700, Sami Tolvanen wrote: > Hi Greg, > > On Fri, Aug 16, 2024 at 12:20 AM Greg Kroah-Hartman > wrote: > > > > On Thu, Aug 15, 2024 at 05:39:20PM +, Sami Tolvanen wrote: > > > Distributions that want to maintain a stable kABI need the ability to > > > add r

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-16 Thread Sami Tolvanen
Hi Greg, On Fri, Aug 16, 2024 at 12:20 AM Greg Kroah-Hartman wrote: > > On Thu, Aug 15, 2024 at 05:39:20PM +, Sami Tolvanen wrote: > > Distributions that want to maintain a stable kABI need the ability to > > add reserved fields to kernel data structures that they anticipate > > will be modif

Re: [PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-16 Thread Greg Kroah-Hartman
On Thu, Aug 15, 2024 at 05:39:20PM +, Sami Tolvanen wrote: > Distributions that want to maintain a stable kABI need the ability to > add reserved fields to kernel data structures that they anticipate > will be modified during the ABI support timeframe, either by LTS > updates or backports. > >

[PATCH v2 16/19] gendwarfksyms: Add support for reserved structure fields

2024-08-15 Thread Sami Tolvanen
Distributions that want to maintain a stable kABI need the ability to add reserved fields to kernel data structures that they anticipate will be modified during the ABI support timeframe, either by LTS updates or backports. With genksyms, developers would typically hide changes to the reserved fie