Thread (10 messages) flat view 10 messages, 3 authors, 2021-06-22

Re: [PATCH 4/4] powerpc: Enable KFENCE on BOOK3S/64

From: Daniel Axtens <hidden>
Date: 2021-06-18 08:02:44

Daniel Axtens [off-list ref] writes:
quoted
+#ifdef CONFIG_PPC64
+static inline bool kfence_protect_page(unsigned long addr, bool protect)
+{
+	struct page *page;
+
+	page = virt_to_page(addr);
+	if (protect)
+		__kernel_map_pages(page, 1, 0);
+	else
+		__kernel_map_pages(page, 1, 1);
I lose track of the type conversions and code conventions involved, but
can we do something like __kernel_map_pages(page, 1, !!protect)?
Ah, I missed that the if changed the truth/falsity. !protect, not
!!protect :P
Apart from that, this seems good.

Kind regards,
Daniel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help