Re: [PATCH 5/6] kmod: preempt on kmod_umh_threads_get()

2017-05-25 Thread Petr Mladek
On Wed 2017-05-24 19:27:38, Dmitry Torokhov wrote: > On Thu, May 25, 2017 at 03:00:17AM +0200, Luis R. Rodriguez wrote: > > On Wed, May 24, 2017 at 05:45:37PM -0700, Dmitry Torokhov wrote: > > > On Thu, May 25, 2017 at 02:14:52AM +0200, Luis R. Rodriguez wrote: > > > > On Fri, May 19, 2017 at 03:27

Re: [PATCH 5/6] kmod: preempt on kmod_umh_threads_get()

2017-05-25 Thread Jessica Yu
+++ Dmitry Torokhov [24/05/17 19:27 -0700]: On Thu, May 25, 2017 at 03:00:17AM +0200, Luis R. Rodriguez wrote: On Wed, May 24, 2017 at 05:45:37PM -0700, Dmitry Torokhov wrote: > On Thu, May 25, 2017 at 02:14:52AM +0200, Luis R. Rodriguez wrote: > > On Fri, May 19, 2017 at 03:27:12PM -0700, Dmitr

Re: [PATCH 5/6] kmod: preempt on kmod_umh_threads_get()

2017-05-25 Thread Luis R. Rodriguez
On Thu, May 25, 2017 at 01:19:31PM +0200, Petr Mladek wrote: > On Wed 2017-05-24 19:27:38, Dmitry Torokhov wrote: > > On Thu, May 25, 2017 at 03:00:17AM +0200, Luis R. Rodriguez wrote: > > > On Wed, May 24, 2017 at 05:45:37PM -0700, Dmitry Torokhov wrote: > > > > On Thu, May 25, 2017 at 02:14:52AM

Re: [RFC PATCH] mm, oom: cgroup-aware OOM-killer

2017-05-25 Thread Michal Hocko
On Tue 23-05-17 09:25:44, Johannes Weiner wrote: > On Tue, May 23, 2017 at 09:07:47AM +0200, Michal Hocko wrote: > > On Mon 22-05-17 18:01:16, Roman Gushchin wrote: [...] > > > How to react on an OOM - is definitely a policy, which depends > > > on the workload. Nothing is changing here from how it

[PATCH v13 0/9] coresight: enable debug module

2017-05-25 Thread Leo Yan
ARMv8 architecture reference manual (ARM DDI 0487A.k) Chapter H7 "The Sample-based Profiling Extension" has description for sampling registers, we can utilize these registers to check program counter value with combined CPU exception level, secure state, etc. So this is helpful for CPU lockup bugs,

[PATCH v13 5/9] coresight: of_get_coresight_platform_data: Add missing of_node_put

2017-05-25 Thread Leo Yan
From: Suzuki K Poulose The of_get_coresight_platform_data iterates over the possible CPU nodes to find a given cpu phandle. However it does not drop the reference to the node pointer returned by the of_get_coresight_platform_data. This patch also introduces another minor fix is to use of_cpu_dev

[PATCH v13 4/9] MAINTAINERS: update file entries for Coresight subsystem

2017-05-25 Thread Leo Yan
Update document file entries for Coresight debug module. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9e98464..8623d95 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1207,7 +1207,9 @@ L:

[PATCH v13 3/9] doc: Add coresight_cpu_debug.enable to kernel-parameters.txt

2017-05-25 Thread Leo Yan
Add coresight_cpu_debug.enable to kernel-parameters.txt, this flag is used to enable/disable the CPU sampling based debugging. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- Documentation/admin-guide/kernel-parameters.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Docum

[PATCH v13 6/9] coresight: refactor with function of_coresight_get_cpu

2017-05-25 Thread Leo Yan
This is refactor to add function of_coresight_get_cpu(), so it's used to retrieve CPU id for coresight component. Finally can use it as a common function for multiple places. Suggested-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/of_c

[PATCH v13 8/9] arm64: dts: hi6220: register debug module

2017-05-25 Thread Leo Yan
Bind debug module driver for Hi6220. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 64 +++ 1 file changed, 64 insertions(+) diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/

[PATCH v13 7/9] coresight: add support for CPU debug module

2017-05-25 Thread Leo Yan
Coresight includes debug module and usually the module connects with CPU debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has description for related info in "Part H: External Debug". Chapter H7 "The Sample-based Profiling Extension" introduces several sampling registers, e.g. we

[PATCH v13 1/9] coresight: bindings for CPU debug module

2017-05-25 Thread Leo Yan
According to ARMv8 architecture reference manual (ARM DDI 0487A.k) Chapter 'Part H: External debug', the CPU can integrate debug module and it can support self-hosted debug and external debug. Especially for supporting self-hosted debug, this means the program can access the debug module from mmio

[PATCH v13 2/9] doc: Add documentation for Coresight CPU debug

2017-05-25 Thread Leo Yan
Add detailed documentation for Coresight CPU debug driver, which contains the info for driver implementation, Mike Leach excellent summary for "clock and power domain". At the end some examples on how to enable the debugging functionality are provided. Suggested-by: Mike Leach Reviewed-by: Mathie

[PATCH v13 9/9] arm64: dts: qcom: msm8916: Add debug unit

2017-05-25 Thread Leo Yan
Add debug unit on Qualcomm msm8916 based platforms, including the DragonBoard 410c board. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 32 1 file changed, 32 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Luis R. Rodriguez
On Fri, May 19, 2017 at 02:58:29PM -0700, Dmitry Torokhov wrote: > On Fri, May 19, 2017 at 02:45:29PM -0700, Luis R. Rodriguez wrote: > > On May 19, 2017 1:45 PM, "Dmitry Torokhov" > > wrote: > > > > On Thu, May 18, 2017 at 08:24:39PM -0700, Luis R. Rodriguez wrote: > > > We currently statically

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Dmitry Torokhov
On Thu, May 25, 2017 at 06:22:01PM +0200, Luis R. Rodriguez wrote: > On Fri, May 19, 2017 at 02:58:29PM -0700, Dmitry Torokhov wrote: > > On Fri, May 19, 2017 at 02:45:29PM -0700, Luis R. Rodriguez wrote: > > > On May 19, 2017 1:45 PM, "Dmitry Torokhov" > > > wrote: > > > > > > On Thu, May 18, 20

Re: [PATCH 5/6] kmod: preempt on kmod_umh_threads_get()

2017-05-25 Thread Dmitry Torokhov
On Thu, May 25, 2017 at 01:19:31PM +0200, Petr Mladek wrote: > On Wed 2017-05-24 19:27:38, Dmitry Torokhov wrote: > > On Thu, May 25, 2017 at 03:00:17AM +0200, Luis R. Rodriguez wrote: > > > On Wed, May 24, 2017 at 05:45:37PM -0700, Dmitry Torokhov wrote: > > > > On Thu, May 25, 2017 at 02:14:52AM

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Luis R. Rodriguez
On Thu, May 25, 2017 at 9:38 AM, Dmitry Torokhov wrote: > On Thu, May 25, 2017 at 06:22:01PM +0200, Luis R. Rodriguez wrote: >> On Fri, May 19, 2017 at 02:58:29PM -0700, Dmitry Torokhov wrote: >> > On Fri, May 19, 2017 at 02:45:29PM -0700, Luis R. Rodriguez wrote: >> > > On May 19, 2017 1:45 PM, "

Re: [RFC PATCH] mm, oom: cgroup-aware OOM-killer

2017-05-25 Thread Johannes Weiner
On Thu, May 25, 2017 at 05:38:19PM +0200, Michal Hocko wrote: > On Tue 23-05-17 09:25:44, Johannes Weiner wrote: > > On Tue, May 23, 2017 at 09:07:47AM +0200, Michal Hocko wrote: > > > On Mon 22-05-17 18:01:16, Roman Gushchin wrote: > [...] > > > > How to react on an OOM - is definitely a policy, w

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Dmitry Torokhov
On Thu, May 25, 2017 at 09:50:15AM -0700, Luis R. Rodriguez wrote: > On Thu, May 25, 2017 at 9:38 AM, Dmitry Torokhov > wrote: > > On Thu, May 25, 2017 at 06:22:01PM +0200, Luis R. Rodriguez wrote: > >> On Fri, May 19, 2017 at 02:58:29PM -0700, Dmitry Torokhov wrote: > >> > On Fri, May 19, 2017 at

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Luis R. Rodriguez
On Thu, May 25, 2017 at 10:30 AM, Dmitry Torokhov wrote: > On Thu, May 25, 2017 at 09:50:15AM -0700, Luis R. Rodriguez wrote: >> On Thu, May 25, 2017 at 9:38 AM, Dmitry Torokhov >> wrote: >> > On Thu, May 25, 2017 at 06:22:01PM +0200, Luis R. Rodriguez wrote: >> >> On Fri, May 19, 2017 at 02:58:2

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Luis R. Rodriguez
On Thu, May 25, 2017 at 10:38:40AM -0700, Luis R. Rodriguez wrote: > On Thu, May 25, 2017 at 10:30 AM, Dmitry Torokhov > > There is > > no slippery slope for systems to move away, no need to backport > > anything. We seem to agree that a better solution is possible (throttle > > number of concurren

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Dmitry Torokhov
On Thu, May 25, 2017 at 08:06:03PM +0200, Luis R. Rodriguez wrote: > On Thu, May 25, 2017 at 10:38:40AM -0700, Luis R. Rodriguez wrote: > > On Thu, May 25, 2017 at 10:30 AM, Dmitry Torokhov > > > There is > > > no slippery slope for systems to move away, no need to backport > > > anything. We seem

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Luis R. Rodriguez
On Thu, May 25, 2017 at 11:26 AM, Dmitry Torokhov wrote: > On Thu, May 25, 2017 at 08:06:03PM +0200, Luis R. Rodriguez wrote: >> On Thu, May 25, 2017 at 10:38:40AM -0700, Luis R. Rodriguez wrote: >> > On Thu, May 25, 2017 at 10:30 AM, Dmitry Torokhov >> > > There is >> > > no slippery slope for sy

Re: [PATCH 1/6] kmod: add dynamic max concurrent thread count

2017-05-25 Thread Luis R. Rodriguez
On Thu, May 25, 2017 at 12:01 PM, Luis R. Rodriguez wrote: > On Thu, May 25, 2017 at 11:26 AM, Dmitry Torokhov > wrote: >> On Thu, May 25, 2017 at 08:06:03PM +0200, Luis R. Rodriguez wrote: >>> On Thu, May 25, 2017 at 10:38:40AM -0700, Luis R. Rodriguez wrote: >>> > On Thu, May 25, 2017 at 10:30

Re: [PATCH v5 29/32] x86/mm: Add support to encrypt the kernel in-place

2017-05-25 Thread Tom Lendacky
On 5/18/2017 7:46 AM, Borislav Petkov wrote: On Tue, Apr 18, 2017 at 04:21:49PM -0500, Tom Lendacky wrote: Add the support to encrypt the kernel in-place. This is done by creating new page mappings for the kernel - a decrypted write-protected mapping and an encrypted mapping. The kernel is encry

[PATCH v2 0/5] kmod: help make deterministic

2017-05-25 Thread Luis R. Rodriguez
and an or clause was used if I wanted to use copyleft-next. Later based on discussions with Alan and Ted ironed out an "or" language clause to use [3]. All code is also available on my 20170525-kmod-throttle branch of my linux-next tree based on tag next-20170525 [4]. If there are any

[PATCH v2 1/5] module: use list_for_each_entry_rcu() on find_module_all()

2017-05-25 Thread Luis R. Rodriguez
The module list has been using RCU in a lot of other calls for a while now, we just overlooked changing this one over to use RCU. Signed-off-by: Luis R. Rodriguez --- kernel/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/module.c b/kernel/module.c index 38034

[PATCH v2 3/5] kmod: add test driver to stress test the module loader

2017-05-25 Thread Luis R. Rodriguez
This adds a new stress test driver for kmod: the kernel module loader. The new stress test driver, test_kmod, is only enabled as a module right now. It should be possible to load this as built-in and load tests early (refer to the force_init_test module parameter), however since a lot of test can g

[PATCH v2 2/5] kmod: reduce atomic operations on kmod_concurrent

2017-05-25 Thread Luis R. Rodriguez
When checking if we want to allow a kmod thread to kick off we increment, then read to see if we should enable a thread. If we were over the allowed limit limit we decrement. Splitting the increment far apart from decrement means there could be a time where two increments happen potentially giving

[PATCH v2 5/5] kmod: throttle kmod thread limit

2017-05-25 Thread Luis R. Rodriguez
If we reach the limit of modprobe_limit threads running the next request_module() call will fail. The original reason for adding a kill was to do away with possible issues with in old circumstances which would create a recursive series of request_module() calls. We can do better than just be super

[PATCH v2 4/5] kmod: add helpers for getting kmod limit

2017-05-25 Thread Luis R. Rodriguez
This adds helpers for getting access to the kmod limit from userspace. This knob should help userspace more gracefully and deterministically handle module loading. Cc: Tom Gundersen Cc: Petr Mladek Signed-off-by: Luis R. Rodriguez --- Documentation/sysctl/kernel.txt | 20

[PATCH v4 3/6] selftests/seccomp: Force rebuild according to dependencies

2017-05-25 Thread Mickaël Salaün
Rebuild the seccomp tests when kselftest_harness.h is updated. Signed-off-by: Mickaël Salaün Acked-by: Kees Cook Cc: Andy Lutomirski Cc: Shuah Khan Cc: Will Drewry --- tools/testing/selftests/seccomp/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/secco

[PATCH v4 2/6] selftests: Cosmetic renames in kselftest_harness.h

2017-05-25 Thread Mickaël Salaün
Keep the content consistent with the new name. Signed-off-by: Mickaël Salaün Acked-by: Kees Cook Cc: Andy Lutomirski Cc: Shuah Khan Cc: Will Drewry --- tools/testing/selftests/kselftest_harness.h | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/testing/se

[PATCH v4 1/6] selftests: Make test_harness.h more generally available

2017-05-25 Thread Mickaël Salaün
The seccomp/test_harness.h file contains useful helpers to build tests. Moving it to the selftest directory should benefit to other test components. Keep seccomp maintainers for this file. Changes since v1: * rename to kselftest_harness.h (suggested by Shuah Khan) * keep maintainers Signed-off-b

[PATCH v4 4/6] Documentation/dev-tools: Add kselftest

2017-05-25 Thread Mickaël Salaün
Move kselftest.txt to dev-tools/kselftest.rst . Signed-off-by: Mickaël Salaün Acked-by: Kees Cook Cc: Jonathan Corbet Cc: Shuah Khan --- Documentation/00-INDEX | 2 -- Documentation/{kselftest.txt => dev-tools/kselftest.rst} | 0 2 files changed, 2 deletions(

[PATCH v4 6/6] Documentation/dev-tools: Add kselftest_harness documentation

2017-05-25 Thread Mickaël Salaün
Add metadata to kselftest_harness.h to be able to include the comments in the Sphinx documentation. Changes since v3: * document macros as actual functions (suggested by Jonathan Corbet) * remove the TEST_API() wrapper to expose the underlying macro arguments to the documentation tools * move an

[PATCH v4 0/6] Add kselftest_harness.h

2017-05-25 Thread Mickaël Salaün
Hi, This fourth patch series make the seccomp/test_harness.h more generally available [1] and update the kselftest documentation in the Sphinx format. It also improve the Makefile of seccomp tests to take into account any kselftest_harness.h update. [1] https://lkml.kernel.org/r/CAGXu5j+8CVz8vL5

[PATCH v4 5/6] Documentation/dev-tools: Use reStructuredText markups for kselftest

2017-05-25 Thread Mickaël Salaün
Include and convert kselftest to the Sphinx format. Changes since v2: * lighten the modifications (suggested by Kees Cook) Signed-off-by: Mickaël Salaün Acked-by: Kees Cook Cc: Jonathan Corbet Cc: Shuah Khan --- Documentation/dev-tools/index.rst | 1 + Documentation/dev-tools/kselftest.

Re: [PATCH v2 4/5] kmod: add helpers for getting kmod limit

2017-05-25 Thread Dmitry Torokhov
On Thu, May 25, 2017 at 05:16:29PM -0700, Luis R. Rodriguez wrote: > This adds helpers for getting access to the kmod limit from > userspace. This knob should help userspace more gracefully and > deterministically handle module loading. I think more details is needed before we add a new ABI to the

Re: [PATCH v2 2/5] kmod: reduce atomic operations on kmod_concurrent

2017-05-25 Thread Dmitry Torokhov
On Thu, May 25, 2017 at 05:16:27PM -0700, Luis R. Rodriguez wrote: > When checking if we want to allow a kmod thread to kick off we increment, > then read to see if we should enable a thread. If we were over the allowed > limit limit we decrement. Splitting the increment far apart from decrement >

Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory Encryption

2017-05-25 Thread Dave Young
Ccing Xunlei he is reading the patches see what need to be done for kdump. There should still be several places to handle to make kdump work. On 05/18/17 at 07:01pm, Borislav Petkov wrote: > On Tue, Apr 18, 2017 at 04:22:12PM -0500, Tom Lendacky wrote: > > Add sysfs support for SME so that user-sp

Re: [PATCH v4 6/6] Documentation/dev-tools: Add kselftest_harness documentation

2017-05-25 Thread Kees Cook
On Thu, May 25, 2017 at 5:20 PM, Mickaël Salaün wrote: > Add metadata to kselftest_harness.h to be able to include the comments > in the Sphinx documentation. > > Changes since v3: > * document macros as actual functions (suggested by Jonathan Corbet) > * remove the TEST_API() wrapper to expose th

Re: [PATCH v5 28/32] x86/mm, kexec: Allow kexec to be used with SME

2017-05-25 Thread Xunlei Pang
On 04/19/2017 at 05:21 AM, Tom Lendacky wrote: > Provide support so that kexec can be used to boot a kernel when SME is > enabled. > > Support is needed to allocate pages for kexec without encryption. This > is needed in order to be able to reboot in the kernel in the same manner > as originally b

Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory Encryption

2017-05-25 Thread Xunlei Pang
On 05/26/2017 at 10:49 AM, Dave Young wrote: > Ccing Xunlei he is reading the patches see what need to be done for > kdump. There should still be several places to handle to make kdump work. > > On 05/18/17 at 07:01pm, Borislav Petkov wrote: >> On Tue, Apr 18, 2017 at 04:22:12PM -0500, Tom Lendacky