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

Daniel Axtens dja at axtens.net
Fri Jun 18 18:00:59 AEST 2021


> +#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)?

Apart from that, this seems good.

Kind regards,
Daniel


More information about the Linuxppc-dev mailing list