Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-14 Thread Zhenyu Ye
On 2020/7/14 18:36, Catalin Marinas wrote: > On Fri, Jul 10, 2020 at 05:44:20PM +0800, Zhenyu Ye wrote: >> +#define __TLBI_RANGE_PAGES(num, scale) (((num) + 1) << (5 * (scale) + >> 1)) >> +#define MAX_TLBI_RANGE_PAGES__TLBI_RANGE_PAGES(31, 3) >> + >> +#define TLBI_RANGE_MASK

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-14 Thread Catalin Marinas
On Fri, Jul 10, 2020 at 05:44:20PM +0800, Zhenyu Ye wrote: > +#define __TLBI_RANGE_PAGES(num, scale) (((num) + 1) << (5 * (scale) + > 1)) > +#define MAX_TLBI_RANGE_PAGES __TLBI_RANGE_PAGES(31, 3) > + > +#define TLBI_RANGE_MASK GENMASK_ULL(4, 0) > +#define

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-13 Thread Catalin Marinas
On Mon, Jul 13, 2020 at 03:44:16PM +0100, Jon Hunter wrote: > On 13/07/2020 15:39, Zhenyu Ye wrote: > > On 2020/7/13 22:27, Jon Hunter wrote: > >> After this change I am seeing the following build errors ... > >> > >> /tmp/cckzq3FT.s: Assembler messages: > >> /tmp/cckzq3FT.s:854: Error: unknown or

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-13 Thread Jon Hunter
On 13/07/2020 15:39, Zhenyu Ye wrote: > Hi Jon, > > On 2020/7/13 22:27, Jon Hunter wrote: >> After this change I am seeing the following build errors ... >> >> /tmp/cckzq3FT.s: Assembler messages: >> /tmp/cckzq3FT.s:854: Error: unknown or missing operation name at operand 1 >> -- `tlbi

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-13 Thread Zhenyu Ye
Hi Jon, On 2020/7/13 22:27, Jon Hunter wrote: > After this change I am seeing the following build errors ... > > /tmp/cckzq3FT.s: Assembler messages: > /tmp/cckzq3FT.s:854: Error: unknown or missing operation name at operand 1 -- > `tlbi rvae1is,x7' > /tmp/cckzq3FT.s:870: Error: unknown or

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-13 Thread Jon Hunter
On 10/07/2020 10:44, Zhenyu Ye wrote: > Add __TLBI_VADDR_RANGE macro and rewrite __flush_tlb_range(). > > When cpu supports TLBI feature, the minimum range granularity is > decided by 'scale', so we can not flush all pages by one instruction > in some cases. > > For example, when the pages =

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-12 Thread Catalin Marinas
On Sat, Jul 11, 2020 at 02:50:46PM +0800, Zhenyu Ye wrote: > On 2020/7/11 2:31, Catalin Marinas wrote: > > On Fri, Jul 10, 2020 at 05:44:20PM +0800, Zhenyu Ye wrote: > >> - if ((end - start) >= (MAX_TLBI_OPS * stride)) { > >> + if ((!cpus_have_const_cap(ARM64_HAS_TLBI_RANGE) && > >> + (end

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-11 Thread Zhenyu Ye
Hi Catalin, On 2020/7/11 2:31, Catalin Marinas wrote: > On Fri, Jul 10, 2020 at 05:44:20PM +0800, Zhenyu Ye wrote: >> -if ((end - start) >= (MAX_TLBI_OPS * stride)) { >> +if ((!cpus_have_const_cap(ARM64_HAS_TLBI_RANGE) && >> +(end - start) >= (MAX_TLBI_OPS * stride)) || >> +

Re: [PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-10 Thread Catalin Marinas
On Fri, Jul 10, 2020 at 05:44:20PM +0800, Zhenyu Ye wrote: > Add __TLBI_VADDR_RANGE macro and rewrite __flush_tlb_range(). > > When cpu supports TLBI feature, the minimum range granularity is > decided by 'scale', so we can not flush all pages by one instruction > in some cases. > > For example,

[PATCH v2 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64

2020-07-10 Thread Zhenyu Ye
Add __TLBI_VADDR_RANGE macro and rewrite __flush_tlb_range(). When cpu supports TLBI feature, the minimum range granularity is decided by 'scale', so we can not flush all pages by one instruction in some cases. For example, when the pages = 0xe81a, let's start 'scale' from maximum, and find