Re: [PATCH RESEND v1 0/4] powerpc/vdso: Add support for time namespaces

2021-04-12 Thread Michael Ellerman
Thomas Gleixner writes: > On Wed, Mar 31 2021 at 16:48, Christophe Leroy wrote: >> [Sorry, resending with complete destination list, I used the wrong script on >> the first delivery] >> >> This series adds support for time namespaces on powerpc. >> >> All timens selftests are successfull. > > If

Re: [PATCH v2 14/14] powerpc/pseries/iommu: Rename "direct window" to "dma window"

2021-04-12 Thread Leonardo Bras
On Wed, 2020-09-30 at 17:29 +1000, Alexey Kardashevskiy wrote: > > On 30/09/2020 06:54, Leonardo Bras wrote: > > On Tue, 2020-09-29 at 13:55 +1000, Alexey Kardashevskiy wrote: > > > > > > On 12/09/2020 03:07, Leonardo Bras wrote: > > > > Cc: linuxppc-dev@lists.ozlabs.org, linux-ker...@vger.kernel

Re: [PATCH v2 13/14] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-04-12 Thread Leonardo Bras
Thanks for the feedback! On Tue, 2020-09-29 at 13:56 +1000, Alexey Kardashevskiy wrote: > > -static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr) > > +static phys_addr_t ddw_memory_hotplug_max(void) > > > Please, forward declaration or a separate patch; this creates > unnecessa

Re: [PATCH v2 11/14] powerpc/pseries/iommu: Update remove_dma_window() to accept property name

2021-04-12 Thread Leonardo Bras
On Tue, 2020-09-29 at 13:56 +1000, Alexey Kardashevskiy wrote: > > On 12/09/2020 03:07, Leonardo Bras wrote: > > Cc: linuxppc-dev@lists.ozlabs.org, linux-ker...@vger.kernel.org, > > > > Update remove_dma_window() so it can be used to remove DDW with a given > > property name. > > > > Out of con

Re: [PATCH] ibmvfc: Fix invalid state machine BUG_ON

2021-04-12 Thread Martin K. Petersen
Tyrel, > This fixes an issue hitting the BUG_ON in ibmvfc_do_work. When going > through a host action of IBMVFC_HOST_ACTION_RESET, we change the > action to IBMVFC_HOST_ACTION_TGT_DEL, then drop the host lock, and > reset the CRQ, which changes the host state to IBMVFC_NO_CRQ. [...] Applied to

Re: [PATCH v3 2/9] selftest/mremap_test: Avoid crash with static build

2021-04-12 Thread Kalesh Singh
On Mon, Mar 29, 2021 at 11:08 PM Aneesh Kumar K.V wrote: > > With a large mmap map size, we can overlap with the text area and using > MAP_FIXED results in unmapping that area. Switch to MAP_FIXED_NOREPLACE > and handle the EEXIST error. > > Signed-off-by: Aneesh Kumar K.V Reviewed-by: Kalesh Si

Re: [PATCH v3 1/9] selftest/mremap_test: Update the test to handle pagesize other than 4K

2021-04-12 Thread Kalesh Singh
On Mon, Mar 29, 2021 at 11:08 PM Aneesh Kumar K.V wrote: > > Instead of hardcoding 4K page size fetch it using sysconf(). For the > performance > measurements test still assume 2M and 1G are hugepage sizes. > > Signed-off-by: Aneesh Kumar K.V Reviewed-by: Kalesh Singh > --- > tools/testing/s

Re: [PATCH net-next v4 2/2] of: net: fix of_get_mac_addr_nvmem() for non-platform devices

2021-04-12 Thread Andrew Lunn
On Mon, Apr 12, 2021 at 07:47:18PM +0200, Michael Walle wrote: > of_get_mac_address() already supports fetching the MAC address by an > nvmem provider. But until now, it was just working for platform devices. > Esp. it was not working for DSA ports and PCI devices. It gets more > common that PCI de

Re: [PATCH net-next v4 1/2] of: net: pass the dst buffer to of_get_mac_address()

2021-04-12 Thread Andrew Lunn
On Mon, Apr 12, 2021 at 07:47:17PM +0200, Michael Walle wrote: > of_get_mac_address() returns a "const void*" pointer to a MAC address. > Lately, support to fetch the MAC address by an NVMEM provider was added. > But this will only work with platform devices. It will not work with > PCI devices (e.

Re: [PATCH v1 01/12] KVM: PPC: Book3S HV P9: Restore host CTRL SPR after guest exit

2021-04-12 Thread Nicholas Piggin
Excerpts from Fabiano Rosas's message of April 13, 2021 12:06 am: > Nicholas Piggin writes: > >> The host CTRL (runlatch) value is not restored after guest exit. The >> host CTRL should always be 1 except in CPU idle code, so this can result >> in the host running with runlatch clear, and potenti

Re: [PATCH V2 4/6] mm: Drop redundant ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION

2021-04-12 Thread Anshuman Khandual
On 4/12/21 5:29 PM, Oscar Salvador wrote: > On Thu, Apr 01, 2021 at 12:14:06PM +0530, Anshuman Khandual wrote: >> ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION configs have duplicate definitions on >> platforms that subscribe them. Drop these reduntant definitions and instead >> just select them appropriate

Re: [PATCH v2] powerpc/eeh: Fix EEH handling for hugepages in ioremap space.

2021-04-12 Thread Oliver O'Halloran
On Mon, Apr 12, 2021 at 5:52 PM Mahesh Salgaonkar wrote: > > During the EEH MMIO error checking, the current implementation fails to map > the (virtual) MMIO address back to the pci device on radix with hugepage > mappings for I/O. This results into failure to dispatch EEH event with no > recovery

[PATCH] ibmvfc: Fix invalid state machine BUG_ON

2021-04-12 Thread Tyrel Datwyler
From: Brian King This fixes an issue hitting the BUG_ON in ibmvfc_do_work. When going through a host action of IBMVFC_HOST_ACTION_RESET, we change the action to IBMVFC_HOST_ACTION_TGT_DEL, then drop the host lock, and reset the CRQ, which changes the host state to IBMVFC_NO_CRQ. If, prior to sett

[RFC PATCH 1/2] KVM: selftests: Add max vcpus test for ppc64le

2021-04-12 Thread Fabiano Rosas
$ cd tools/selftests/kvm $ make ARCH=powerpc $ ulimit -n 4096 $ ./kvm_create_max_vcpus Note the test currently fails in P9 with: KVM_CAP_MAX_VCPU_ID: 16384 KVM_CAP_MAX_VCPUS: 2048 Testing creating 2048 vCPUs, with IDs 0...2047. Testing creating 2048 vCPUs, with IDs 14336...16383. Test Assert

[RFC PATCH 0/2] kvm selftests and MAX_VCPU_ID

2021-04-12 Thread Fabiano Rosas
I've been experimenting with the kvm selftests to see if I can enable them for powerpc and get some useful coverage going. This series is just the initial boilerplate to get the simplest of the tests to run. The test is arch agnostic and is already in the tree. It just tries to start a vm with the

[RFC PATCH 2/2] KVM: PPC: Book3S HV: Provide a more accurate MAX_VCPU_ID in P9

2021-04-12 Thread Fabiano Rosas
The KVM_CAP_MAX_VCPU_ID capability was added by commit 0b1b1dfd52a6 ("kvm: introduce KVM_MAX_VCPU_ID") to allow for vcpu ids larger than KVM_MAX_VCPU in powerpc. For a P9 host we depend on the guest VSMT value to know what is the maximum number of vcpu id we can support: kvmppc_core_vcpu_create_h

Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-04-12 Thread Segher Boessenkool
On Fri, Apr 09, 2021 at 02:36:16PM +1000, Alexey Kardashevskiy wrote: > On 08/04/2021 19:04, Michael Ellerman wrote: > +#define QUERY_DDW_PGSIZE_4K 0x01 > +#define QUERY_DDW_PGSIZE_64K 0x02 > +#define QUERY_DDW_PGSIZE_16M 0x04 > +#define QUERY_DDW_PGSIZE_32M 0x08 >

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

2021-04-12 Thread Segher Boessenkool
Hi! On Thu, Apr 08, 2021 at 03:33:45PM +, Christophe Leroy wrote: > +#define ATOMIC_OP(op, asm_op, dot, sign) \ > static __inline__ void atomic_##op(int a, atomic_t *v) > \ > {

[PATCH net-next v4 0/2] of: net: support non-platform devices in of_get_mac_address()

2021-04-12 Thread Michael Walle
of_get_mac_address() is commonly used to fetch the MAC address from the device tree. It also supports reading it from a NVMEM provider. But the latter is only possible for platform devices, because only platform devices are searched for a matching device node. Add a second method to fetch the NVME

[PATCH net-next v4 1/2] of: net: pass the dst buffer to of_get_mac_address()

2021-04-12 Thread Michael Walle
of_get_mac_address() returns a "const void*" pointer to a MAC address. Lately, support to fetch the MAC address by an NVMEM provider was added. But this will only work with platform devices. It will not work with PCI devices (e.g. of an integrated root complex) and esp. not with DSA ports. There i

[PATCH net-next v4 2/2] of: net: fix of_get_mac_addr_nvmem() for non-platform devices

2021-04-12 Thread Michael Walle
of_get_mac_address() already supports fetching the MAC address by an nvmem provider. But until now, it was just working for platform devices. Esp. it was not working for DSA ports and PCI devices. It gets more common that PCI devices have a device tree binding since SoCs contain integrated root com

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

2021-04-12 Thread Segher Boessenkool
Hi! On Thu, Apr 08, 2021 at 03:33:44PM +, Christophe Leroy wrote: > For clear bits, on 32 bits 'rlwinm' can be used instead or 'andc' for > when all bits to be cleared are consecutive. Also on 64-bits, as long as both the top and bottom bits are in the low 32-bit half (for 32 bit mode, it can

Re: [PATCH 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-04-12 Thread kernel test robot
Hi Christophe, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on kbuild/for-next v5.12-rc7 next-20210412] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--bas

Re: [PATCH v1 4/4] powerpc: Move copy_from_kernel_nofault_inst()

2021-04-12 Thread kernel test robot
Hi Christophe, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on next-20210412] [cannot apply to v5.12-rc7] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '-

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-12 Thread Matthew Wilcox
On Sun, Apr 11, 2021 at 11:43:07AM +0200, Jesper Dangaard Brouer wrote: > Could you explain your intent here? > I worry about @index. > > As I mentioned in other thread[1] netstack use page_is_pfmemalloc() > (code copy-pasted below signature) which imply that the member @index > have to be kept in

Re: [RFC/PATCH] powerpc/smp: Add SD_SHARE_PKG_RESOURCES flag to MC sched-domain

2021-04-12 Thread Michal Suchánek
On Mon, Apr 12, 2021 at 04:24:44PM +0100, Mel Gorman wrote: > On Mon, Apr 12, 2021 at 02:21:47PM +0200, Vincent Guittot wrote: > > > > Peter, Valentin, Vincent, Mel, etal > > > > > > > > On architectures where we have multiple levels of cache access latencies > > > > within a DIE, (For example: one

[PATCH AUTOSEL 4.4 08/23] ASoC: fsl_esai: Fix TDM slot setup for I2S mode

2021-04-12 Thread Sasha Levin
From: Alexander Shiyan [ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2. To fix this, let's use the saved slot count val

[PATCH AUTOSEL 4.14 08/25] ASoC: fsl_esai: Fix TDM slot setup for I2S mode

2021-04-12 Thread Sasha Levin
From: Alexander Shiyan [ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2. To fix this, let's use the saved slot count val

[PATCH AUTOSEL 4.9 08/23] ASoC: fsl_esai: Fix TDM slot setup for I2S mode

2021-04-12 Thread Sasha Levin
From: Alexander Shiyan [ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2. To fix this, let's use the saved slot count val

[PATCH 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-04-12 Thread Christophe Leroy
powerpc BUG_ON() and WARN_ON() are based on using twnei instruction. For catching simple conditions like a variable having value 0, this is efficient because it does the test and the trap at the same time. But most conditions used with BUG_ON or WARN_ON are more complex and forces GCC to format th

[PATCH 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-04-12 Thread Christophe Leroy
Using asm goto in __WARN_FLAGS() and WARN_ON() allows more flexibility to GCC. For that add an entry to the exception table so that program_check_exception() knowns where to resume execution after a WARNING. Here are two exemples. The first one is done on PPC32 (which benefits from the previous p

[PATCH AUTOSEL 4.19 11/28] ASoC: fsl_esai: Fix TDM slot setup for I2S mode

2021-04-12 Thread Sasha Levin
From: Alexander Shiyan [ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2. To fix this, let's use the saved slot count val

[PATCH AUTOSEL 5.4 17/39] ASoC: fsl_esai: Fix TDM slot setup for I2S mode

2021-04-12 Thread Sasha Levin
From: Alexander Shiyan [ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2. To fix this, let's use the saved slot count val

[PATCH AUTOSEL 5.10 21/46] ASoC: fsl_esai: Fix TDM slot setup for I2S mode

2021-04-12 Thread Sasha Levin
From: Alexander Shiyan [ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2. To fix this, let's use the saved slot count val

[PATCH AUTOSEL 5.11 25/51] ASoC: fsl_esai: Fix TDM slot setup for I2S mode

2021-04-12 Thread Sasha Levin
From: Alexander Shiyan [ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ] When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2. To fix this, let's use the saved slot count val

[PATCH AUTOSEL 5.11 19/51] powerpc/signal32: Fix Oops on sigreturn with unmapped VDSO

2021-04-12 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit acca57217c688c5bbbd5140974533d81e8757cc9 ] PPC32 encounters a KUAP fault when trying to handle a signal with VDSO unmapped. Kernel attempted to read user page (7fc07ec0) - exploit attempt? (uid: 0) BUG: Unable to handle kernel data acces

Re: [RFC/PATCH] powerpc/smp: Add SD_SHARE_PKG_RESOURCES flag to MC sched-domain

2021-04-12 Thread Mel Gorman
On Mon, Apr 12, 2021 at 02:21:47PM +0200, Vincent Guittot wrote: > > > Peter, Valentin, Vincent, Mel, etal > > > > > > On architectures where we have multiple levels of cache access latencies > > > within a DIE, (For example: one within the current LLC or SMT core and the > > > other at MC or Hemis

Re: [PATCH 1/2] vfio/pci: remove vfio_pci_nvlink2

2021-04-12 Thread Alex Williamson
On Mon, 12 Apr 2021 19:41:41 +1000 Michael Ellerman wrote: > Alex Williamson writes: > > On Fri, 26 Mar 2021 07:13:10 +0100 > > Christoph Hellwig wrote: > > > >> This driver never had any open userspace (which for VFIO would include > >> VM kernel drivers) that use it, and thus should never h

Re: [PATCH -next] powerpc/perf: Make symbol 'isa207_pmu_format_attr' static

2021-04-12 Thread kajoljain
On 4/9/21 2:31 PM, Bixuan Cui wrote: > The sparse tool complains as follows: > > arch/powerpc/perf/isa207-common.c:24:18: warning: > symbol 'isa207_pmu_format_attr' was not declared. Should it be static? > > This symbol is not used outside of isa207-common.c, so this > commit marks it static.

Re: [PATCH -next] powerpc/perf/hv-24x7: Make some symbols static

2021-04-12 Thread kajoljain
On 4/9/21 2:31 PM, Bixuan Cui wrote: > The sparse tool complains as follows: > > arch/powerpc/perf/hv-24x7.c:229:1: warning: > symbol '__pcpu_scope_hv_24x7_txn_flags' was not declared. Should it be > static? > arch/powerpc/perf/hv-24x7.c:230:1: warning: > symbol '__pcpu_scope_hv_24x7_txn_err

Re: [PATCH v1 01/12] KVM: PPC: Book3S HV P9: Restore host CTRL SPR after guest exit

2021-04-12 Thread Fabiano Rosas
Nicholas Piggin writes: > The host CTRL (runlatch) value is not restored after guest exit. The > host CTRL should always be 1 except in CPU idle code, so this can result > in the host running with runlatch clear, and potentially switching to > a different vCPU which then runs with runlatch clear

RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition

2021-04-12 Thread David Laight
From: Arnd Bergmann > Sent: 12 April 2021 12:26 > > On Mon, Apr 12, 2021 at 12:54 PM David Laight wrote: > > From: David Laight > Sent: 12 April 2021 10:37 > > ... > > > I'm guessing that compat_pid_t is 16 bits? > > > So the native 32bit version has an unnamed 2 byte structure pad. > > > The 'pa

Re: [PATCH RESEND v1 4/4] powerpc/vdso: Add support for time namespaces

2021-04-12 Thread Vincenzo Frascino
On 3/31/21 5:48 PM, Christophe Leroy wrote: > This patch adds the necessary glue to provide time namespaces. > > Things are mainly copied from ARM64. > > __arch_get_timens_vdso_data() calculates timens vdso data position > based on the vdso data position, knowing it is the next page in vvar. >

[PATCH] [v2] selftests: powerpc: Remove unneeded variables

2021-04-12 Thread Wan Jiabing
Fix coccicheck warning: ./tools/testing/selftests/powerpc/alignment/alignment_handler.c:539:5-7: Unneeded variable: "rc". Return "0" on line 562 ./tools/testing/selftests/powerpc/alignment/alignment_handler.c:567:5-7: Unneeded variable: "rc". Return "0" on line 580 ./tools/testing/selftests/powerp

Re: [PATCH RESEND v1 3/4] powerpc/vdso: Separate vvar vma from vdso

2021-04-12 Thread Vincenzo Frascino
On 3/31/21 5:48 PM, Christophe Leroy wrote: > From: Dmitry Safonov > > Since commit 511157ab641e ("powerpc/vdso: Move vdso datapage up front") > VVAR page is in front of the VDSO area. In result it breaks CRIU > (Checkpoint Restore In Userspace) [1], where CRIU expects that "[vdso]" > from /pr

Re: [PATCH RESEND v1 2/4] lib/vdso: Add vdso_data pointer as input to __arch_get_timens_vdso_data()

2021-04-12 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 16:48, Christophe Leroy wrote: > For the same reason as commit e876f0b69dc9 ("lib/vdso: Allow > architectures to provide the vdso data pointer"), powerpc wants to > avoid calculation of relative position to code. > > As the timens_vdso_data is next page to vdso_data, provide

Re: [PATCH RESEND v1 2/4] lib/vdso: Add vdso_data pointer as input to __arch_get_timens_vdso_data()

2021-04-12 Thread Vincenzo Frascino
On 3/31/21 5:48 PM, Christophe Leroy wrote: > For the same reason as commit e876f0b69dc9 ("lib/vdso: Allow > architectures to provide the vdso data pointer"), powerpc wants to > avoid calculation of relative position to code. > > As the timens_vdso_data is next page to vdso_data, provide > vdso

Re: [PATCH RESEND v1 1/4] lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline()

2021-04-12 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 16:48, Christophe Leroy wrote: > In the same spirit as commit c966533f8c6c ("lib/vdso: Mark do_hres() > and do_coarse() as __always_inline"), mark do_hres_timens() and > do_coarse_timens() __always_inline. > > The measurement below in on a non timens process, ie on the fastes

Re: [PATCH RESEND v1 1/4] lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline()

2021-04-12 Thread Vincenzo Frascino
On 3/31/21 5:48 PM, Christophe Leroy wrote: > In the same spirit as commit c966533f8c6c ("lib/vdso: Mark do_hres() > and do_coarse() as __always_inline"), mark do_hres_timens() and > do_coarse_timens() __always_inline. > > The measurement below in on a non timens process, ie on the fastest path

Re: [PATCH RESEND v1 0/4] powerpc/vdso: Add support for time namespaces

2021-04-12 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 16:48, Christophe Leroy wrote: > [Sorry, resending with complete destination list, I used the wrong script on > the first delivery] > > This series adds support for time namespaces on powerpc. > > All timens selftests are successfull. If PPC people want to pick up the whole

Re: [RFC/PATCH] powerpc/smp: Add SD_SHARE_PKG_RESOURCES flag to MC sched-domain

2021-04-12 Thread Vincent Guittot
On Mon, 12 Apr 2021 at 11:37, Mel Gorman wrote: > > On Mon, Apr 12, 2021 at 11:54:36AM +0530, Srikar Dronamraju wrote: > > * Gautham R. Shenoy [2021-04-02 11:07:54]: > > > > > > > > To remedy this, this patch proposes that the LLC be moved to the MC > > > level which is a group of cores in one ha

Re: [PATCH V2 4/6] mm: Drop redundant ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION

2021-04-12 Thread Oscar Salvador
On Thu, Apr 01, 2021 at 12:14:06PM +0530, Anshuman Khandual wrote: > ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION configs have duplicate definitions on > platforms that subscribe them. Drop these reduntant definitions and instead > just select them appropriately. > > Cc: Catalin Marinas > Cc: Will Deacon

[PATCH 3/3] powerpc/ebpf32: Use standard function call for functions within 32M distance

2021-04-12 Thread Christophe Leroy
If the target of a function call is within 32 Mbytes distance, use a standard function call with 'bl' of the 'lis/ori/mtlr/blrl' sequence. In the first pass, no memory has been allocated yet and the code position is not known yet (image pointer is NULL). This pass is there to calculate the amount

[PATCH 2/3] powerpc/ebpf32: Rework 64 bits shifts to avoid tests and branches

2021-04-12 Thread Christophe Leroy
Re-implement BPF_ALU64 | BPF_{LSH/RSH/ARSH} | BPF_X with branchless implementation copied from misc_32.S. Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit_comp32.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/net/b

[PATCH 1/3] powerpc/ebpf32: Fix comment on BPF_ALU{64} | BPF_LSH | BPF_K

2021-04-12 Thread Christophe Leroy
Replace <<== by <<= Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit_comp32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp32.c b/arch/powerpc/net/bpf_jit_comp32.c index 003843273b43..ca6fe1583460 100644 --- a/arch/powerpc/net/

[PATCH v1 4/4] powerpc: Move copy_from_kernel_nofault_inst()

2021-04-12 Thread Christophe Leroy
When probe_kernel_read_inst() was created, there was no good place to put it, so a file called lib/inst.c was dedicated for it. Since then, probe_kernel_read_inst() has been renamed copy_from_kernel_nofault_inst(). And mm/maccess.h didn't exist at that time. Today, mm/maccess.h is related to copy_

[PATCH v1 3/4] powerpc: Rename probe_kernel_read_inst()

2021-04-12 Thread Christophe Leroy
When probe_kernel_read_inst() was created, it was to mimic probe_kernel_read() function. Since then, probe_kernel_read() has been renamed copy_from_kernel_nofault(). Rename probe_kernel_read_inst() into copy_from_kernel_nofault_inst(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/a

[PATCH v1 1/4] powerpc: Remove probe_user_read_inst()

2021-04-12 Thread Christophe Leroy
Its name comes from former probe_user_read() function. That function is now called copy_from_user_nofault(). probe_user_read_inst() uses copy_from_user_nofault() to read only a few bytes. It is suboptimal. It does the same as get_user_inst() but in addition disables page faults. But on the other

[PATCH v1 2/4] powerpc: Make probe_kernel_read_inst() common to PPC32 and PPC64

2021-04-12 Thread Christophe Leroy
We have two independant versions of probe_kernel_read_inst(), one for PPC32 and one for PPC64. The PPC32 is identical to the first part of the PPC64 version. The remaining part of PPC64 version is not relevant for PPC32, but not contradictory, so we can easily have a common function with the PPC64

Re: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition

2021-04-12 Thread Arnd Bergmann
On Mon, Apr 12, 2021 at 12:54 PM David Laight wrote: > From: David Laight > Sent: 12 April 2021 10:37 > ... > > I'm guessing that compat_pid_t is 16 bits? > > So the native 32bit version has an unnamed 2 byte structure pad. > > The 'packed' removes this pad from the compat structure. > > > > AFAIC

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

2021-04-12 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: git_versi

[PATCH v3 3/4] powerpc/selftests/perf-hwbreak: Add testcases for 2nd DAWR

2021-04-12 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 addr

[PATCH v3 2/4] powerpc/selftests/perf-hwbreak: Coalesce event creation code

2021-04-12 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 | 79 +-- 1 file changed, 39 insertions(+), 40 deletions(-)

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

2021-04-12 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, l

[PATCH v3 0/4] powerpc/selftests: Add Power10 2nd DAWR selftests

2021-04-12 Thread Ravi Bangoria
Power10 introduced 2nd watchpoint (DAWR). ISA 3.1, Book 3S, Ch 9 - 'Debug Facilities' covers the feature in detail. Kernel patches to enable the 2nd DAWR are already in[1], including kvm enablement[2]. These patches adds selftests for 2nd DAWR. [1]: https://git.kernel.org/torvalds/c/deb2bd9bcc842

Re: consolidate the flock uapi definitions

2021-04-12 Thread Arnd Bergmann
On Mon, Apr 12, 2021 at 12:22 PM David Laight wrote: > > From: Arnd Bergmann > > Sent: 12 April 2021 11:04 > > > > On Mon, Apr 12, 2021 at 10:55 AM Christoph Hellwig wrote: > > > > > > Hi all, > > > > > > currently we deal with the slight differents in the various architecture > > > variants of t

Re: [PATCH] powerpc: alignment: Remove unneeded variables

2021-04-12 Thread Christophe Leroy
Le 12/04/2021 à 11:59, Wan Jiabing a écrit : Fix coccicheck warning: Can you mention in the commit subject that it is selftests and not the core part of powerpc which is addressed here ? ./tools/testing/selftests/powerpc/alignment/alignment_handler.c:539:5-7: Unneeded variable: "rc". Re

Re: [RFC/PATCH] powerpc/smp: Add SD_SHARE_PKG_RESOURCES flag to MC sched-domain

2021-04-12 Thread Mel Gorman
On Mon, Apr 12, 2021 at 11:06:19AM +0100, Valentin Schneider wrote: > On 12/04/21 10:37, Mel Gorman wrote: > > On Mon, Apr 12, 2021 at 11:54:36AM +0530, Srikar Dronamraju wrote: > >> * Gautham R. Shenoy [2021-04-02 11:07:54]: > >> > >> > > >> > To remedy this, this patch proposes that the LLC be m

RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition

2021-04-12 Thread David Laight
From: David Laight > Sent: 12 April 2021 10:37 ... > I'm guessing that compat_pid_t is 16 bits? > So the native 32bit version has an unnamed 2 byte structure pad. > The 'packed' removes this pad from the compat structure. > > AFAICT (apart from mips) the __ARCH_COMPAT_FLOCK_PAD is just > adding an

Re: [PATCH] ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk

2021-04-12 Thread Shengjiu Wang
On Sun, Apr 11, 2021 at 10:43 PM Guenter Roeck wrote: > > On Fri, Mar 19, 2021 at 04:06:43PM +0800, Shengjiu Wang wrote: > > When there is power domain bind with bus clock, > > > > The call flow: > > devm_regmap_init_mmio_clk > >- clk_prepare() > > - clk_pm_runtime_get() > > > > cause th

RE: consolidate the flock uapi definitions

2021-04-12 Thread David Laight
From: Arnd Bergmann > Sent: 12 April 2021 11:04 > > On Mon, Apr 12, 2021 at 10:55 AM Christoph Hellwig wrote: > > > > Hi all, > > > > currently we deal with the slight differents in the various architecture > > variants of the flock and flock64 stuctures in a very cruft way. This > > series swit

Re: [RFC/PATCH] powerpc/smp: Add SD_SHARE_PKG_RESOURCES flag to MC sched-domain

2021-04-12 Thread Valentin Schneider
On 12/04/21 10:37, Mel Gorman wrote: > On Mon, Apr 12, 2021 at 11:54:36AM +0530, Srikar Dronamraju wrote: >> * Gautham R. Shenoy [2021-04-02 11:07:54]: >> >> > >> > To remedy this, this patch proposes that the LLC be moved to the MC >> > level which is a group of cores in one half of the chip. >>

Re: consolidate the flock uapi definitions

2021-04-12 Thread Arnd Bergmann
On Mon, Apr 12, 2021 at 10:55 AM Christoph Hellwig wrote: > > Hi all, > > currently we deal with the slight differents in the various architecture > variants of the flock and flock64 stuctures in a very cruft way. This > series switches to just use small arch hooks and define the rest in > asm-ge

[PATCH] powerpc: alignment: Remove unneeded variables

2021-04-12 Thread Wan Jiabing
Fix coccicheck warning: ./tools/testing/selftests/powerpc/alignment/alignment_handler.c:539:5-7: Unneeded variable: "rc". Return "0" on line 562 ./tools/testing/selftests/powerpc/alignment/alignment_handler.c:567:5-7: Unneeded variable: "rc". Return "0" on line 580 ./tools/testing/selftests/powerp

Re: [PATCH 1/5] uapi: remove the unused HAVE_ARCH_STRUCT_FLOCK64 define

2021-04-12 Thread Arnd Bergmann
On Mon, Apr 12, 2021 at 10:55 AM Christoph Hellwig wrote: > > Signed-off-by: Christoph Hellwig The patch looks good, but I'd like to see a description for each one. How about: | The check was added when Stephen Rothwell created the file, but | no architecture ever defined it. Arnd

Re: [RFC/PATCH] powerpc/smp: Add SD_SHARE_PKG_RESOURCES flag to MC sched-domain

2021-04-12 Thread Mel Gorman
On Mon, Apr 12, 2021 at 11:54:36AM +0530, Srikar Dronamraju wrote: > * Gautham R. Shenoy [2021-04-02 11:07:54]: > > > > > To remedy this, this patch proposes that the LLC be moved to the MC > > level which is a group of cores in one half of the chip. > > > > SMT (SMT4) --> MC (Hemisphere)

Re: [PATCH 1/2] vfio/pci: remove vfio_pci_nvlink2

2021-04-12 Thread Michael Ellerman
Alex Williamson writes: > On Fri, 26 Mar 2021 07:13:10 +0100 > Christoph Hellwig wrote: > >> This driver never had any open userspace (which for VFIO would include >> VM kernel drivers) that use it, and thus should never have been added >> by our normal userspace ABI rules. >> >> Signed-off-by:

RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition

2021-04-12 Thread David Laight
From: Christoph Hellwig > Sent: 12 April 2021 09:56 > > Provide a single common definition for the compat_flock and > compat_flock64 structures using the same tricks as for the native > variants. An extra define is added for the packing required on x86. > ... > /* > - * IA32 uses 4 byte alignme

[PATCH 3/5] uapi: merge the 32-bit mips struct flock into the generic one

2021-04-12 Thread Christoph Hellwig
Add a new __ARCH_FLOCK_EXTRA_SYSID macro following the style of __ARCH_FLOCK_PAD to avoid having a separate definition just for one architecture. Signed-off-by: Christoph Hellwig --- arch/mips/include/uapi/asm/fcntl.h | 26 +++--- include/uapi/asm-generic/fcntl.h |

[PATCH 1/5] uapi: remove the unused HAVE_ARCH_STRUCT_FLOCK64 define

2021-04-12 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/uapi/asm-generic/fcntl.h | 2 -- tools/include/uapi/asm-generic/fcntl.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h index 9dc0bf0c5a6ee8..fb454bb629d114 100644 --- a/in

consolidate the flock uapi definitions

2021-04-12 Thread Christoph Hellwig
Hi all, currently we deal with the slight differents in the various architecture variants of the flock and flock64 stuctures in a very cruft way. This series switches to just use small arch hooks and define the rest in asm-generic and linux/compat.h instead. Diffstat: arch/arm64/include/asm/com

[PATCH 4/5] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h

2021-04-12 Thread Christoph Hellwig
The F_GETLK64/F_SETLK64/F_SETLKW64 commands are only implemented for 32-bit syscall APIs, but we also need them for compat handling on 64-bit kernels. Given that redefining them is rather error prone, as shown by parisc getting the opcodes wrong currently, just use the existing definitions for the

[PATCH 2/5] uapi: simplify __ARCH_FLOCK{,64}_PAD a little

2021-04-12 Thread Christoph Hellwig
Don't bother to define emtpty versions of the macros if the architecture doesn't define them. Signed-off-by: Christoph Hellwig --- include/uapi/asm-generic/fcntl.h | 12 tools/include/uapi/asm-generic/fcntl.h | 12 2 files changed, 8 insertions(+), 16 deletions(-)

[PATCH 5/5] compat: consolidate the compat_flock{,64} definition

2021-04-12 Thread Christoph Hellwig
Provide a single common definition for the compat_flock and compat_flock64 structures using the same tricks as for the native variants. An extra define is added for the packing required on x86. Signed-off-by: Christoph Hellwig --- arch/arm64/include/asm/compat.h | 16 arch/mi

Re: [PATCH V2] mm/page_alloc: Ensure that HUGETLB_PAGE_ORDER is less than MAX_ORDER

2021-04-12 Thread David Hildenbrand
On 12.04.21 10:06, Anshuman Khandual wrote: + linuxppc-dev@lists.ozlabs.org + linux-i...@vger.kernel.org On 4/12/21 9:18 AM, Anshuman Khandual wrote: pageblock_order must always be less than MAX_ORDER, otherwise it might lead to an warning during boot. A similar problem got fixed on arm64 platf

Re: [PATCH V2] mm/page_alloc: Ensure that HUGETLB_PAGE_ORDER is less than MAX_ORDER

2021-04-12 Thread Anshuman Khandual
+ linuxppc-dev@lists.ozlabs.org + linux-i...@vger.kernel.org On 4/12/21 9:18 AM, Anshuman Khandual wrote: > pageblock_order must always be less than MAX_ORDER, otherwise it might lead > to an warning during boot. A similar problem got fixed on arm64 platform > with the commit 79cc2ed5a716 ("arm64/

[PATCH v2] powerpc/eeh: Fix EEH handling for hugepages in ioremap space.

2021-04-12 Thread Mahesh Salgaonkar
During the EEH MMIO error checking, the current implementation fails to map the (virtual) MMIO address back to the pci device on radix with hugepage mappings for I/O. This results into failure to dispatch EEH event with no recovery even when EEH capability has been enabled on the device. eeh_check

[PATCH v1 7/7] KVM: PPC: Book3S 64: Minimise hcall handler calling convention differences

2021-04-12 Thread Nicholas Piggin
This sets up the same calling convention from interrupt entry to KVM interrupt handler for system calls as exists for other interrupt types. This is a better API, it uses a save area rather than SPR, and it has more registers free to use. Using a single common API helps maintain it, and it becomes

[PATCH v1 6/7] KVM: PPC: Book3S 64: move bad_host_intr check to HV handler

2021-04-12 Thread Nicholas Piggin
The bad_host_intr check will never be true with PR KVM, move it to HV code. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Nicholas Piggin --- arch/powerpc/kvm/book3s_64_entry.S | 4 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 +++- arch/powerpc/kvm/book3s_segment.S | 3 +++ 3

[PATCH v1 5/7] KVM: PPC: Book3S 64: Move interrupt early register setup to KVM

2021-04-12 Thread Nicholas Piggin
Like the earlier patch for hcalls, KVM interrupt entry requires a different calling convention than the Linux interrupt handlers set up. Move the code that converts from one to the other into KVM. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 131 +

[PATCH v1 4/7] KVM: PPC: Book3S 64: Move hcall early register setup to KVM

2021-04-12 Thread Nicholas Piggin
System calls / hcalls have a different calling convention than other interrupts, so there is code in the KVMTEST to massage these into the same form as other interrupt handlers. Move this work into the KVM hcall handler. This means teaching KVM a little more about the low level interrupt handler s

[PATCH v1 3/7] KVM: PPC: Book3S 64: add hcall interrupt handler

2021-04-12 Thread Nicholas Piggin
Add a separate hcall entry point. This can be used to deal with the different calling convention. Reviewed-by: Daniel Axtens Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 +++--- arch/powerpc/kvm/book3s_64_entry.S | 6 +- 2 files c

[PATCH v1 2/7] KVM: PPC: Book3S 64: Move GUEST_MODE_SKIP test into KVM

2021-04-12 Thread Nicholas Piggin
Move the GUEST_MODE_SKIP logic into KVM code. This is quite a KVM internal detail that has no real need to be in common handlers. Add a comment explaining the what and why of KVM "skip" interrupts. Reviewed-by: Daniel Axtens Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- arch/p

[PATCH v1 1/7] KVM: PPC: Book3S 64: move KVM interrupt entry to a common entry point

2021-04-12 Thread Nicholas Piggin
Rather than bifurcate the call depending on whether or not HV is possible, and have the HV entry test for PR, just make a single common point which does the demultiplexing. This makes it simpler to add another type of exit handler. Acked-by: Paul Mackerras Reviewed-by: Daniel Axtens Reviewed-by:

[PATCH v1 0/7] KVM / 64s interrupt handling changes

2021-04-12 Thread Nicholas Piggin
This is the second batch of patches split from the big KVM in C series. This implements all the changes to exception-64s.S required for the subsequent C conversion. I think they stand on their own as good patches. The main things done here are to make the code more amenable to adding different KV

Re: [PATCH] powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC

2021-04-12 Thread Athira Rajeev
On 12-Apr-2021, at 8:38 AM, Nicholas Piggin wrote:Excerpts from Athira Rajeev's message of April 9, 2021 10:53 pm:On 09-Apr-2021, at 6:38 AM, Nicholas Piggin wrote:Hi Nick,Thanks for checking the patch and sharing review comments.I was going to nitpick "overflown" here as something birds do, but

Re: [PATCH v2 5/5] powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE

2021-04-12 Thread Andrew Donnellan
On 9/4/21 12:06 am, Nathan Lynch wrote: RTAS_RMOBUF_MAX doesn't actually describe a "maximum" value in any sense. It represents the size of an area of memory set aside for user space to use as work areas for certain RTAS calls. Rename it to RTAS_USER_REGION_SIZE. Signed-off-by: Nathan Lynch