From: "Joel Fernandes (Google)" <joel(a)joelfernandes.org>
The preempt/irq tracepoints exist but not everything in the kernel is
using it during preempt/irq on/off events. This makes things not work
simultaneously (for ex, only either lockdep or irqsoff events can be
used at a time). This series is an attempt to solve that, and also
results in a nice clean up of the kernel in general. Several ifdefs are
simpler, and the design is more unified and better. Also as a result of
this, we also speeded up performance all rcuidle tracepoints since
their handling is simpler.
v7->v8:
- Refactored irqsoff tracer probe defines based on Namhyung's
suggestions. No functional change.
v6->v7:
- Added a module to simulate an atomic section, a kselftest to load and
and trigger it which verifies the preempt-tracer and this series.
- Fixed a new warning after I rebased in early boot, this is because
early_boot_irqs_disabled was set too early, I moved it after the lockdep
initialization.
- added back the softirq fix since it appears it wasn't picked up.
- Ran Ingo's locking API selftest suite which are passing with this
series.
- Mathieu suggested ifdef'ing the tracepoint_synchronize_unregister
function incase tracepoints aren't enabled, did that.
Joel Fernandes (Google) (7):
softirq: reorder trace_softirqs_on to prevent lockdep splat
srcu: Add notrace variant of srcu_dereference
trace/irqsoff: Split reset into separate functions
tracepoint: Make rcuidle tracepoint callers use SRCU
tracing: Centralize preemptirq tracepoints and unify their usage
lib: Add module to simulate atomic sections for testing preemptoff
tracers
kselftests: Add tests for the preemptoff and irqsoff tracers
Paul McKenney (1):
srcu: Add notrace variants of srcu_read_{lock,unlock}
include/linux/ftrace.h | 11 +-
include/linux/irqflags.h | 11 +-
include/linux/lockdep.h | 8 +-
include/linux/preempt.h | 2 +-
include/linux/srcu.h | 22 ++
include/linux/tracepoint.h | 48 +++-
include/trace/events/preemptirq.h | 23 +-
init/main.c | 5 +-
kernel/locking/lockdep.c | 35 +--
kernel/sched/core.c | 2 +-
kernel/softirq.c | 6 +-
kernel/trace/Kconfig | 22 +-
kernel/trace/Makefile | 2 +-
kernel/trace/trace_irqsoff.c | 253 ++++++------------
kernel/trace/trace_preemptirq.c | 71 +++++
kernel/tracepoint.c | 15 +-
lib/Kconfig.debug | 8 +
lib/Makefile | 1 +
lib/test_atomic_sections.c | 79 ++++++
tools/testing/selftests/ftrace/config | 3 +
.../test.d/preemptirq/irqsoff_tracer.tc | 74 +++++
21 files changed, 459 insertions(+), 242 deletions(-)
create mode 100644 kernel/trace/trace_preemptirq.c
create mode 100644 lib/test_atomic_sections.c
create mode 100644 tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
--
2.17.0.921.gf22659ad46-goog
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
ADI is a feature supported on SPARC M7 and newer processors to allow
hardware to catch rogue accesses to memory. ADI is supported for data
fetches only and not instruction fetches. An app can enable ADI on its
data pages, set version tags on them and use versioned addresses to
access the data pages. Upper bits of the address contain the version
tag. On M7 processors, upper four bits (bits 63-60) contain the version
tag. If a rogue app attempts to access ADI enabled data pages, its
access is blocked and processor generates an exception. Please see
Documentation/sparc/adi.txt for further details.
This patchset implements a char driver to read/write ADI versions from
privileged user space processes. Intended consumers are makedumpfile
and crash.
v6:
* Addressed a few action items from greg k-h
* Added Reviewed-by Greg Kroah-Hartman and Shuah Khan
v5:
* Fixed MODULE_LICENSE() for adi.c
v4:
* Fixed messed up subject lines.
v3:
* Really fixed the copyright headers to use SPDX GPL v2. Really.
v2:
* Simplified copyright headers
* Completely reworked sparc64 selftests Makefiles. Used the
android selftests Makefiles as an example
* Added run.sh and drivers_test.sh to the sparc64 selftest
directory. Used bpf/test_kmod.sh and the android selftests
as examples
* Minor cleanups in the selftest adi-test.c
* Added calls to ksft_test_*() in the adi-test.c
Tom Hromatka (2):
char: sparc64: Add privileged ADI driver
selftests: sparc64: char: Selftest for privileged ADI driver
drivers/char/Kconfig | 12 +
drivers/char/Makefile | 1 +
drivers/char/adi.c | 239 +++++++
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/sparc64/Makefile | 46 ++
tools/testing/selftests/sparc64/drivers/.gitignore | 1 +
tools/testing/selftests/sparc64/drivers/Makefile | 15 +
tools/testing/selftests/sparc64/drivers/adi-test.c | 721 +++++++++++++++++++++
.../selftests/sparc64/drivers/drivers_test.sh | 30 +
tools/testing/selftests/sparc64/run.sh | 3 +
10 files changed, 1069 insertions(+)
create mode 100644 drivers/char/adi.c
create mode 100644 tools/testing/selftests/sparc64/Makefile
create mode 100644 tools/testing/selftests/sparc64/drivers/.gitignore
create mode 100644 tools/testing/selftests/sparc64/drivers/Makefile
create mode 100644 tools/testing/selftests/sparc64/drivers/adi-test.c
create mode 100755 tools/testing/selftests/sparc64/drivers/drivers_test.sh
create mode 100755 tools/testing/selftests/sparc64/run.sh
--
2.15.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
When libraries are sourced from elsewhere from the tree, such as the
testing/selftests/drivers/net/mlxsw subdirectory, sourcing their own
dependencies directly by name doesn't work. Thus running mirror_gre.sh
from that subdirectory results in the following cascade of errors:
./../../../net/forwarding/mirror_gre_lib.sh: line 3: mirror_lib.sh: No such file or directory
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 36: mirror_topo_lib.sh: No such file or directory
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 80: mirror_topo_h1_create: command not found
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 81: mirror_topo_h2_create: command not found
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 40: mirror_topo_h3_create: command not found
[...]
Fix by relying on $relative_path, set up by lib.sh, which should be
imported by the test in question anyway, and source the file using
relative path appropriate for the subdirectory.
Fixes: d5ea2bfc806a ("selftests: forwarding: mirror_gre_lib: Extract generic functions")
Fixes: 74ed089d48a4 ("selftests: forwarding: Split mirror_gre_topo_lib.sh")
Signed-off-by: Petr Machata <petrm(a)mellanox.com>
---
tools/testing/selftests/net/forwarding/mirror_gre_lib.sh | 2 +-
tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
index 619b469..1388845 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-source mirror_lib.sh
+source "$relative_path/mirror_lib.sh"
quick_test_span_gre_dir_ips()
{
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
index 2534195..39c03e2 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
@@ -33,7 +33,7 @@
# | |
# +-------------------------------------------------------------------------+
-source mirror_topo_lib.sh
+source "$relative_path/mirror_topo_lib.sh"
mirror_gre_topo_h3_create()
{
--
2.4.11
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
This patchset includes two small fixes for the tests that were
introduced in commit 1bb58d2d3cbe ("Merge branch
'Mirroring-tests-involving-VLAN'").
In patch #1, a "tc action trap" is uninstalled after the suite runs,
instead of being installed again.
In patch #2, a test in suite is renamed to differentiate it from another
test of the same name.
Petr Machata (2):
selftests: forwarding: mirror_vlan: Uninstall trap
selftests: forwarding: mirror_vlan: Change test description
tools/testing/selftests/net/forwarding/mirror_vlan.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.4.11
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html