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

2020-07-26 Thread peterz
On Sun, Jul 26, 2020 at 02:14:34PM +1000, Nicholas Piggin wrote: > > Now, x86, and at least arm64 call nmi_enter() before > > trace_hardirqs_off(), but AFAICT Power never did that, and that's part > > of the problem. nmi_enter() does lockdep_off() and that _used_ to also > > kill IRQ tracking. >

[RESEND PATCH v2 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-07-26 Thread Vaibhav Jain
We add support for reporting 'fuel-gauge' NVDIMM metric via PAPR_PDSM_HEALTH pdsm payload. 'fuel-gauge' metric indicates the usage life remaining of a papr-scm compatible NVDIMM. PHYP exposes this metric via the H_SCM_PERFORMANCE_STATS. The metric value is returned from the pdsm by extending the

[RESEND PATCH v2 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-07-26 Thread Vaibhav Jain
Update papr_scm.c to query dimm performance statistics from PHYP via H_SCM_PERFORMANCE_STATS hcall and export them to user-space as PAPR specific NVDIMM attribute 'perf_stats' in sysfs. The patch also provide a sysfs ABI documentation for the stats being reported and their meanings. During NVDIMM

Re: [PATCH 5/5] selftests/powerpc: Add test for pkey siginfo verification

2020-07-26 Thread Christophe Leroy
Michael Ellerman a écrit : Sandipan Das writes: diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c new file mode 100644 index 0..58605c53d495d --- /dev/null +++ b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c

[PATCH V4 4/4] tools/perf: Add perf tools support for extended regs in power10

2020-07-26 Thread Athira Rajeev
Added support for supported regs which are new in power10 ( MMCR3, SIER2, SIER3 ) to sample_reg_mask in the tool side to use with `-I?` option. Also added PVR check to send extended mask for power10 at kernel while capturing extended regs in each sample. Signed-off-by: Athira Rajeev Reviewed-by:

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

2020-07-26 Thread peterz
On Sun, Jul 26, 2020 at 02:14:34PM +1000, Nicholas Piggin wrote: > Excerpts from Peter Zijlstra's message of July 26, 2020 6:26 am: > > Which is 'funny' when it interleaves like: > > > > local_irq_disable(); > > ... > > local_irq_enable() > > trace_hardirqs_on(); > > > >

[PATCH v2] powerpc/book3s64/pkey: Disable pkey on POWER6 and before

2020-07-26 Thread Aneesh Kumar K.V
POWER6 only support AMR update via privileged mode(MSR[PR] = 0, SPRN_AMR=29) The PR=1 alias for that SPR (SPRN_AMR=13) was only supported from POWER7. Since we don't allow userspace modifying of AMR value we should disable pkey support on P6 and before. The hypervisor will still report pkey

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-26 Thread Christophe Leroy
Randy Dunlap a écrit : Drop duplicated words in arch/powerpc/ header files. How did you detect them ? Do you have some script for tgat, or you just read all comments ? Cc: Michael Ellerman You say you Cc Michael, but in fact you don't ... Allthough he is the powerpc maintainer

[PATCH V4 1/4] powerpc/perf: Add support for outputting extended regs in perf intr_regs

2020-07-26 Thread Athira Rajeev
From: Anju T Sudhakar Add support for perf extended register capability in powerpc. The capability flag PERF_PMU_CAP_EXTENDED_REGS, is used to indicate the PMU which support extended registers. The generic code define the mask of extended registers as 0 for non supported architectures. Patch

[PATCH V4 0/4] powerpc/perf: Add support for perf extended regs in powerpc

2020-07-26 Thread Athira Rajeev
Patch set to add support for perf extended register capability in powerpc. The capability flag PERF_PMU_CAP_EXTENDED_REGS, is used to indicate the PMU which support extended registers. The generic code define the mask of extended registers as 0 for non supported architectures. Patches 1 and 2 are

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-26 Thread Randy Dunlap
On 7/26/20 7:29 AM, Christophe Leroy wrote: > Randy Dunlap a écrit : > >> Drop duplicated words in arch/powerpc/ header files. > > How did you detect them ? Do you have some script for tgat, or you just read > all comments ? Yes, it's a script that finds lots of false positives, so I have to

[RESEND PATCH v2 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

2020-07-26 Thread Vaibhav Jain
Changes since v2[1]: * Rebased the patch series on latest ppc-next tree located [2] [1] https://lore.kernel.org/linux-nvdimm/20200701133510.4613-1-vaib...@linux.ibm.com/ [2] git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git --- This small patchset implements kernel side support

[PATCH] powerpc/book3s64/pkey: Disable pkey on POWER6 and before

2020-07-26 Thread Aneesh Kumar K.V
POWER6 only support AMR update via privileged mode(MSR[PR] = 0, SPRN_AMR=29) The PR=1 alias for that SPR (SPRN_AMR=13) was only supported from POWER7. Since we don't allow userspace modifying of AMR value we should disable pkey support on P6 and before. The hypervisor will still report pkey

Re: [PATCH 5/5] selftests/powerpc: Add test for pkey siginfo verification

2020-07-26 Thread Michael Ellerman
Sandipan Das writes: > diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c > b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c > new file mode 100644 > index 0..58605c53d495d > --- /dev/null > +++ b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c > @@ -0,0 +1,332 @@

[PATCH V4 3/4] tools/perf: Add perf tools support for extended register capability in powerpc

2020-07-26 Thread Athira Rajeev
From: Anju T Sudhakar Add extended regs to sample_reg_mask in the tool side to use with `-I?` option. Perf tools side uses extended mask to display the platform supported register names (with -I? option) to the user and also send this mask to the kernel to capture the extended registers in each

[PATCH V4 2/4] powerpc/perf: Add extended regs support for power10 platform

2020-07-26 Thread Athira Rajeev
Include capability flag `PERF_PMU_CAP_EXTENDED_REGS` for power10 and expose MMCR3, SIER2, SIER3 registers as part of extended regs. Also introduce `PERF_REG_PMU_MASK_31` to define extended mask value at runtime for power10 Signed-off-by: Athira Rajeev [Fix build failure on PPC32 platform]

Re: [PATCH v3 1/3] powerpc: inline doorbell sending functions

2020-07-26 Thread Michael Ellerman
Nicholas Piggin writes: > diff --git a/arch/powerpc/include/asm/dbell.h > b/arch/powerpc/include/asm/dbell.h > index 4ce6808deed3..1f04f3de96ba 100644 > --- a/arch/powerpc/include/asm/dbell.h > +++ b/arch/powerpc/include/asm/dbell.h > @@ -100,4 +102,63 @@ static inline void ppc_msgsnd(enum

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-26 Thread Joe Perches
On 2020-07-26 12:08, Randy Dunlap wrote: On 7/26/20 10:49 AM, Joe Perches wrote: On Sun, 2020-07-26 at 10:23 -0700, Randy Dunlap wrote: On 7/26/20 7:29 AM, Christophe Leroy wrote: Randy Dunlap a écrit : Drop duplicated words in arch/powerpc/ header files. How did you detect them ? Do you

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-26 Thread Joe Perches
On Sun, 2020-07-26 at 10:23 -0700, Randy Dunlap wrote: > On 7/26/20 7:29 AM, Christophe Leroy wrote: > > Randy Dunlap a écrit : > > > > > Drop duplicated words in arch/powerpc/ header files. > > > > How did you detect them ? Do you have some script for tgat, or you just > > read all comments ?

[RESEND PATCH v5 03/11] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-26 Thread Hari Bathini
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 it and exporting the elfcore of the

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

2020-07-26 Thread Jarkko Sakkinen
On Fri, Jul 24, 2020 at 10:05:08AM +0200, Jessica Yu wrote: > +++ Jarkko Sakkinen [24/07/20 10:36 +0300]: > > On Thu, Jul 23, 2020 at 03:42:09PM +0300, Ard Biesheuvel wrote: > > > On Thu, 23 Jul 2020 at 04:52, Jarkko Sakkinen > > > wrote: > > > > > > > > On Thu, Jul 16, 2020 at 06:49:09PM +0200,

[RESEND PATCH v5 09/11] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-26 Thread Hari Bathini
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 on while booting. Signed-off-by:

[PATCH] selftests/powerpc: Squash spurious errors due to device removal

2020-07-26 Thread Oliver O'Halloran
For drivers that don't have the error handling callbacks we implement recovery by removing the device and re-probing it. This causes the sysfs directory for the PCI device to be removed which causes the following spurious error to be printed when checking the PE state: Breaking 0005:03:00.0...

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

2020-07-26 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the vfs tree got a conflict in: arch/powerpc/kernel/ptrace/ptrace-view.c between commit: e0d8e991be64 ("powerpc/book3s64/kuap: Move UAMOR setup to key init function") from the powerpc tree and commit: 5e39a71bddb3 ("powerpc: switch to

Re: [PATCH 5/5] selftests/powerpc: Add test for pkey siginfo verification

2020-07-26 Thread Sandipan Das
On 27/07/20 5:22 am, Michael Ellerman wrote: > Christophe Leroy writes: >> Michael Ellerman a écrit : >>> Sandipan Das writes: diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c new file mode 100644 index

[RESEND PATCH v5 05/11] powerpc/drmem: make lmb walk a bit more flexible

2020-07-26 Thread Hari Bathini
Currently, numa & prom are the users of drmem lmb walk code. Loading kdump with kexec_file also needs to walk the drmem LMBs to setup the usable memory ranges for kdump kernel. But there are couple of issues in using the code as is. One, walk_drmem_lmb() code is built into the .init section

[RESEND PATCH v5 06/11] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-26 Thread Hari Bathini
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, the OPAL region and RTAS region

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-26 Thread Michael Ellerman
Randy Dunlap writes: > On 7/26/20 7:29 AM, Christophe Leroy wrote: >> Randy Dunlap a écrit : >> >>> Drop duplicated words in arch/powerpc/ header files. >> >> How did you detect them ? Do you have some script for tgat, or you just read >> all comments ? > > Yes, it's a script that finds lots

Re: [PATCH] powerpc/rtas: Restrict RTAS requests from userspace

2020-07-26 Thread Daniel Axtens
Andrew Donnellan writes: > A number of userspace utilities depend on making calls to RTAS to retrieve > information and update various things. > > The existing API through which we expose RTAS to userspace exposes more > RTAS functionality than we actually need, through the sys_rtas syscall, >

[RESEND PATCH v5 02/11] powerpc/kexec_file: mark PPC64 specific code

2020-07-26 Thread Hari Bathini
Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 specific code from kexec/file_load.c to kexec/file_load_64.c. Also, rename purgatory/trampoline.S to purgatory/trampoline_64.S in the same spirit. No functional changes. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu

[RESEND PATCH v5 01/11] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-26 Thread Hari Bathini
Some architectures may have special memory regions, within the given memory range, which can't be used for the buffer in a kexec segment. Implement weak arch_kexec_locate_mem_hole() definition which arch code may override, to take care of special regions, while trying to locate a memory hole.

Re: [PATCH 0/9] powerpc: delete duplicated words

2020-07-26 Thread Randy Dunlap
On 7/26/20 10:49 AM, Joe Perches wrote: > On Sun, 2020-07-26 at 10:23 -0700, Randy Dunlap wrote: >> On 7/26/20 7:29 AM, Christophe Leroy wrote: >>> Randy Dunlap a écrit : >>> Drop duplicated words in arch/powerpc/ header files. >>> >>> How did you detect them ? Do you have some script for

[RESEND PATCH v5 00/11] ppc64: enable kdump support for kexec_file_load syscall

2020-07-26 Thread Hari Bathini
Sorry! There was a gateway issue on my system while posting v5, due to which some patches did not make it through. Resending... This patch series enables kdump support for kexec_file_load system call (kexec -s -p) on PPC64. The changes are inspired from kexec-tools code but heavily modified for

[RESEND PATCH v5 08/11] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-26 Thread Hari Bathini
Though kdump kernel boots from loaded address, the first 64KB of it is copied down to real 0. So, setup a backup region and let purgatory copy the first 64KB of crashed kernel into this backup region before booting into kdump kernel. Update reserve map with backup region and crashed kernel's

[RESEND PATCH v5 07/11] ppc64/kexec_file: enable early kernel's OPAL calls

2020-07-26 Thread Hari Bathini
Kernel built with CONFIG_PPC_EARLY_DEBUG_OPAL enabled expects r8 & r9 to be filled with OPAL base & entry addresses respectively. Setting these registers allows the kernel to perform OPAL calls before the device tree is parsed. Signed-off-by: Hari Bathini --- v4 -> v5: * New patch. Updated

[RESEND PATCH v5 11/11] ppc64/kexec_file: fix kexec load failure with lack of memory hole

2020-07-26 Thread Hari Bathini
The kexec purgatory has to run in real mode. Only the first memory block maybe accessible in real mode. And, unlike the case with panic kernel, no memory is set aside for regular kexec load. Another thing to note is, the memory for crashkernel is reserved at an offset of 128MB. So, when

[RESEND PATCH v5 04/11] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-26 Thread Hari Bathini
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 segments. Override

[RESEND PATCH v5 10/11] ppc64/kexec_file: add appropriate regions for memory reserve map

2020-07-26 Thread Hari Bathini
While initrd, elfcorehdr and backup regions are already added to the reserve map, there are a few missing regions that need to be added to the memory reserve map. Add them here. And now that all the changes to load panic kernel are in place, claim likewise. Signed-off-by: Hari Bathini Tested-by:

Re: [PATCH 5/5] selftests/powerpc: Add test for pkey siginfo verification

2020-07-26 Thread Michael Ellerman
Christophe Leroy writes: > Michael Ellerman a écrit : >> Sandipan Das writes: >>> diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c >>> b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c >>> new file mode 100644 >>> index 0..58605c53d495d >>> --- /dev/null >>> +++

Re: [PATCH v5 6/7] KVM: PPC: Book3S HV: move kvmppc_svm_page_out up

2020-07-26 Thread Bharata B Rao
On Thu, Jul 23, 2020 at 01:07:23PM -0700, Ram Pai wrote: > From: Laurent Dufour > > kvmppc_svm_page_out() will need to be called by kvmppc_uvmem_drop_pages() > so move it upper in this file. > > Furthermore it will be interesting to call this function when already > holding the

[PATCH v2 5/6] selftests/powerpc: Add wrapper for gettid

2020-07-26 Thread Sandipan Das
The gettid() syscall wrapper was first introduced in glibc 2.30. This adds a wrapper for use in distros running older versions. Suggested-by: Christophe Leroy Suggested-by: Michael Ellerman Signed-off-by: Sandipan Das --- tools/testing/selftests/powerpc/include/utils.h | 10 ++ 1 file

[PATCH v4 07/10] Powerpc/numa: Detect support for coregroup

2020-07-26 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.

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

2020-07-26 Thread Bharata B Rao
On Fri, Jul 24, 2020 at 10:35:27AM +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, this was > achieved by triggering the page

[PATCH v2 3/6] selftests/powerpc: Harden test for execute-disabled pkeys

2020-07-26 Thread Sandipan Das
Commit 192b6a7805989 ("powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey") fixed a bug that caused repetitive faults for pkeys with no execute rights alongside some combination of read and write rights. This removes the last two cases of the test, which check the

[PATCH v2 4/6] selftests/powerpc: Add helper to exit on failure

2020-07-26 Thread Sandipan Das
This adds a helper similar to FAIL_IF() which lets a program exit with code 1 (to indicate failure) when the given condition is true. Signed-off-by: Sandipan Das --- tools/testing/selftests/powerpc/include/utils.h | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH v4 07/10] Powerpc/numa: Detect support for coregroup

2020-07-26 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 v4 06/10] powerpc/smp: Generalize 2nd sched domain

2020-07-26 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 v4 00/10] Coregroup support on Powerpc

2020-07-26 Thread Srikar Dronamraju
Changelog v3 ->v4: v3: https://lore.kernel.org/lkml/20200723085116.4731-1-sri...@linux.vnet.ibm.com/t/#u powerpc/smp: Create coregroup domain if coregroup_support doesn't exist, update MC mask to the next smaller domain mask. Changelog v2 -> v3: v2:

Re: [PATCH v5 5/7] KVM: PPC: Book3S HV: migrate hot plugged memory

2020-07-26 Thread Bharata B Rao
On Thu, Jul 23, 2020 at 01:07:22PM -0700, Ram Pai wrote: > From: Laurent Dufour > > When a memory slot is hot plugged to a SVM, PFNs associated with the > GFNs in that slot must be migrated to the secure-PFNs, aka device-PFNs. > > Call kvmppc_uv_migrate_mem_slot() to accomplish this. > Disable

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

2020-07-26 Thread Gautham R Shenoy
On Thu, Jul 23, 2020 at 02:21:15PM +0530, Srikar Dronamraju wrote: > 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

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

2020-07-26 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 v4 03/10] powerpc/smp: Move powerpc_topology above

2020-07-26 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 v4 08/10] powerpc/smp: Allocate cpumask only after searching thread group

2020-07-26 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 v2 1/6] selftests/powerpc: Move pkey helpers to headers

2020-07-26 Thread Sandipan Das
This moves all the pkey-related helpers to a new header file and also a helper to print error messages in signal handlers to the existing utils header file. Signed-off-by: Sandipan Das --- .../testing/selftests/powerpc/include/pkeys.h | 108 ++

[PATCH v2 2/6] selftests/powerpc: Add pkey helpers for rights

2020-07-26 Thread Sandipan Das
This adds some new pkey-related helper to print access rights of a pkey in the "rwx" format and to generate different valid combinations of pkey rights starting from a given combination. Signed-off-by: Sandipan Das --- .../testing/selftests/powerpc/include/pkeys.h | 28 +++

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

2020-07-26 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 v4 10/10] powerpc/smp: Implement cpu_to_coregroup_id

2020-07-26 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 v4 05/10] powerpc/smp: Dont assume l2-cache to be superset of sibling

2020-07-26 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 v4 01/10] powerpc/smp: Fix a warning under !NEED_MULTIPLE_NODES

2020-07-26 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 v4 03/10] powerpc/smp: Move powerpc_topology above

2020-07-26 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 v4 04/10] powerpc/smp: Move topology fixups into a new function

2020-07-26 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 v4 04/10] powerpc/smp: Move topology fixups into a new function

2020-07-26 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 v4 05/10] powerpc/smp: Dont assume l2-cache to be superset of sibling

2020-07-26 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 v4 06/10] powerpc/smp: Generalize 2nd sched domain

2020-07-26 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 v2 0/6] Improvements to pkey tests

2020-07-26 Thread Sandipan Das
Based on recent bugs found in the pkey infrastructure, this improves the test for execute-disabled pkeys and adds a new test for detecting inconsistencies with the pkey reported by the signal information upon getting a fault. Previous versions can be found at: v1:

[PATCH v2 6/6] selftests/powerpc: Add test for pkey siginfo verification

2020-07-26 Thread Sandipan Das
Commit c46241a370a61 ("powerpc/pkeys: Check vma before returning key fault error to the user") fixes a bug which causes the kernel to set the wrong pkey in siginfo when a pkey fault occurs after two competing threads that have allocated different pkeys, one fully permissive and the other

[PATCH v4 00/10] Coregroup support on Powerpc

2020-07-26 Thread Srikar Dronamraju
Changelog v3 ->v4: v3: https://lore.kernel.org/lkml/20200723085116.4731-1-sri...@linux.vnet.ibm.com/t/#u powerpc/smp: Create coregroup domain if coregroup_support doesn't exist, update MC mask to the next smaller domain mask. Changelog v2 -> v3: v2:

[PATCH v4 09/10] Powerpc/smp: Create coregroup domain

2020-07-26 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 v4 08/10] powerpc/smp: Allocate cpumask only after searching thread group

2020-07-26 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 v4 02/10] powerpc/smp: Merge Power9 topology with Power topology

2020-07-26 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 v4 09/10] Powerpc/smp: Create coregroup domain

2020-07-26 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

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

2020-07-26 Thread Alexey Kardashevskiy
On 24/07/2020 15:59, Nicholas Piggin wrote: > Excerpts from Alexey Kardashevskiy's message of July 24, 2020 2:16 pm: >> >> >> 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