Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-06 Thread Josh Poimboeuf
On Fri, Sep 06, 2024 at 12:19:09PM +0200, Borislav Petkov wrote: > Right, I was talking to Michael about it yesterday, CCed. > > He suggested that you might be better off creating these annotations by > sticking the required info in a section instead of generating symbols. > > I.e., > > .pushsec

Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-06 Thread Borislav Petkov
On Wed, Sep 04, 2024 at 09:44:29AM -0700, Josh Poimboeuf wrote: > Not that I know of, since the compiler usually doesn't have visibility > to these sections. > > It might be possible to specify "entsize" in the .pushsection flags, > which is an ELF section header attribute which objtool could read

Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-04 Thread Josh Poimboeuf
On Wed, Sep 04, 2024 at 02:39:18PM +0200, Borislav Petkov wrote: > On Tue, Sep 03, 2024 at 09:28:29PM -0700, Josh Poimboeuf wrote: > > Take a more generic approach: for the "array of structs" style sections, > > annotate each struct entry with a symbol containing the entry. This > > makes it easy

Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-04 Thread Josh Poimboeuf
On Wed, Sep 04, 2024 at 10:08:42AM +0200, Peter Zijlstra wrote: > On Tue, Sep 03, 2024 at 09:28:29PM -0700, Josh Poimboeuf wrote: > > Take a more generic approach: for the "array of structs" style sections, > > annotate each struct entry with a symbol containing the entry. This > > makes it easy f

Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-04 Thread Borislav Petkov
On Tue, Sep 03, 2024 at 09:28:29PM -0700, Josh Poimboeuf wrote: > Take a more generic approach: for the "array of structs" style sections, > annotate each struct entry with a symbol containing the entry. This > makes it easy for tooling to parse the data and avoids the fragility of > hardcoding se

Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-04 Thread Peter Zijlstra
On Tue, Sep 03, 2024 at 09:28:29PM -0700, Josh Poimboeuf wrote: > On Tue, Sep 03, 2024 at 10:29:09AM +0200, Peter Zijlstra wrote: > > On Mon, Sep 02, 2024 at 09:00:11PM -0700, Josh Poimboeuf wrote: > > > Create a symbol for each special section entry. This helps objtool > > > extract needed entrie

Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-03 Thread Josh Poimboeuf
On Tue, Sep 03, 2024 at 10:29:09AM +0200, Peter Zijlstra wrote: > On Mon, Sep 02, 2024 at 09:00:11PM -0700, Josh Poimboeuf wrote: > > Create a symbol for each special section entry. This helps objtool > > extract needed entries. > > A little more explanation would be nice,.. Indeed! From: Josh

Re: [RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-03 Thread Peter Zijlstra
On Mon, Sep 02, 2024 at 09:00:11PM -0700, Josh Poimboeuf wrote: > Create a symbol for each special section entry. This helps objtool > extract needed entries. A little more explanation would be nice,..

[RFC 28/31] x86/alternative: Create symbols for special section entries

2024-09-02 Thread Josh Poimboeuf
Create a symbol for each special section entry. This helps objtool extract needed entries. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/alternative.h | 50 -- arch/x86/include/asm/asm.h | 24 +- arch/x86/include/asm/bug.h | 2 ++