Re: [PATCH 9/11] KVM/MMU: Flush tlb in the kvm_mmu_write_protect_pt_masked()

2019-01-10 Thread Tianyu Lan
On Tue, Jan 8, 2019 at 12:26 AM Paolo Bonzini wrote: > > On 04/01/19 09:54, lantianyu1...@gmail.com wrote: > > rmap_head = __gfn_to_rmap(slot->base_gfn + gfn_offset + > > __ffs(mask), > > PT_PAGE_TABLE_LEVEL, slot); > > - __rmap_wr

[PATCH 1/2] perf powerpc: Rework syscall table generation

2019-01-10 Thread Ravi Bangoria
Commit aff850393200 ("powerpc: add system call table generation support") changed how systemcall table is generated for powerpc. Incorporate these changes into perf as well. Signed-off-by: Ravi Bangoria --- tools/perf/arch/powerpc/Makefile | 15 +- .../perf/arch/powerpc/entry/

[PATCH 2/2] perf powerpc: Remove unistd.h

2019-01-10 Thread Ravi Bangoria
We use syscall.tbl to generate system call table on powerpc. unistd.h is no longer required now. Remove it. Signed-off-by: Ravi Bangoria --- tools/arch/powerpc/include/uapi/asm/unistd.h | 404 --- tools/perf/check-headers.sh | 1 - 2 files changed, 405

Re: [PATCH 1/2] powerpc: Use seq_buf to avoid pr_cont() in __die()

2019-01-10 Thread Michael Ellerman
Christophe Leroy writes: > Le 08/01/2019 à 13:04, Michael Ellerman a écrit : >> Using pr_cont() risks having our output interleaved with other output >> from other CPUs. Instead use a seq_buf to construct the line and then >> print it as a whole. > > Why not simply doing a single printk() or simil

Re: [PATCH v4 13/13] drivers/perf: use PERF_PMU_CAP_NO_EXCLUDE for Cavium TX2 PMU

2019-01-10 Thread Will Deacon
On Mon, Jan 07, 2019 at 04:27:30PM +, Andrew Murray wrote: > The Cavium ThunderX2 UNCORE PMU driver doesn't support any event > filtering. Let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability to > simplify the code. > > Signed-off-by: Andrew Murray > --- > drivers/perf/thunderx2_pmu.c | 10

Re: [PATCH v2 18/34] dt-bindings: arm: Convert FSL board/soc bindings to json-schema

2019-01-10 Thread Vokáč Michal
On 10.1.2019 07:42, Shawn Guo wrote: > On Sat, Dec 08, 2018 at 09:58:37AM +0800, Shawn Guo wrote: >> On Thu, Dec 06, 2018 at 05:33:13PM -0600, Rob Herring wrote: >>> On Wed, Dec 5, 2018 at 8:32 PM Shawn Guo wrote: On Mon, Dec 03, 2018 at 03:32:07PM -0600, Rob Herring wrote: > Convert

[PATCH] powerpc/powernv: Allow smt-enabled=off on Power9

2019-01-10 Thread Michael Ellerman
In commit d70a54e2d085 ("powerpc/powernv: Ignore smt-enabled on Power8 and later") we disabled smt-enabled=off on Power8 and later CPUs because the subcore logic required all CPUs to be booted. However Power9 doesn't support subcore, so we can support smt-enabled=off on Power9. Fix the code to do

[PATCH v2 1/3] powerpc: Stop using pr_cont() in __die()

2019-01-10 Thread Michael Ellerman
Using pr_cont() risks having our output interleaved with other output from other CPUs. Instead print everything in a single printk() call. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/traps.c | 26 -- 1 file changed, 8 insertions(+), 18 deletions(-) v2: Use a

[PATCH v2 2/3] powerpc: Show PAGE_SIZE in __die() output

2019-01-10 Thread Michael Ellerman
The page size the kernel is built with is useful info when debugging a crash, so add it to the output in __die(). Result looks like eg: kernel BUG at drivers/misc/lkdtm/bugs.c:63! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K SMP NR_CPUS=2048 NUMA pSeries Modules linked in:

[PATCH v2 3/3] powerpc/64s: Add MMU type to __die() output

2019-01-10 Thread Michael Ellerman
On Power9 machines (64-bit Book3S), we can be running with either the Hash table or Radix tree MMU enabled. So add some text to the __die() output to tell us which is enabled, for the case where all you have is the oops output and no other information. Example output: kernel BUG at drivers/misc

Re: [PATCH] powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group()

2019-01-10 Thread Michael Ellerman
Greg Kurz writes: > On Wed, 9 Jan 2019 17:45:53 +0100 > Frederic Barrat wrote: > >> Le 09/01/2019 à 17:25, Greg Kurz a écrit : >> > On Wed, 9 Jan 2019 16:13:42 +0100 >> > Frederic Barrat wrote: >> > >> >> With a recent change around IOMMU group, a system with an opencapi >> >> adapter is no

Re: [PATCH] powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group()

2019-01-10 Thread Greg Kurz
On Thu, 10 Jan 2019 23:25:11 +1100 Michael Ellerman wrote: > Greg Kurz writes: > > On Wed, 9 Jan 2019 17:45:53 +0100 > > Frederic Barrat wrote: > > > >> Le 09/01/2019 à 17:25, Greg Kurz a écrit : > >> > On Wed, 9 Jan 2019 16:13:42 +0100 > >> > Frederic Barrat wrote: > >> > > >> >> Wi

Re: [PATCH] powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group()

2019-01-10 Thread Frederic Barrat
Le 10/01/2019 à 13:25, Michael Ellerman a écrit : Greg Kurz writes: On Wed, 9 Jan 2019 17:45:53 +0100 Frederic Barrat wrote: Le 09/01/2019 à 17:25, Greg Kurz a écrit : On Wed, 9 Jan 2019 16:13:42 +0100 Frederic Barrat wrote: With a recent change around IOMMU group, a system with a

Re: [PATCH v4 10/13] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Michael Ellerman
Peter Zijlstra writes: > On Mon, Jan 07, 2019 at 04:27:27PM +, Andrew Murray wrote: >> For drivers that do not support context exclusion let's advertise the >> PERF_PMU_CAP_NOEXCLUDE capability. This ensures that perf will >> prevent us from handling events where any exclusion flags are set.

Re: [PATCH] powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group()

2019-01-10 Thread Greg KH
On Thu, Jan 10, 2019 at 01:58:31PM +0100, Frederic Barrat wrote: > > > Le 10/01/2019 à 13:25, Michael Ellerman a écrit : > > Greg Kurz writes: > > > On Wed, 9 Jan 2019 17:45:53 +0100 > > > Frederic Barrat wrote: > > > > > > > Le 09/01/2019 à 17:25, Greg Kurz a écrit : > > > > > On Wed, 9 Jan

Re: [PATCH v2 1/3] powerpc: Stop using pr_cont() in __die()

2019-01-10 Thread Christophe Leroy
Le 10/01/2019 à 12:57, Michael Ellerman a écrit : Using pr_cont() risks having our output interleaved with other output from other CPUs. Instead print everything in a single printk() call. Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy --- arch/powerpc/kernel/traps.c |

Re: [PATCH 1/2] perf powerpc: Rework syscall table generation

2019-01-10 Thread Arnaldo Carvalho de Melo
Em Thu, Jan 10, 2019 at 03:19:35PM +0530, Ravi Bangoria escreveu: > Commit aff850393200 ("powerpc: add system call table generation support") > changed how systemcall table is generated for powerpc. Incorporate these > changes into perf as well. Thanks, applied and performed the following tests, n

Re: [PATCH v2 2/3] powerpc: Show PAGE_SIZE in __die() output

2019-01-10 Thread Christophe Leroy
Le 10/01/2019 à 12:57, Michael Ellerman a écrit : The page size the kernel is built with is useful info when debugging a crash, so add it to the output in __die(). Result looks like eg: kernel BUG at drivers/misc/lkdtm/bugs.c:63! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_S

Re: [PATCH v2 3/3] powerpc/64s: Add MMU type to __die() output

2019-01-10 Thread Christophe Leroy
Le 10/01/2019 à 12:57, Michael Ellerman a écrit : On Power9 machines (64-bit Book3S), we can be running with either the Hash table or Radix tree MMU enabled. So add some text to the __die() output to tell us which is enabled, for the case where all you have is the oops output and no other info

Re: [PATCH v2 18/34] dt-bindings: arm: Convert FSL board/soc bindings to json-schema

2019-01-10 Thread Shawn Guo
On Thu, Jan 10, 2019 at 10:44:03AM +, Vokáč Michal wrote: ... > > What happened to this? It seems the patch did not hit v5.0-rc1. > > Hi Shawn, > Rob actually asked you a similar question two days ago.. > > https://lkml.org/lkml/2019/1/8/754 Oops, it seems there were some miscommunication b

[PATCH v5 00/12] perf/core: Generalise event exclusion checking

2019-01-10 Thread Andrew Murray
Many PMU drivers do not have the capability to exclude counting events that occur in specific contexts such as idle, kernel, guest, etc. These drivers indicate this by returning an error in their event_init upon testing the events attribute flags. However this approach requires that each time a ne

[PATCH v5 01/12] perf/doc: update design.txt for exclude_{host|guest} flags

2019-01-10 Thread Andrew Murray
Update design.txt to reflect the presence of the exclude_host and exclude_guest perf flags. Signed-off-by: Andrew Murray --- tools/perf/design.txt | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/design.txt b/tools/perf/design.txt index a28dca2..0453ba2 100644 --- a/tools/perf/

[PATCH v5 02/12] perf/core: add function to test for event exclusion flags

2019-01-10 Thread Andrew Murray
Add a function that tests if any of the perf event exclusion flags are set on a given event. Signed-off-by: Andrew Murray --- include/linux/perf_event.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 1d5c551..54a78d2 100

[PATCH v5 03/12] perf/core: add PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs

2019-01-10 Thread Andrew Murray
Many PMU drivers do not have the capability to exclude counting events that occur in specific contexts such as idle, kernel, guest, etc. These drivers indicate this by returning an error in their event_init upon testing the events attribute flags. This approach is error prone and often inconsistent

[PATCH v5 04/12] alpha: perf/core: strengthen exclude checks with PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
As the Alpha PMU doesn't support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. This change means that __hw_per

[PATCH v5 05/12] arm: perf: conditionally use PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
The ARM PMU driver can be used to represent a variety of ARM based PMUs. Some of these PMUs do not provide support for context exclusion, where this is the case we advertise the PERF_PMU_CAP_NO_EXCLUDE capability to ensure that perf prevents us from handling events where any exclusion flags are set

[PATCH v5 06/12] arm: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray Ac

[PATCH v5 07/12] drivers/perf: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray Ac

[PATCH v5 08/12] drivers/perf: perf/core: strengthen exclude checks with PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. This change means that qcom_{l2|

[PATCH v5 09/12] powerpc: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
For PowerPC PMUs that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murra

[PATCH v5 10/12] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NOEXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. PMU drivers that support at least

[PATCH v5 11/12] x86: perf/core: strengthen exclude checks with PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
For x86 PMUs that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. This change means that amd/iomm

[PATCH v5 12/12] perf/core: remove unused perf_flags

2019-01-10 Thread Andrew Murray
Now that perf_flags is not used we remove it. Signed-off-by: Andrew Murray --- include/uapi/linux/perf_event.h | 2 -- tools/include/uapi/linux/perf_event.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 9de8780

Re: [PATCH v4 1/2] crypto: talitos - reorder code in talitos_edesc_alloc()

2019-01-10 Thread Herbert Xu
On Tue, Jan 08, 2019 at 06:56:46AM +, Christophe Leroy wrote: > This patch moves the mapping of IV after the kmalloc(). This > avoids having to unmap in case kmalloc() fails. > > Signed-off-by: Christophe Leroy > --- > new in v4 > > drivers/crypto/talitos.c | 25 +++-- >

Re: [PATCH] powerpc/vdso32: Drop -mabi=elfv1 for 32 bit objects

2019-01-10 Thread Daniel Axtens
Christophe Leroy writes: > Le 10/01/2019 à 02:42, Joel Stanley a écrit : >> From: Daniel Axtens >> >> All 64-bit objects need to specify the flag to be compiled correctly, we >> just don't need it for 32-bit objects. GCC just ignored it, but clang >> doesn't. >> >> Link: https://github.com/Cla

[PATCH] powerpc/8xx: replace most #ifdef by IS_ENABLED() in 8xx_mmu.c

2019-01-10 Thread Christophe Leroy
This patch replaces most #ifdef mess by IS_ENABLED() in 8xx_mmu.c This has the advantage of allowing syntax verification at compile time regardless of selected options. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/8xx_mmu.c | 65 +-- 1 file chan

Re: [PATCH] ibmvscsi: use GFP_ATOMIC with dma_alloc_coherent in map_sg_data

2019-01-10 Thread Brian King
On 01/09/2019 08:58 PM, Tyrel Datwyler wrote: > While mapping DMA for scatter list when a scsi command is queued the > existing call to dma_alloc_coherent() in our map_sg_data() function > passes zero for the gfp_flags parameter. We are most definitly in atomic > context at this point as queue_comm

Re: [PATCH] ibmvscsi: use GFP_KERNEL with dma_alloc_coherent in initialize_event_pool

2019-01-10 Thread Brian King
On 01/09/2019 08:59 PM, Tyrel Datwyler wrote: > During driver probe we allocate a dma region for our event pool. > Currently, zero is passed for the gfp_flags parameter. Driver probe > callbacks run in process context and we hold no locks so we can sleep > here if necessary. > > Fix by passing GFP

Re: [PATCH] ibmvscsi: use GFP_ATOMIC with dma_alloc_coherent in map_sg_data

2019-01-10 Thread Christoph Hellwig
On Wed, Jan 09, 2019 at 06:58:56PM -0800, Tyrel Datwyler wrote: > While mapping DMA for scatter list when a scsi command is queued the > existing call to dma_alloc_coherent() in our map_sg_data() function > passes zero for the gfp_flags parameter. We are most definitly in atomic > context at this p

[PATCH v2 00/15] powerpc/32s: Use BATs/LTLBs for STRICT_KERNEL_RWX

2019-01-10 Thread Christophe Leroy
The purpose of this serie is to: - use BATs with STRICT_KERNEL_RWX on book3s (See patch 12 for details.) - use LTLBs with STRICT_KERNEL_RWX on 8xx (See patch 14 for a few details.) v2: - Fix patch 2 (was patch 3 in v1) based on feedback from Jonathan. - Added support for 8xx with LTLBs. - Added sy

[PATCH v2 01/15] powerpc/mm/32: add base address to mmu_mapin_ram()

2019-01-10 Thread Christophe Leroy
At the time being, mmu_mapin_ram() always maps RAM from the beginning. But some platforms like the WII have to map a second block of RAM. This patch adds to mmu_mapin_ram() the base address of the block. At the moment, only base address 0 is supported. Signed-off-by: Christophe Leroy --- arch/p

[PATCH v2 02/15] powerpc/mm/32s: rework mmu_mapin_ram()

2019-01-10 Thread Christophe Leroy
This patch reworks mmu_mapin_ram() to be more generic and map as much blocks as possible. It now supports blocks not starting at address 0. It scans DBATs array to find free ones instead of forcing the use of BAT2 and BAT3. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ppc_mmu_32.c | 61 +

[PATCH v2 03/15] powerpc/mm/32s: use generic mmu_mapin_ram() for all blocks.

2019-01-10 Thread Christophe Leroy
Now that mmu_mapin_ram() is able to handle other blocks than the one starting at 0, the WII can use it for all its blocks. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable_32.c | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/

[PATCH v2 04/15] powerpc/32: always populate page tables for Abatron BDI.

2019-01-10 Thread Christophe Leroy
When CONFIG_BDI_SWITCH is set, the page tables have to be populated allthough large TLBs are used, because the BDI switch knows nothing about those large TLBs which are handled directly in TLB miss logic. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable_32.c | 5 - 1 file changed,

[PATCH v2 05/15] powerpc/wii: remove wii_mmu_mapin_mem2()

2019-01-10 Thread Christophe Leroy
wii_mmu_mapin_mem2() is not used anymore, remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/embedded6xx/wii.c | 24 1 file changed, 24 deletions(-) diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c inde

[PATCH v2 06/15] powerpc/mm/32s: use _PAGE_EXEC in setbat()

2019-01-10 Thread Christophe Leroy
Do not set IBAT when setbat() is called without _PAGE_EXEC Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ppc_mmu_32.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c index b8a8d55f51a6..42320688e415

[PATCH v2 07/15] powerpc/mm/32s: add setibat() clearibat() and update_bats()

2019-01-10 Thread Christophe Leroy
setibat() and clearibat() allows to manipulate IBATs independently of DBATs. update_bats() allows to update bats after init. This is done with MMU off. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 ++ arch/powerpc/kernel/head_32.S | 35 +

[PATCH v2 08/15] powerpc/32: add helper to write into segment registers

2019-01-10 Thread Christophe Leroy
This patch add an helper which wraps 'mtsrin' instruction to write into segment registers. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/reg.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 1c98ef1f2d5

[PATCH v2 09/15] powerpc/mmu: add is_strict_kernel_rwx() helper

2019-01-10 Thread Christophe Leroy
Add a helper to know whether STRICT_KERNEL_RWX is enabled. This is based on rodata_enabled flag which is defined only when CONFIG_STRICT_KERNEL_RWX is selected. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu.h | 11 +++ arch/powerpc/mm/init_32.c | 4 +--- 2 files

[PATCH v2 10/15] powerpc/kconfig: define PAGE_SHIFT inside Kconfig

2019-01-10 Thread Christophe Leroy
This patch defined CONFIG_PPC_PAGE_SHIFT in order to be able to use PAGE_SHIFT value inside Kconfig. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig| 7 +++ arch/powerpc/include/asm/page.h | 13 ++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git

[PATCH v2 11/15] powerpc/kconfig: define CONFIG_DATA_SHIFT and CONFIG_ETEXT_SHIFT

2019-01-10 Thread Christophe Leroy
CONFIG_STRICT_KERNEL_RWX requires a special alignment for DATA for some subarches. Today it is just defined as an #ifdef in vmlinux.lds.S In order to get more flexibility, this patch moves the definition of this alignment in Kconfig On some subarches, CONFIG_STRICT_KERNEL_RWX will require a speci

[PATCH v2 12/15] powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX

2019-01-10 Thread Christophe Leroy
Today, STRICT_KERNEL_RWX is based on the use of regular pages to map kernel pages. On Book3s 32, it has three consequences: - Using pages instead of BAT for mapping kernel linear memory severely impacts performance. - Exec protection is not effective because no-execute cannot be set at page level

[PATCH v2 13/15] powerpc/kconfig: make _etext and data areas alignment configurable on Book3s 32

2019-01-10 Thread Christophe Leroy
Depending on the number of available BATs for mapping the different kernel areas, it might be needed to increase the alignment of _etext and/or of data areas. This patchs allows the user to do it via Kconfig. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 32

[PATCH v2 14/15] powerpc/8xx: don't disable large TLBs with CONFIG_STRICT_KERNEL_RWX

2019-01-10 Thread Christophe Leroy
This patch implements handling of STRICT_KERNEL_RWX with large TLBs directly in the TLB miss handlers. To do so, etext and sinittext are aligned on 512kB boundaries and the miss handlers use 512kB pages instead of 8Mb pages for addresses close to the boundaries. It sets RO PP flags for addresses

[PATCH v2 15/15] powerpc/kconfig: make _etext and data areas alignment configurable on 8xx

2019-01-10 Thread Christophe Leroy
On 8xx, large pages (512kb or 8M) are used to map kernel linear memory. Aligning to 8M reduces TLB misses as only 8M pages are used in that case. This patchs allows the user to do it via Kconfig. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 16 ++-- arch/powe

[PATCH 11/15] mips: fix n32 compat_ipc_parse_version

2019-01-10 Thread Arnd Bergmann
While reading through the sysvipc implementation, I noticed that the n32 semctl/shmctl/msgctl system calls behave differently based on whether o32 support is enabled or not: Without o32, the IPC_64 flag passed by user space is rejected but calls without that flag get IPC_64 behavior. As far as I c

[PATCH 03/15] ia64: assign syscall numbers for perf and seccomp

2019-01-10 Thread Arnd Bergmann
Most architectures have assigned numbers for both seccomp and perf_event_open, even when they do not implement either. ia64 is an exception here, so for consistency lets add numbers for both of them. Unless CONFIG_PERF_EVENTS and CONFIG_SECCOMP are implemented, the system calls just return -ENOSYS

[PATCH 05/15] alpha: update syscall macro definitions

2019-01-10 Thread Arnd Bergmann
Other architectures commonly use __NR_umount2 for sys_umount, only ia64 and alpha use __NR_umount here. In order to synchronize the generated tables, use umount2 like everyone else, and add back the old name from asm/unistd.h for compatibility. For shmat, alpha uses the osf_shmat name, we can do t

[PATCH 02/15] ia64: add statx and io_pgetevents syscalls

2019-01-10 Thread Arnd Bergmann
All architectures should implement these two, so assign numbers and hook them up on ia64. Signed-off-by: Arnd Bergmann --- arch/ia64/kernel/syscalls/syscall.tbl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl in

[PATCH 08/15] m68k: assign syscall number for seccomp

2019-01-10 Thread Arnd Bergmann
Most architectures have assigned a numbers for the seccomp syscall even when they do not implement it. m68k is an exception here, so for consistency lets add the number. Unless CONFIG_SECCOMP is implemented, the system call just returns -ENOSYS. Signed-off-by: Arnd Bergmann --- arch/m68k/kernel

[PATCH 07/15] ARM: add kexec_file_load system call number

2019-01-10 Thread Arnd Bergmann
A couple of architectures including arm64 already implement the kexec_file_load system call, on many others we have assigned a system call number for it, but not implemented it yet. Adding the number in arch/arm/ lets us use the system call on arm64 systems in compat mode, and also reduces the num

[PATCH 10/15] sh: add statx system call

2019-01-10 Thread Arnd Bergmann
statx is available on almost all other architectures but got missed on sh, so add it now. Signed-off-by: Arnd Bergmann --- arch/sh/kernel/syscalls/syscall.tbl | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl index 21ec

[PATCH 09/15] sh: remove duplicate unistd_32.h file

2019-01-10 Thread Arnd Bergmann
When I merged this patch, the file was accidentally left intact instead of being removed, which means any changes to syscall.tbl have no effect. Fixes: 2b3c5a99d5f3 ("sh: generate uapi header and syscall table header files") Signed-off-by: Arnd Bergmann --- arch/sh/include/uapi/asm/unistd_32.h |

[PATCH 14/15] arch: add split IPC system calls where needed

2019-01-10 Thread Arnd Bergmann
The IPC system call handling is highly inconsistent across architectures, some use sys_ipc, some use separate calls, and some use both. We also have some architectures that require passing IPC_64 in the flags, and others that set it implicitly. For the additon of a y2083 safe semtimedop() system

[PATCH 00/15] arch: synchronize syscall tables in preparation for y2038

2019-01-10 Thread Arnd Bergmann
The system call tables have diverged a bit over the years, and a number of the recent additions never made it into all architectures, for one reason or another. This is an attempt to clean it up as far as we can without breaking compatibility, doing a number of steps: - Add system calls that have

Re: [PATCH] powerpc/vdso32: Drop -mabi=elfv1 for 32 bit objects

2019-01-10 Thread Segher Boessenkool
On Thu, Jan 10, 2019 at 08:10:43AM +0100, Christophe Leroy wrote: > Le 10/01/2019 à 02:42, Joel Stanley a écrit : > >From: Daniel Axtens > > > >All 64-bit objects need to specify the flag to be compiled correctly, we > >just don't need it for 32-bit objects. GCC just ignored it, but clang > >doesn

Re: [PATCH 06/15] ARM: add migrate_pages() system call

2019-01-10 Thread Will Deacon
On Thu, Jan 10, 2019 at 05:24:26PM +0100, Arnd Bergmann wrote: > The migrate_pages system call has an assigned number on all architectures > except ARM. When it got added initially in commit d80ade7b3231 ("ARM: > Fix warning: #warning syscall migrate_pages not implemented"), it was > intentionally

[PATCH 15/15] arch: add pkey and rseq syscall numbers everywhere

2019-01-10 Thread Arnd Bergmann
Most architectures define system call numbers for the rseq and pkey system calls, even when they don't support the features, and perhaps never will. Only a few architectures are missing these, so just define them anyway for consistency. If we decide to add them later to one of these, the system ca

[PATCH 04/15] alpha: wire up io_pgetevents system call

2019-01-10 Thread Arnd Bergmann
The io_pgetevents system call was added in linux-4.18 but has no entry for alpha: warning: #warning syscall io_pgetevents not implemented [-Wcpp] Assign a the next system call number here. Cc: sta...@vger.kernel.org Signed-off-by: Arnd Bergmann --- arch/alpha/kernel/syscalls/syscall.tbl | 1 +

[PATCH 06/15] ARM: add migrate_pages() system call

2019-01-10 Thread Arnd Bergmann
The migrate_pages system call has an assigned number on all architectures except ARM. When it got added initially in commit d80ade7b3231 ("ARM: Fix warning: #warning syscall migrate_pages not implemented"), it was intentionally left out based on the observation that there are no 32-bit ARM NUMA sys

[PATCH 01/15] ia64: add __NR_umount2 definition

2019-01-10 Thread Arnd Bergmann
Other architectures commonly use __NR_umount2 for sys_umount, only ia64 and alpha use __NR_umount here. In order to synchronize the generated tables, use umount2 like everyone else, and add back the old name from asm/unistd.h for compatibility. The __IGNORE_* lines are now all obsolete and can be

[PATCH 13/15] ipc: rename old-style shmctl/semctl/msgctl syscalls

2019-01-10 Thread Arnd Bergmann
The behavior of these system calls is slightly different between architectures, as determined by the CONFIG_ARCH_WANT_IPC_PARSE_VERSION symbol. Most architectures that implement the split IPC syscalls don't set that symbol and only get the modern version, but alpha, arm, microblaze, mips-n32, mips-

[PATCH 12/15] sparc64: fix sparc_ipc type conversion

2019-01-10 Thread Arnd Bergmann
__kernel_timespec and timespec are currently the same type, but once they are different, the type cast has to be changed here. Signed-off-by: Arnd Bergmann --- arch/sparc/kernel/sys_sparc_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/kernel/sys_sparc_64.c b/

Re: [PATCH 07/15] ARM: add kexec_file_load system call number

2019-01-10 Thread Will Deacon
On Thu, Jan 10, 2019 at 05:24:27PM +0100, Arnd Bergmann wrote: > A couple of architectures including arm64 already implement the > kexec_file_load system call, on many others we have assigned a system > call number for it, but not implemented it yet. > > Adding the number in arch/arm/ lets us use

[PATCH 3/4] perf powerpc: Rework syscall table generation

2019-01-10 Thread Arnaldo Carvalho de Melo
From: Ravi Bangoria Commit aff850393200 ("powerpc: add system call table generation support") changed how systemcall table is generated for powerpc. Incorporate these changes into perf as well. Committer testing: $ podman run --entrypoint=/bin/sh --privileged -v /home/acme/git:/git --rm -ti

Re: [PATCH 00/15] arch: synchronize syscall tables in preparation for y2038

2019-01-10 Thread Geert Uytterhoeven
Hi Arnd, On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann wrote: > The system call tables have diverged a bit over the years, and a number > of the recent additions never made it into all architectures, for one > reason or another. > > This is an attempt to clean it up as far as we can without break

Re: [PATCH 00/15] arch: synchronize syscall tables in preparation for y2038

2019-01-10 Thread Arnd Bergmann
On Thu, Jan 10, 2019 at 5:59 PM Geert Uytterhoeven wrote: > > Hi Arnd, > > On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann wrote: > > The system call tables have diverged a bit over the years, and a number > > of the recent additions never made it into all architectures, for one > > reason or anoth

Re: [PATCH 06/15] ARM: add migrate_pages() system call

2019-01-10 Thread Arnd Bergmann
On Thu, Jan 10, 2019 at 5:32 PM Will Deacon wrote: > > diff --git a/arch/arm64/include/asm/unistd32.h > > b/arch/arm64/include/asm/unistd32.h > > index 04ee190b90fe..355fe2bc035b 100644 > > --- a/arch/arm64/include/asm/unistd32.h > > +++ b/arch/arm64/include/asm/unistd32.h > > @@ -821,6 +821,8 @

[PATCH 4/4] tools headers powerpc: Remove unistd.h

2019-01-10 Thread Arnaldo Carvalho de Melo
From: Ravi Bangoria We use syscall.tbl to generate system call table on powerpc. The unistd.h copy is no longer required now. Remove it. Signed-off-by: Ravi Bangoria Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/20190110

Re: [PATCH 07/15] ARM: add kexec_file_load system call number

2019-01-10 Thread Arnd Bergmann
On Thu, Jan 10, 2019 at 5:39 PM Will Deacon wrote: > > > diff --git a/arch/arm64/include/asm/unistd32.h > > b/arch/arm64/include/asm/unistd32.h > > index 355fe2bc035b..19f3f58b6146 100644 > > --- a/arch/arm64/include/asm/unistd32.h > > +++ b/arch/arm64/include/asm/unistd32.h > > @@ -823,6 +823,8

[PATCH 02/11] time: Add struct __kernel_timex

2019-01-10 Thread Arnd Bergmann
From: Deepa Dinamani struct timex uses struct timeval internally. struct timeval is not y2038 safe. Introduce a new UAPI type struct __kernel_timex that is y2038 safe. struct __kernel_timex uses a timeval type that is similar to struct __kernel_timespec which preserves the same structure size ac

[PATCH 04/11] sparc64: add custom adjtimex/clock_adjtime functions

2019-01-10 Thread Arnd Bergmann
sparc64 is the only architecture on Linux that has a 'timeval' definition with a 32-bit tv_usec but a 64-bit tv_sec. This causes problems for sparc32 compat mode when we convert it to use the new __kernel_timex type that has the same layout as all other 64-bit architectures. To avoid adding sparc6

[PATCH 03/11] time: fix sys_timer_settime prototype

2019-01-10 Thread Arnd Bergmann
A small typo has crept into the y2038 conversion of the timer_settime system call. So far this was completely harmless, but once we start using the new version, this has to be fixed. Fixes: 6ff847350702 ("time: Change types to new y2038 safe __kernel_itimerspec") Signed-off-by: Arnd Bergmann ---

[PATCH 08/11] y2038: use time32 syscall names on 32-bit

2019-01-10 Thread Arnd Bergmann
This is the big flip, where all 32-bit architectures set COMPAT_32BIT_TIME abd use the _time32 system calls from the former compat layer instead of the system calls that take __kernel_timespec and similar arguments. The temporary redirects for __kernel_timespec, __kernel_itimerspec and __kernel_ti

[PATCH 05/11] timex: use __kernel_timex internally

2019-01-10 Thread Arnd Bergmann
From: Deepa Dinamani struct timex is not y2038 safe. Replace all uses of timex with y2038 safe __kernel_timex. Note that struct __kernel_timex is an ABI interface definition. We could define a new structure based on __kernel_timex that is only available internally instead. Right now, there isn't

[PATCH 01/11] time: make adjtime compat handling available for 32 bit

2019-01-10 Thread Arnd Bergmann
We want to reuse the compat_timex handling on 32-bit architectures the same way we are using the compat handling for timespec when moving to 64-bit time_t. Move all definitions related to compat_timex out of the compat code into the normal timekeeping code, along with a rename to old_timex32, corr

[PATCH 07/11] y2038: syscalls: rename y2038 compat syscalls

2019-01-10 Thread Arnd Bergmann
A lot of system calls that pass a time_t somewhere have an implementation using a COMPAT_SYSCALL_DEFINEx() on 64-bit architectures, and have been reworked so that this implementation can now be used on 32-bit architectures as well. The missing step is to redefine them using the regular SYSCALL_DEF

[PATCH 06/11] timex: change syscalls to use struct __kernel_timex

2019-01-10 Thread Arnd Bergmann
From: Deepa Dinamani struct timex is not y2038 safe. Switch all the syscall apis to use y2038 safe __kernel_timex. Note that sys_adjtimex() does not have a y2038 safe solution. C libraries can implement it by calling clock_adjtime(CLOCK_REALTIME, ...). Signed-off-by: Deepa Dinamani Signed-off

[PATCH 09/11] y2038: remove struct definition redirects

2019-01-10 Thread Arnd Bergmann
We now use 64-bit time_t on all architectures, so the __kernel_timex, __kernel_timeval and __kernel_timespec redirects can be removed after having served their purpose. This makes it all much less confusing, as the __kernel_* types now always refer to the same layout based on 64-bit time_t across

[PATCH 00/11] y2038: add time64 syscalls

2019-01-10 Thread Arnd Bergmann
This series finally gets us to the point of having system calls with 64-bit time_t on all architectures, after a long time of incremental preparation patches. There was actually one conversion that I missed during the summer, i.e. Deepa's timex series, which I now updated based the 5.0-rc1 changes

[PATCH 11/11] y2038: add 64-bit time_t syscalls to all 32-bit architectures

2019-01-10 Thread Arnd Bergmann
This adds 21 new system calls on each ABI that has 32-bit time_t today. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification. This gets us to the point of being able to safely use a C library that ha

[PATCH 10/11] y2038: rename old time and utime syscalls

2019-01-10 Thread Arnd Bergmann
The time, stime, utime, utimes, and futimesat system calls are only used on older architectures, and we do not provide y2038 safe variants of them, as they are replaced by clock_gettime64, clock_settime64, and utimensat_time64. However, for consistency it seems better to have the 32-bit architectu

Re: [PATCH 00/15] arch: synchronize syscall tables in preparation for y2038

2019-01-10 Thread Geert Uytterhoeven
Hi Arnd, On Thu, Jan 10, 2019 at 6:06 PM Arnd Bergmann wrote: > On Thu, Jan 10, 2019 at 5:59 PM Geert Uytterhoeven > wrote: > > On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann wrote: > > > The system call tables have diverged a bit over the years, and a number > > > of the recent additions never

Re: [PATCH 00/15] arch: synchronize syscall tables in preparation for y2038

2019-01-10 Thread Joseph Myers
On Thu, 10 Jan 2019, Arnd Bergmann wrote: > - Add system calls that have not yet been integrated into all > architectures but that we definitely want there. glibc has a note that alpha lacks statfs64, any plans for that? -- Joseph S. Myers jos...@codesourcery.com

Re: [PATCH 11/15] mips: fix n32 compat_ipc_parse_version

2019-01-10 Thread Paul Burton
Hi Arnd, On Thu, Jan 10, 2019 at 05:24:31PM +0100, Arnd Bergmann wrote: > While reading through the sysvipc implementation, I noticed that the n32 > semctl/shmctl/msgctl system calls behave differently based on whether > o32 support is enabled or not: Without o32, the IPC_64 flag passed by > user

Re: [PATCH] soc: fsl: guts: us devm_kstrdup_const() for RO data

2019-01-10 Thread Li Yang
On Sat, Dec 22, 2018 at 2:02 AM Nicholas Mc Guire wrote: > > On Fri, Dec 21, 2018 at 08:29:56PM -0600, Scott Wood wrote: > > On Fri, 2018-12-07 at 09:22 +0100, Nicholas Mc Guire wrote: > > > devm_kstrdup() may return NULL if internal allocation failed, but > > > as machine is from the device tre

Re: [PATCH] ibmvscsi: use GFP_ATOMIC with dma_alloc_coherent in map_sg_data

2019-01-10 Thread Tyrel Datwyler
On 01/10/2019 07:07 AM, Christoph Hellwig wrote: > On Wed, Jan 09, 2019 at 06:58:56PM -0800, Tyrel Datwyler wrote: >> While mapping DMA for scatter list when a scsi command is queued the >> existing call to dma_alloc_coherent() in our map_sg_data() function >> passes zero for the gfp_flags paramete

Patch series for 4.19 to compile powerpc with Clang

2019-01-10 Thread Nathan Chancellor
Hi Greg and Sasha, Attached is an mbox with a series of patches to allow building the powerpc kernel with Clang. We have been running continuous integration that builds and boots the kernel in QEMU for almost two months now with no regressions. This is on top of 4.19.14, there should be no conflic

Patch series for 4.14 to compile powerpc with Clang

2019-01-10 Thread Nathan Chancellor
Hi Greg and Sasha, Attached is an mbox with a series of patches to allow building the powerpc kernel with Clang. We have been running continuous integration that builds and boots the kernel in QEMU for almost two months now with no regressions. This is on top of 4.14.92, there should be no conflic

Re: [PATCH 14/15] arch: add split IPC system calls where needed

2019-01-10 Thread Heiko Carstens
On Thu, Jan 10, 2019 at 05:24:34PM +0100, Arnd Bergmann wrote: > The IPC system call handling is highly inconsistent across architectures, > some use sys_ipc, some use separate calls, and some use both. We also > have some architectures that require passing IPC_64 in the flags, and > others that s

  1   2   >