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: <20241205103729.14798-8-luxu.kernel@bytedance.com>
Date: Thu,  5 Dec 2024 18:37:15 +0800
From: Xu Lu <luxu.kernel@...edance.com>
To: paul.walmsley@...ive.com,
	palmer@...belt.com,
	aou@...s.berkeley.edu,
	ardb@...nel.org,
	anup@...infault.org,
	atishp@...shpatra.org
Cc: xieyongji@...edance.com,
	lihangjing@...edance.com,
	punit.agrawal@...edance.com,
	linux-kernel@...r.kernel.org,
	linux-riscv@...ts.infradead.org,
	Xu Lu <luxu.kernel@...edance.com>
Subject: [RFC PATCH v2 07/21] riscv: mm: Reimplement page table entry get function

This commit reimplements ptep_get/pmdp_get/... functions. As pte
structures now contains multiple mapping entries, we can not use
READ_ONCE to fetch its value. Instead, we use traditional dereference
way.

Signed-off-by: Xu Lu <luxu.kernel@...edance.com>
---
 arch/riscv/include/asm/pgtable.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index d3da8aee213c..ba4a083b7210 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -704,6 +704,36 @@ static inline void set_pte(pte_t *ptep, pte_t pteval)
 	WRITE_ONCE(*ptep, pteval);
 }
 
+static inline pte_t ptep_get(pte_t *ptep)
+{
+	return *ptep;
+}
+#define ptep_get	ptep_get
+
+static inline pmd_t pmdp_get(pmd_t *pmdp)
+{
+	return *pmdp;
+}
+#define pmdp_get	pmdp_get
+
+static inline pud_t pudp_get(pud_t *pudp)
+{
+	return *pudp;
+}
+#define pudp_get	pudp_get
+
+static inline p4d_t p4dp_get(p4d_t *p4dp)
+{
+	return *p4dp;
+}
+#define p4dp_get	p4dp_get
+
+static inline pgd_t pgdp_get(pgd_t *pgdp)
+{
+	return *pgdp;
+}
+#define pgdp_get	pgdp_get
+
 void flush_icache_pte(struct mm_struct *mm, pte_t pte);
 
 static inline void __set_pte_at(struct mm_struct *mm, pte_t *ptep, pte_t pteval)
-- 
2.20.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ