Re: [v4 4/5] KVM: PPC: Book3S HV: retry page migration before erroring-out

2020-07-23 Thread Bharata B Rao
On Fri, Jul 17, 2020 at 01:00:26AM -0700, Ram Pai wrote: > @@ -812,7 +842,7 @@ unsigned long kvmppc_h_svm_page_in(struct kvm *kvm, > unsigned long gpa, > struct vm_area_struct *vma; > int srcu_idx; > unsigned long gfn = gpa >> page_shift; > - int ret; > + int ret,

Re: [PATCH kernel] KVM: PPC: Protect kvm_vcpu_read_guest with srcu locks

2020-07-23 Thread Paul Mackerras
On Tue, Jun 09, 2020 at 12:12:29PM +1000, Alexey Kardashevskiy wrote: > The kvm_vcpu_read_guest/kvm_vcpu_write_guest used for nested guests > eventually call srcu_dereference_check to dereference a memslot and > lockdep produces a warning as neither kvm->slots_lock nor > kvm->srcu lock is held and

Re: [PATCH] powerpc/kvm: Enable support for ISA v3.1 guests

2020-07-23 Thread Paul Mackerras
On Tue, Jun 02, 2020 at 03:53:25PM +1000, Alistair Popple wrote: > Adds support for emulating ISAv3.1 guests by adding the appropriate PCR > and FSCR bits. > > Signed-off-by: Alistair Popple Thanks, patch applied to my kvm-ppc-next branch. Paul.

Re: [PATCH v6 3/5] KVM: PPC: clean up redundant kvm_run parameters in assembly

2020-07-23 Thread Paul Mackerras
On Tue, Jun 23, 2020 at 09:14:16PM +0800, Tianjia Zhang wrote: > In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' > structure. For historical reasons, many kvm-related function parameters > retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This > patch does

Re: [v4 3/5] KVM: PPC: Book3S HV: in H_SVM_INIT_DONE, migrate remaining normal-GFNs to secure-GFNs.

2020-07-23 Thread Bharata B Rao
On Fri, Jul 17, 2020 at 01:00:25AM -0700, Ram Pai wrote: > > +int kvmppc_uv_migrate_mem_slot(struct kvm *kvm, > + const struct kvm_memory_slot *memslot) Don't see any callers for this outside of this file, so why not static? > +{ > + unsigned long gfn = memslot->base_gfn; > +

Re: [PATCH] KVM: PPC: Book3S HV: increase KVMPPC_NR_LPIDS on POWER8 and POWER9

2020-07-23 Thread Paul Mackerras
On Mon, Jun 08, 2020 at 01:57:14PM +0200, Cédric Le Goater wrote: > POWER8 and POWER9 have 12-bit LPIDs. Change LPID_RSVD to support up to > (4096 - 2) guests on these processors. POWER7 is kept the same with a > limitation of (1024 - 2), but it might be time to drop KVM support for > POWER7. > >

[PATCH v3 08/10] powerpc/smp: Allocate cpumask only after searching thread group

2020-07-23 Thread Srikar Dronamraju
If allocated earlier and the search fails, then cpumask need to be freed. However cpu_l1_cache_map can be allocated after we search thread group. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Anton Blanchard Cc: Oliver O'Halloran Cc: Nathan Lynch Cc: Michael

[PATCH v5 06/10] powerpc/watchpoint: Set CPU_FTR_DAWR1 based on pa-features bit

2020-07-23 Thread Ravi Bangoria
As per the PAPR, bit 0 of byte 64 in pa-features property indicates availability of 2nd DAWR registers. i.e. If this bit is set, 2nd DAWR is present, otherwise not. Host generally uses "cpu-features", which masks "pa-features". But "cpu-features" are still not used for guests and thus this change

[PATCH v2] powerpc/watchpoint/ptrace: Introduce PPC_DEBUG_FEATURE_DATA_BP_DAWR_ARCH_31

2020-07-23 Thread Ravi Bangoria
PPC_DEBUG_FEATURE_DATA_BP_DAWR_ARCH_31 can be used to determine whether we are running on an ISA 3.1 compliant machine. Which is needed to determine DAR behaviour, 512 byte boundary limit etc. This was requested by Pedro Miraglia Franco de Carvalho for extending watchpoint features in gdb. Note

Re: [PATCH] powerpc/64s: Fix irq tracing corruption in interrupt/syscall return caused by perf interrupts

2020-07-23 Thread Nicholas Piggin
Excerpts from Alexey Kardashevskiy's message of July 22, 2020 8:50 pm: > > > On 22/07/2020 17:34, Nicholas Piggin wrote: >> Alexey reports lockdep_assert_irqs_enabled() warnings when stress testing >> perf, e.g., >> >> WARNING: CPU: 0 PID: 1556 at kernel/softirq.c:169 >>

Re: [PATCH 2/2] powerpc/64s: system call support for scv/rfscv instructions

2020-07-23 Thread Michael Ellerman
Nicholas Piggin writes: > diff --git a/arch/powerpc/include/asm/ppc-opcode.h > b/arch/powerpc/include/asm/ppc-opcode.h > index 2a39c716c343..b2bdc4de1292 100644 > --- a/arch/powerpc/include/asm/ppc-opcode.h > +++ b/arch/powerpc/include/asm/ppc-opcode.h > @@ -257,6 +257,7 @@ > #define

[PATCH v5 02/10] powerpc/watchpoint: Fix DAWR exception constraint

2020-07-23 Thread Ravi Bangoria
Pedro Miraglia Franco de Carvalho noticed that on p8/p9, DAR value is inconsistent with different type of load/store. Like for byte,word etc. load/stores, DAR is set to the address of the first byte of overlap between watch range and real access. But for quadword load/ store it's sometime set to

[PATCH 0/7] powerpc/watchpoint: 2nd DAWR kvm enablement + selftests

2020-07-23 Thread Ravi Bangoria
Patch #1, #2 and #3 enables p10 2nd DAWR feature for Book3S kvm guest. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/unset it. A new case H_SET_MODE_RESOURCE_SET_DAWR1 is introduced in H_SET_MODE hcall for setting/unsetting 2nd DAWR. Also, new capability KVM_CAP_PPC_DAWR1

[PATCH 1/7] powerpc/watchpoint/kvm: Rename current DAWR macros and variables

2020-07-23 Thread Ravi Bangoria
Power10 is introducing second DAWR. Use real register names (with suffix 0) from ISA for current macros and variables used by kvm. Signed-off-by: Ravi Bangoria --- Documentation/virt/kvm/api.rst| 4 +-- arch/powerpc/include/asm/kvm_host.h | 4 +--

[PATCH v3 03/10] powerpc/smp: Move powerpc_topology above

2020-07-23 Thread Srikar Dronamraju
Just moving the powerpc_topology description above. This will help in using functions in this file and avoid declarations. No other functional changes Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Anton Blanchard Cc: Oliver O'Halloran Cc: Nathan Lynch Cc: Michael

[PATCH v3 07/10] powerpc/numa: Detect support for coregroup

2020-07-23 Thread Srikar Dronamraju
Add support for grouping cores based on the device-tree classification. - The last domain in the associativity domains always refers to the core. - If primary reference domain happens to be the penultimate domain in the associativity domains device-tree property, then there are no coregroups.

[PATCH v3 06/10] powerpc/smp: Generalize 2nd sched domain

2020-07-23 Thread Srikar Dronamraju
Currently "CACHE" domain happens to be the 2nd sched domain as per powerpc_topology. This domain will collapse if cpumask of l2-cache is same as SMT domain. However we could generalize this domain such that it could mean either be a "CACHE" domain or a "BIGCORE" domain. While setting up the

[PATCH v5 07/10] powerpc/watchpoint: Rename current H_SET_MODE DAWR macro

2020-07-23 Thread Ravi Bangoria
Current H_SET_MODE hcall macro name for setting/resetting DAWR0 is H_SET_MODE_RESOURCE_SET_DAWR. Add suffix 0 to macro name as well. Signed-off-by: Ravi Bangoria Reviewed-by: Jordan Niethe --- arch/powerpc/include/asm/hvcall.h | 2 +- arch/powerpc/include/asm/plpar_wrappers.h | 2 +-

[PATCH 3/7] powerpc/watchpoint/kvm: Introduce new capability for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
Introduce KVM_CAP_PPC_DAWR1 which can be used by Qemu to query whether kvm supports 2nd DAWR or not. Signed-off-by: Ravi Bangoria --- arch/powerpc/kvm/powerpc.c | 3 +++ include/uapi/linux/kvm.h | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/kvm/powerpc.c

Re: [PATCH 0/7] powerpc/watchpoint: 2nd DAWR kvm enablement + selftests

2020-07-23 Thread Ravi Bangoria
On 7/23/20 3:50 PM, Ravi Bangoria wrote: Patch #1, #2 and #3 enables p10 2nd DAWR feature for Book3S kvm guest. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/unset it. A new case H_SET_MODE_RESOURCE_SET_DAWR1 is introduced in H_SET_MODE hcall for setting/unsetting 2nd

[powerpc:merge] BUILD SUCCESS c27fe454aff795023d2f3f90f41eb1a3104e614f

2020-07-23 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge branch HEAD: c27fe454aff795023d2f3f90f41eb1a3104e614f Automatic merge of 'master', 'next' and 'fixes' (2020-07-21 00:00) elapsed time: 3913m configs tested: 111 configs skipped: 2 The following configs have

[PATCH v5 00/10] powerpc/watchpoint: Enable 2nd DAWR on baremetal and powervm

2020-07-23 Thread Ravi Bangoria
Last series[1] was to add basic infrastructure support for more than one watchpoint on Book3S powerpc. This series actually enables the 2nd DAWR for baremetal and powervm. Kvm guest is still not supported. v4: https://lore.kernel.org/r/20200717040958.70561-1-ravi.bango...@linux.ibm.com v4->v5:

[PATCH v5 05/10] powerpc/dt_cpu_ftrs: Add feature for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
Add new device-tree feature for 2nd DAWR. If this feature is present, 2nd DAWR is supported, otherwise not. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 3 ++- arch/powerpc/kernel/dt_cpu_ftrs.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v5 09/10] powerpc/watchpoint: Return available watchpoints dynamically

2020-07-23 Thread Ravi Bangoria
So far Book3S Powerpc supported only one watchpoint. Power10 is introducing 2nd DAWR. Enable 2nd DAWR support for Power10. Availability of 2nd DAWR will depend on CPU_FTR_DAWR1. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 5 +++--

[PATCH 2/7] powerpc/watchpoint/kvm: Add infrastructure to support 2nd DAWR

2020-07-23 Thread Ravi Bangoria
kvm code assumes single DAWR everywhere. Add code to support 2nd DAWR. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/ unset it. Introduce new case H_SET_MODE_RESOURCE_SET_DAWR1 for 2nd DAWR. Also, kvm will support 2nd DAWR only if CPU_FTR_DAWR1 is set. Signed-off-by: Ravi

[PATCH 6/7] powerpc/selftests/perf-hwbreak: Add testcases for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
Extend perf-hwbreak.c selftest to test multiple DAWRs. Also add testcase for testing 512 byte boundary removal. Sample o/p: # ./perf-hwbreak ... TESTED: Process specific, Two events, diff addr TESTED: Process specific, Two events, same addr TESTED: Process specific, Two events, diff

Re: [PATCH v4 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-23 Thread Michael Ellerman
Hari Bathini writes: > On 22/07/20 9:55 am, Michael Ellerman wrote: >> Hari Bathini writes: >>> Right now purgatory implementation is only minimal. But if purgatory >>> code is to be enhanced to copy memory to the backup region and verify >>> sha256 digest, relocations may have to be applied to

[PATCH v3 01/10] powerpc/smp: Fix a warning under !NEED_MULTIPLE_NODES

2020-07-23 Thread Srikar Dronamraju
Fix a build warning in a non CONFIG_NEED_MULTIPLE_NODES "error: _numa_cpu_lookup_table_ undeclared" Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Anton Blanchard Cc: Oliver O'Halloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Gautham R Shenoy Cc: Ingo Molnar Cc:

[PATCH v3 05/10] powerpc/smp: Dont assume l2-cache to be superset of sibling

2020-07-23 Thread Srikar Dronamraju
Current code assumes that cpumask of cpus sharing a l2-cache mask will always be a superset of cpu_sibling_mask. Lets stop that assumption. cpu_l2_cache_mask is a superset of cpu_sibling_mask if and only if shared_caches is set. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas

[PATCH v5 04/10] powerpc/watchpoint: Enable watchpoint functionality on power10 guest

2020-07-23 Thread Ravi Bangoria
CPU_FTR_DAWR is by default enabled for host via CPU_FTRS_DT_CPU_BASE (controlled by CONFIG_PPC_DT_CPU_FTRS). But cpu-features device-tree node is not PAPR compatible and thus not yet used by kvm or pHyp guests. Enable watchpoint functionality on power10 guest (both kvm and powervm) by adding

[PATCH v5 10/10] powerpc/watchpoint: Remove 512 byte boundary

2020-07-23 Thread Ravi Bangoria
Power10 has removed 512 bytes boundary from match criteria i.e. the watch range can cross 512 bytes boundary. Note: ISA 3.1 Book III 9.4 match criteria includes 512 byte limit but that is a documentation mistake and hopefully will be fixed in the next version of ISA. Though, ISA 3.1 change log

[PATCH 4/7] powerpc/selftests/ptrace-hwbreak: Add testcases for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
Add selftests to test multiple active DAWRs with ptrace interface. Sample o/p: $ ./ptrace-hwbreak ... PPC_PTRACE_SETHWDEBUG 2, MODE_RANGE, DW ALIGNED, WO, len: 6: Ok PPC_PTRACE_SETHWDEBUG 2, MODE_RANGE, DW UNALIGNED, RO, len: 6: Ok PPC_PTRACE_SETHWDEBUG 2, MODE_RANGE, DAWR Overlap, WO,

[PATCH v3 04/10] powerpc/smp: Move topology fixups into a new function

2020-07-23 Thread Srikar Dronamraju
Move topology fixup based on the platform attributes into its own function which is called just before set_sched_topology. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Anton Blanchard Cc: Oliver O'Halloran Cc: Nathan Lynch Cc: Michael Neuling Cc: Gautham R Shenoy

[PATCH v3 10/10] powerpc/smp: Implement cpu_to_coregroup_id

2020-07-23 Thread Srikar Dronamraju
Lookup the coregroup id from the associativity array. If unable to detect the coregroup id, fallback on the core id. This way, ensure sched_domain degenerates and an extra sched domain is not created. Ideally this function should have been implemented in arch/powerpc/kernel/smp.c. However if its

[PATCH 5/7] powerpc/selftests/perf-hwbreak: Coalesce event creation code

2020-07-23 Thread Ravi Bangoria
perf-hwbreak selftest opens hw-breakpoint event at multiple places for which it has same code repeated. Coalesce that code into a function. Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 78 +-- 1 file changed, 38 insertions(+), 40 deletions(-)

[PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
If an interrupt is not masked by local_irq_disable (e.g., a powerpc perf interrupt), then it can hit in local_irq_enable() after trace_hardirqs_on() and before raw_local_irq_enable(). If that interrupt handler calls local_irq_save(), it will call trace_hardirqs_off() but the local_irq_restore()

[PATCH v3 00/10] Coregroup support on Powerpc

2020-07-23 Thread Srikar Dronamraju
Changelog v2 -> v3: v2: https://lore.kernel.org/linuxppc-dev/20200721113814.32284-1-sri...@linux.vnet.ibm.com/t/#u powerpc/smp: Cache node for reuse Removed node caching part. Rewrote the Commit msg (Michael Ellerman) Renamed to powerpc/smp: Fix a warning under

[PATCH v5 03/10] powerpc/watchpoint: Fix DAWR exception for CACHEOP

2020-07-23 Thread Ravi Bangoria
'ea' returned by analyse_instr() needs to be aligned down to cache block size for CACHEOP instructions. analyse_instr() does not set size for CACHEOP, thus size also needs to be calculated manually. Fixes: 27985b2a640e ("powerpc/watchpoint: Don't ignore extraneous exceptions blindly") Fixes:

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > >> diff --git a/arch/powerpc/include/asm/hw_irq.h >> b/arch/powerpc/include/asm/hw_irq.h >> index 3a0db7b0b46e..35060be09073 100644 >> ---

Re: [PATCH 2/5] powerpc: Allow 4096 bytes of stack expansion for the signal frame

2020-07-23 Thread Daniel Axtens
Hi Michael, Unfortunately, this patch doesn't completely solve the problem. Trying the original reproducer, I'm still able to trigger the crash even with this patch, although not 100% of the time. (If I turn ASLR off outside of tmux it reliably crashes, if I turn ASLR off _inside_ of tmux it

Re: [PATCH v2 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper

2020-07-23 Thread Ard Biesheuvel
On Thu, 23 Jul 2020 at 04:52, Jarkko Sakkinen wrote: > > On Thu, Jul 16, 2020 at 06:49:09PM +0200, Christophe Leroy wrote: > > Jarkko Sakkinen a écrit : > > > > > Rename module_alloc() to text_alloc() and module_memfree() to > > > text_memfree(), and move them to kernel/text.c, which is

Re: [PATCHv3 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents

2020-07-23 Thread Michael Ellerman
Pingfan Liu writes: > On Wed, Jul 22, 2020 at 12:57 PM Michael Ellerman wrote: >> >> Pingfan Liu writes: >> > A bug is observed on pseries by taking the following steps on rhel: >> ^ >>

[v4] powerpc/perf: Initialize power10 PMU registers in cpu setup routine

2020-07-23 Thread Athira Rajeev
Initialize Monitor Mode Control Register 3 (MMCR3) SPR which is new in power10. For PowerISA v3.1, BHRB disable is controlled via Monitor Mode Control Register A (MMCRA) bit, namely "BHRB Recording Disable (BHRBRD)". This patch also initializes MMCRA BHRBRD to disable BHRB feature at boot for

Re: [v4] powerpc/perf: Initialize power10 PMU registers in cpu setup routine

2020-07-23 Thread Jordan Niethe
On Thu, Jul 23, 2020 at 5:32 PM Athira Rajeev wrote: > > Initialize Monitor Mode Control Register 3 (MMCR3) > SPR which is new in power10. For PowerISA v3.1, BHRB disable > is controlled via Monitor Mode Control Register A (MMCRA) bit, > namely "BHRB Recording Disable (BHRBRD)". This patch also

[PATCH v3 02/10] powerpc/smp: Merge Power9 topology with Power topology

2020-07-23 Thread Srikar Dronamraju
A new sched_domain_topology_level was added just for Power9. However the same can be achieved by merging powerpc_topology with power9_topology and makes the code more simpler especially when adding a new sched domain. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc:

[PATCH v3 09/10] powerpc/smp: Create coregroup domain

2020-07-23 Thread Srikar Dronamraju
Add percpu coregroup maps and masks to create coregroup domain. If a coregroup doesn't exist, the coregroup domain will be degenerated in favour of SMT/CACHE domain. Cc: linuxppc-dev Cc: LKML Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Anton Blanchard Cc: Oliver O'Halloran Cc: Nathan Lynch

[PATCH v5 01/10] powerpc/watchpoint: Fix 512 byte boundary limit

2020-07-23 Thread Ravi Bangoria
Milton Miller reported that we are aligning start and end address to wrong size SZ_512M. It should be SZ_512. Fix that. While doing this change I also found a case where ALIGN() comparison fails. Within a given aligned range, ALIGN() of two addresses does not match when start address is pointing

[PATCH v5 08/10] powerpc/watchpoint: Guest support for 2nd DAWR hcall

2020-07-23 Thread Ravi Bangoria
2nd DAWR can be set/unset using H_SET_MODE hcall with resource value 5. Enable powervm guest support with that. This has no effect on kvm guest because kvm will return error if guest does hcall with resource value 5. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hvcall.h | 1

[PATCH 7/7] powerpc/selftests: Add selftest to test concurrent perf/ptrace events

2020-07-23 Thread Ravi Bangoria
ptrace and perf watchpoints can't co-exists if their address range overlaps. See commit 29da4f91c0c1 ("powerpc/watchpoint: Don't allow concurrent perf and ptrace events") for more detail. Add selftest for the same. Sample o/p: # ./ptrace-perf-hwbreak test: ptrace-perf-hwbreak tags:

[PATCH 2/2] lockdep: warn on redundant or incorrect irq state changes

2020-07-23 Thread Nicholas Piggin
With the previous patch, lockdep hardirq state changes should not be redundant. Softirq state changes already follow that pattern. So warn on unexpected enable-when-enabled or disable-when-disabled conditions, to catch possible errors or sloppy patterns that could lead to similar bad behavior due

Re: [RFC PATCH 4/5] powerpc/mm: Remove custom stack expansion checking

2020-07-23 Thread Daniel Axtens
Hi Michael, > We have powerpc specific logic in our page fault handling to decide if > an access to an unmapped address below the stack pointer should expand > the stack VMA. > > The logic aims to prevent userspace from doing bad accesses below the > stack pointer. However as long as the stack is

Re: [PATCH v2 2/2] KVM: PPC: Book3S HV: rework secure mem slot dropping

2020-07-23 Thread Laurent Dufour
Le 23/07/2020 à 14:32, Laurent Dufour a écrit : Le 23/07/2020 à 05:36, Bharata B Rao a écrit : On Tue, Jul 21, 2020 at 12:42:02PM +0200, Laurent Dufour wrote: When a secure memslot is dropped, all the pages backed in the secure device (aka really backed by secure memory by the Ultravisor)

Re: [v4 4/5] KVM: PPC: Book3S HV: retry page migration before erroring-out

2020-07-23 Thread Ram Pai
I am dropping this patch based on our conversation, where we agreed, we need to rootcause the migration failure. On Thu, Jul 23, 2020 at 11:43:44AM +0530, Bharata B Rao wrote: > On Fri, Jul 17, 2020 at 01:00:26AM -0700, Ram Pai wrote: > > @@ -812,7 +842,7 @@ unsigned long

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Peter Zijlstra
On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > diff --git a/arch/powerpc/include/asm/hw_irq.h > b/arch/powerpc/include/asm/hw_irq.h > index 3a0db7b0b46e..35060be09073 100644 > --- a/arch/powerpc/include/asm/hw_irq.h > +++ b/arch/powerpc/include/asm/hw_irq.h > @@ -200,17

Re: [PATCHv3 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents

2020-07-23 Thread Nathan Lynch
Pingfan Liu writes: > A bug is observed on pseries by taking the following steps on rhel: > -1. drmgr -c mem -r -q 5 > -2. echo c > /proc/sysrq-trigger > > And then, the failure looks like: > kdump: saving to /sysroot//var/crash/127.0.0.1-2020-01-16-02:06:14/ > kdump: saving vmcore-dmesg.txt >

Re: [PATCH v2 2/2] KVM: PPC: Book3S HV: rework secure mem slot dropping

2020-07-23 Thread Laurent Dufour
Le 23/07/2020 à 05:36, Bharata B Rao a écrit : On Tue, Jul 21, 2020 at 12:42:02PM +0200, Laurent Dufour wrote: When a secure memslot is dropped, all the pages backed in the secure device (aka really backed by secure memory by the Ultravisor) should be paged out to a normal page. Previously,

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-23 Thread Nicholas Piggin
Excerpts from Waiman Long's message of July 22, 2020 12:36 am: > On 7/21/20 7:08 AM, Nicholas Piggin wrote: >> diff --git a/arch/powerpc/include/asm/qspinlock.h >> b/arch/powerpc/include/asm/qspinlock.h >> index b752d34517b3..26d8766a1106 100644 >> --- a/arch/powerpc/include/asm/qspinlock.h >>

Re: [PATCH v4 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-23 Thread Thiago Jung Bauermann
Hari Bathini writes: > Kdump kernel, used for capturing the kernel core image, is supposed > to use only specific memory regions to avoid corrupting the image to > be captured. The regions are crashkernel range - the memory reserved > explicitly for kdump kernel, memory used for the tce-table,

Re: [PATCH v4 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-23 Thread Thiago Jung Bauermann
Hari Bathini writes: > Though kdump kernel boots from loaded address, the first 64K bytes > of it is copied down to real 0. So, setup a backup region to copy > the first 64K bytes of crashed kernel, in purgatory, before booting > into kdump kernel. Also, update reserve map with backup region

Re: [PATCH v2 2/3] powerpc/powernv/idle: save-restore DAWR0,DAWRX0 for P10

2020-07-23 Thread Michael Neuling
On Fri, 2020-07-10 at 10:52 +0530, Pratik Rajesh Sampat wrote: > Additional registers DAWR0, DAWRX0 may be lost on Power 10 for > stop levels < 4. > Therefore save the values of these SPRs before entering a "stop" > state and restore their values on wakeup. > > Signed-off-by: Pratik Rajesh

Re: [PATCH v4 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-23 Thread Thiago Jung Bauermann
Hari Bathini writes: > Prepare elf headers for the crashing kernel's core file using > crash_prepare_elf64_headers() and pass on this info to kdump > kernel by updating its command line with elfcorehdr parameter. > Also, add elfcorehdr location to reserve map to avoid it from > being stomped

[PATCH] powerpc/test_emulate_sstep: Fix build error

2020-07-23 Thread Michael Ellerman
ppc64_book3e_allmodconfig fails with: arch/powerpc/lib/test_emulate_step.c: In function 'test_pld': arch/powerpc/lib/test_emulate_step.c:113:7: error: implicit declaration of function 'cpu_has_feature' 113 | if (!cpu_has_feature(CPU_FTR_ARCH_31)) { | ^~~ Add

[powerpc:merge] BUILD SUCCESS d6c13d397d6988ec3e6029cae9e80501364cf9cb

2020-07-23 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge branch HEAD: d6c13d397d6988ec3e6029cae9e80501364cf9cb Automatic merge of 'master', 'next' and 'fixes' (2020-07-22 23:08) elapsed time: 2204m configs tested: 74 configs skipped: 1 The following configs have

Re: [v3 12/15] powerpc/perf: Add support for outputting extended regs in perf intr_regs

2020-07-23 Thread Arnaldo Carvalho de Melo
Em Thu, Jul 23, 2020 at 11:14:16AM +0530, kajoljain escreveu: > > > On 7/21/20 11:32 AM, kajoljain wrote: > > > > > > On 7/17/20 8:08 PM, Athira Rajeev wrote: > >> From: Anju T Sudhakar > >> > >> Add support for perf extended register capability in powerpc. > >> The capability flag

Re: [PATCHv3 1/2] powerpc/pseries: group lmb operation and memblock's

2020-07-23 Thread Nathan Lynch
Pingfan Liu writes: > This patch prepares for the incoming patch which swaps the order of KOBJ_ > uevent and dt's updating. > > It has no functional effect, just groups lmb operation and memblock's in > order to insert dt updating operation easily, and makes it easier to > review. ... > diff

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-23 Thread Nicholas Piggin
Excerpts from Waiman Long's message of July 24, 2020 12:29 am: > On 7/23/20 9:30 AM, Nicholas Piggin wrote: >>> I would prefer to extract out the pending bit handling code out into a >>> separate helper function which can be overridden by the arch code >>> instead of breaking the slowpath into 2

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 24, 2020 12:59 am: > On Thu, Jul 23, 2020 at 11:11:03PM +1000, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >> > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >> > >> >> diff --git

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-23 Thread Waiman Long
On 7/23/20 9:30 AM, Nicholas Piggin wrote: I would prefer to extract out the pending bit handling code out into a separate helper function which can be overridden by the arch code instead of breaking the slowpath into 2 pieces. You mean have the arch provide a queued_spin_lock_slowpath_pending

Re: [PATCH v3 4/6] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-23 Thread Michal Suchánek
On Mon, Jul 06, 2020 at 02:35:38PM +1000, Nicholas Piggin wrote: > These have shown significantly improved performance and fairness when > spinlock contention is moderate to high on very large systems. > > [ Numbers hopefully forthcoming after more testing, but initial >results look good ] >

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Peter Zijlstra
On Thu, Jul 23, 2020 at 11:11:03PM +1000, Nicholas Piggin wrote: > Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: > > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > > > >> diff --git a/arch/powerpc/include/asm/hw_irq.h > >>

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-23 Thread Waiman Long
On 7/23/20 10:00 AM, Peter Zijlstra wrote: On Thu, Jul 09, 2020 at 12:06:13PM -0400, Waiman Long wrote: We don't really need to do a pv_spinlocks_init() if pv_kick() isn't supported. Waiman, if you cannot explain how not having kick is a sane thing, what are you saying here? The current PPC

Re: [PATCH v2 0/3] powerpc/pseries: IPI doorbell improvements

2020-07-23 Thread Cédric Le Goater
On 6/30/20 1:50 PM, Nicholas Piggin wrote: > Since v1: > - Fixed SMP compile error. > - Fixed EPAPR / KVM_GUEST breakage. > - Expanded patch 3 changelog a bit. > > Thanks, > Nick I gave the patchset a try on KVM guests (P9 and P8) and PowerVM LPARs (P9). Looks good. Tested-by: Cédric Le

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-23 Thread peterz
On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote: > BTW, do you have any comment on my v2 lock holder cpu info qspinlock patch? > I will have to update the patch to fix the reported 0-day test problem, but > I want to collect other feedback before sending out v3. I want to say I hate

Re: [PATCH 2/2] powerpc/64s: system call support for scv/rfscv instructions

2020-07-23 Thread Christophe Leroy
Michael Ellerman a écrit : Nicholas Piggin writes: diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 2a39c716c343..b2bdc4de1292 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h @@ -257,6 +257,7 @@

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-23 Thread Waiman Long
On 7/23/20 2:47 PM, pet...@infradead.org wrote: On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote: BTW, do you have any comment on my v2 lock holder cpu info qspinlock patch? I will have to update the patch to fix the reported 0-day test problem, but I want to collect other feedback

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-23 Thread Waiman Long
On 7/23/20 3:58 PM, pet...@infradead.org wrote: On Thu, Jul 23, 2020 at 03:04:13PM -0400, Waiman Long wrote: On 7/23/20 2:47 PM, pet...@infradead.org wrote: On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote: BTW, do you have any comment on my v2 lock holder cpu info qspinlock patch?

Re: [PATCH v5 1/4] riscv: Move kernel mapping to vmalloc zone

2020-07-23 Thread Benjamin Herrenschmidt
On Thu, 2020-07-23 at 01:21 -0400, Alex Ghiti wrote: > > works fine with huge pages, what is your problem there ? You rely on > > punching small-page size holes in there ? > > > > ARCH_HAS_STRICT_KERNEL_RWX prevents the use of a hugepage for the kernel > mapping in the direct mapping as it sets

Re: [PATCH v4 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-23 Thread Thiago Jung Bauermann
Hari Bathini writes: > In kexec case, the kernel to be loaded uses the same memory layout as > the running kernel. So, passing on the DT of the running kernel would > be good enough. > > But in case of kdump, different memory ranges are needed to manage > loading the kdump kernel, booting into

Re: [PATCH v4 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-23 Thread Thiago Jung Bauermann
Hari Bathini writes: > crashkernel region could have an overlap with special memory regions > like opal, rtas, tce-table & such. These regions are referred to as > exclude memory ranges. Setup this ranges during image probe in order > to avoid them while finding the buffer for different kdump

Re: [v4 2/5] KVM: PPC: Book3S HV: track the state GFNs associated with secure VMs

2020-07-23 Thread Ram Pai
On Thu, Jul 23, 2020 at 10:18:30AM +0530, Bharata B Rao wrote: > On Fri, Jul 17, 2020 at 01:00:24AM -0700, Ram Pai wrote: > > pvt->gpa = gpa; ..snip.. > > pvt->kvm = kvm; > > @@ -524,6 +663,7 @@ static unsigned long kvmppc_share_page(struct kvm *kvm, > > unsigned long gpa, > >

Re: [v4 3/5] KVM: PPC: Book3S HV: in H_SVM_INIT_DONE, migrate remaining normal-GFNs to secure-GFNs.

2020-07-23 Thread Ram Pai
On Thu, Jul 23, 2020 at 11:40:37AM +0530, Bharata B Rao wrote: > On Fri, Jul 17, 2020 at 01:00:25AM -0700, Ram Pai wrote: > > > > +int kvmppc_uv_migrate_mem_slot(struct kvm *kvm, > > + const struct kvm_memory_slot *memslot) > > Don't see any callers for this outside of this file, so

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-23 Thread Peter Zijlstra
On Thu, Jul 09, 2020 at 12:06:13PM -0400, Waiman Long wrote: > We don't really need to do a pv_spinlocks_init() if pv_kick() isn't > supported. Waiman, if you cannot explain how not having kick is a sane thing, what are you saying here?

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-23 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of July 9, 2020 8:53 pm: > Nicholas Piggin writes: > >> Signed-off-by: Nicholas Piggin >> --- >> arch/powerpc/include/asm/paravirt.h | 28 >> arch/powerpc/include/asm/qspinlock.h | 66 +++ >>

Re: [PATCH v5 7/7] KVM: PPC: Book3S HV: rework secure mem slot dropping

2020-07-23 Thread Bharata B Rao
On Thu, Jul 23, 2020 at 01:07:24PM -0700, Ram Pai wrote: > From: Laurent Dufour > > When a secure memslot is dropped, all the pages backed in the secure > device (aka really backed by secure memory by the Ultravisor) > should be paged out to a normal page. Previously, this was > achieved by

Re: [PATCH 15/15] powerpc/powernv/sriov: Make single PE mode a per-BAR setting

2020-07-23 Thread Oliver O'Halloran
On Wed, Jul 22, 2020 at 8:06 PM Alexey Kardashevskiy wrote: > > >> Well, realistically the segment size should be 8MB to make this matter > >> (or the whole window 2GB) which does not seem to happen so it does not > >> matter. > > > > I'm not sure what you mean. > > I mean how can we possibly hit

[powerpc:fixes-test] BUILD SUCCESS 590ce02bd148cd35721560c140e3759e39a6e56a

2020-07-23 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git fixes-test branch HEAD: 590ce02bd148cd35721560c140e3759e39a6e56a powerpc/64s: Fix irq tracing corruption in interrupt/syscall return caused by perf interrupts elapsed time: 905m configs tested: 74 configs skipped:

Re: [PATCH v2 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic()

2020-07-23 Thread Alexey Kardashevskiy
On 22/07/2020 14:26, Oliver O'Halloran wrote: > This function is a one line wrapper around eeh_phb_pe_create() and despite > the name it doesn't create any eeh_dev structures. The "eeh_dev_phb_init_dynamic" name does not suggest anything really but the comment does. Reviewed-by: Alexey

Re: [PATCH v2 14/14] powerpc/eeh: Move PE tree setup into the platform

2020-07-23 Thread Oliver O'Halloran
On Fri, Jul 24, 2020 at 3:01 PM Alexey Kardashevskiy wrote: > > > > On 22/07/2020 14:26, Oliver O'Halloran wrote: > > The EEH core has a concept of a "PE tree" to support PowerNV. The PE tree > > follows the PCI bus structures because a reset asserted on an upstream > > bridge will be propagated

Re: [v4] powerpc/perf: Initialize power10 PMU registers in cpu setup routine

2020-07-23 Thread kernel test robot
Hi Athira, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.8-rc6 next-20200723] [cannot apply to mpe/next scottwood/next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Alexey Kardashevskiy
On 23/07/2020 23:11, Nicholas Piggin wrote: > Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >> On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >> >>> diff --git a/arch/powerpc/include/asm/hw_irq.h >>> b/arch/powerpc/include/asm/hw_irq.h >>> index

Re: [PATCH] powerpc/64s: Fix irq tracing corruption in interrupt/syscall return caused by perf interrupts

2020-07-23 Thread Alexey Kardashevskiy
On 23/07/2020 20:29, Nicholas Piggin wrote: > Excerpts from Alexey Kardashevskiy's message of July 22, 2020 8:50 pm: >> >> >> On 22/07/2020 17:34, Nicholas Piggin wrote: >>> Alexey reports lockdep_assert_irqs_enabled() warnings when stress testing >>> perf, e.g., >>> >>> WARNING: CPU: 0 PID:

Re: [PATCH v2 10/16] powerpc/powernv/pci: Refactor pnv_ioda_alloc_pe()

2020-07-23 Thread Alexey Kardashevskiy
On 22/07/2020 16:57, Oliver O'Halloran wrote: > Rework the PE allocation logic to allow allocating blocks of PEs rather > than individually. We'll use this to allocate contigious blocks of PEs for > the SR-IOVs. > > This patch also adds code to pnv_ioda_alloc_pe() and pnv_ioda_reserve_pe() to

[powerpc:next] BUILD SUCCESS 335aca5f65f1a39670944930131da5f2276f888f

2020-07-23 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next branch HEAD: 335aca5f65f1a39670944930131da5f2276f888f Merge branch 'scv' support into next elapsed time: 951m configs tested: 74 configs skipped: 1 The following configs have been built successfully. More

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread kernel test robot
Hi Nicholas, I love your patch! Yet something to improve: [auto build test ERROR on linux/master] [also build test ERROR on powerpc/next linus/master v5.8-rc6 next-20200723] [cannot apply to tip/locking/core] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [PATCH 2/2] lockdep: warn on redundant or incorrect irq state changes

2020-07-23 Thread kernel test robot
Hi Nicholas, I love your patch! Yet something to improve: [auto build test ERROR on linux/master] [also build test ERROR on powerpc/next linus/master v5.8-rc6] [cannot apply to tip/locking/core next-20200723] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread kernel test robot
Hi Nicholas, I love your patch! Perhaps something to improve: [auto build test WARNING on linux/master] [also build test WARNING on powerpc/next linus/master v5.8-rc6 next-20200723] [cannot apply to tip/locking/core] [If your patch is applied to the wrong git tree, kindly drop us a note

Re: [PATCH v5 4/7] KVM: PPC: Book3S HV: in H_SVM_INIT_DONE, migrate remaining normal-GFNs to secure-GFNs.

2020-07-23 Thread Bharata B Rao
On Thu, Jul 23, 2020 at 01:07:21PM -0700, Ram Pai wrote: > The Ultravisor is expected to explicitly call H_SVM_PAGE_IN for all the > pages of the SVM before calling H_SVM_INIT_DONE. This causes a huge > delay in tranistioning the VM to SVM. The Ultravisor is only interested > in the pages that

Re: [PATCH v2 14/14] powerpc/eeh: Move PE tree setup into the platform

2020-07-23 Thread Alexey Kardashevskiy
On 22/07/2020 14:26, Oliver O'Halloran wrote: > The EEH core has a concept of a "PE tree" to support PowerNV. The PE tree > follows the PCI bus structures because a reset asserted on an upstream > bridge will be propagated to the downstream bridges. On pseries there's a > 1-1 correspondence

[PATCH v5 3/7] KVM: PPC: Book3S HV: track the state GFNs associated with secure VMs

2020-07-23 Thread Ram Pai
During the life of SVM, its GFNs transition through normal, secure and shared states. Since the kernel does not track GFNs that are shared, it is not possible to disambiguate a shared GFN from a GFN whose PFN has not yet been migrated to a secure-PFN. Also it is not possible to disambiguate a

[PATCH v5 4/7] KVM: PPC: Book3S HV: in H_SVM_INIT_DONE, migrate remaining normal-GFNs to secure-GFNs.

2020-07-23 Thread Ram Pai
The Ultravisor is expected to explicitly call H_SVM_PAGE_IN for all the pages of the SVM before calling H_SVM_INIT_DONE. This causes a huge delay in tranistioning the VM to SVM. The Ultravisor is only interested in the pages that contain the kernel, initrd and other important data structures. The

  1   2   >