Re: [PATCH v2 3/3] ARM: Support KFENCE for ARM

From
Kefeng Wang <hidden>
Date
2021-11-04 01:14:24
Also in
lkml
Reply to
Alexander Potapenko, 2021-11-03

On 2021/11/4 0:22, Alexander Potapenko wrote:
On Wed, Nov 3, 2021 at 2:26 PM Kefeng Wang [off-list ref] wrote:
quoted
Add architecture specific implementation details for KFENCE and enable
KFENCE on ARM. In particular, this implements the required interface in
  <asm/kfence.h>.

KFENCE requires that attributes for pages from its memory pool can
individually be set. Therefore, force the kfence pool to be mapped
at page granularity.

Testing this patch using the testcases in kfence_test.c and all passed
with or without ARM_LPAE.

Signed-off-by: Kefeng Wang <redacted>
...
quoted
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index f7ab6dabe89f..49148b675b43 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -17,6 +17,7 @@
  #include <linux/sched/debug.h>
  #include <linux/highmem.h>
  #include <linux/perf_event.h>
+#include <linux/kfence.h>

  #include <asm/system_misc.h>
  #include <asm/system_info.h>
@@ -99,6 +100,11 @@ void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
  { }
  #endif                                 /* CONFIG_MMU */

+static inline bool is_write_fault(unsigned int fsr)
+{
+       return (fsr & FSR_WRITE) && !(fsr & FSR_CM);
+}
Please don't increase the diff by moving the code around. Consider
putting is_write_fault() in the right place in "ARM: mm: Provide
is_write_fault()" instead.
Sure. Let's wait some time to see whether there are any other comments,
and resend, thanks.
.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (10 messages) 10 messages, 4 authors, last reply 2021-11-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help