[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210426210020.417e3cfc@oasis.local.home>
Date: Mon, 26 Apr 2021 21:00:20 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Lai Jiangshan <jiangshanlai+lkml@...il.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Uros Bizjak <ubizjak@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Sean Christopherson <seanjc@...gle.com>,
Maxim Levitsky <mlevitsk@...hat.com>
Subject: Re: [PATCH v2 2/2] KVM: VMX: Invoke NMI handler via indirect call
instead of INTn
On Tue, 27 Apr 2021 08:54:37 +0800
Lai Jiangshan <jiangshanlai+lkml@...il.com> wrote:
> > However, I'm not sure which of the two situations is better: entering
> > the NMI handler on the IST without setting the hidden NMI-blocked flag
> > could be a recipe for bad things as well.
>
> The change makes the ASM NMI entry called on the kernel stack. But the
> ASM NMI entry expects it on the IST stack and it plays with "NMI executing"
> variable on the IST stack. In this change, the stranded ASM NMI entry
> will use the wrong/garbage "NMI executing" variable on the kernel stack
> and may do some very wrong thing.
I missed this detail.
>
> Sorry, in my reply, "the NMI handler" meant to be the ASM entry installed
> on the IDT table which really expects to be NMI-masked at the beginning.
>
> The C NMI handler can handle the case of nested NMIs, which is useful
> here. I think we should change it to call the C NMI handler directly
> here as Andy Lutomirski suggested:
Yes, because that's the way x86_32 works.
>
> On Mon, Apr 26, 2021 at 11:09 PM Andy Lutomirski <luto@...capital.net> wrote:
> > The C NMI code has its own reentrancy protection and has for years.
> > It should work fine for this use case.
>
> I think this is the right way.
Agreed.
-- Steve
Powered by blists - more mailing lists