Re: [PATCH] powerpc/64s: fix hash page fault interrupt handler

2021-06-28 Thread Sachin Sant
> On 29-Jun-2021, at 7:20 AM, Nicholas Piggin wrote: > > The early bad fault or key fault test in do_hash_fault() ends up calling > into ___do_page_fault without having gone through an interrupt handler > wrapper (except the initial _RAW one). This can end up calling local irq > functions

Re: [PATCH] Documentation: PCI: pci-error-recovery: rearrange the general sequence

2021-06-28 Thread Wesley Sheng
On Fri, Jun 18, 2021 at 05:21:32PM +1000, Oliver O'Halloran wrote: > On Fri, Jun 18, 2021 at 4:05 PM Wesley Sheng wrote: > > > > Reset_link() callback function was called before mmio_enabled() in > > pcie_do_recovery() function actually, so rearrange the general > > sequence betwen step 2 and

[PATCH] powerpc/64s: fix hash page fault interrupt handler

2021-06-28 Thread Nicholas Piggin
The early bad fault or key fault test in do_hash_fault() ends up calling into ___do_page_fault without having gone through an interrupt handler wrapper (except the initial _RAW one). This can end up calling local irq functions while the interrupt has not been reconciled, which will likely cause

Re: [PATCH v5 4/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-06-28 Thread kernel test robot
Hi "Aneesh, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.13 next-20210628] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in

Re: [PATCH v5 4/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-06-28 Thread kernel test robot
Hi "Aneesh, I love your patch! Perhaps something to improve: [auto build test WARNING on powerpc/next] [also build test WARNING on v5.13 next-20210628] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as docum

Re: [PATCH 5/8] powerpc/64: enable MSR[EE] in irq replay pt_regs

2021-06-28 Thread Nicholas Piggin
Excerpts from Sachin Sant's message of June 29, 2021 12:37 am: > >> On 28-Jun-2021, at 1:19 PM, Nicholas Piggin wrote: >> >> Similar to 2b48e96be2f9f ("powerpc/64: fix irq replay pt_regs->softe >> value"), enable MSR_EE in pt_regs->msr, which makes the regs look a >> bit more normal and allows

Re: [RFC] fpga: dfl: fme: Fix cpu hotplug code

2021-06-28 Thread Moritz Fischer
On Mon, Jun 28, 2021 at 12:45:46PM +0530, Kajol Jain wrote: > Commit 724142f8c42a ("fpga: dfl: fme: add performance > reporting support") added performance reporting support > for FPGA management engine via perf. > > It also added cpu hotplug feature but it didn't add > pmu migration call in cpu

Re: [PATCH v4 7/7] powerpc/pseries: Add support for FORM2 associativity

2021-06-28 Thread Aneesh Kumar K.V
David Gibson writes: > On Thu, Jun 24, 2021 at 01:50:34PM +0530, Aneesh Kumar K.V wrote: >> David Gibson writes: >> >> > On Thu, Jun 17, 2021 at 10:21:05PM +0530, Aneesh Kumar K.V wrote: >> >> PAPR interface currently supports two different ways of communicating >> >> resource >> >> grouping

[PATCH v5 6/6] powerpc/pseries: Add support for FORM2 associativity

2021-06-28 Thread Aneesh Kumar K.V
PAPR interface currently supports two different ways of communicating resource grouping details to the OS. These are referred to as Form 0 and Form 1 associativity grouping. Form 0 is the older format and is now considered deprecated. This patch adds another resource grouping named FORM2.

[PATCH v5 5/6] powerpc/pseries: Add a helper for form1 cpu distance

2021-06-28 Thread Aneesh Kumar K.V
This helper is only used with the dispatch trace log collection. A later patch will add Form2 affinity support and this change helps in keeping that simpler. Also add a comment explaining we don't expect the code to be called with FORM0 Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V

[PATCH v5 4/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-06-28 Thread Aneesh Kumar K.V
The associativity details of the newly added resourced are collected from the hypervisor via "ibm,configure-connector" rtas call. Update the numa distance details of the newly added numa node after the above call. Instead of updating NUMA distance every time we lookup a node id from the

[PATCH v5 3/6] powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY

2021-06-28 Thread Aneesh Kumar K.V
Also make related code cleanup that will allow adding FORM2_AFFINITY in later patches. No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/firmware.h | 4 +-- arch/powerpc/include/asm/prom.h | 2 +-

[PATCH v5 2/6] powerpc/pseries: rename distance_ref_points_depth to max_associativity_domain_index

2021-06-28 Thread Aneesh Kumar K.V
No functional change in this patch Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 8365b298ec48..132813dd1a6c 100644 ---

[PATCH v5 1/6] powerpc/pseries: rename min_common_depth to primary_domain_index

2021-06-28 Thread Aneesh Kumar K.V
No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index

[PATCH v5 0/6] Add support for FORM2 associativity

2021-06-28 Thread Aneesh Kumar K.V
Form2 associativity adds a much more flexible NUMA topology layout than what is provided by Form1. More details can be found in patch 7. $ numactl -H ... node distances: node 0 1 2 3 0: 10 11 222 33 1: 44 10 55 66 2: 77 88 10 99 3: 101 121 132 10 $ After DAX

Re: [PATCH] perf script python: Fix buffer size to report iregs in perf script

2021-06-28 Thread Paul A. Clarke
On Mon, Jun 28, 2021 at 11:53:41AM +0530, Kajol Jain wrote: > Commit 48a1f565261d ("perf script python: Add more PMU fields > to event handler dict") added functionality to report fields like > weight, iregs, uregs etc via perf report. > That commit predefined buffer size to 512 bytes to print

Re: [PATCH 5/8] powerpc/64: enable MSR[EE] in irq replay pt_regs

2021-06-28 Thread Sachin Sant
> On 28-Jun-2021, at 1:19 PM, Nicholas Piggin wrote: > > Similar to 2b48e96be2f9f ("powerpc/64: fix irq replay pt_regs->softe > value"), enable MSR_EE in pt_regs->msr, which makes the regs look a > bit more normal and allows the extra debug checks to be added to > interrupt handler entry. > >

Re: [PATCH] perf vendor events power10: Adds 24x7 nest metric events for power10 platform

2021-06-28 Thread Paul A. Clarke
On Mon, Jun 28, 2021 at 11:58:54AM +0530, kajoljain wrote: > > > On 6/25/21 6:51 PM, Paul A. Clarke wrote: > > On Fri, Jun 25, 2021 at 05:29:48PM +0530, Kajol Jain wrote: > >> Patch adds 24x7 nest metric events for POWER10. > >> > >> Signed-off-by: Kajol Jain > >> --- > >>

Re: [PATCH 3/8] powerpc/64s: add a table of implicit soft-masked addresses

2021-06-28 Thread Sachin Sant
> On 28-Jun-2021, at 1:19 PM, Nicholas Piggin wrote: > > Commit 9d1988ca87dd ("powerpc/64: treat low kernel text as irqs > soft-masked") ends up catching too much code, including ret_from_fork, > and parts of interrupt and syscall return that do not expect to be > interrupts to be

Re: [RFC] fpga: dfl: fme: Fix cpu hotplug code

2021-06-28 Thread Xu Yilun
It's a good fix, you can drop the RFC in commit title. :) The title could be more specific, like: fpga: dfl: fme: Fix cpu hotplug issue in performance reporting So we know it is for performance reporting feature at first glance. On Mon, Jun 28, 2021 at 12:45:46PM +0530, Kajol Jain wrote:

[PATCH] fpga: dfl: fme: Fix cpu hotplug issue in performance reporting

2021-06-28 Thread Kajol Jain
The performance reporting driver added cpu hotplug feature but it didn't add pmu migration call in cpu offline function. This can create an issue incase the current designated cpu being used to collect fme pmu data got offline, as based on current code we are not migrating fme pmu to new target

Re: [RFC] fpga: dfl: fme: Fix cpu hotplug code

2021-06-28 Thread kajoljain
On 6/28/21 2:31 PM, Xu Yilun wrote: > It's a good fix, you can drop the RFC in commit title. :) > > The title could be more specific, like: > > fpga: dfl: fme: Fix cpu hotplug issue in performance reporting > > So we know it is for performance reporting feature at first glance. > > On

linux-next: manual merge of the akpm tree with the powerpc tree

2021-06-28 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the akpm tree got a conflict in: arch/powerpc/kernel/setup-common.c between commit: 56afad885228 ("powerpc: Remove klimit") from the powerpc tree and commit: 6e6e0df2a484 ("powerpc: convert to setup_initial_init_mm()") from the akpm tree. I fixed

[PATCH 8/8] powerpc/64s: move ret_from_fork etc above __end_soft_masked

2021-06-28 Thread Nicholas Piggin
Code which runs with interrupts enabled should be moved above __end_soft_masked where possible, because maskable interrupts that hit below there need to consult the soft mask table. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/interrupt_64.S | 52 +++--- 1 file

[PATCH 7/8] powerpc/64s/interrupt: clean up interrupt return labels

2021-06-28 Thread Nicholas Piggin
Normal kernel-interrupt exits can get interrupt_return_srr_user_restart in their backtrace, which is an unusual and notable function, and it is part of the user-interrupt exit path, which is doubly confusing. Add symmetric non-local labels for user and kernel interrupt exit cases to address this.

[PATCH 6/8] powerpc/64/interrupts: add missing kprobe annotations on interrupt exit symbols

2021-06-28 Thread Nicholas Piggin
If one interrupt exit symbol must not be kprobed, none of them can be, really. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/interrupt_64.S | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/interrupt_64.S b/arch/powerpc/kernel/interrupt_64.S index

[PATCH 5/8] powerpc/64: enable MSR[EE] in irq replay pt_regs

2021-06-28 Thread Nicholas Piggin
Similar to 2b48e96be2f9f ("powerpc/64: fix irq replay pt_regs->softe value"), enable MSR_EE in pt_regs->msr, which makes the regs look a bit more normal and allows the extra debug checks to be added to interrupt handler entry. Signed-off-by: Nicholas Piggin ---

[PATCH 4/8] powerpc/64s/interrupt: preserve regs->softe for NMI interrupts

2021-06-28 Thread Nicholas Piggin
If an NMI interrupt hits in an implicit soft-masked region, regs->softe is modified to reflect that. This may not be necessary for correctness at the moment, but it is less surprising and it's unhelpful when debugging or adding checks. Make sure this is changed back to how it was found before

[PATCH 3/8] powerpc/64s: add a table of implicit soft-masked addresses

2021-06-28 Thread Nicholas Piggin
Commit 9d1988ca87dd ("powerpc/64: treat low kernel text as irqs soft-masked") ends up catching too much code, including ret_from_fork, and parts of interrupt and syscall return that do not expect to be interrupts to be soft-masked. If an interrupt gets marked pending, and then the code proceeds

[PATCH 2/8] powerpc/64e: remove implicit soft-masking and interrupt exit restart logic

2021-06-28 Thread Nicholas Piggin
The implicit soft-masking to speed up interrupt return was going to be used by 64e as well, but it was not ready in time. 64e always disables MSR[EE] when exiting from interrupt and syscall. Disable it for now. Fixes: 9d1988ca87dd ("powerpc/64: treat low kernel text as irqs soft-masked")

[PATCH 1/8] powerpc/64e: fix CONFIG_RELOCATABLE build

2021-06-28 Thread Nicholas Piggin
Commit 24d33ac5b8ff ("powerpc/64s: Make prom_init require RELOCATABLE") also made my 64e config require RELOCATABLE, which results in compile failures. Whether or not that's the right thing to do for prom_init for 64e, this fixes CONFIG_RELOCATABLE=y compile errors. That commit is marked as being

[PATCH 0/8] powerpc: fast interrupt exit bug and misc fixes

2021-06-28 Thread Nicholas Piggin
This is a bunch of fixes for powerpc next, mostly a nasty hole in fast interrupt exit code found by Sachin and some other bits along the way while looking at it. So far this survives about 5 hours of stress testing with a workload that would trigger it in a few seconds (guest 128 vcpus running

Re: [PATCH v4 7/7] powerpc/pseries: Add support for FORM2 associativity

2021-06-28 Thread David Gibson
On Thu, Jun 24, 2021 at 01:50:34PM +0530, Aneesh Kumar K.V wrote: > David Gibson writes: > > > On Thu, Jun 17, 2021 at 10:21:05PM +0530, Aneesh Kumar K.V wrote: > >> PAPR interface currently supports two different ways of communicating > >> resource > >> grouping details to the OS. These are

[RFC] fpga: dfl: fme: Fix cpu hotplug code

2021-06-28 Thread Kajol Jain
Commit 724142f8c42a ("fpga: dfl: fme: add performance reporting support") added performance reporting support for FPGA management engine via perf. It also added cpu hotplug feature but it didn't add pmu migration call in cpu offline function. This can create an issue incase the current designated

Re: [PATCH] perf script python: Fix buffer size to report iregs in perf script

2021-06-28 Thread Nageswara Sastry
Tested by creating perf-script.py using perf script and priting the iregs. Seen more values with this patch. Tested-by: Nageswara R Sastry On 28/06/21 11:53 am, Kajol Jain wrote: Commit 48a1f565261d ("perf script python: Add more PMU fields to event handler dict") added functionality to

[PATCH] powerpc/4xx: Fix setup_kuep() on SMP

2021-06-28 Thread Christophe Leroy
On SMP, setup_kuep() is also called from start_secondary() since commit 86f46f343272 ("powerpc/32s: Initialise KUAP and KUEP in C"). start_secondary() is not an __init function. Remove the __init marker from setup_kuep() and bail out when not caller on the first CPU as the work is already done.

[PATCH] powerpc/32s: Fix setup_{kuap/kuep}() on SMP

2021-06-28 Thread Christophe Leroy
On SMP, setup_kup() is also called from start_secondary(). start_secondary() is not an __init function. Remove the __init marker from setup_kuep() and and setup_kuap(). Reported-by: kernel test robot Fixes: 86f46f343272 ("powerpc/32s: Initialise KUAP and KUEP in C"). Signed-off-by: Christophe

[PATCH v2] perf vendor events power10: Adds 24x7 nest metric events for power10 platform

2021-06-28 Thread Kajol Jain
Patch adds 24x7 nest metric events for POWER10. Tested-by: Nageswara R Sastry Signed-off-by: Kajol Jain --- .../arch/powerpc/power10/nest_metrics.json| 424 ++ 1 file changed, 424 insertions(+) create mode 100644 tools/perf/pmu-events/arch/powerpc/power10/nest_metrics.json

Re: [PATCH] perf vendor events power10: Adds 24x7 nest metric events for power10 platform

2021-06-28 Thread kajoljain
On 6/25/21 6:51 PM, Paul A. Clarke wrote: > On Fri, Jun 25, 2021 at 05:29:48PM +0530, Kajol Jain wrote: >> Patch adds 24x7 nest metric events for POWER10. >> >> Signed-off-by: Kajol Jain >> --- >> .../arch/powerpc/power10/nest_metrics.json| 491 ++ >> 1 file changed, 491

[PATCH] perf script python: Fix buffer size to report iregs in perf script

2021-06-28 Thread Kajol Jain
Commit 48a1f565261d ("perf script python: Add more PMU fields to event handler dict") added functionality to report fields like weight, iregs, uregs etc via perf report. That commit predefined buffer size to 512 bytes to print those fields. But incase of powerpc, since we added extended regs

Re: [PATCH v3] mm: pagewalk: Fix walk for hugepage tables

2021-06-28 Thread Christophe Leroy
Le 28/06/2021 à 08:03, Aneesh Kumar K.V a écrit : Christophe Leroy writes: Pagewalk ignores hugepd entries and walk down the tables as if it was traditionnal entries, leading to crazy result. But we do handle hugetlb separately if (vma && is_vm_hugetlb_page(vma)) {

Re: [PATCH v3] mm: pagewalk: Fix walk for hugepage tables

2021-06-28 Thread Aneesh Kumar K.V
Christophe Leroy writes: > Pagewalk ignores hugepd entries and walk down the tables > as if it was traditionnal entries, leading to crazy result. But we do handle hugetlb separately if (vma && is_vm_hugetlb_page(vma)) { if (ops->hugetlb_entry)