Re: [PATCH v13 14/14] powerpc/64s/radix: Enable huge vmalloc mappings

2021-04-16 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of April 16, 2021 4:55 am: > On Thu, 15 Apr 2021 12:23:55 +0200 Christophe Leroy > wrote: >> > + * is done. STRICT_MODULE_RWX may require extra work to support this >> > + * too. >> > + */ >> > >> > - return __vmalloc_node_range(size, 1,

Re: [PATCH v1 1/2] powerpc/bitops: Use immediate operand when possible

2021-04-13 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of April 14, 2021 7:58 am: > On Tue, Apr 13, 2021 at 06:33:19PM +0200, Christophe Leroy wrote: >> Le 12/04/2021 à 23:54, Segher Boessenkool a écrit : >> >On Thu, Apr 08, 2021 at 03:33:44PM +, Christophe Leroy wrote: >> >>For clear bits, on 32 bits

[tip: irq/core] genirq: Reduce irqdebug cacheline bouncing

2021-04-10 Thread tip-bot2 for Nicholas Piggin
The following commit has been merged into the irq/core branch of tip: Commit-ID: 7c07012eb1be8b4a95d3502fd30795849007a40e Gitweb: https://git.kernel.org/tip/7c07012eb1be8b4a95d3502fd30795849007a40e Author:Nicholas Piggin AuthorDate:Fri, 02 Apr 2021 23:20:37 +10:00

Re: [PATCH v4] powerpc/traps: Enhance readability for trap types

2021-04-09 Thread Nicholas Piggin
Thanks for working on this, I think it's a nice cleanup and helps non-powerpc people understand the code a bit better. Excerpts from Xiongwei Song's message of April 10, 2021 12:28 am: > From: Xiongwei Song > > Create a new header named traps.h, define macros to list ppc interrupt > types in

[PATCH] genirq: reduce irqdebug bouncing cachelines

2021-04-02 Thread Nicholas Piggin
306 25.473 0-1276.223 27.814 28.029 Signed-off-by: Nicholas Piggin --- kernel/irq/spurious.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index f865e5f4d382..c481d8458325 100644 --- a/kernel/irq/spurious.c +++ b/kernel/

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-04-01 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of April 2, 2021 2:11 am: > On Thu, Apr 01, 2021 at 10:55:58AM +0800, Xiongwei Song wrote: >> Segher Boessenkool 于2021年4月1日周四 上午6:15写道: >> >> > On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: >> > > So perhaps: >> > > >> > >

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-04-01 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of April 1, 2021 12:39 pm: > Segher Boessenkool writes: >> On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: >>> So perhaps: >>> >>> EXC_SYSTEM_RESET >>> EXC_MACHINE_CHECK >>> EXC_DATA_STORAGE >>> EXC_DATA_SEGMENT >>>

Re: linux-next: build failure after merge of the akpm-current tree

2021-03-23 Thread Nicholas Piggin
Excerpts from Stephen Rothwell's message of March 24, 2021 6:58 am: > Hi all, > > On Thu, 18 Mar 2021 20:56:07 +1100 Stephen Rothwell > wrote: >> >> After merging the akpm-current tree, today's linux-next build (sparc >> defconfig) failed like this: >> >> In file included from

Re: [PATCH v4 01/25] mm: Introduce struct folio

2021-03-21 Thread Nicholas Piggin
Excerpts from Matthew Wilcox's message of March 19, 2021 11:25 am: > On Fri, Mar 19, 2021 at 10:56:45AM +1100, Balbir Singh wrote: >> On Fri, Mar 05, 2021 at 04:18:37AM +, Matthew Wilcox (Oracle) wrote: >> > A struct folio refers to an entire (possibly compound) page. A function >> > which

Re: [PATCH][next] mm/vmalloc: fix read of uninitialized pointer area

2021-03-21 Thread Nicholas Piggin
} > > Fix this by setting area to NULL to avoid the uninitialized read > of area. > > Addresses-Coverity: ("Uninitialized pointer read") > Fixes: 92db9fec381b ("mm/vmalloc: hugepage vmalloc mappings") > Signed-off-by: Colin Ian King Looks good to me. Ack

Re: [PATCH v13 00/14] huge vmalloc mappings

2021-03-17 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of March 18, 2021 8:58 am: > On Wed, 17 Mar 2021 16:23:48 +1000 Nicholas Piggin wrote: > >> >> *** BLURB HERE *** >> > > That's really not what it means ;) Sigh, wasn't having a good yesterday. > Could we please ge

Re: [PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
Excerpts from Linus Torvalds's message of March 18, 2021 5:26 am: > On Wed, Mar 17, 2021 at 3:44 AM Nicholas Piggin wrote: >> >> Argh, because I didn't test small. Sorry I had the BASE_SMALL setting in >> another patch and thought it would be a good idea to mash them toge

[tip: sched/core] sched/wait_bit, mm/filemap: Increase page and bit waitqueue hash size

2021-03-17 Thread tip-bot2 for Nicholas Piggin
The following commit has been merged into the sched/core branch of tip: Commit-ID: 873d7c4c6a920d43ff82e44121e54053d4edba93 Gitweb: https://git.kernel.org/tip/873d7c4c6a920d43ff82e44121e54053d4edba93 Author:Nicholas Piggin AuthorDate:Wed, 17 Mar 2021 17:54:27 +10:00

Re: [PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
Excerpts from Rasmus Villemoes's message of March 17, 2021 8:12 pm: > On 17/03/2021 08.54, Nicholas Piggin wrote: > >> +#if CONFIG_BASE_SMALL >> +static const unsigned int page_wait_table_bits = 4; >> static wait_queue_head_t page_wait_table[PAGE_WAIT_TABLE_SIZE]

Re: [PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
Excerpts from Ingo Molnar's message of March 17, 2021 6:38 pm: > > * Nicholas Piggin wrote: > >> The page waitqueue hash is a bit small (256 entries) on very big systems. A >> 16 socket 1536 thread POWER9 system was found to encounter hash collisions >> and excessiv

[PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
help reduce remote accesses on well localised workloads, but that adds some complexity with indexing and hotplug, so until we get a less artificial workload to test with, keep it simple. Signed-off-by: Nicholas Piggin --- kernel/sched/wait_bit.c | 30 +++--- mm/filemap.c

[PATCH v13 13/14] mm/vmalloc: Hugepage vmalloc mappings

2021-03-17 Thread Nicholas Piggin
allocation, an option nohugevmalloc is added to disable at boot. Signed-off-by: Nicholas Piggin --- arch/Kconfig| 11 ++ include/linux/vmalloc.h | 21 mm/page_alloc.c | 5 +- mm/vmalloc.c| 216 +++- 4 files changed, 206

[PATCH v13 14/14] powerpc/64s/radix: Enable huge vmalloc mappings

2021-03-17 Thread Nicholas Piggin
This reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%, due to vfs hashes being allocated with 2MB pages. Cc: linuxppc-...@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- .../admin-gu

[PATCH v13 10/14] mm/vmalloc: provide fallback arch huge vmap support functions

2021-03-17 Thread Nicholas Piggin
If an architecture doesn't support a particular page table level as a huge vmap page size then allow it to skip defining the support query function. Suggested-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 7 +++ arch/powerpc/include/asm

[PATCH v13 12/14] mm/vmalloc: add vmap_range_noflush variant

2021-03-17 Thread Nicholas Piggin
As a side-effect, the order of flush_cache_vmap() and arch_sync_kernel_mappings() calls are switched, but that now matches the other callers in this file. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 +--- 1 file changed, 13 insertions(+), 3

[PATCH v13 11/14] mm: Move vmap_range from mm/ioremap.c to mm/vmalloc.c

2021-03-17 Thread Nicholas Piggin
This is a generic kernel virtual memory mapper, not specific to ioremap. Code is unchanged other than making vmap_range non-static. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- include/linux/vmalloc.h | 3 + mm/ioremap.c| 203

[PATCH v13 04/14] mm/vmalloc: rename vmap_*_range vmap_pages_*_range

2021-03-17 Thread Nicholas Piggin
The vmalloc mapper operates on a struct page * array rather than a linear physical address, re-name it to make this distinction clear. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 1 file changed, 8 insertions

[PATCH v13 08/14] arm64: inline huge vmap supported functions

2021-03-17 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Acked-by: Catalin Marinas Signed-off-by: Nicholas Piggin --- arch/arm64/include

[PATCH v13 06/14] mm: HUGE_VMAP arch support cleanup

2021-03-17 Thread Nicholas Piggin
Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Reviewed-by: Ding Tianhong Acked-by: Catalin Marinas [arm64] Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 8 ++ arch/arm64/mm/mmu.c

[PATCH v13 07/14] powerpc: inline huge vmap supported functions

2021-03-17 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: linuxppc-...@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/vmalloc.h | 19

[PATCH v13 09/14] x86: inline huge vmap supported functions

2021-03-17 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- arch/x86/i

[PATCH v13 05/14] mm/ioremap: rename ioremap_*_range to vmap_*_range

2021-03-17 Thread Nicholas Piggin
This will be used as a generic kernel virtual mapping function, so re-name it in preparation. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/ioremap.c | 64 +++- 1 file changed, 33 insertions(+), 31

[PATCH v13 03/14] mm: apply_to_pte_range warn and fail if a large pte is encountered

2021-03-17 Thread Nicholas Piggin
apply_to_pte_range might mistake a large pte for bad, or treat it as a page table, resulting in a crash or corruption. Add a test to warn and return error if large entries are found. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/memory.c | 66

[PATCH v13 02/14] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page

2021-03-17 Thread Nicholas Piggin
pings") Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 4f5f8c907897..98e697ac764c 10064

[PATCH v13 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-03-17 Thread Nicholas Piggin
ARM uses its own PMD folding scheme which is missing pud_page which should just pass through to pmd_page. Move this from the 3-level page table to common header. Cc: Russell King Cc: Ding Tianhong Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arm/include/asm

[PATCH v13 00/14] huge vmalloc mappings

2021-03-17 Thread Nicholas Piggin
** BLURB HERE *** Nicholas Piggin (14): ARM: mm: add missing pud_page define to 2-level page tables mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page mm: apply_to_pte_range warn and fail if a large pte is encountered mm/vmalloc: rename vmap_*_range vmap_pages

Re: [PATCH 3/3] powerpc/qspinlock: Use generic smp_cond_load_relaxed

2021-03-15 Thread Nicholas Piggin
at it? Something like this /* * smp_cond_load_relaxed was found to have performance problems if * implemented with spin_begin()/spin_end(). */ I wonder if it should have a Fixes: tag to the original commit as well. Otherwise, Acked-by: Nicholas Piggin Thanks, Nick > > Data is from three benchmarks on

Re: [PATCH v2 36/43] powerpc/32: Set current->thread.regs in C interrupt entry

2021-03-11 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 11, 2021 10:38 pm: > > > Le 11/03/2021 à 11:38, Christophe Leroy a écrit : >> >> >> Le 10/03/2021 à 02:33, Nicholas Piggin a écrit : >>> Excerpts from Christophe Leroy's message of March 9, 2021 10:10 pm: >

Re: [PATCH v2 40/43] powerpc/64s: Make kuap_check_amr() and kuap_get_and_check_amr() generic

2021-03-09 Thread Nicholas Piggin
gt; for when CONFIG_PPC_KUAP is not selected. Looks pretty straightforward to me. While you're renaming things, could kuap_check_amr() be changed to kuap_assert_locked() or similar? Otherwise, Reviewed-by: Nicholas Piggin > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/

Re: [PATCH v2 36/43] powerpc/32: Set current->thread.regs in C interrupt entry

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:10 pm: > No need to do that is assembly, do it in C. Hmm. No issues with the patch as such, but why does ppc32 need this but not 64? AFAIKS 64 sets this when a thread is created. Thanks, Nick > > Signed-off-by: Christophe Leroy >

Re: [PATCH v2 28/43] powerpc/64e: Call bad_page_fault() from do_page_fault()

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:09 pm: > book3e/64 is the last one calling __bad_page_fault() > from assembly. > > Save non volatile registers before calling do_page_fault() > and modify do_page_fault() to call __bad_page_fault() > for all platforms. > > Then it can

Re: [PATCH v2 02/43] powerpc/traps: Declare unrecoverable_exception() as __noreturn

2021-03-09 Thread Nicholas Piggin
and fall through again and warn again, etc. Putting the infinite loop is good enough I think (and better than there was previously). Otherwise Reviewed-by: Nicholas Piggin Thanks, Nick

Re: [PATCH v2 01/43] powerpc/traps: unrecoverable_exception() is not an interrupt handler

2021-03-09 Thread Nicholas Piggin
time accounting). > > Fixes: 3a96570ffceb ("powerpc: convert interrupt handlers to use wrappers") > Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin This should go in as a fix for this release I think. > --- > arch/powerpc/include/asm/interrupt.h | 3 ++- >

Re: [PATCH v5 05/22] powerpc/irq: Add helper to set regs->softe

2021-03-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 5, 2021 6:54 pm: > > > Le 09/02/2021 à 08:49, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 4:18 pm: >>> >>> >>> Le 09/02/2021 à 02:11, Nicholas Piggin a écr

Re: [PATCH] [RFC] arm64: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION

2021-02-28 Thread Nicholas Piggin
gt; non-magic start/stop symbols for all sections, and relying on KEEP() > instead where needed. > >> There are a lot of KEEP usage. Perhaps some can be dropped to facilitate >> ld --gc-sections. > > I see a lot of these were added by Nick Piggin (added to Cc) in this commit

Re: [PATCH] powerpc/syscall: Force inlining of __prep_irq_for_enabled_exit()

2021-02-25 Thread Nicholas Piggin
gcc not seeing that __prep_irq_for_enabled_exit() > always returns true on ppc32 because it doesn't inline it for > some reason. > > Force inlining of __prep_irq_for_enabled_exit() to fix the build. > > Reported-by: kernel test robot > Signed-off-by: Christophe Leroy Acked-by: Nic

Re: [PATCH v12 13/14] mm/vmalloc: Hugepage vmalloc mappings

2021-02-18 Thread Nicholas Piggin
Excerpts from Ding Tianhong's message of February 19, 2021 1:45 pm: > Hi Nicholas: > > I met some problem for this patch, like this: > > kva = vmalloc(3*1024k); > > remap_vmalloc_range(xxx, kva, xxx) > > It failed because that the check for page_count(page) is null so return, it > break the

Re: [PATCH] powerpc/bug: Remove specific powerpc BUG_ON()

2021-02-11 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of February 11, 2021 9:50 pm: > On Thu, Feb 11, 2021 at 08:04:55PM +1000, Nicholas Piggin wrote: >> It would be nice if we could have a __builtin_trap_if that gcc would use >> conditional traps with, (and which never assumes

Re: [PATCH] powerpc/bug: Remove specific powerpc BUG_ON()

2021-02-11 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 11, 2021 5:41 pm: > powerpc BUG_ON() is based on using twnei or tdnei instruction, > which obliges gcc to format the condition into a 0 or 1 value > in a register. > > By using a generic implementation, gcc will generate a branch > to the

Re: linux-next: build failure after merge of the powerpc tree

2021-02-10 Thread Nicholas Piggin
Excerpts from Stephen Rothwell's message of February 9, 2021 8:19 pm: > Hi all, > > After merging the powerpc tree, today's linux-next build (powerpc > allyesconfig) failed like this: > > arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0x0): relocation truncated to > fit: R_PPC64_REL24 (OPD)

Re: [PATCH v5 20/22] powerpc/syscall: Avoid storing 'current' in another pointer

2021-02-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 10, 2021 3:03 am: > > > Le 09/02/2021 à 15:31, David Laight a écrit : >> From: Segher Boessenkool >>> Sent: 09 February 2021 13:51 >>> >>> On Tue, Feb 09, 2021 at 12:36:20PM +1000, N

Re: [PATCH v5 18/22] powerpc/syscall: Remove FULL_REGS verification in system_call_exception

2021-02-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 10, 2021 12:31 am: > > > Le 09/02/2021 à 03:02, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >>> For book3s/64, FULL_REGS() is 'true' at all time, so the test vo

Re: [PATCH v5 16/22] powerpc/syscall: Avoid stack frame in likely part of system_call_exception()

2021-02-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 10, 2021 2:13 am: > > > Le 09/02/2021 à 02:55, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >>> When r3 is not modified, reload it from regs->orig_r3 to

Re: [PATCH v5 17/22] powerpc/syscall: Do not check unsupported scv vector on PPC32

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 4:13 pm: > > > Le 09/02/2021 à 03:00, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >>> Only PPC64 has scv. No need to check the 0x7ff0 trap on PPC32. &g

Re: [PATCH v5 09/22] powerpc/syscall: Make interrupt.c buildable on PPC32

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 4:02 pm: > > > Le 09/02/2021 à 02:27, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >>> To allow building interrupt.c on PPC32, ifdef out specific PPC64 >&

Re: [PATCH v5 05/22] powerpc/irq: Add helper to set regs->softe

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 3:57 pm: > > > Le 09/02/2021 à 02:11, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >>> regs->softe doesn't exist on PPC32. >>> >>> Add

Re: [PATCH v5 05/22] powerpc/irq: Add helper to set regs->softe

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 4:18 pm: > > > Le 09/02/2021 à 02:11, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >>> regs->softe doesn't exist on PPC32. >>> >>> Add

Re: [PATCH v5 20/22] powerpc/syscall: Avoid storing 'current' in another pointer

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > By saving the pointer pointing to thread_info.flags, gcc copies r2 > in a non-volatile register. > > We know 'current' doesn't change, so avoid that intermediaite pointer. > > Reduces null_syscall benchmark by 2 cycles (322

Re: [PATCH v5 19/22] powerpc/syscall: Optimise checks in beginning of system_call_exception()

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > Combine all tests of regs->msr into a single logical one. Okay by me unless we choose to do the config option and put these all under it. I think I would prefer that because sometimes the registers are in a state you can't

Re: [PATCH v5 18/22] powerpc/syscall: Remove FULL_REGS verification in system_call_exception

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > For book3s/64, FULL_REGS() is 'true' at all time, so the test voids. > For others, non volatile registers are saved inconditionally. > > So the verification is pointless. > > Should one fail to do it, it would anyway be

Re: [PATCH v5 17/22] powerpc/syscall: Do not check unsupported scv vector on PPC32

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > Only PPC64 has scv. No need to check the 0x7ff0 trap on PPC32. > For that, add a helper trap_is_unsupported_scv() similar to > trap_is_scv(). > > And ignore the scv parameter in syscall_exit_prepare (Save 14 cycles > 346 =>

Re: [PATCH v5 16/22] powerpc/syscall: Avoid stack frame in likely part of system_call_exception()

2021-02-08 Thread Nicholas Piggin
be just keep it PPC32 specific for the moment, will have to do more tuning for 64 and we have other stuff to do there first. If you are happy to make it 32-bit only then Reviewed-by: Nicholas Piggin > > Before the patch: > > c000b4d4 : > c000b4d4: 7c 08 02 a6 mflrr0

Re: [PATCH v5 12/22] powerpc/syscall: Change condition to check MSR_RI

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > In system_call_exception(), MSR_RI also needs to be checked on 8xx. > Only booke and 40x doesn't have MSR_RI. Reviewed-by: Nicholas Piggin ... > > Signed-off-by: Christophe Leroy > --- > v5: Also in inte

Re: [PATCH v5 11/22] powerpc/syscall: Save r3 in regs->orig_r3

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > Save r3 in regs->orig_r3 in system_call_exception() > > Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin > --- > v5: Removed the assembly one on SCV type system call > --- > arch/p

Re: [PATCH v5 10/22] powerpc/syscall: Use is_compat_task()

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > Instead of hard comparing task flags with _TIF_32BIT, use > is_compat_task(). The advantage is that it returns 0 on PPC32 > allthough _TIF_32BIT is always set. > > Signed-off-by: Christophe Leroy Review

Re: [PATCH v5 09/22] powerpc/syscall: Make interrupt.c buildable on PPC32

2021-02-08 Thread Nicholas Piggin
g this */ > /* >* We do this at the end so that we do context switch with KERNEL AMR >*/ > @@ -318,7 +323,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long > r3, > return ret; > } > > -#ifdef CONFIG_PPC_BOOK3S /* BOOK3E not yet using this

Re: [PATCH v5 08/22] powerpc/syscall: Rename syscall_64.c into interrupt.c

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > syscall_64.c will be reused almost as is for PPC32. > > As this file also contains functions to handle other types > of interrupts rename it interrupt.c > > Signed-off-by: Christophe Leroy Reviewed-b

Re: [PATCH v5 07/22] powerpc/irq: Add stub irq_soft_mask_return() for PPC32

2021-02-08 Thread Nicholas Piggin
there might be a way to improve it. For example make a debug_syscall_entry(regs) function that ppc64 could put the soft mask checks into. No big deal, if you don't make any changes now I might see about doing something like that after your series goes in. Reviewed-by: Nicholas Piggin > ---

Re: [PATCH v5 06/22] powerpc/irq: Rework helpers that manipulate MSR[EE/RI]

2021-02-08 Thread Nicholas Piggin
ard_irq_disable() > __hard_EE_RI_disable() > __hard_RI_enable() > > Then use them in PPC32 version of arch_local_irq_disable() > and arch_local_irq_enable() to avoid code duplication. > Reviewed-by: Nicholas Piggin > Signed-off-by: Christophe Leroy > --- &g

Re: [PATCH v5 05/22] powerpc/irq: Add helper to set regs->softe

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > regs->softe doesn't exist on PPC32. > > Add irq_soft_mask_regs_set_state() helper to set regs->softe. > This helper will void on PPC32. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/hw_irq.h | 11

Re: [PATCH v5 00/22] powerpc/32: Implement C syscall entry/exit

2021-02-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: > This series implements C syscall entry/exit for PPC32. It reuses > the work already done for PPC64. > > This series is based on today's merge-test > (b6f72fc05389e3fc694bf5a5fa1bbd33f61879e0) > > In terms on performance we

Re: [PATCH] powerpc/8xx: Fix software emulation interrupt

2021-02-05 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 5, 2021 6:56 pm: > For unimplemented instructions or unimplemented SPRs, the 8xx triggers > a "Software Emulation Exception" (0x1000). That interrupt doesn't set > reason bits in SRR1 as the "Program Check Exception" does. > > Go through

Re: [PATCH v2 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-05 Thread Nicholas Piggin
Excerpts from Leonardo Bras's message of February 5, 2021 5:01 pm: > Hey Nick, thanks for reviewing :) > > On Fri, 2021-02-05 at 16:28 +1000, Nicholas Piggin wrote: >> Excerpts from Leonardo Bras's message of February 5, 2021 4:06 pm: >> > Before guest entry, TBU40 regist

Re: [PATCH v2 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-04 Thread Nicholas Piggin
Excerpts from Leonardo Bras's message of February 5, 2021 4:06 pm: > Before guest entry, TBU40 register is changed to reflect guest timebase. > After exitting guest, the register is reverted to it's original value. > > If one tries to get the timestamp from host between those changes, it > will

Re: [PATCH v2 0/5] shoot lazy tlbs

2021-02-04 Thread Nicholas Piggin
gt; Thanks, > Nick > > Nicholas Piggin (5): > lazy tlb: introduce lazy mm refcount helper functions > lazy tlb: allow lazy tlb mm switching to be configurable > lazy tlb: shoot lazies, a non-refcounting lazy tlb option > powerpc: use lazy mm refcount helper functions >

Re: [PATCH] mm/memory.c: Remove pte_sw_mkyoung()

2021-02-03 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of February 4, 2021 10:46 am: > On Wed, 3 Feb 2021 10:19:44 + (UTC) Christophe Leroy > wrote: > >> Commit 83d116c53058 ("mm: fix double page fault on arm64 if PTE_AF >> is cleared") introduced arch_faults_on_old_pte() helper to identify >> platforms

Re: [PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Nicholas Piggin
Excerpts from Russell King - ARM Linux admin's message of February 2, 2021 9:13 pm: > On Tue, Feb 02, 2021 at 09:05:02PM +1000, Nicholas Piggin wrote: >> diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h >> index c02f24400369..d63a5bb6bd0c 100644 &g

[PATCH v12 14/14] powerpc/64s/radix: Enable huge vmalloc mappings

2021-02-02 Thread Nicholas Piggin
This reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%, due to vfs hashes being allocated with 2MB pages. Cc: linuxppc-...@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- .../admin-gu

[PATCH v12 13/14] mm/vmalloc: Hugepage vmalloc mappings

2021-02-02 Thread Nicholas Piggin
allocation, an option nohugevmalloc is added to disable at boot. Signed-off-by: Nicholas Piggin --- arch/Kconfig| 11 ++ include/linux/vmalloc.h | 21 mm/page_alloc.c | 5 +- mm/vmalloc.c| 215 +++- 4 files changed, 205

[PATCH v12 12/14] mm/vmalloc: add vmap_range_noflush variant

2021-02-02 Thread Nicholas Piggin
As a side-effect, the order of flush_cache_vmap() and arch_sync_kernel_mappings() calls are switched, but that now matches the other callers in this file. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 +--- 1 file changed, 13 insertions(+), 3

[PATCH v12 11/14] mm: Move vmap_range from mm/ioremap.c to mm/vmalloc.c

2021-02-02 Thread Nicholas Piggin
This is a generic kernel virtual memory mapper, not specific to ioremap. Code is unchanged other than making vmap_range non-static. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- include/linux/vmalloc.h | 3 + mm/ioremap.c| 203

[PATCH v12 10/14] mm/vmalloc: provide fallback arch huge vmap support functions

2021-02-02 Thread Nicholas Piggin
If an architecture doesn't support a particular page table level as a huge vmap page size then allow it to skip defining the support query function. Suggested-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 7 +++ arch/powerpc/include/asm

[PATCH v12 09/14] x86: inline huge vmap supported functions

2021-02-02 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- arch/x86/i

[PATCH v12 07/14] powerpc: inline huge vmap supported functions

2021-02-02 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: linuxppc-...@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/vmalloc.h | 19

[PATCH v12 08/14] arm64: inline huge vmap supported functions

2021-02-02 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Acked-by: Catalin Marinas Signed-off-by: Nicholas Piggin --- arch/arm64/include

[PATCH v12 05/14] mm/ioremap: rename ioremap_*_range to vmap_*_range

2021-02-02 Thread Nicholas Piggin
This will be used as a generic kernel virtual mapping function, so re-name it in preparation. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/ioremap.c | 64 +++- 1 file changed, 33 insertions(+), 31

[PATCH v12 06/14] mm: HUGE_VMAP arch support cleanup

2021-02-02 Thread Nicholas Piggin
Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Reviewed-by: Ding Tianhong Acked-by: Catalin Marinas [arm64] Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 8 ++ arch/arm64/mm/mmu.c

[PATCH v12 04/14] mm/vmalloc: rename vmap_*_range vmap_pages_*_range

2021-02-02 Thread Nicholas Piggin
The vmalloc mapper operates on a struct page * array rather than a linear physical address, re-name it to make this distinction clear. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 1 file changed, 8 insertions

[PATCH v12 03/14] mm: apply_to_pte_range warn and fail if a large pte is encountered

2021-02-02 Thread Nicholas Piggin
apply_to_pte_range might mistake a large pte for bad, or treat it as a page table, resulting in a crash or corruption. Add a test to warn and return error if large entries are found. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/memory.c | 66

[PATCH v12 02/14] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page

2021-02-02 Thread Nicholas Piggin
pings") Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e6f352bf0498..62372f9e0167 10064

[PATCH v12 00/14] huge vmalloc mappings

2021-02-02 Thread Nicholas Piggin
v4 - Several minor cleanups. - Added page order to /proc/vmallocinfo - Added hugepage to alloc_large_system_hage output. - Made an architecture config option, powerpc only for now. Since v3: - Fixed an off-by-one bug in a loop - Fix !CONFIG_HAVE_ARCH_HUGE_VMAP build fail Nicholas Piggin (14):

[PATCH v12 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-02-02 Thread Nicholas Piggin
ARM uses its own PMD folding scheme which is missing pud_page which should just pass through to pmd_page. Move this from the 3-level page table to common header. Cc: Russell King Cc: Ding Tianhong Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arm/include/asm

Re: [PATCH v11 01/13] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page

2021-02-02 Thread Nicholas Piggin
Excerpts from Ding Tianhong's message of January 28, 2021 1:13 pm: > On 2021/1/26 12:44, Nicholas Piggin wrote: >> vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. >> Whether or not a vmap is huge depends on the architecture details, >> alignments, boot

Re: [RFC 00/20] TLB batching consolidation and enhancements

2021-02-01 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of February 1, 2021 10:44 pm: > On Sun, Jan 31, 2021 at 07:57:01AM +, Nadav Amit wrote: >> > On Jan 30, 2021, at 7:30 PM, Nicholas Piggin wrote: > >> > I'll go through the patches a bit more closely when they all come >>

Re: [RFC 11/20] mm/tlb: remove arch-specific tlb_start/end_vma()

2021-02-01 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of February 1, 2021 10:09 pm: > On Sat, Jan 30, 2021 at 04:11:23PM -0800, Nadav Amit wrote: > >> diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h >> index 427bfcc6cdec..b97136b7010b 100644 >> --- a/include/asm-generic/tlb.h >> +++

Re: [PATCH v4 11/23] powerpc/syscall: Rename syscall_64.c into syscall.c

2021-02-01 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 2, 2021 4:15 pm: > > > Le 28/01/2021 à 00:50, Nicholas Piggin a écrit : >> Excerpts from David Laight's message of January 26, 2021 8:28 pm: >>> From: Nicholas Piggin >>>> Sent: 26 January 2021 10:21 >&g

Re: [RFC 00/20] TLB batching consolidation and enhancements

2021-01-30 Thread Nicholas Piggin
Excerpts from Nadav Amit's message of January 31, 2021 10:11 am: > From: Nadav Amit > > There are currently (at least?) 5 different TLB batching schemes in the > kernel: > > 1. Using mmu_gather (e.g., zap_page_range()). > > 2. Using {inc|dec}_tlb_flush_pending() to inform other threads on the

RE: [PATCH v4 11/23] powerpc/syscall: Rename syscall_64.c into syscall.c

2021-01-27 Thread Nicholas Piggin
Excerpts from David Laight's message of January 26, 2021 8:28 pm: > From: Nicholas Piggin >> Sent: 26 January 2021 10:21 >> >> Excerpts from Christophe Leroy's message of January 26, 2021 12:48 am: >> > syscall_64.c will be reused almost as is for PPC32. >> >

Re: [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range

2021-01-27 Thread Nicholas Piggin
Excerpts from Christoph Hellwig's message of January 27, 2021 5:10 pm: > On Tue, Jan 26, 2021 at 05:08:46PM -0500, Konrad Rzeszutek Wilk wrote: >> On Tue, Jan 26, 2021 at 02:54:01PM +1000, Nicholas Piggin wrote: >> > vunmap will remove ptes. >> >> Should there b

[PATCH v11 00/13] huge vmalloc mappings

2021-01-27 Thread Nicholas Piggin
dded hugepage to alloc_large_system_hage output. - Made an architecture config option, powerpc only for now. Since v3: - Fixed an off-by-one bug in a loop - Fix !CONFIG_HAVE_ARCH_HUGE_VMAP build fail Nicholas Piggin (13): mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc

[PATCH v11 01/13] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page

2021-01-27 Thread Nicholas Piggin
pings") Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e6f352bf0498..62372f9e0167 100644 --- a/mm/vmalloc.c +++ b/mm

[PATCH v11 08/13] x86: inline huge vmap supported functions

2021-01-27 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- arch/x86/i

[PATCH 4/5] mm/vmalloc: remove unmap_kernel_range

2021-01-27 Thread Nicholas Piggin
This is a shim around vunmap_range, get rid of it. Move the main API comment from the _noflush variant to the normal variant, and make _noflush internal to mm/. Signed-off-by: Nicholas Piggin --- Documentation/core-api/cachetlb.rst | 2 +- arch/arm64/mm/init.c| 2 +- arch

[PATCH 5/5] mm/vmalloc: improve allocation failure error messages

2021-01-26 Thread Nicholas Piggin
where applicable. Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 40 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 5ff190590fe4..4facf582a3be 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2790,6

[PATCH 3/5] powerpc/xive: remove unnecessary unmap_kernel_range

2021-01-26 Thread Nicholas Piggin
iounmap will remove ptes. Cc: "Cédric Le Goater" Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- arch/powerpc/sysdev/xive/common.c | 4 1 file changed, 4 deletions(-) diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/comm

  1   2   3   4   5   6   7   8   9   10   >