Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-29 Thread Nathan Lynch
Andrew Donnellan writes: > On Mon, 2022-11-28 at 18:08 -0600, Nathan Lynch wrote: >> Andrew Donnellan writes: >> > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: >> > > Convert rtas_token() to use a lockless binary search on the >> > > function table. Fall back to the old behavior for loo

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Andrew Donnellan
On Mon, 2022-11-28 at 18:08 -0600, Nathan Lynch wrote: > Andrew Donnellan writes: > > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: > > > Convert rtas_token() to use a lockless binary search on the > > > function > > > table. Fall back to the old behavior for lookups against names > > > t

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Nathan Lynch
Andrew Donnellan writes: > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: >> Convert rtas_token() to use a lockless binary search on the function >> table. Fall back to the old behavior for lookups against names that >> are not known to be RTAS functions, but issue a warning. rtas_token()

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Nathan Lynch
Nick Child writes: > On 11/18/22 09:07, Nathan Lynch wrote: >> +static int __init rtas_token_to_function_xarray_init(void) >> +{ >> +int err = 0; >> + >> +for (size_t i = 0; i < ARRAY_SIZE(rtas_function_table); ++i) { >> +const struct rtas_function *func = &rtas_function_table[

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Nathan Lynch
Andrew Donnellan writes: > On Wed, 2022-11-23 at 13:32 -0600, Nick Child wrote: >> On 11/22/22 20:51, Andrew Donnellan wrote: >> > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: >> > > +enum rtas_function_flags { >> > > +   RTAS_FN_FLAG_BANNED_FOR_SYSCALL_ON_LE = (1 << 0), >> > > +}; >

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-23 Thread Andrew Donnellan
On Wed, 2022-11-23 at 13:32 -0600, Nick Child wrote: > On 11/22/22 20:51, Andrew Donnellan wrote: > > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: > > > +enum rtas_function_flags { > > > +   RTAS_FN_FLAG_BANNED_FOR_SYSCALL_ON_LE = (1 << 0), > > > +}; > > > > This seems to be new, wha

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-23 Thread Nick Child
On 11/18/22 09:07, Nathan Lynch wrote: +static int __init rtas_token_to_function_xarray_init(void) +{ + int err = 0; + + for (size_t i = 0; i < ARRAY_SIZE(rtas_function_table); ++i) { + const struct rtas_function *func = &rtas_function_table[i]; + const

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-23 Thread Nick Child
On 11/22/22 20:51, Andrew Donnellan wrote: On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: +enum rtas_function_flags { +   RTAS_FN_FLAG_BANNED_FOR_SYSCALL_ON_LE = (1 << 0), +}; This seems to be new, what's the justification? Seems to be a run-time replacement of: #ifdef CONFIG_CP

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-22 Thread Andrew Donnellan
On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: > Convert rtas_token() to use a lockless binary search on the function > table. Fall back to the old behavior for lookups against names that > are not known to be RTAS functions, but issue a warning. rtas_token() > is for function names; it is

[PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-18 Thread Nathan Lynch
The core RTAS support code and its clients perform two types of lookup for RTAS firmware function information. First, mapping a known function name to a token. The typical use case invokes rtas_token() to retrieve the token value to pass to rtas_call(). rtas_token() relies on of_get_property(), wh