Re: [PATCH v9 3/7] acpi: apei: Add SEI notification type support for ARMv8

2018-01-22 Thread James Morse
Hi Dongjiu Geng, (versions of patches 1,2 and 4 have been queued by Catalin) (Nit 'ACPI / APEI:' is the normal subject prefix for ghes.c, this helps the maintainers know which patches they need to pay attention to when you are touching multiple trees) On 06/01/18 16:02, Dongjiu Geng wrote: >

Re: [PATCH v8 7/7] arm64: kvm: handle SError Interrupt by categorization

2018-01-22 Thread James Morse
Hi gengdongjiu, On 16/12/17 03:44, gengdongjiu wrote: > On 2017/12/16 2:52, James Morse wrote: >>> signal, it will record the CPER and trigger a IRQ to notify guest, as shown >>> below: >>> >>> SIGBUS_MCEERR_AR trigger Synchronous External Abort. >>> SIGBUS_MCEERR_AO trigger GPIO IRQ. >>> >>>

Re: [PATCH v8 7/7] arm64: kvm: handle SError Interrupt by categorization

2018-01-22 Thread James Morse
Hi gengdongjiu, On 21/01/18 02:45, gengdongjiu wrote: > For the ESR_ELx_AET_UER, this exception is precise, closing the VM may > be better[1]. > But if you think panic is better until we support kernel-first, it is > also OK to me. I'm not convinced SError while a guest was running means only

[PATCH v10 03/24] selftests/vm: move generic definitions to header file

2018-01-22 Thread Ram Pai
Moved all the generic definition and helper functions to the header file Signed-off-by: Ram Pai --- tools/testing/selftests/vm/pkey-helpers.h| 62 ++-- tools/testing/selftests/vm/protection_keys.c | 66 -- 2 files changed,

[PATCH v10 02/24] selftests/vm: rename all references to pkru to a generic name

2018-01-22 Thread Ram Pai
some pkru references are named to pkey_reg and some prku references are renamed to pkey Signed-off-by: Ram Pai --- tools/testing/selftests/vm/pkey-helpers.h| 85 +- tools/testing/selftests/vm/protection_keys.c | 227 ++ 2 files

[PATCH v10 04/24] selftests/vm: typecast the pkey register

2018-01-22 Thread Ram Pai
This is in preparation to accomadate a differing size register across architectures. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/pkey-helpers.h| 27 +- tools/testing/selftests/vm/protection_keys.c | 69 ++ 2 files changed,

[PATCH v10 01/24] selftests/x86: Move protecton key selftest to arch neutral directory

2018-01-22 Thread Ram Pai
Signed-off-by: Ram Pai --- tools/testing/selftests/vm/Makefile |1 + tools/testing/selftests/vm/pkey-helpers.h | 223 tools/testing/selftests/vm/protection_keys.c | 1407 + tools/testing/selftests/x86/Makefile |2

[PATCH v10 07/24] selftests/vm: fixed bugs in pkey_disable_clear()

2018-01-22 Thread Ram Pai
instead of clearing the bits, pkey_disable_clear() was setting the bits. Fixed it. Also fixed a wrong assertion in that function. When bits are cleared, the resulting bit value will be less than the original. Signed-off-by: Ram Pai ---

[PATCH v10 08/24] selftests/vm: clear the bits in shadow reg when a pkey is freed.

2018-01-22 Thread Ram Pai
When a key is freed, the key is no more effective. Clear the bits corresponding to the pkey in the shadow register. Otherwise it will carry some spurious bits which can trigger false-positive asserts. Signed-off-by: Ram Pai ---

[PATCH v10 05/24] selftests/vm: generic function to handle shadow key register

2018-01-22 Thread Ram Pai
helper functions to handler shadow pkey register Signed-off-by: Ram Pai --- tools/testing/selftests/vm/pkey-helpers.h| 27 tools/testing/selftests/vm/protection_keys.c | 34 - 2 files changed, 49 insertions(+), 12

[PATCH v10 06/24] selftests/vm: fix the wrong assert in pkey_disable_set()

2018-01-22 Thread Ram Pai
If the flag is 0, no bits will be set. Hence we cant expect the resulting bitmap to have a higher value than what it was earlier. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH v10 11/24] selftests/vm: pkey register should match shadow pkey

2018-01-22 Thread Ram Pai
expected_pkey_fault() is comparing the contents of pkey register with 0. This may not be true all the time. There could be bits set by default by the architecture which can never be changed. Hence compare the value against shadow pkey register, which is supposed to track the bits accurately all

[PATCH v10 09/24] selftests/vm: fix alloc_random_pkey() to make it really random

2018-01-22 Thread Ram Pai
alloc_random_pkey() was allocating the same pkey every time. Not all pkeys were geting tested. fixed it. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git

[PATCH v10 12/24] selftests/vm: generic cleanup

2018-01-22 Thread Ram Pai
cleanup the code to satisfy coding styles. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 81 ++ 1 files changed, 43 insertions(+), 38 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c

[PATCH v10 10/24] selftests/vm: introduce two arch independent abstraction

2018-01-22 Thread Ram Pai
open_hugepage_file() <- opens the huge page file get_start_key() <-- provides the first non-reserved key. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/pkey-helpers.h| 11 +++ tools/testing/selftests/vm/protection_keys.c |6 +++--- 2 files

[PATCH v10 13/24] selftests/vm: powerpc implementation for generic abstraction

2018-01-22 Thread Ram Pai
Introduce powerpc implementation for the different abstactions. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/pkey-helpers.h| 109 ++ tools/testing/selftests/vm/protection_keys.c | 40 ++ 2 files changed, 118 insertions(+), 31

[PATCH v10 14/24] selftests/vm: clear the bits in shadow reg when a pkey is freed.

2018-01-22 Thread Ram Pai
When a key is freed, the key is no more effective. Clear the bits corresponding to the pkey in the shadow register. Otherwise it will carry some spurious bits which can trigger false-positive asserts. Signed-off-by: Ram Pai ---

[PATCH v10 16/24] selftests/vm: fix an assertion in test_pkey_alloc_exhaust()

2018-01-22 Thread Ram Pai
The maximum number of keys that can be allocated has to take into consideration, that some keys are reserved by the architecture for specific purpose. Hence cannot be allocated. Fix the assertion in test_pkey_alloc_exhaust() Signed-off-by: Ram Pai ---

[PATCH v10 17/24] selftests/vm: associate key on a mapped page and detect access violation

2018-01-22 Thread Ram Pai
detect access-violation on a page to which access-disabled key is associated much after the page is mapped. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git

[PATCH v10 18/24] selftests/vm: associate key on a mapped page and detect write violation

2018-01-22 Thread Ram Pai
detect write-violation on a page to which write-disabled key is associated much after the page is mapped. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git

[PATCH v10 19/24] selftests/vm: detect write violation on a mapped access-denied-key page

2018-01-22 Thread Ram Pai
detect write-violation on a page to which access-disabled key is associated much after the page is mapped. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git

[PATCH v10 24/24] selftests/powerpc: Add core file test for Protection Key register

2018-01-22 Thread Ram Pai
From: Thiago Jung Bauermann This test verifies that the AMR is being written to a process' core file. Signed-off-by: Thiago Jung Bauermann --- tools/testing/selftests/powerpc/ptrace/Makefile|2 +-

[PATCH v10 22/24] selftests/vm: Fix deadlock in protection_keys.c

2018-01-22 Thread Ram Pai
From: Thiago Jung Bauermann The sig_chld() handler calls dprintf2() taking care of setting dprint_in_signal so that sigsafe_printf() won't call printf(). Unfortunately, this precaution is is negated by dprintf_level(), which has a call to fflush(). This function

[PATCH v10 00/24] selftests, powerpc, x86 : Memory Protection Keys

2018-01-22 Thread Ram Pai
Memory protection keys enable applications to protect its address space from inadvertent access from itself. This feature is now enabled on powerpc architecture. The patches move the selftests to arch neutral directory and enhances them. Verified for correctness on powerpc and on x86

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

2018-01-22 Thread Ram Pai
Sorry please ignore this series. It was a duplication mistake. I aborted the send midway, but a few escaped into the cyber. RP On Mon, Jan 22, 2018 at 10:26:29AM -0800, Ram Pai wrote: > Memory protection keys enable applications to protect its > address space from inadvertent access from or

[PATCH v10 0/2] Documentation, powerpc, x86 : Memory Protection Keys

2018-01-22 Thread Ram Pai
Memory protection keys enable applications to protect its address space from inadvertent access from itself. This feature is now enabled on powerpc architecture. The patches moves the documentation to arch neutral directory and captures the latest information. Ram Pai (2): Documentation/x86:

[PATCH v10 1/2] Documentation/x86: Move protecton key documentation to arch neutral directory

2018-01-22 Thread Ram Pai
Since PowerPC and Intel both support memory protection keys, moving the documenation to arch-neutral directory. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 90 + Documentation/x86/protection-keys.txt | 90

[PATCH v10 2/2] Documentation/vm: PowerPC specific updates to memory protection keys

2018-01-22 Thread Ram Pai
Add documentation updates that capture PowerPC specific changes. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 84 + 1 files changed, 63 insertions(+),

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

2018-01-22 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 ++--

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

2018-01-22 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

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

2018-01-22 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 ---

[PATCH v2] Documentation/ABI: update cpuidle sysfs documentationDaniel Lezcano <daniel.lezc...@linaro.org>,

2018-01-22 Thread Aishwarya Pant
Update cpuidle documentation using git logs and existing documentation in Documentation/cpuidle/sysfs.txt. This might be useful for scripting and tracking changes in the ABI. Signed-off-by: Aishwarya Pant --- Change in v2: - Merge cpuidle_sysfs_switch attributes' description

Re: [PATCH v1] Input: docs - use PROPERTY_ENTRY_U32() directly

2018-01-22 Thread Dmitry Torokhov
On Mon, Jan 22, 2018 at 02:54:57PM +0200, Andy Shevchenko wrote: > Instead of using PROPERTY_ENTRY_INTEGER() with explicitly supplied type, > use PROPERTY_ENTRY_U32() dedicated macro. > > It will help modify internals of built-in device properties API. > > No functional change intended. > >

Re: [PATCH] Documentation/ABI: update cpuidle sysfs documentation

2018-01-22 Thread Sudeep Holla
On 22/01/18 16:09, Aishwarya Pant wrote: > Update cpuidle documentation using git logs and existing documentation > in Documentation/cpuidle/sysfs.txt. This might be useful for scripting > and tracking changes in the ABI. > > Signed-off-by: Aishwarya Pant > --- >

[PATCH] Documentation/ABI: update cpuidle sysfs documentation

2018-01-22 Thread Aishwarya Pant
Update cpuidle documentation using git logs and existing documentation in Documentation/cpuidle/sysfs.txt. This might be useful for scripting and tracking changes in the ABI. Signed-off-by: Aishwarya Pant --- Documentation/ABI/testing/sysfs-devices-system-cpu | 79

[PATCH v1] Input: docs - use PROPERTY_ENTRY_U32() directly

2018-01-22 Thread Andy Shevchenko
Instead of using PROPERTY_ENTRY_INTEGER() with explicitly supplied type, use PROPERTY_ENTRY_U32() dedicated macro. It will help modify internals of built-in device properties API. No functional change intended. Signed-off-by: Andy Shevchenko ---