From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: Aishwarya TCV <aishwarya.tcv@arm.com>,
<linux-arm-kernel@lists.infradead.org>, <linux-mm@kvack.org>,
Will Deacon <will@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Russell King <linux@armlinux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 1/2] arm64: mm: drop VM_FAULT_BADMAP/VM_FAULT_BADACCESS
Date: Wed, 10 Apr 2024 20:48:28 +0800 [thread overview]
Message-ID: <8a695c3f-a5eb-4012-a14c-1d76ad79c0dc@huawei.com> (raw)
In-Reply-To: <ZhaIlOGhnMOmONF3@e120937-lin>
On 2024/4/10 20:39, Cristian Marussi wrote:
> On Wed, Apr 10, 2024 at 07:53:21PM +0800, Kefeng Wang wrote:
>>
>>
>> On 2024/4/10 19:24, Aishwarya TCV wrote:
>>>
>
> Hi,
>
>>>
>>> On 07/04/2024 09:12, Kefeng Wang wrote:
>>>> If bad map or access, directly set si_code to SEGV_MAPRR or SEGV_ACCERR,
>>>> also set fault to 0 and goto error handling, which make us to drop the
>>>> arch's special vm fault reason.
>>>>
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>> ---
>>>> arch/arm64/mm/fault.c | 41 ++++++++++++++++++-----------------------
>>>> 1 file changed, 18 insertions(+), 23 deletions(-)
>>>
>>> Hi Kefeng,
>>>
>>> While running LTP test suite, I observed that few test cases are unable
>>> to kill exe when run against next-master(next-20240409) kernel with
>>> Arm64 on JUNO in our CI. I can send the full logs if required, but it
>>> doesn't say much.
>>
>> Sorry about it, as Catalin pointed, there is issue in this patch, and
>> I replied today, could you help to test with following changes, many thanks.
>>
>> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
>> index 61a2acae0dca..451ba7cbd5ad 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -604,6 +604,7 @@ static int __kprobes do_page_fault(unsigned long far,
>> unsigned long esr,
>> }
>>
>> if (!(vma->vm_flags & vm_flags)) {
>> + mmap_read_unlock(mm);
>> fault = 0;
>> si_code = SEGV_ACCERR;
>> goto bad_area;
>> @@ -632,6 +633,7 @@ static int __kprobes do_page_fault(unsigned long far,
>> unsigned long esr,
>> if (likely(!(fault & VM_FAULT_ERROR)))
>> return 0;
>>
>> + si_code = SEGV_MAPERR;
>> bad_area:
>> /*
>> * If we are in kernel mode at this point, we have no context to
>>
>
> On my JUNO setup, the above patch solves the 'un-killable tests' issues and
> all the previously failing tests passes. (I have NOT run the full LTP
> test-suite, though, only replayed the tests that were failing before as
> mentioned by Aishwarya)
Thanks, I will resend v2, but let's wait for Catalin to see if there is
any other opinion.
>
> Thanks,
> Cristian
next prev parent reply other threads:[~2024-04-10 12:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-07 8:12 [PATCH -next 0/2] mm: remove arch's private VM_FAULT_BADMAP/BADACCESS Kefeng Wang
2024-04-07 8:12 ` [PATCH 1/2] arm64: mm: drop VM_FAULT_BADMAP/VM_FAULT_BADACCESS Kefeng Wang
2024-04-09 14:28 ` Catalin Marinas
2024-04-10 1:30 ` Kefeng Wang
2024-04-10 10:58 ` Kefeng Wang
2024-04-11 9:59 ` Catalin Marinas
2024-04-11 11:11 ` Kefeng Wang
2024-04-10 11:24 ` Aishwarya TCV
2024-04-10 11:53 ` Kefeng Wang
2024-04-10 12:39 ` Cristian Marussi
2024-04-10 12:48 ` Kefeng Wang [this message]
2024-04-10 20:18 ` Andrew Morton
2024-04-07 8:12 ` [PATCH 2/2] arm: " 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=8a695c3f-a5eb-4012-a14c-1d76ad79c0dc@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=aishwarya.tcv@arm.com \
--cc=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=cristian.marussi@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=linux@armlinux.org.uk \
--cc=will@kernel.org \
/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