qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>,
	Radim Krcmar <rkrcmar@redhat.com>
Cc: "Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	kevin@koconnor.net, qemu-devel@nongnu.org, ehabkost@redhat.com,
	rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos
Date: Tue, 15 Dec 2015 05:43:06 -0500 (EST)	[thread overview]
Message-ID: <145192308.40660604.1450176186593.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020B02B4BE3@SZXEMA503-MBS.china.huawei.com>

> 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?

Paolo

  reply	other threads:[~2015-12-15 10:43 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 [this message]
2015-12-15 18:53               ` Radim Krcmar
2015-12-16  8:26                 ` Gonglei (Arei)
2015-12-16  8:51                 ` Paolo Bonzini
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=145192308.40660604.1450176186593.JavaMail.zimbra@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).