From: Paolo Bonzini <pbonzini@redhat.com>
To: Radim Krcmar <rkrcmar@redhat.com>
Cc: ehabkost@redhat.com,
"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
qemu-devel@nongnu.org, "Gonglei (Arei)" <arei.gonglei@huawei.com>,
kevin@koconnor.net, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos
Date: Wed, 16 Dec 2015 09:51:43 +0100 [thread overview]
Message-ID: <5671261F.4010305@redhat.com> (raw)
In-Reply-To: <20151215185335.GF17283@potion.brq.redhat.com>
On 15/12/2015 19:53, Radim Krcmar wrote:
> 2015-12-15 05:43-0500, Paolo Bonzini:
>>> Hi Paolo,
>>>
>>> /* for KVM_GET/SET_VCPU_EVENTS */
>>> struct kvm_vcpu_events {
>>> ...
>>> struct {
>>> __u8 injected;
>>> __u8 pending;
>>> __u8 masked;
>>> __u8 pad;
>>> } nmi;
>>> ...
>>>
>>> I found that the nmi.masked property does these enable or disable NMI jobs.
>>> So, I think we don't need to add a new bit. Right?
>>
>> nmi.masked says whether the CPU is accepting the NMIs, and is cleared
>> by the next IRET instruction. This is a different thing; it probably
>> shouldn't affect NMI IPIs, and it definitely should remain set until
>> cleared via the RTC. So it should be something like
>>
>> _u8 external_nmi_disabled;
>>
>> or similar.
>>
>> *However* I found this in the ICH9 datasheet:
>>
>> The ICH9's I/O APIC can only send interrupts due to interrupts which
>> do not include SMI, NMI or INIT. This means that in IA-32/Intel ® 64
>> based platforms, Front Side Bus interrupt message format delivery modes
>> 010 (SMI/PMI), 100 (NMI), and 101 (INIT) as indicated in this section,
>> must not be used and is not supported.
>>
>> In theory the PIIX4 could deliver such messages, but perhaps we could
>> disable them in the KVM IOAPIC. If we do this, there is no need for a
>> change to struct kvm_vcpu_events, because all external NMI sources will
>> be in userspace.
>>
>> Radim, what do you think?
>
> I looked at the 440fx, piix, and 82083aa(ioapic) datasheets and the
> NMI_EN bit doesn't seem to be propagated into the IOAPIC.
> The IOAPIC datasheet doesn't mention a thing about NMI masking and PIIX4
> generates NMI on SERR# or IOCHK# so it seems that the NMI_EN feature
> only changes the behavior of those two ...
>
> I think it's best to do nothing in KVM.
Then Gonglei's patch (apart from the issues that Eduardo pointed out) is
fine.
Paolo
next prev parent reply other threads:[~2015-12-16 8:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-12 13:15 [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos Gonglei
2015-12-14 9:56 ` Paolo Bonzini
2015-12-14 12:49 ` Gonglei (Arei)
2015-12-14 12:51 ` Paolo Bonzini
2015-12-14 13:27 ` Gonglei (Arei)
2015-12-14 13:37 ` Paolo Bonzini
2015-12-15 0:58 ` Gonglei (Arei)
2015-12-15 9:34 ` Gonglei (Arei)
2015-12-15 10:43 ` Paolo Bonzini
2015-12-15 18:53 ` Radim Krcmar
2015-12-16 8:26 ` Gonglei (Arei)
2015-12-16 8:51 ` Paolo Bonzini [this message]
2015-12-16 10:28 ` Gonglei (Arei)
2015-12-16 12:14 ` Paolo Bonzini
2015-12-17 7:17 ` Gonglei (Arei)
2015-12-17 8:37 ` Paolo Bonzini
2015-12-17 9:04 ` Gonglei (Arei)
2015-12-14 18:16 ` Eduardo Habkost
2015-12-15 1:00 ` Gonglei (Arei)
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=5671261F.4010305@redhat.com \
--to=pbonzini@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=ehabkost@redhat.com \
--cc=kevin@koconnor.net \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
--cc=rth@twiddle.net \
/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).