linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <bp@alien8.de>, "Ren, Qiaowei" <qiaowei.ren@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 2/5] x86, mpx: hook #BR exception handler to allocate bound tables
Date: Fri, 17 Jan 2014 08:51:03 -0800	[thread overview]
Message-ID: <52D95F77.4030908@zytor.com> (raw)
In-Reply-To: <20140117164736.GE8715@pd.tnic>

On 01/17/2014 08:47 AM, Borislav Petkov wrote:
> 
> Right, so Steve and I played a couple of scenarios in IRC with this. So
> #BR is comparable with #PF, AFAICT, and as expected we don't take any
> locks when handling page faults in kernel space as we might deadlock.
> 
> Now, what happens if a thread is sleeping on some lock down that
> GFP_KERNEL allocation path and another thread gets a #BR and goes that
> same mmap_pgoff path and tries to grab that same lock?

It goes to sleep.  Same as if we take a page fault and have to page
something in.

> Also, what happens if you take a #BR in NMI context, say the NMI
> handler?

You should never, ever do that.  We should never take a #BR in the
kernel, full stop -- if we do it is panic time.

> All I'm trying to say is, it might not be such a good idea to sleep in a
> fault handler...

A fault handler from user space is really nothing other than a different
kind of system call.  It is nothing magic about it.

	-hpa


  reply	other threads:[~2014-01-17 16:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-12  9:19 [PATCH 1/5] x86, mpx: add documentation on Intel MPX Qiaowei Ren
2014-01-12  9:20 ` [PATCH 2/5] x86, mpx: hook #BR exception handler to allocate bound tables Qiaowei Ren
2014-01-12  9:20   ` Borislav Petkov
2014-01-13  3:17     ` Ren Qiaowei
2014-01-13 10:38       ` Borislav Petkov
2014-01-17 14:47         ` Ren, Qiaowei
2014-01-17 16:47           ` Borislav Petkov
2014-01-17 16:51             ` H. Peter Anvin [this message]
2014-01-17 17:14               ` Steven Rostedt
2014-01-17 17:51                 ` H. Peter Anvin
2014-01-19 12:50                 ` Ren, Qiaowei
2014-01-17 17:10             ` Steven Rostedt
2014-01-17 16:31         ` H. Peter Anvin
2014-01-17 16:48           ` Borislav Petkov
2014-01-17 16:51             ` H. Peter Anvin
2014-01-17 16:56               ` Borislav Petkov
2014-01-17 16:58                 ` H. Peter Anvin
2014-01-17 17:04                   ` Borislav Petkov
2014-01-17 17:30                     ` H. Peter Anvin
2014-01-17 18:23                       ` Borislav Petkov
2014-01-17 18:25                         ` H. Peter Anvin
2014-01-12  9:20 ` [PATCH 3/5] x86, mpx: add prctl commands PR_MPX_INIT, PR_MPX_RELEASE Qiaowei Ren
2014-01-12  9:20 ` [PATCH 4/5] x86, mpx: add MPX related opcodes to the x86 opcode map Qiaowei Ren
2014-01-17 19:04   ` H. Peter Anvin
2014-01-17 19:22   ` [tip:x86/mpx] x86, mpx: Add " tip-bot for Qiaowei Ren
2014-01-12  9:20 ` [PATCH 5/5] x86, mpx: extend siginfo structure to include bound violation information Qiaowei Ren
2014-01-12  9:30   ` Borislav Petkov
2014-01-12 16:49     ` H. Peter Anvin
2014-01-12 17:03       ` Borislav Petkov
2014-01-12 17:06         ` H. Peter Anvin
2014-01-13  3:09         ` Ren Qiaowei
2014-01-13  8:22           ` Ren Qiaowei
2014-01-13 10:43             ` Borislav Petkov
2014-01-17 14:55               ` Ren, Qiaowei

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=52D95F77.4030908@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=qiaowei.ren@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).