public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>, X86 ML <x86@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] x86, traps: install gates using IST after cpu_init().
Date: Fri, 27 Feb 2015 12:34:47 +0800	[thread overview]
Message-ID: <54EFF3E7.2070007@huawei.com> (raw)
In-Reply-To: <CALCETrVf91jv4X6t+WsRb2Fxhcj-ZCtPyL5TXE8CR0=1L4y-eg@mail.gmail.com>

On 2015/2/26 23:14, Andy Lutomirski wrote:
> On Wed, Feb 25, 2015 at 10:15 PM, Wang Nan <wangnan0@huawei.com> wrote:
>> X86_TRAP_NMI, X86_TRAP_DF and X86_TRAP_MC use their own stack. Those
>> stacks are invalid until cpu_init() installs TSS.
>>
>> This patch moves setting of the 3 gates after cpu_init().
>>
>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>> ---
>>
>> If I understand correctly, logically speaking the original code is
>> incorrect.  However, there is no real bug caused by it for serval years.
>> I'm not sure whether this fix is practical or not. Fix them only for
>> logical correctness.
> 
> Acked-by: Andy Lutomirski <luto@amacapital.net>
> 
> That being said, I'm pretty sure you're not fixing a bug here.

Agree.

> Delivery of an exception with no handler is every bit as fatal as
> delivery of an exception with a non-working IST handler.
> 

Just curious: in original code, what will happen if an NMI or MC raises after
'set_intr_gate_ist(X86_TRAP_NMI, &nmi, NMI_STACK);' and before cpu_init()?
In my opinion, at that time the interrupt handler is set but IST is not ready.

In addition, why it's never happened for real? Does it means NMI is possible
to be disabled?

Thank you!

> --Andy
> 



  reply	other threads:[~2015-02-27  4:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  6:15 [PATCH] x86, traps: install gates using IST after cpu_init() Wang Nan
2015-02-26 15:14 ` Andy Lutomirski
2015-02-27  4:34   ` Wang Nan [this message]
2015-02-27 19:56     ` Andy Lutomirski

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=54EFF3E7.2070007@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=luto@amacapital.net \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.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