lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211021134530.206216-4-leo.yan@linaro.org>
Date:   Thu, 21 Oct 2021 21:45:29 +0800
From:   Leo Yan <leo.yan@...aro.org>
To:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Kees Cook <keescook@...omium.org>,
        Ard Biesheuvel <ardb@...nel.org>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Nicholas Piggin <npiggin@...il.com>,
        James Morse <james.morse@....com>,
        Marc Zyngier <maz@...nel.org>, Joey Gouly <joey.gouly@....com>,
        Peter Collingbourne <pcc@...gle.com>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Stephane Eranian <eranian@...gle.com>,
        James Clark <james.clark@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:     Leo Yan <leo.yan@...aro.org>
Subject: [RFCv1 3/4] arm64: Introduce functions for controlling PID tracing

Introduce two functions contextidr_enable() and contextidr_disable(),
which can be used by kernel modules to turn on or off PID tracing in
contextidr register.

Signed-off-by: Leo Yan <leo.yan@...aro.org>
---
 arch/arm64/include/asm/mmu_context.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
index e1f33616f83a..0c1669db19a1 100644
--- a/arch/arm64/include/asm/mmu_context.h
+++ b/arch/arm64/include/asm/mmu_context.h
@@ -37,6 +37,16 @@ static inline void contextidr_thread_switch(struct task_struct *next)
 	isb();
 }
 
+static inline void contextidr_enable(void)
+{
+	static_branch_inc(&contextidr_in_use);
+}
+
+static inline void contextidr_disable(void)
+{
+	static_branch_dec(&contextidr_in_use);
+}
+
 /*
  * Set TTBR0 to reserved_pg_dir. No translations will be possible via TTBR0.
  */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ