linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"Russell King - ARM Linux admin" <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Arnd Bergmann <arnd@arndb.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"yadi.hu@windriver.com" <yadi.hu@windriver.com>
Subject: Re: [RFC PATCH] ARM: enable irq in translation/section permission fault handlers
Date: Thu, 21 Feb 2019 09:31:53 +0000	[thread overview]
Message-ID: <VI1PR0702MB3840118FE9014CB1E9801F83E47E0@VI1PR0702MB3840.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <f05d2cae-5664-6cc7-51c8-933d6d1403ec@hotmail.de>

> But if there is a way to get into the code path do_DataAbort->do_page_fault with
> addr > TASK_SIZE, then I don't see why that works without the RT patch,
> since the interrupts are enabled here:
>
> do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
> {
>         struct task_struct *tsk;
>         struct mm_struct *mm;
>         int sig, code;
>         vm_fault_t fault;
>         unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
> 
>         if (notify_page_fault(regs, fsr))
>                 return 0;
> 
>         tsk = current;
>         mm  = tsk->mm;
> 
>         /* Enable interrupts if they were enabled in the parent context. */
>         if (interrupts_enabled(regs))
>                 local_irq_enable();
> 
> Is preemption disabled at this point, without the RT patch?
> 
> I still don't quite see why is this no issue without the RT patch.
> Can someone explain that?

Never mind, now I found out how to prove that it is not a RT issue:

$ cat t2.c 
int main() {
  *((char*)0xFFFFFFFF) = 1;
}
$ gcc t2.c -o t2
$ ./t2 
BUG: using smp_processor_id() in preemptible [00000000] code: t2/832
caller is debug_smp_processor_id+0x18/0x24
CPU: 1 PID: 832 Comm: t2 Not tainted 4.18.0-00005-g7523d7f #1
Hardware name: Altera SOCFPGA
[<80112e68>] (unwind_backtrace) from [<8010da28>] (show_stack+0x20/0x24)
[<8010da28>] (show_stack) from [<806bcaec>] (dump_stack+0x78/0x94)
[<806bcaec>] (dump_stack) from [<8043f2d0>] (check_preemption_disabled+0xe4/0x120)
[<8043f2d0>] (check_preemption_disabled) from [<8043f324>] (debug_smp_processor_id+0x18/0x24)
[<8043f324>] (debug_smp_processor_id) from [<80116ba0>] (__do_user_fault+0x48/0x13c)
[<80116ba0>] (__do_user_fault) from [<8011700c>] (do_page_fault+0x2f4/0x328)
[<8011700c>] (do_page_fault) from [<80117200>] (do_DataAbort+0x58/0x100)
[<80117200>] (do_DataAbort) from [<80102460>] (__dabt_usr+0x40/0x60)
Exception stack(0xbf197fb0 to 0xbf197ff8)
7fa0:                                     00000001 7e963d94 00000001 ffffffff
7fc0: 000103f8 00000000 000102e0 00000000 00000000 00000000 76fa9000 7e963c3c
7fe0: 00000000 7e963c3c 76e47bbc 000103e0 60060010 ffffffff
Segmentation fault


What exactly is the reason why we should not apply this patch in the non-RT kernel as well:

https://marc.info/?l=linux-rt-users&m=154997565610392&w=2



Thanks
Bernd.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-02-21  9:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 20:05 [RFC PATCH] ARM: enable irq in translation/section permission fault handlers Sebastian Andrzej Siewior
2019-02-15 21:57 ` Bernd Edlinger
2019-02-20 10:50   ` Sebastian Andrzej Siewior
2019-02-16 11:33 ` Russell King - ARM Linux admin
2019-02-20 11:00   ` Sebastian Andrzej Siewior
2019-02-21  8:06     ` Bernd Edlinger
2019-02-21  9:31       ` Bernd Edlinger [this message]
2019-02-21  9:57         ` Sebastian Andrzej Siewior
2019-02-21 14:03           ` Bernd Edlinger

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=VI1PR0702MB3840118FE9014CB1E9801F83E47E0@VI1PR0702MB3840.eurprd07.prod.outlook.com \
    --to=bernd.edlinger@hotmail.de \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=tglx@linutronix.de \
    --cc=yadi.hu@windriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).