2017-12-07 16:40:55

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH v2 06/35] nds32: MMU fault handling and page table management

On Mon, Nov 27, 2017 at 08:27:53PM +0800, Greentime Hu wrote:
> +void do_page_fault(unsigned long entry, unsigned long addr,
> + unsigned int error_code, struct pt_regs *regs)
[snip]
> + /*
> + * If we're in an interrupt or have no user
> + * context, we must not take the fault..
> + */
> + if (unlikely(in_atomic() || !mm))

Broken. in_atomic() is wrong here - it should be faulthandler_disabled().


2017-12-08 05:27:27

by Greentime Hu

[permalink] [raw]
Subject: Re: [PATCH v2 06/35] nds32: MMU fault handling and page table management

2017-12-08 0:40 GMT+08:00 Al Viro <[email protected]>:
> On Mon, Nov 27, 2017 at 08:27:53PM +0800, Greentime Hu wrote:
>> +void do_page_fault(unsigned long entry, unsigned long addr,
>> + unsigned int error_code, struct pt_regs *regs)
> [snip]
>> + /*
>> + * If we're in an interrupt or have no user
>> + * context, we must not take the fault..
>> + */
>> + if (unlikely(in_atomic() || !mm))
>
> Broken. in_atomic() is wrong here - it should be faulthandler_disabled().

Thanks.
I will include <linux/uaccess.h> and replace in_atomic() with
faulthandler_disabled()
I will fix it in the next version patch.