Re: [PATCH v2 3/7] soc: qcom: Add GENI based QUP Wrapper driver

2018-01-18 Thread Rajendra Nayak
[].. >> diff --git a/drivers/soc/qcom/qcom-geni-se.c >> b/drivers/soc/qcom/qcom-geni-se.c >> new file mode 100644 >> index 000..3f43582 >> --- /dev/null >> +++ b/drivers/soc/qcom/qcom-geni-se.c >> @@ -0,0 +1,1016 @@ >> +/* >> + * Copyright (c) 2017-2018, The Linux Foundation. All rights reser

Re: Protecting code integrity with PGP (kernel developer version)

2018-01-18 Thread Jani Nikula
On Thu, 11 Jan 2018, Konstantin Ryabitsev wrote: > On Wed, Jan 10, 2018 at 02:05:16PM -0700, Jonathan Corbet wrote: >>> Does such document belong with the rest of the kernel docs in the >>> tree, >>> or should it remain fully external? I'll be happy to port it to RST if >>> you think it should l

[PATCH] acpi, spcr: Make SPCR available to x86

2018-01-18 Thread Prarit Bhargava
Note on testing: I've tested this on several ARM64 and x86 boxes (only earlycon, console=ttyS0,115200, and with both options), verified that functionality on ARM64 has not changed (ie, CONFIG_ACPI_SPCR_TABLE is always =y), and verified functionality when !CONFIG_ACPI_SPCR_TABLE on x86. P. 8<

Re: [PATCH v2 3/7] soc: qcom: Add GENI based QUP Wrapper driver

2018-01-18 Thread Bjorn Andersson
On Thu 18 Jan 01:13 PST 2018, Rajendra Nayak wrote: > [].. > > >> diff --git a/drivers/soc/qcom/qcom-geni-se.c > >> b/drivers/soc/qcom/qcom-geni-se.c > >> new file mode 100644 > >> index 000..3f43582 > >> --- /dev/null > >> +++ b/drivers/soc/qcom/qcom-geni-se.c > >> @@ -0,0 +1,1016 @@ > >> +

Re: Protecting code integrity with PGP (kernel developer version)

2018-01-18 Thread Randy Dunlap
On 01/18/2018 06:09 AM, Jani Nikula wrote: > On Thu, 11 Jan 2018, Konstantin Ryabitsev > wrote: >> On Wed, Jan 10, 2018 at 02:05:16PM -0700, Jonathan Corbet wrote: Does such document belong with the rest of the kernel docs in the tree, or should it remain fully external? I'll be h

[PATCHv2 1/5] Documentation/pktgen: Clearify how-to use pktgen samples

2018-01-18 Thread Dmitry Safonov
o Change process name in ps output: looks like, these days the process is named kpktgend_, rather than pktgen/. o Use pg_ctrl for start/stop as it can work well with pgset without changes to $(PGDEV) variable. o Clarify a bit needed $(PGDEV) definition for sample scripts and that one needs to

[PATCHv2 0/5] pktgen: Behavior flags fixes

2018-01-18 Thread Dmitry Safonov
v2: o fixed a nitpick from David Miller There are a bunch of fixes/cleanups/Documentations. Diffstat says for itself, regardless added docs and missed flag parameters. Cc: Arnd Bergmann Cc: "David S. Miller" Cc: David Windsor Cc: Eric Dumazet Cc: Ingo Molnar Cc: Johannes Berg Cc: Mark Rut

Re: [PATCH v2 7/7] tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP

2018-01-18 Thread Bjorn Andersson
On Fri 12 Jan 17:05 PST 2018, Karthikeyan Ramasubramanian wrote: > This driver supports GENI based UART Controller in the Qualcomm SOCs. The > Qualcomm Generic Interface (GENI) is a programmable module supporting a > wide range of serial interfaces including UART. This driver support console > ope

[RESEND PATCH] Documentation: input: ff: fix small typos

2018-01-18 Thread Jean-François Têtu
Fix small typos in the Instructions and Uploading sections. Fix a typo in the start/stop effect example usage code. Signed-off-by: Jean-François Têtu --- Documentation/input/ff.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/input/ff.rst b/Documentatio

[PATCH v10 03/27] powerpc: initial pkey plumbing

2018-01-18 Thread Ram Pai
Basic plumbing to initialize the pkey system. Nothing is enabled yet. A later patch will enable it once all the infrastructure is in place. Signed-off-by: Ram Pai --- arch/powerpc/Kconfig | 15 + arch/powerpc/include/asm/mmu_context.h |1 + arch/powerpc/in

[PATCH v10 01/27] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled

2018-01-18 Thread Ram Pai
VM_PKEY_BITx are defined only if CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is enabled. Powerpc also needs these bits. Hence lets define the VM_PKEY_BITx bits for any architecture that enables CONFIG_ARCH_HAS_PKEYS. Signed-off-by: Ram Pai --- fs/proc/task_mmu.c |4 ++-- include/linux/mm.h |

[PATCH v10 02/27] mm, powerpc, x86: introduce an additional vma bit for powerpc pkey

2018-01-18 Thread Ram Pai
Currently only 4bits are allocated in the vma flags to hold 16 keys. This is sufficient for x86. PowerPC supports 32 keys, which needs 5bits. This patch allocates an additional bit. Acked-by: Balbir Singh Signed-off-by: Ram Pai --- fs/proc/task_mmu.c |1 + include/linux/mm.h |3 ++-

[PATCH v10 04/27] powerpc: track allocation status of all pkeys

2018-01-18 Thread Ram Pai
Total 32 keys are available on power7 and above. However pkey 0,1 are reserved. So effectively we have 30 pkeys. On 4K kernels, we do not have 5 bits in the PTE to represent all the keys; we only have 3bits.Two of those keys are reserved; pkey 0 and pkey 1. So effectively we have 6 pkeys

[PATCH v10 00/27] powerpc, mm: Memory Protection Keys

2018-01-18 Thread Ram Pai
Memory protection keys enable applications to protect its address space from inadvertent access from or corruption by itself. These patches along with the pte-bit freeing patch series enables the protection key feature on powerpc; 4k and 64k hashpage kernels. Will send the documentation and selft

[PATCH v10 07/27] powerpc: cleanup AMR, IAMR when a key is allocated or freed

2018-01-18 Thread Ram Pai
Cleanup the bits corresponding to a key in the AMR, and IAMR register, when the key is newly allocated/activated or is freed. We dont want some residual bits cause the hardware enforce unintended behavior when the key is activated or freed. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Ram Pa

[PATCH v10 19/27] powerpc: Handle exceptions caused by pkey violation

2018-01-18 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. The CPU will detect the key fault if the HPTE is already programmed with the key. However if the HPTE is not hashed, a key fault will not be detected by the hardware. The software will detect pkey violation in such a case.

[PATCH v10 06/27] powerpc: helper functions to initialize AMR, IAMR and UAMOR registers

2018-01-18 Thread Ram Pai
Introduce helper functions that can initialize the bits in the AMR, IAMR and UAMOR register; the bits that correspond to the given pkey. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Ram Pai --- arch/powerpc/mm/pkeys.c | 47 +++ 1 files changed

[PATCH v10 20/27] powerpc: introduce get_mm_addr_key() helper

2018-01-18 Thread Ram Pai
get_mm_addr_key() helper returns the pkey associated with an address corresponding to a given mm_struct. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu.h |9 + arch/powerpc/mm/hash_utils_64.c | 24 2 files changed, 33 insertions(+), 0 deletions(-)

[PATCH v10 18/27] powerpc: implementation for arch_vma_access_permitted()

2018-01-18 Thread Ram Pai
This patch provides the implementation for arch_vma_access_permitted(). Returns true if the requested access is allowed by pkey associated with the vma. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h |5 +++- arch/powerpc/mm/pkeys.c| 34 ++

[PATCH v10 27/27] mm: display pkey in smaps if arch_pkeys_enabled() is true

2018-01-18 Thread Ram Pai
Currently the architecture specific code is expected to display the protection keys in smap for a given vma. This can lead to redundant code and possibly to divergent formats in which the key gets displayed. This patch changes the implementation. It displays the pkey only if the archite

[PATCH v10 25/27] powerpc: sys_pkey_mprotect() system call

2018-01-18 Thread Ram Pai
Patch provides the ability for a process to associate a pkey with a address range. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/systbl.h |1 + arch/powerpc/include/asm/unistd.h |4 +--- arch/powerpc/include/uapi/asm/unistd.h |1 + 3 files changed, 3 insertions(+), 3

[PATCH v10 26/27] mm, x86 : introduce arch_pkeys_enabled()

2018-01-18 Thread Ram Pai
Arch neutral code needs to know if the architecture supports protection keys to display protection key in smaps. Hence introducing arch_pkeys_enabled(). This patch also provides x86 implementation for arch_pkeys_enabled(). Signed-off-by: Ram Pai --- arch/x86/include/asm/pkeys.h |1 + arc

[PATCH v10 17/27] powerpc: check key protection for user page access

2018-01-18 Thread Ram Pai
Make sure that the kernel does not access user pages without checking their key-protection. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/pgtab

[PATCH v10 24/27] powerpc: sys_pkey_alloc() and sys_pkey_free() system calls

2018-01-18 Thread Ram Pai
Finally this patch provides the ability for a process to allocate and free a protection key. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/systbl.h |2 ++ arch/powerpc/include/asm/unistd.h |4 +--- arch/powerpc/include/uapi/asm/unistd.h |2 ++ 3 files changed, 5 inser

[PATCH v10 22/27] powerpc/ptrace: Add memory protection key regset

2018-01-18 Thread Ram Pai
From: Thiago Jung Bauermann The AMR/IAMR/UAMOR are part of the program context. Allow it to be accessed via ptrace and through core files. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/pkeys.h|5 +++ arch/powerpc/include/uapi/asm/elf.h |1

[PATCH v10 15/27] powerpc: Program HPTE key protection bits

2018-01-18 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creating HPTE entries. Acked-by: Balbir Singh Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h |5 + arch/powerpc/include/asm/mmu_context.h|6 ++ arch/powerpc/include/asm/pkey

[PATCH v10 23/27] powerpc: Enable pkey subsystem

2018-01-18 Thread Ram Pai
PAPR defines 'ibm,processor-storage-keys' property. It exports two values. The first value holds the number of data-access keys and the second holds the number of instruction-access keys. Due to a bug in the firmware, instruction-access keys is always reported as zero. However any key can be

[PATCH v10 09/27] powerpc: ability to create execute-disabled pkeys

2018-01-18 Thread Ram Pai
powerpc has hardware support to disable execute on a pkey. This patch enables the ability to create execute-disabled keys. Signed-off-by: Ram Pai --- arch/powerpc/include/uapi/asm/mman.h |6 ++ arch/powerpc/mm/pkeys.c | 16 2 files changed, 22 insertions(+

[PATCH v10 14/27] powerpc: map vma key-protection bits to pte key bits.

2018-01-18 Thread Ram Pai
Map the key protection bits of the vma to the pkey bits in the PTE. The PTE bits used for pkey are 3,4,5,6 and 57. The first four bits are the same four bits that were freed up initially in this patch series. remember? :-) Without those four bits this patch wouldn't be possible. BUT, o

[PATCH v10 21/27] powerpc: Deliver SEGV signal on pkey violation

2018-01-18 Thread Ram Pai
The value of the pkey, whose protection got violated, is made available in si_pkey field of the siginfo structure. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/bug.h |1 + arch/powerpc/kernel/traps.c| 12 +++- arch/powerpc/mm/fault.c

[PATCH v10 16/27] powerpc: helper to validate key-access permissions of a pte

2018-01-18 Thread Ram Pai
helper function that checks if the read/write/execute is allowed on the pte. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h |4 +++ arch/powerpc/include/asm/pkeys.h |9 arch/powerpc/mm/pkeys.c | 28 +

[PATCH v10 12/27] powerpc: ability to associate pkey to a vma

2018-01-18 Thread Ram Pai
arch-independent code expects the arch to map a pkey into the vma's protection bit setting. The patch provides that ability. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mman.h |7 ++- arch/powerpc/include/asm/pkeys.h | 11 +++ arch/powerpc/mm/pkeys.c |8

[PATCH v10 05/27] powerpc: helper function to read,write AMR,IAMR,UAMOR registers

2018-01-18 Thread Ram Pai
Implements helper functions to read and write the key related registers; AMR, IAMR, UAMOR. AMR register tracks the read,write permission of a key IAMR register tracks the execute permission of a key UAMOR register enables and disables a key Acked-by: Balbir Singh Reviewed-by: Thiago Jung Bauerma

[PATCH v10 13/27] powerpc: implementation for arch_override_mprotect_pkey()

2018-01-18 Thread Ram Pai
arch independent code calls arch_override_mprotect_pkey() to return a pkey that best matches the requested protection. This patch provides the implementation. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h |5 arch/powerpc/include/asm/pkeys.h | 21 +++

[PATCH v10 08/27] powerpc: implementation for arch_set_user_pkey_access()

2018-01-18 Thread Ram Pai
This patch provides the detailed implementation for a user to allocate a key and enable it in the hardware. It provides the plumbing, but it cannot be used till the system call is implemented. The next patch will do so. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Ram Pai --- arch/powerp

[PATCH v10 10/27] powerpc: store and restore the pkey state across context switches

2018-01-18 Thread Ram Pai
Store and restore the AMR, IAMR and UAMOR register state of the task before scheduling out and after scheduling in, respectively. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h |3 ++ arch/powerpc/include/asm/pkeys.h |4 ++ arch/powerpc/include/asm/processor.h

[PATCH v10 11/27] powerpc: introduce execute-only pkey

2018-01-18 Thread Ram Pai
This patch provides the implementation of execute-only pkey. The architecture-independent layer expects the arch-dependent layer, to support the ability to create and enable a special key which has execute-only permission. Acked-by: Balbir Singh Signed-off-by: Ram Pai --- arch/powerpc/include/a

[RESEND PATCH v8 5/5] document: add document for kaslr_mem

2018-01-18 Thread Chao Fan
Cc: linux-doc@vger.kernel.org Cc: Jonathan Corbet Cc: Randy Dunlap Signed-off-by: Chao Fan --- Documentation/admin-guide/kernel-parameters.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-para

Re: [PATCH v2 7/7] tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP

2018-01-18 Thread Bjorn Andersson
On Fri 12 Jan 17:05 PST 2018, Karthikeyan Ramasubramanian wrote: > This driver supports GENI based UART Controller in the Qualcomm SOCs. The > Qualcomm Generic Interface (GENI) is a programmable module supporting a > wide range of serial interfaces including UART. This driver support console > ope