[PATCH v4 1/2] kheaders: Move from proc to sysfs

2019-05-15 Thread Joel Fernandes (Google)
-by: Steven Rostedt Signed-off-by: Joel Fernandes (Google) --- This patch applies on top of the previous patch that was applied to the driver tree: https://lore.kernel.org/patchwork/patch/1067310/ v2->v3: Fixed sysfs file mode nit (Greg). v1->v2: Fixed some kconfig nits (Masami). init/K

[PATCH -manpage 1/2] fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal

2019-03-14 Thread Joel Fernandes (Google)
More details of the seal can be found in the LKML patch: https://lore.kernel.org/lkml/20181120052137.74317-1-j...@joelfernandes.org/T/#t Signed-off-by: Joel Fernandes (Google) --- man2/fcntl.2 | 15 +++ 1 file changed, 15 insertions(+) diff --git a/man2/fcntl.2 b/man2/fcntl.2 index

[PATCH -manpage 0/2]

2019-03-14 Thread Joel Fernandes (Google)
This documentation is for F_SEAL_FUTURE_WRITE patches that are in linux-next. Joel Fernandes (Google) (2): fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal memfd_create.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal man2/fcntl.2| 15 +++ man2

[PATCH -manpage 2/2] memfd_create.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal

2019-03-14 Thread Joel Fernandes (Google)
More details of the seal can be found in the LKML patch: https://lore.kernel.org/lkml/20181120052137.74317-1-j...@joelfernandes.org/T/#t Signed-off-by: Joel Fernandes (Google) --- man2/memfd_create.2 | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/man2

[PATCH v2 1/4] lockdep: Add assertion to check if in an interrupt

2019-03-26 Thread Joel Fernandes (Google)
: kernel-t...@android.com Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- include/linux/lockdep.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index c5335df2372f..d24f564823d3 100644 --- a/include/linux/lockdep.h +++ b

[PATCH v2 3/4] rcutorture: Select from only online CPUs

2019-03-26 Thread Joel Fernandes (Google)
the online CPUs on the system. Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/rcutorture/bin/jitter.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests

[PATCH v2 2/4] rcutree: Add checks for dynticks counters in rcu_is_cpu_rrupt_from_idle

2019-03-26 Thread Joel Fernandes (Google)
chul.p...@lge.com Cc: kernel-t...@android.com Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9180158756d2..dbff8a274c46 100

[PATCH v2 4/4] rcutorture: Add cpu0 to the set of CPUs to add jitter

2019-03-26 Thread Joel Fernandes (Google)
jitter.sh currently does not add CPU0 to the list of CPUs for adding of jitter. Let us add it to this list even when it is not hot-pluggable. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/rcutorture/bin/jitter.sh | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCH] Convert struct pid count to refcount_t

2019-03-27 Thread Joel Fernandes (Google)
...@lists.openwall.com Signed-off-by: Joel Fernandes (Google) --- include/linux/pid.h | 5 +++-- kernel/pid.c| 8 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/linux/pid.h b/include/linux/pid.h index 14a9a39da9c7..8cb86d377ff5 100644 --- a/include/linux/pid.h

[PATCH v3 2/2] Add selftests for module build using in-kernel headers

2019-02-27 Thread Joel Fernandes (Google)
This test tries to build a module successfully using the in-kernel headers found in /proc/kheaders.tar.xz. Verified pass and fail scenarios by running: make -C tools/testing/selftests TARGETS=kheaders run_tests Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/Makefile

[PATCH v3 1/2] Provide in-kernel headers for making it easy to extend the kernel

2019-02-27 Thread Joel Fernandes (Google)
_ST and IKHD_ED markers as is to facilitate future patches that would extract the headers from a kernel or module image. Signed-off-by: Joel Fernandes (Google) --- Changes since v2: (Thanks to Masahiro Yamada for several excellent suggestions) - Added support for out of tree builds. - Ad

[PATCH 1/2] module: Prepare for addition of new ro_after_init sections

2019-04-09 Thread Joel Fernandes (Google)
...@linux.vnet.ibm.com Cc: rost...@goodmis.org Cc: mathieu.desnoy...@efficios.com Cc: r...@vger.kernel.org Cc: kernel-harden...@lists.openwall.com Cc: kernel-t...@android.com Suggested-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 42

[PATCH 2/2] module: Make srcu_struct ptr array as read-only post init

2019-04-09 Thread Joel Fernandes (Google)
f pointers to be writable, and can cause security or other hidden bugs. Mark these are read-only after the module init has completed. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 9 - 1 file changed, 8 insert

[PATCH v2 2/3] module: Make srcu_struct ptr array as read-only post init

2019-04-10 Thread Joel Fernandes (Google)
f pointers to be writable, and can cause security or other hidden bugs. Mark these are read-only after the module init has completed. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Acked-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 10 +++

[PATCH v2 1/3] module: Prepare for addition of new ro_after_init sections

2019-04-10 Thread Joel Fernandes (Google)
...@linux.vnet.ibm.com Cc: rost...@goodmis.org Cc: mathieu.desnoy...@efficios.com Cc: r...@vger.kernel.org Cc: kernel-harden...@lists.openwall.com Cc: kernel-t...@android.com Suggested-by: keesc...@chromium.org Reviewed-by: keesc...@chromium.org Acked-by: rost...@goodmis.org Signed-off-by: Joel Fernandes

[PATCH v2 3/3] module: Make __tracepoints_ptrs as read-only

2019-04-10 Thread Joel Fernandes (Google)
security or other hidden bugs. Mark these as ro_after_init. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Suggested-by: mathieu.desnoy...@efficios.com Cc: rost...@goodmis.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 6 ++ 1 file changed, 6

[PATCH v3 3/3] module: Make __tracepoints_ptrs as read-only

2019-04-10 Thread Joel Fernandes (Google)
security or other hidden bugs. Mark these as ro_after_init. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Suggested-by: mathieu.desnoy...@efficios.com Cc: rost...@goodmis.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 6 ++ 1 file changed, 6

[PATCH v3 1/3] module: Prepare for addition of new ro_after_init sections

2019-04-10 Thread Joel Fernandes (Google)
...@linux.vnet.ibm.com Cc: rost...@goodmis.org Cc: mathieu.desnoy...@efficios.com Cc: r...@vger.kernel.org Cc: kernel-harden...@lists.openwall.com Cc: kernel-t...@android.com Suggested-by: keesc...@chromium.org Reviewed-by: keesc...@chromium.org Acked-by: rost...@goodmis.org Signed-off-by: Joel Fernandes

[PATCH v3 2/3] module: Make srcu_struct ptr array as read-only post init

2019-04-10 Thread Joel Fernandes (Google)
f pointers to be writable, and can cause security or other hidden bugs. Mark these are read-only after the module init has completed. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Acked-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 6

[PATCH RFC 2/2] Add selftests for pidfd polling

2019-04-11 Thread Joel Fernandes (Google)
, then the thread group leader is signaled to exit and is replaced with the execing thread as the new leader, however the parent is not notified in this case. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/pidfd/Makefile | 2 +- tools/testing/selftests/pidfd

[PATCH RFC 1/2] Add polling support to pidfd

2019-04-11 Thread Joel Fernandes (Google)
/lkml/20181029175322.189042-1-dan...@google.com/ Cc: l...@amacapital.net Cc: rost...@goodmis.org Cc: dan...@google.com Cc: christ...@brauner.io Cc: ja...@google.com Cc: sur...@google.com Cc: torva...@linux-foundation.org Co-developed-by: Daniel Colascione Signed-off-by: Joel Fernandes (Google

[PATCH] srcu: Remove unused vmlinux srcu linker entries

2019-04-07 Thread Joel Fernandes (Google)
it is able to find and initialize the srcu structures. Cc: kernel-t...@android.com Cc: paul...@linux.vnet.ibm.com Signed-off-by: Joel Fernandes (Google) --- include/asm-generic/vmlinux.lds.h | 4 1 file changed, 4 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm

[PATCH v2] srcu: Remove unused vmlinux srcu linker entries

2019-04-07 Thread Joel Fernandes (Google)
initialize the srcu structures. Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: kernel-t...@android.com Cc: paul...@linux.vnet.ibm.com Signed-off-by: Joel Fernandes (Google) --- v1->v2: Added more context to change log. include/asm-generic/vmlinux.lds.h | 4

[PATCH v2 0/4] RCU fixes for rcu_assign_pointer() usage

2019-03-20 Thread Joel Fernandes (Google)
added in the series can also help avoid future incorrect usages and bugs so it is a good idea to do in any case. RFC v1 -> Patch v2: Made changes based on Peter Zijlstra review. Joel Fernandes (Google) (4): sched/cpufreq: Annotate cpufreq_update_util_data pointer with __rcu sched_domain: Annot

[PATCH v2 2/4] sched_domain: Annotate RCU pointers properly

2019-03-20 Thread Joel Fernandes (Google)
fair.c:9421:16: error: incompatible types in comparison expression fair.c:9421:16: error: incompatible types in comparison expression [From an RCU perspective] Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- include/linux/sched/topology.h | 4 ++-- kernel/sched/sched.h

[PATCH v2 3/4] rcuwait: Annotate task_struct with __rcu

2019-03-20 Thread Joel Fernandes (Google)
E. McKenney Signed-off-by: Joel Fernandes (Google) --- include/linux/rcuwait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h index 90bfa3279a01..563290fc194f 100644 --- a/include/linux/rcuwait.h +++ b/include/linux/rcuwait.h

[PATCH v2 1/4] sched/cpufreq: Annotate cpufreq_update_util_data pointer with __rcu

2019-03-20 Thread Joel Fernandes (Google)
: error: incompatible types in comparison expression (different address spaces) Fix this by annotating cpufreq_update_util_data pointer with __rcu. This will also help sparse catch any future RCU misuage bugs. [From an RCU perspective] Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes

[PATCH v2 4/4] sched: Annotate perf_domain pointer with __rcu

2019-03-20 Thread Joel Fernandes (Google)
. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/sched/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 2b452d68ab2e..b52ed1ada0be 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -780,7 +780,7

[PATCH] module: Make srcu_struct ptr array as read-only

2019-04-11 Thread Joel Fernandes (Google)
mod); Cc: Rasmus Villemoes Cc: paul...@linux.vnet.ibm.com Cc: rost...@goodmis.org Cc: mathieu.desnoy...@efficios.com Cc: r...@vger.kernel.org Cc: kernel-harden...@lists.openwall.com Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- This single patch superceded the patches at: ht

[RFC 1/2] lockdep: Add assertion to check if in an interrupt

2019-03-22 Thread Joel Fernandes (Google)
: kernel-t...@android.com Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- include/linux/lockdep.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index c5335df2372f..d24f564823d3 100644 --- a/include/linux/lockdep.h +++ b

[RFC 2/2] rcutree: Add checks for dynticks counters in rcu_is_cpu_rrupt_from_idle

2019-03-22 Thread Joel Fernandes (Google)
chul.p...@lge.com Cc: kernel-t...@android.com Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9180158756d2..d94c8ed29f6b 100

[PATCH] rcutorture: Select from only online CPUs

2019-03-22 Thread Joel Fernandes (Google)
the online CPUs on the system. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/rcutorture/bin/jitter.sh | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh

[RFC 2/5] ixgbe: Fix incorrect RCU API usage

2019-02-19 Thread Joel Fernandes (Google)
From: Joel Fernandes Recently, I added an RCU annotation check in rcu_assign_pointer. This caused a sparse error to be reported by the ixgbe driver. Further looking, it seems the adapter->xdp_prog pointer is not annotated with __rcu. Annonating it fixed the error, but caused a bunch of other

[RFC 1/5] net: rtnetlink: Fix incorrect RCU API usage

2019-02-19 Thread Joel Fernandes (Google)
From: Joel Fernandes rtnl_register_internal() and rtnl_unregister_all tries to directly dereference an RCU protected pointed outside RCU read side section. While this is Ok to do since a lock is held, let us use the correct API to avoid programmer bugs in the future. This also fixes sparse

[RFC 0/5] RCU fixes for rcu_assign_pointer usage

2019-02-19 Thread Joel Fernandes (Google)
These patches fix various RCU API usage issues found due to sparse errors as a result of the recent check to add rcu_check_sparse() to rcu_assign_pointer(). This is very early RFC stage, and is only build tested. I am also only sending to the RCU group for initial review before sending to LKML.

[RFC 4/5] sched/toplogy: Use smp_store_release() instead of rcu_assign_pointer

2019-02-19 Thread Joel Fernandes (Google)
From: Joel Fernandes The scheduler's topology code seems to want to use rcu_assign_pointer() to initialize various pointers for no apparent reason. With a guess that what was needed here is smp_store_release(), I am replacing it with that. This suppresses the new sparse errors caused by an

[RFC 3/5] sched/cpufreq: Fix incorrect RCU API usage

2019-02-19 Thread Joel Fernandes (Google)
From: Joel Fernandes Recently I added an RCU annotation check to rcu_assign_pointer(). All pointers assigned to RCU protected data are to be annotated with __rcu inorder to be able to use rcu_assign_pointer() similar to checks in other RCU APIs. This resulted in a sparse error:

[RFC 5/5] rcuwait: Replace rcu_assign_pointer with smp_store_release

2019-02-19 Thread Joel Fernandes (Google)
From: Joel Fernandes This suppresses a sparse error generated to the recently added rcu_assign_pointer sparse check: >> kernel//locking/percpu-rwsem.c:162:9: sparse: error: incompatible types in comparison expression (different address spaces) Signed-off-by: Joel Fernandes ---

[PATCH RFC 0/5] RCU fixes for rcu_assign_pointer() usage

2019-02-20 Thread Joel Fernandes (Google)
time since fixing them is a bit more involved). Joel Fernandes (Google) (5): net: rtnetlink: Fix incorrect RCU API usage ixgbe: Fix incorrect RCU API usage sched/cpufreq: Fix incorrect RCU API usage sched/topology: Annonate RCU pointers properly rcuwait: Replace rcu_assign_pointer() with WRITE_ONCE

[PATCH RFC 2/5] ixgbe: Fix incorrect RCU API usage

2019-02-20 Thread Joel Fernandes (Google)
rea to test it properly. Signed-off-by: Joel Fernandes (Google) --- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 4 ++-- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 - 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgb

[PATCH RFC 4/5] sched/topology: Annonate RCU pointers properly

2019-02-20 Thread Joel Fernandes (Google)
/sched/topology.c:618:9: sparse: error: incompatible types in comparison expression (different address spaces) kernel//sched/topology.c:621:9: sparse: error: incompatible types in comparison expression (different address spaces) Signed-off-by: Joel Fernandes (Google) --- kernel/sched/sched.h

[PATCH RFC 1/5] net: rtnetlink: Fix incorrect RCU API usage

2019-02-20 Thread Joel Fernandes (Google)
not using RCU API. net/core/rtnetlink.c:332:13: warning: incorrect type in assignment (different address spaces) net/core/rtnetlink.c:332:13:expected struct rtnl_link **tab net/core/rtnetlink.c:332:13:got struct rtnl_link *[noderef] * Signed-off-by: Joel Fernandes (Google) --- net/core

[PATCH RFC 3/5] sched/cpufreq: Fix incorrect RCU API usage

2019-02-20 Thread Joel Fernandes (Google)
and replaced with, say, WRITE_ONCE or smp_store_release. Or, may be we add a new API to do it. But calls rcu_assign_pointer seems an abuse of the RCU API unless RCU is being used. Signed-off-by: Joel Fernandes (Google) --- kernel/sched/cpufreq.c | 8 ++-- kernel/sched/sched.h | 2 +- 2 files changed

[PATCH RFC 5/5] rcuwait: Replace rcu_assign_pointer() with WRITE_ONCE

2019-02-20 Thread Joel Fernandes (Google)
ed-off-by: Joel Fernandes (Google) --- include/linux/rcuwait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h index 90bfa3279a01..9e5b4760e6c2 100644 --- a/include/linux/rcuwait.h +++ b/include/linux/rcuwait.h @@ -44,7 +44,7 @@ exter

[PATCH v2 2/6] ixgbe: Fix incorrect RCU API usage

2019-02-22 Thread Joel Fernandes (Google)
rea to review / test it properly. The sparse error fixed is: ixgbe_main.c:10256:25: error: incompatible types in comparison expression Signed-off-by: Joel Fernandes (Google) --- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 4 ++-- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |

[PATCH v2 0/6] RCU fixes for rcu_assign_pointer() usage

2019-02-22 Thread Joel Fernandes (Google)
and bugs so it is a good idea to do in any case. RFC v1 -> Patch v2: Made changes to various scheduler patches (Peter Zijlstra) Joel Fernandes (Google) (6): net: rtnetlink: Fix incorrect RCU API usage ixgbe: Fix incorrect RCU API usage sched/cpufreq: Annotate cpufreq_update_util_data pointer with __

[PATCH v2 3/6] sched/cpufreq: Annotate cpufreq_update_util_data pointer with __rcu

2019-02-22 Thread Joel Fernandes (Google)
: error: incompatible types in comparison expression (different address spaces) Fix this by annotating cpufreq_update_util_data pointer with __rcu. This will also help sparse catch any future RCU misuage bugs. Signed-off-by: Joel Fernandes (Google) --- kernel/sched/cpufreq.c | 2 +- kernel/sched

[PATCH v2 4/6] sched_domain: Annotate RCU pointers properly

2019-02-22 Thread Joel Fernandes (Google)
fair.c:9421:16: error: incompatible types in comparison expression fair.c:9421:16: error: incompatible types in comparison expression Signed-off-by: Joel Fernandes (Google) --- include/linux/sched/topology.h | 4 ++-- kernel/sched/sched.h | 14 +++--- kernel/sched/topology.c

[PATCH v2 5/6] rcuwait: Annotate task_struct with __rcu

2019-02-22 Thread Joel Fernandes (Google)
This suppresses sparse error generated due to the recently added rcu_assign_pointer sparse check. percpu-rwsem.c:162:9: sparse: error: incompatible types in comparison expression exit.c:316:16: sparse: error: incompatible types in comparison expression Signed-off-by: Joel Fernandes (Google

[PATCH v2 6/6] sched: Annotate perf_domain pointer with __rcu

2019-02-22 Thread Joel Fernandes (Google)
This fixes the following sparse errors in sched/fair.c: fair.c:6506:14: error: incompatible types in comparison expression fair.c:8642:21: error: incompatible types in comparison expression Using __rcu will also help sparse catch any future bugs. Signed-off-by: Joel Fernandes (Google

[PATCH v2 1/6] net: rtnetlink: Fix incorrect RCU API usage

2019-02-22 Thread Joel Fernandes (Google)
not using RCU API. net/core/rtnetlink.c:332:13: warning: incorrect type in assignment (different address spaces) net/core/rtnetlink.c:332:13:expected struct rtnl_link **tab net/core/rtnetlink.c:332:13:got struct rtnl_link *[noderef] * Signed-off-by: Joel Fernandes (Google) --- net/core

[PATCH v4 2/2] Add selftests for module build using in-kernel headers

2019-03-01 Thread Joel Fernandes (Google)
This test tries to build a module successfully using the in-kernel headers found in /proc/kheaders.tar.xz. Verified pass and fail scenarios by running: make -C tools/testing/selftests TARGETS=kheaders run_tests Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/Makefile

[PATCH v4 1/2] Provide in-kernel headers for making it easy to extend the kernel

2019-03-01 Thread Joel Fernandes (Google)
rom a kernel or module image. Signed-off-by: Joel Fernandes (Google) --- Changes since v3: - Blank tar was being generated because of a one line I forgot to push. It is updated now. - Added module.lds since arm64 needs it to build modules. Changes since v2: (Tha

[PATCH v2 1/2] Provide in-kernel headers for making it easy to extend the kernel

2019-02-11 Thread Joel Fernandes (Google)
-xvf /proc/kheaders.txz -C $HOME/headers >/dev/null cd my-kernel-module make -C $HOME/headers M=$(pwd) modules rmmod kheaders Signed-off-by: Joel Fernandes (Google) --- Changes since v1: - removed IKH_EXTRA variable, not needed (Masahiro Yamada) - small fix ups to selftest - added tar

[PATCH v2 2/2] Add selftests for module build using in-kernel headers

2019-02-11 Thread Joel Fernandes (Google)
This test tries to build a module successfully using the in-kernel headers found in /proc/kheaders.txz. Verified pass and fail scenarios by running: make -C tools/testing/selftests TARGETS=kheaders run_tests Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/Makefile

[RFC] rcu: Avoid unnecessary softirq when system is idle

2019-01-19 Thread Joel Fernandes (Google)
Fernandes (Google) --- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9180158756d2..96ad80c76b15 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2273,6 +2273,7 @@ rcu_report_qs_rdp(int cpu, struct rcu_data *rdp

[PATCH RFC v2 0/3] cleanups for pstore and ramoops

2018-11-03 Thread Joel Fernandes (Google)
Here are some simple cleanups and fixes for ramoops in pstore. Let me know what you think, thanks. Joel Fernandes (Google) (3): pstore: map pstore types to names pstore: simplify ramoops_get_next_prz arguments pstore: donot treat empty buffers as valid fs/pstore/inode.c | 53

[PATCH RFC v2 1/3] pstore: map pstore types to names

2018-11-03 Thread Joel Fernandes (Google)
In later patches we will need to map types to names, so create a table for that which can also be used and reused in different parts of old and new code. Also use it to save the type in the PRZ which will be useful in later patches. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/inode.c

[PATCH RFC v2 3/3] pstore: donot treat empty buffers as valid

2018-11-03 Thread Joel Fernandes (Google)
like: found existing buffer, size 0, start 0 When I was expecting: no valid data in buffer (sig = ...) Signed-off-by: Joel Fernandes (Google) --- Note that if you feel this patch is not necessary, then feel free to drop it. I would say it is harmless and is a good clean up. fs/pstore/ram_core.c

[PATCH RFC v2 2/3] pstore: simplify ramoops_get_next_prz arguments

2018-11-03 Thread Joel Fernandes (Google)
hed into a single patch to reduce fixup conflicts. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/ram.c | 48 ++-- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index b174d0fc009f..202eaa82bcc6 100

[PATCH v3 resend 1/2] mm: Add an F_SEAL_FUTURE_WRITE seal to memfd

2018-11-07 Thread Joel Fernandes (Google)
write passed as expected future-write seal now active write failed as expected due to future-write seal map 2 prot-write failed as expected due to seal : Permission denied map 3 prot-read passed as expected Cc: jr...@google.com Cc: john.stu...@linaro.org Cc: tk...@google.com Cc: gre...@linuxf

[PATCH v3 resend 2/2] selftests/memfd: Add tests for F_SEAL_FUTURE_WRITE seal

2018-11-07 Thread Joel Fernandes (Google)
Add tests to verify sealing memfds with the F_SEAL_FUTURE_WRITE works as expected. Cc: dan...@google.com Cc: minc...@kernel.org Reviewed-by: John Stultz Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/memfd/memfd_test.c | 74 ++ 1 file changed, 74

[PATCH 2/7] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET When in cyclic mode, the configuration is updated after having started the DMA hardware (STM32_DMA_SCR_EN) leading to incomplete configuration of SMxAR registers. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Hugues Fruchet Signed-off-by: Vinod Koul ---

[PATCH 0/7] NULL pointer deref fix for stm32-dma

2018-10-08 Thread Joel Fernandes (Google)
Hi Greg, While looking at android-4.14, I found a NULL pointer deref with stm32-dma driver using Coccicheck errors. I found that upstream had a bunch of patches on stm32-dma that have fixed this and other issues, I applied these patches cleanly onto Android 4.14. I believe these should goto

[PATCH 1/7] dmaengine: stm32-dma: threshold manages with bitfield feature

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET >From now on, DMA bitfield is to manage DMA FIFO Threshold. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Vinod Koul --- drivers/dma/stm32-dma.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/dma/stm32-dma.c

[PATCH 3/7] dmaengine: stm32-dma: fix typo and reported checkpatch warnings

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET Fix typo in a comment and solved reported checkpatch warnings. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Vinod Koul --- drivers/dma/stm32-dma.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/dma/stm32-dma.c

[PATCH 5/7] dmaengine: stm32-dma: fix DMA IRQ status handling

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET Update the way Transfer Complete and Half Transfer Complete status are acknowledge. Even if HTI is not enabled its status is shown when reading registers, driver has to clear it gently and not raise an error. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Vinod

[PATCH 4/7] dmaengine: stm32-dma: Improve memory burst management

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET This patch improves memory burst capability using best burst size according to transferred buffer size from/to memory. >From now on, memory burst is not necessarily same as with peripheral burst one and fifo threshold is directly managed by this driver in order to fit

[PATCH 7/7] dmaengine: stm32-dma: properly mask irq bits

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET A single register of the controller holds the information for four dma channels. The functions stm32_dma_irq_status() don't mask the relevant bits after the shift, thus adjacent channel's status is also reported in the returned value. Fixed by masking the value before

[PATCH 6/7] dmaengine: stm32-dma: fix max items per transfer

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET Having 0 in item counter register is valid and stands for a "No or Ended transfer". Therefore valid transfer starts from @+0 to @+0xFFFE leading to unaligned scatter gather at boundary. Thus it's safer to round down this value on its FIFO size (16 Bytes).

[PATCH] mm: Speed up mremap on large regions

2018-10-09 Thread Joel Fernandes (Google)
and arm64. Cc: minc...@google.com Cc: hu...@google.com Cc: lokeshgi...@google.com Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- mm/mremap.c | 62 + 1 file changed, 62 insertions(+) diff --git a/mm/mremap.c b/mm/mremap.c index

[PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-09 Thread Joel Fernandes (Google)
f the memfd. This is not something we do in Android so it does not affect us, however I have mentioned this behavior of the seal in the manpage. Cc: jr...@google.com Cc: john.stu...@linaro.org Cc: tk...@google.com Cc: gre...@linuxfoundation.org Signed-off-by: Joel Fernandes (Google) --- v1->v

[PATCH v2 2/2] selftests/memfd: Add tests for F_SEAL_FS_WRITE seal

2018-10-09 Thread Joel Fernandes (Google)
Add tests to verify sealing memfds with the F_SEAL_FS_WRITE works as expected. Cc: dan...@google.com Cc: minc...@google.com Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/memfd/memfd_test.c | 51 +- 1 file changed, 50 insertions(+), 1 deletion(-) diff

Re: [RFC v3 1/5] sched/core: add capacity constraints to CPU controller

2017-03-22 Thread Joel Fernandes (Google)
Hi, On Mon, Mar 20, 2017 at 11:08 AM, Patrick Bellasi wrote: > On 20-Mar 13:15, Tejun Heo wrote: >> Hello, >> >> On Tue, Feb 28, 2017 at 02:38:38PM +, Patrick Bellasi wrote: [..] >> > These attributes: >> > a) are tunable at all hierarchy levels, i.e. root group too >> >> This usually is

Re: [RFC v3 1/5] sched/core: add capacity constraints to CPU controller

2017-03-24 Thread Joel Fernandes (Google)
Hi Tejun, >> That's also why the proposed interface has now been defined as a extension of >> the CPU controller in such a way to keep a consistent view. >> >> This controller is already used by run-times like Android to "scope" apps by >> constraining the amount of CPUs resource they are

Re: [RFC v3 1/5] sched/core: add capacity constraints to CPU controller

2017-03-24 Thread Joel Fernandes (Google)
Hi Patrick, On Thu, Mar 23, 2017 at 3:32 AM, Patrick Bellasi wrote: [..] >> > which can be used to defined tunable root constraints when CGroups are >> > not available, and becomes RO when CGroups are. >> > >> > Can this be eventually an acceptable option? >> > >> > In any case I think that this

Re: [RFC v3 5/5] sched/{core,cpufreq_schedutil}: add capacity clamping for RT/DL tasks

2017-03-13 Thread Joel Fernandes (Google)
Hi Patrick, On Tue, Feb 28, 2017 at 6:38 AM, Patrick Bellasi wrote: > Currently schedutil enforce a maximum OPP when RT/DL tasks are RUNNABLE. > Such a mandatory policy can be made more tunable from userspace thus > allowing for example to define a reasonable max capacity (i.e. > frequency)

Re: [RFC v3 1/5] sched/core: add capacity constraints to CPU controller

2017-03-13 Thread Joel Fernandes (Google)
On Tue, Feb 28, 2017 at 6:38 AM, Patrick Bellasi wrote: > The CPU CGroup controller allows to assign a specified (maximum) > bandwidth to tasks within a group, however it does not enforce any > constraint on how such bandwidth can be consumed. > With the integration of schedutil, the scheduler

[PATCH v8 -tip 01/26] sched: Wrap rq::lock access

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra In preparation of playing games with rq->lock, abstract the thing using an accessor. Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Vineeth Remanan Pillai Signed-off-by: Julien Desfossez --- kernel/sched/core.c | 46

[PATCH v8 -tip 00/26] Core scheduling

2020-10-19 Thread Joel Fernandes (Google)
- Fix for 32bit build - Aubrey Li Aubrey Li (1): sched: migration changes for core scheduling Joel Fernandes (Google) (13): sched/fair: Snapshot the min_vruntime of CPUs on force idle arch/x86: Add a new TIF flag for untrusted tasks kernel/entry: Add support for core-wide protection of kernel-mode

[PATCH v8 -tip 02/26] sched: Introduce sched_class::pick_task()

2020-10-19 Thread Joel Fernandes (Google)
(Intel) Signed-off-by: Vineeth Remanan Pillai Signed-off-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/deadline.c | 16 ++-- kernel/sched/fair.c | 32 +++- kernel/sched/idle.c | 8 kernel/sched/rt.c

[PATCH v8 -tip 08/26] sched/fair: Snapshot the min_vruntime of CPUs on force idle

2020-10-19 Thread Joel Fernandes (Google)
usecase. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 33 - kernel/sched/fair.c | 40 kernel/sched/sched.h | 5 + 3 files changed, 65 insertions(+), 13 deletions(-) diff

[PATCH v8 -tip 14/26] entry/idle: Enter and exit kernel protection during idle entry and exit

2020-10-19 Thread Joel Fernandes (Google)
Add a generic_idle_{enter,exit} helper function to enter and exit kernel protection when entering and exiting idle, respectively. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- include/linux/entry-common.h | 18 ++ kernel/sched/idle.c | 11

[PATCH v8 -tip 12/26] arch/x86: Add a new TIF flag for untrusted tasks

2020-10-19 Thread Joel Fernandes (Google)
. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- arch/x86/include/asm/thread_info.h | 2 ++ kernel/sched/sched.h | 6 ++ 2 files changed, 8 insertions(+) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index c448fcfa1b82

[PATCH v8 -tip 06/26] sched: Add core wide task selection and scheduling.

2020-10-19 Thread Joel Fernandes (Google)
. This can confuse the logic. Add a retry logic if smt_mask changes between the loops. Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Julien Desfossez Signed-off-by: Vineeth Remanan Pillai Signed-off-by: Joel Fernandes (Google) Signed-off-by: Aaron Lu Signed

[PATCH v8 -tip 03/26] sched: Core-wide rq->lock

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra Introduce the basic infrastructure to have a core wide rq->lock. Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Julien Desfossez Signed-off-by: Vineeth Remanan Pillai --- kernel/Kconfig.preempt | 6 +++ kernel/sched/core.c| 109

[PATCH v8 -tip 07/26] sched/fair: Fix forced idle sibling starvation corner case

2020-10-19 Thread Joel Fernandes (Google)
From: Vineeth Pillai If there is only one long running local task and the sibling is forced idle, it might not get a chance to run until a schedule event happens on any cpu in the core. So we check for this condition during a tick to see if a sibling is starved and then give it a chance to

[PATCH v8 -tip 10/26] sched: migration changes for core scheduling

2020-10-19 Thread Joel Fernandes (Google)
From: Aubrey Li - Don't migrate if there is a cookie mismatch Load balance tries to move task from busiest CPU to the destination CPU. When core scheduling is enabled, if the task's cookie does not match with the destination CPU's core cookie, this task will be skipped by

[PATCH v8 -tip 04/26] sched/fair: Add a few assertions

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/fair.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bd6aed63f5e3..b4bc82f46fe7 100644 ---

[PATCH v8 -tip 13/26] kernel/entry: Add support for core-wide protection of kernel-mode

2020-10-19 Thread Joel Fernandes (Google)
-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- .../admin-guide/kernel-parameters.txt | 7 + include/linux/entry-common.h | 2 +- include/linux/sched.h | 12 + kernel/entry/common.c | 25 +- kernel/sched/core.c

[PATCH v8 -tip 05/26] sched: Basic tracking of matching tasks

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra Introduce task_struct::core_cookie as an opaque identifier for core scheduling. When enabled; core scheduling will only allow matching task to be on the core; where idle matches everything. When task_struct::core_cookie is set (and core scheduling is enabled) these tasks

[PATCH v8 -tip 11/26] irq_work: Cleanup

2020-10-19 Thread Joel Fernandes (Google)
-off-by: Joel Fernandes (Google) --- drivers/gpu/drm/i915/i915_request.c | 4 ++-- include/linux/irq_work.h| 33 ++--- include/linux/irqflags.h| 4 ++-- kernel/bpf/stackmap.c | 2 +- kernel/irq_work.c | 18

[PATCH v8 -tip 22/26] sched/debug: Add CGroup node for printing group cookie if SCHED_DEBUG

2020-10-19 Thread Joel Fernandes (Google)
This will be used by kselftest to verify the CGroup cookie value that is set by the CGroup interface. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/kernel/sched/core.c b

[PATCH v8 -tip 18/26] sched: Add a per-thread core scheduling interface

2020-10-19 Thread Joel Fernandes (Google)
the camera streaming frame rate by ~3%. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- include/linux/sched.h| 2 ++ include/uapi/linux/prctl.h | 3 ++ kernel/sched/core.c | 51 +--- kernel/sys.c

[PATCH v8 -tip 21/26] sched: Handle task addition to CGroup

2020-10-19 Thread Joel Fernandes (Google)
Due to earlier patches, the old way of computing a task's cookie when it is added to a CGroup,is outdated. Update it by fetching the group's cookie using the new helpers. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 15 ++- 1 file

[PATCH v8 -tip 09/26] sched: Trivial forced-newidle balancer

2020-10-19 Thread Joel Fernandes (Google)
Zijlstra (Intel) Signed-off-by: Joel Fernandes (Google) Acked-by: Paul E. McKenney --- include/linux/sched.h | 1 + kernel/sched/core.c | 130 +- kernel/sched/idle.c | 1 + kernel/sched/sched.h | 6 ++ 4 files changed, 137 insertions(+), 1

[PATCH v8 -tip 25/26] Documentation: Add core scheduling documentation

2020-10-19 Thread Joel Fernandes (Google)
Document the usecases, design and interfaces for core scheduling. Co-developed-by: Vineeth Pillai Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- .../admin-guide/hw-vuln/core-scheduling.rst | 312 ++ Documentation/admin-guide/hw-vuln/index.rst | 1

[PATCH v8 -tip 19/26] sched: Add a second-level tag for nested CGroup usecase

2020-10-19 Thread Joel Fernandes (Google)
' is a 8-bit value allowing for upto 256 unique colors. IMHO, having more than these many CGroups sounds like a scalability issue so this suffices. We steal the lower 8-bits of the cookie to set the color. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c

[PATCH v8 -tip 24/26] sched: Move core-scheduler interfacing code to a new file

2020-10-19 Thread Joel Fernandes (Google)
core.c is already huge. The core-tagging interface code is largely independent of it. Move it to its own file to make both files easier to maintain. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/Makefile | 1 + kernel/sched/core.c| 481

[PATCH v8 -tip 26/26] sched: Debug bits...

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra Tested-by: Julien Desfossez Not-Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/core.c | 37 - 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index

<    1   2   3   4   5   6   >