From: Daniel Axtens <dja@axtens.net>
To: Jordan Niethe <jniethe5@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: Jordan Niethe <jniethe5@gmail.com>,
npiggin@gmail.com, aneesh.kumar@linux.ibm.com
Subject: Re: [PATCH 4/4] powerpc: Enable KFENCE on BOOK3S/64
Date: Fri, 18 Jun 2021 18:02:07 +1000 [thread overview]
Message-ID: <87a6nnsirk.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <87czsjsitg.fsf@dja-thinkpad.axtens.net>
Daniel Axtens <dja@axtens.net> writes:
>> +#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
next prev parent reply other threads:[~2021-06-18 8:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 6:16 [PATCH 0/4] powerpc/64s: Enable KFENCE Jordan Niethe
2021-05-17 6:16 ` [PATCH 1/4] powerpc/64s: Add DEBUG_PAGEALLOC for radix Jordan Niethe
2021-06-18 7:28 ` Daniel Axtens
2021-05-17 6:16 ` [PATCH 2/4] powerpc/64s: Remove unneeded #ifdef CONFIG_DEBUG_PAGEALLOC in hash_utils Jordan Niethe
2021-06-18 7:49 ` Daniel Axtens
2021-05-17 6:16 ` [PATCH 3/4] powerpc/64s: Allow double call of kernel_[un]map_linear_page() Jordan Niethe
2021-05-17 6:16 ` [PATCH 4/4] powerpc: Enable KFENCE on BOOK3S/64 Jordan Niethe
2021-06-18 8:00 ` Daniel Axtens
2021-06-18 8:02 ` Daniel Axtens [this message]
2021-06-22 8:57 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6nnsirk.fsf@dja-thinkpad.axtens.net \
--to=dja@axtens.net \
--cc=aneesh.kumar@linux.ibm.com \
--cc=jniethe5@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.