Re:Re: [PATCH v2] powerpc: kernel: legacy_serial: Fix missing of_node_put() in add_legacy_soc_port()

2022-09-05 Thread Liang He
At 2022-09-05 11:25:38, "Michael Ellerman" wrote: >Liang He writes: >> We should call of_node_put() for the reference 'tsi' returned by >> of_get_parent() which will increase the refcount. >> >> Signed-off-by: Liang He >> --- >> changelog: >> >> v2: use more conservative way to call of_node

Re: [PATCH] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-05 Thread David Hildenbrand
On 03.09.22 09:07, Christophe Leroy wrote: +Resending with valid powerpc list address Le 02/09/2022 à 20:52, David Hildenbrand a écrit : Adding Christophe on Cc: Christophe do you know if is_hugepd is true for all hugetlb entries, not just hugepd? is_hugepd() is true if and only if the direc

[RFC PATCH] powerpc: ideas to improve page table frag allocator

2022-09-05 Thread Nicholas Piggin
The page table fragment allocator is a simple per-mm slab allocator. It can be quite wasteful of space for small processes, as well as being expensive to initialise. It does not do well at NUMA awareness. This is a quick hack at addressing some of those problems, but it's not complete. It doesn't

Re: [PATCH] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-05 Thread Christophe Leroy
Le 05/09/2022 à 10:37, David Hildenbrand a écrit : > On 03.09.22 09:07, Christophe Leroy wrote: >> +Resending with valid powerpc list address >> >> Le 02/09/2022 à 20:52, David Hildenbrand a écrit : >> Adding Christophe on Cc: >> >> Christophe do you know if is_hugepd is true for all

[PATCH] powerpc/book3s: Inline first level of update_mmu_cache()

2022-09-05 Thread Christophe Leroy
update_mmu_cache() voids when hash page tables are not used. On PPC32 that means when MMU_FTR_HPTE_TABLE is not defined. On PPC64 that means when RADIX is enabled. Rename core part of update_mmu_cache() as __update_mmu_cache() and include the initial verification in an inlined caller. Signed-off-

Re: [PATCH] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-05 Thread David Hildenbrand
On 05.09.22 11:33, Christophe Leroy wrote: Le 05/09/2022 à 10:37, David Hildenbrand a écrit : On 03.09.22 09:07, Christophe Leroy wrote: +Resending with valid powerpc list address Le 02/09/2022 à 20:52, David Hildenbrand a écrit : Adding Christophe on Cc: Christophe do you know if is_hugep

Re: [PATCH v2 01/16] powerpc: Replace unreachable() with it's builtin variant in __WARN_FLAGS()

2022-09-05 Thread Naveen N. Rao
Christophe Leroy wrote: Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit : objtool is throwing *unannotated intra-function call* warnings in .c files with a few instructions that are marked unreachable. The problem comes from the annotate_unreachable() macro that is called by unreachable(). T

[Bug 216427] [bisected] OF fails to handle some PCI resources on a PowerMac G4 3,6 (e.g. OF: /pci@f2000000/mac-io@17/gpio@50/gpio5@6f: could not find phandle 1751474532)

2022-09-05 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216427 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Summary|OF fails to handle some PCI |[bisected] OF fails to

[Bug 216427] [bisected] OF fails to handle some PCI resources on a PowerMac G4 3,6 (e.g. OF: /pci@f2000000/mac-io@17/gpio@50/gpio5@6f: could not find phandle 1751474532)

2022-09-05 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216427 --- Comment #3 from Erhard F. (erhar...@mailbox.org) --- Created attachment 301744 --> https://bugzilla.kernel.org/attachment.cgi?id=301744&action=edit bisect.log -- You may reply to this email to add a comment. You are receiving this mail be

Re: [PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on ppc

2022-09-05 Thread Naveen N. Rao
Christophe Leroy wrote: Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit : diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 4c466acdc70d..dc05cd23c233 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -237,6 +237,7 @@ config PPC select HAVE_MOD_ARCH_SPECIF

Re: [PATCH 1/2] tools/perf: Fix out of bound access to affinity "sched_cpus"

2022-09-05 Thread Jiri Olsa
On Mon, Sep 05, 2022 at 10:24:40AM +0530, Athira Rajeev wrote: > The affinity code in "affinity_set" function access array > named "sched_cpus". The size for this array is allocated in > affinity_setup function which is nothing but value from > get_cpu_set_size. This is used to contain the cpumask

Re: [PATCH v2 16/16] objtool/powerpc: Add --mcount specific implementation

2022-09-05 Thread Naveen N. Rao
Segher Boessenkool wrote: On Wed, Aug 31, 2022 at 12:50:07PM +, Christophe Leroy wrote: Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit : > + opcode = insn >> 26; > + > + switch (opcode) { > + case 18: /* bl */ case 18 is more than 'bl', it includes also 'b'. In both cases, the calcula

Re: [PATCH v2 05/16] powerpc: Skip objtool from running on drivers/crypto/vmx/aesp8-ppc.o

2022-09-05 Thread Naveen N. Rao
Peter Zijlstra wrote: On Mon, Aug 29, 2022 at 11:22:12AM +0530, Sathvika Vasireddy wrote: With objtool enabled, below warnings are seen when trying to build: drivers/crypto/vmx/aesp8-ppc.o: warning: objtool: aes_p8_set_encrypt_key+0x44: unannotated intra-function call drivers/crypto/vmx/aesp8

Re: [PATCH v2 11/16] objtool: Add --mnop as an option to --mcount

2022-09-05 Thread Naveen N. Rao
Peter Zijlstra wrote: On Mon, Aug 29, 2022 at 11:22:18AM +0530, Sathvika Vasireddy wrote: Architectures can select HAVE_NOP_MCOUNT if they choose to nop out mcount call sites. If that config option is selected, then --mnop is passed as an option to objtool, along with --mcount. Also, make sure

Re: [PATCH v2 03/16] powerpc: Fix objtool unannotated intra-function call warnings

2022-09-05 Thread Peter Zijlstra
On Mon, Aug 29, 2022 at 11:22:10AM +0530, Sathvika Vasireddy wrote: > objtool does not add STT_NOTYPE symbols with size 0 to the I suspect we can fix that once: https://lkml.kernel.org/r/20220902130949.789826...@infradead.org lands.

Re: [PATCH 1/2] tools/perf: Fix out of bound access to affinity "sched_cpus"

2022-09-05 Thread Athira Rajeev
> On 05-Sep-2022, at 3:30 PM, Jiri Olsa wrote: > > On Mon, Sep 05, 2022 at 10:24:40AM +0530, Athira Rajeev wrote: >> The affinity code in "affinity_set" function access array >> named "sched_cpus". The size for this array is allocated in >> affinity_setup function which is nothing but value fr

Re: [PATCH v2 02/16] powerpc: override __ALIGN() and __ALIGN_STR() macros

2022-09-05 Thread Peter Zijlstra
On Mon, Aug 29, 2022 at 11:22:09AM +0530, Sathvika Vasireddy wrote: > Powerpc instructions must be word-aligned. Currently, > there is an alignment of 16 bytes (by default), and it is > much more than what is required for powerpc (4 bytes). > > The default expansion of __ALIGN() macro is: > #defin

Re: [PATCH net-next v5 00/14] net: dpaa: Cleanups in preparation for phylink conversion (part 2)

2022-09-05 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (master) by David S. Miller : On Fri, 2 Sep 2022 17:57:22 -0400 you wrote: > This series contains several cleanup patches for dpaa/fman. While they > are intended to prepare for a phylink conversion, they stand on their > own. This series was

[PATCH V2 2/2] tools/perf: Fix out of bound access to cpu mask array

2022-09-05 Thread Athira Rajeev
The cpu mask init code in "record__mmap_cpu_mask_init" function access "bits" array part of "struct mmap_cpu_mask". The size of this array is the value from cpu__max_cpu().cpu. This array is used to contain the cpumask value for each cpu. While setting bit for each cpu, it calls "set_bit" function

[PATCH V2 1/2] tools/perf: Fix out of bound access to affinity "sched_cpus"

2022-09-05 Thread Athira Rajeev
The affinity code in "affinity_set" function access array named "sched_cpus". The size for this array is allocated in affinity_setup function which is nothing but value from get_cpu_set_size. This is used to contain the cpumask value for each cpu. While setting bit for each cpu, it calls "set_bit"

Re: [PATCH] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-05 Thread Christophe Leroy
Le 05/09/2022 à 11:46, David Hildenbrand a écrit : > On 05.09.22 11:33, Christophe Leroy wrote: >> >> >> Le 05/09/2022 à 10:37, David Hildenbrand a écrit : >>> On 03.09.22 09:07, Christophe Leroy wrote: +Resending with valid powerpc list address Le 02/09/2022 à 20:52, David Hildenb

Re: [PATCH] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-05 Thread David Hildenbrand
Yes I think the assumption is correct for user pages hence for GUP. By the way the discussion started with PTDUMP. For PTDUMP we need huge page directories to be taken into account. And for anything that involves kernel pages like VMAP or VMALLOC. Yes, makes perfect sense to me now that you exp

[Bug 216368] do_IRQ: stack overflow at boot during btrfs handling on a PowerMac G5 11,2

2022-09-05 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216368 --- Comment #6 from David Sterba (dste...@suse.com) --- (In reply to Christophe Leroy from comment #3) > This happens when you get an IRQ while being deep into BTRFS handling it > seems. > > It should be investigated with BTRFS team why the calls

Re: [RFC PATCH] powerpc: ideas to improve page table frag allocator

2022-09-05 Thread Christophe Leroy
Le 05/09/2022 à 10:50, Nicholas Piggin a écrit : > The page table fragment allocator is a simple per-mm slab allocator. > It can be quite wasteful of space for small processes, as well as being > expensive to initialise. It does not do well at NUMA awareness. > > This is a quick hack at address

Re: [RFC PATCH RESEND 00/28] per-VMA locks proposal

2022-09-05 Thread Kent Overstreet
On Mon, Sep 05, 2022 at 11:32:48AM -0700, Suren Baghdasaryan wrote: > On Mon, Sep 5, 2022 at 5:32 AM 'Michal Hocko' via kernel-team > wrote: > > > > Unless I am missing something, this is not based on the Maple tree > > rewrite, right? Does the change in the data structure makes any > > difference

Re: [PATCH v2 16/16] objtool/powerpc: Add --mcount specific implementation

2022-09-05 Thread Segher Boessenkool
Hi! On Mon, Sep 05, 2022 at 04:15:07PM +0530, Naveen N. Rao wrote: > Segher Boessenkool wrote: > >>> + if ((insn & 3) == 1) { > >>> + *type = INSN_CALL; > >>> + *immediate = insn & 0x3fc; > >>> + if (*immediate & 0x200) > >>> +

[PATCH] powerpc/pasemi: Use of_root in pas_pci_init()

2022-09-05 Thread Michael Ellerman
Currently in pas_pci_init() a reference to the root node is leaked due to a missing of_node_put(). Instead just use of_root directly. Note that converting to of_find_compatible_node(NULL, ...) would not be entirely equivalent, because that would check the compatible property of the root node, wher

Re: [RFC PATCH 1/4] powerpc/code-patching: add patch_memory() for writing RO text

2022-09-05 Thread Russell Currey
On Thu, 2022-09-01 at 07:01 +, Christophe Leroy wrote: > > > Le 01/09/2022 à 07:58, Benjamin Gray a écrit : > > From: Russell Currey > > > > powerpc allocates a text poke area of one page that is used by > > patch_instruction() to modify read-only text when STRICT_KERNEL_RWX > > is enabled.

Re: [PACTH v2] powerpc/pseries/mce: Avoid instrumentation in realmode

2022-09-05 Thread Sachin Sant
> On 05-Sep-2022, at 12:08 PM, Ganesh Goudar wrote: > > Part of machine check error handling is done in realmode, > As of now instrumentation is not possible for any code that > runs in realmode. > When MCE is injected on KASAN enabled kernel, crash is > observed, Hence force inline or mark no

Re: [PATCH] perf: Rewrite core context handling

2022-09-05 Thread Ravi Bangoria
> @@ -9752,10 +9889,13 @@ void perf_tp_event(u16 event_type, u64 count, void > *record, int entry_size, > struct trace_entry *entry = record; > > rcu_read_lock(); > - ctx = rcu_dereference(task->perf_event_ctxp[perf_sw_context]); > + ctx = rcu_

[PATCH v2 0/3] powerpc/64: interrupt soft-mask management fixes

2022-09-05 Thread Nicholas Piggin
Since last posting I've added more debugging and done some test code that tires to irritate this on hardware (e.g., put DEC into the MUST_HARD_MASK category, set_dec(1) in the hash fault handler, run with perf, etc), and also trigger interrupts at various points stepping through in the simulator.

[PATCH v2 1/3] powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending

2022-09-05 Thread Nicholas Piggin
If a synchronous interrupt (e.g., hash fault) is taken inside an irqs-disabled region which has MSR[EE]=1, then an asynchronous interrupt that is PACA_IRQ_MUST_HARD_MASK (e.g., PMI) is taken inside the synchronous interrupt handler, then the synchronous interrupt will return with MSR[EE]=1 and the

[PATCH v2 2/3] powerpc/64s: Fix irq state management in runlatch functions

2022-09-05 Thread Nicholas Piggin
When irqs are soft-disabled, MSR[EE] is volatile and can change from 1 to 0 asynchronously (if a PACA_IRQ_MUST_HARD_MASK interrupt hits). So it can not be used to check hard IRQ enabled status, except to confirm it is disabled. ppc64_runlatch_o* functions use MSR this way to decide whether to re-e

[PATCH v2 3/3] powerpc/64s/interrupt: masked handler debug check for previous hard disable

2022-09-05 Thread Nicholas Piggin
Prior changes eliminated cases of masked PACA_IRQ_MUST_HARD_MASK interrupts that re-fire due to MSR[EE] being enabled while they are pending. Add a debug check in the masked interrupt handler to catch if this occurs. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 10 ++

Re: [PATCH] powerpc/pasemi: Use of_root in pas_pci_init()

2022-09-05 Thread Christophe Leroy
Le 06/09/2022 à 03:03, Michael Ellerman a écrit : > Currently in pas_pci_init() a reference to the root node is leaked due > to a missing of_node_put(). Instead just use of_root directly. > > Note that converting to of_find_compatible_node(NULL, ...) would > not be entirely equivalent, because t

Re: [PATCH v2 16/16] objtool/powerpc: Add --mcount specific implementation

2022-09-05 Thread Christophe Leroy
Le 05/09/2022 à 22:43, Segher Boessenkool a écrit : > Hi! > > On Mon, Sep 05, 2022 at 04:15:07PM +0530, Naveen N. Rao wrote: >> Segher Boessenkool wrote: > + if ((insn & 3) == 1) { > + *type = INSN_CALL; > + *immediate = insn & 0x3fc; >