[PATCH v3 2/9] ARM: tlbflush: Make TLB flushes into static inlines

Linus Walleij linus.walleij at linaro.org
Tue Mar 12 01:14:14 PDT 2024


On Tue, Mar 12, 2024 at 8:25 AM Ard Biesheuvel <ardb at kernel.org> wrote:
> On Tue, 12 Mar 2024 at 00:56, Linus Walleij <linus.walleij at linaro.org> wrote:
> > On Mon, Mar 11, 2024 at 11:28 PM Sami Tolvanen <samitolvanen at google.com> wrote:
> > > On Mon, Mar 11, 2024 at 3:17 PM Linus Walleij <linus.walleij at linaro.org> wrote:


> > +void v7wbi_flush_user_tlb_range(unsigned long, unsigned long, struct
> > vm_area_struct *);
> > +void v7wbi_flush_kern_tlb_range(unsigned long, unsigned long);
> > +__ADDRESSABLE(v7wbi_flush_user_tlb_range);
> > +__ADDRESSABLE(v7wbi_flush_kern_tlb_range);
> >
> > Then that works.
> >
> > The problem is that I also have to define all these function signatures that
> > are never used in C and there are quite a few of them, if I start listing them
> > all and #ifdefining them for selected CPUs it's not going to be pretty.
> >
> > It can be done and they can be in a cfi-defs.c file though.
> > And it's better than __nocfi.
>
> Another option is to move the struct definitions to C entirely. For
> example, the branch below implements this for the tlbflush code:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=arm-cfi

Hm that looks very nice IMO, I think we could go for that for the
tlb functions for sure, I will just steal your patch :D

The same can probably be done for some other vtables.

> However, doing the same will be tricky for the proc_info structs, as
> they have a member that contains a place-relative offset, and those
> cannot be easily emitted in C (similar to the SMP_ON_UP hack in the
> TLB code above).

Hm hm.

I might have to do the first approach and list all functions in a file for
those, it will probably be the lesser evil.

I'll take a stab at it and see where we end up.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list