Re: [RFC][PATCH 07/22] x86,extable: Extend extable functionality

Mark Rutland
2021-11-05T10:16:28Z

On Fri, Nov 05, 2021 at 08:54:00AM +0100, Peter Zijlstra wrote:
> On Thu, Nov 04, 2021 at 02:49:35PM -0700, Josh Poimboeuf wrote:
> > On Thu, Nov 04, 2021 at 05:47:36PM +0100, Peter Zijlstra wrote:
> > > int ex_get_fixup_type(unsigned long ip)
> > > {
> > > const struct exception_table_entry *e = search_exception_tables(ip);
> > >
> > > - return e ? e->type : EX_TYPE_NONE;
> > > + return e ? FIELD_GET(EX_TYPE_MASK, e->type) : EX_TYPE_NONE;
> >
> > Maybe the 'type' field should be renamed, to better represent its new
> > use, and to try to discourage direct access. Not that I have any good
> > ideas. Some not-so-good ideas: "handler", "flags", "_type".
>
> How about the non-descript: "data" ?

FWIW, I was going to have a single `data` or `info` field on arm64, and I only
went with separate 16-bit `type` and `data` fields becuase it was *marginally*
simpler. If we needed more data bits in future I'd probably collapse `type`
into the `data` field. So you'd be in good company. ;)

On arm64 I'd named the masks EX_DATA_* to make the hierarchy clear, so maybe
you'd want to s/EX_TYPE_MASK/EX_DATA_TYPE/ for similar reasons.

Thanks,
Mark.