From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Alexander Potapenko <glider@google.com>
Cc: Russell King <linux@armlinux.org.uk>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, "Marco Elver" <elver@google.com>,
Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [PATCH v2 3/3] ARM: Support KFENCE for ARM
Date: Thu, 4 Nov 2021 09:14:17 +0800 [thread overview]
Message-ID: <7e52f57a-2ff8-736e-d6ea-1e61e5f79375@huawei.com> (raw)
In-Reply-To: <CAG_fn=WT9DzGmXrw97AhgCnyREQaACcgHg-3i62D-qNhUZ0xzg@mail.gmail.com>
On 2021/11/4 0:22, Alexander Potapenko wrote:
> On Wed, Nov 3, 2021 at 2:26 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>>
>> 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 <wangkefeng.wang@huawei.com>
...
>> 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.
> .
>
next prev parent reply other threads:[~2021-11-04 1:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 13:38 [PATCH v2 0/3] ARM: Support KFENCE feature Kefeng Wang
2021-11-03 13:38 ` [PATCH v2 1/3] ARM: mm: Provide set_memory_valid() Kefeng Wang
2021-11-03 13:38 ` [PATCH v2 2/3] ARM: mm: Provide is_write_fault() Kefeng Wang
2021-11-03 13:38 ` [PATCH v2 3/3] ARM: Support KFENCE for ARM Kefeng Wang
2021-11-03 16:22 ` Alexander Potapenko
2021-11-04 1:14 ` Kefeng Wang [this message]
2021-11-04 7:00 ` [PATCH v2 0/3] ARM: Support KFENCE feature Marco Elver
2021-11-04 7:17 ` Kefeng Wang
2021-11-04 12:12 ` Russell King (Oracle)
2021-11-04 12:38 ` Kefeng Wang
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=7e52f57a-2ff8-736e-d6ea-1e61e5f79375@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®