[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210526052308.GA29213@lst.de>
Date: Wed, 26 May 2021 07:23:08 +0200
From: Christoph Hellwig <hch@....de>
To: Guo Ren <guoren@...nel.org>
Cc: Christoph Hellwig <hch@....de>, Anup Patel <anup.patel@....com>,
Palmer Dabbelt <palmerdabbelt@...gle.com>,
Arnd Bergmann <arnd@...db.de>,
linux-riscv <linux-riscv@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-arch <linux-arch@...r.kernel.org>,
linux-sunxi@...ts.linux.dev, Guo Ren <guoren@...ux.alibaba.com>
Subject: Re: [PATCH V3 2/2] riscv: Use use_asid_allocator flush TLB
On Wed, May 26, 2021 at 11:12:40AM +0800, Guo Ren wrote:
> > static inline void local_flush_tlb_range_asid(unsigned long start,
> > unsigned long size, unsigned long asid)
> >
> > > +{
> > > + unsigned long tmp = start & PAGE_MASK;
> > > + unsigned long end = ALIGN(start + size, PAGE_SIZE);
> > > +
> > > + if (size == -1) {
> > > + __asm__ __volatile__ ("sfence.vma x0, %0" : : "r" (asid) : "memory");
> > > + return;
> >
> > Please split the global (size == -1) case into separate helpers.
> Do you mean:
No. Basically a
static inline void local_flush_tlb_ll_asid(unsigned long asid)
{
__asm__ __volatile__ ("sfence.vma x0, %0"
:
: "r" (asid)
: "memory");
}
and
static inline void local_flush_tlb_range_asid(unsigned long start,
unsigned long size, unsigned long asid)
{
unsigned long end = ALIGN(start + size, PAGE_SIZE), tmp;
for (tmp = start & PAGE_MASK; tmp < end; tmp += PAGE_SIZE) {
__asm__ __volatile__ ("sfence.vma %0, %1"
:
: "r" (tmp), "r" (asid)
: "memory");
}
}
Powered by blists - more mailing lists