Re: [PATCH 1/3] rust: add static_call support

2024-06-07 Thread Miguel Ojeda
On Fri, Jun 7, 2024 at 12:52 PM Peter Zijlstra wrote: > > I'm sorry, but 30+ years of reading ! as NOT (or factorial) isn't going > to go away. So I'm reading your macros do NOT rule. It makes it clear what is macro call or not. They could have gone for UPPERCASE names (for instance), yes. On the

Re: [PATCH 1/3] rust: add static_call support

2024-06-07 Thread Peter Zijlstra
On Fri, Jun 07, 2024 at 09:43:29AM +, Alice Ryhl wrote: > Peter Zijlstra wrote: > > On Thu, Jun 06, 2024 at 09:09:00PM +0200, Miguel Ojeda wrote: > > > On Thu, Jun 6, 2024 at 7:19 PM Peter Zijlstra > > > wrote: > > > > > > > > This is absolutely unreadable gibberish -- how am I supposed to k

Re: [PATCH 1/3] rust: add static_call support

2024-06-07 Thread Alice Ryhl
Peter Zijlstra wrote: > On Thu, Jun 06, 2024 at 09:09:00PM +0200, Miguel Ojeda wrote: > > On Thu, Jun 6, 2024 at 7:19 PM Peter Zijlstra wrote: > > > > > > This is absolutely unreadable gibberish -- how am I supposed to keep > > > this in sync with the rest of the static_call infrastructure? > >

Re: [PATCH 1/3] rust: add static_call support

2024-06-06 Thread Peter Zijlstra
On Thu, Jun 06, 2024 at 09:09:00PM +0200, Miguel Ojeda wrote: > On Thu, Jun 6, 2024 at 7:19 PM Peter Zijlstra wrote: > > > > This is absolutely unreadable gibberish -- how am I supposed to keep > > this in sync with the rest of the static_call infrastructure? > > Yeah, they are macros, which look

Re: [PATCH 1/3] rust: add static_call support

2024-06-06 Thread Miguel Ojeda
On Thu, Jun 6, 2024 at 7:19 PM Peter Zijlstra wrote: > > This is absolutely unreadable gibberish -- how am I supposed to keep > this in sync with the rest of the static_call infrastructure? Yeah, they are macros, which look different from "normal" Rust code. Is there something we could do to hel

Re: [PATCH 1/3] rust: add static_call support

2024-06-06 Thread Peter Zijlstra
On Thu, Jun 06, 2024 at 03:05:24PM +, Alice Ryhl wrote: > Add static_call support by mirroring how C does. When the platform does > not support static calls (right now, that means that it is not x86), > then the function pointer is loaded from a global and called. Otherwise, > we generate a cal

[PATCH 1/3] rust: add static_call support

2024-06-06 Thread Alice Ryhl
Add static_call support by mirroring how C does. When the platform does not support static calls (right now, that means that it is not x86), then the function pointer is loaded from a global and called. Otherwise, we generate a call to a trampoline function, and objtool is used to make these calls