All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: James Sullivan <sullivan.james.f@gmail.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, gleb@kernel.org, pbonzini@redhat.com
Subject: Re: [Patch v5] x86: irq_comm: Add check for RH bit in kvm_set_msi_irq
Date: Tue, 24 Mar 2015 15:03:04 +0100	[thread overview]
Message-ID: <20150324140301.GD21522@potion.brq.redhat.com> (raw)
In-Reply-To: <551097AF.4000303@gmail.com>

2015-03-23 16:46-0600, James Sullivan:
> On 03/23/2015 03:13 PM, Radim Krčmář wrote:
> > I meant if the delivery mode from data register isn't ignored with RH=1,
> > and the message delivered as if lowest-priority was set there.
> > (Decided by having something else than fixed or lowest-priority there.)
> > 
> 
> Hmm, any thoughts on how I could test for that?

Set the MSI data register's delivery mode to NMI/SMI/...
The change below fails => hardware honors delivery mode.

I tested it and Linux got a lot of unexpected NMIs, so the emulation in
your latest patch looks correct.

diff --git a/arch/x86/include/asm/msidef.h b/arch/x86/include/asm/msidef.h
index 4cc48af23fef..2270e459186b 100644
--- a/arch/x86/include/asm/msidef.h
+++ b/arch/x86/include/asm/msidef.h
@@ -17,6 +17,7 @@
 #define MSI_DATA_DELIVERY_MODE_SHIFT	8
 #define  MSI_DATA_DELIVERY_FIXED	(0 << MSI_DATA_DELIVERY_MODE_SHIFT)
 #define  MSI_DATA_DELIVERY_LOWPRI	(1 << MSI_DATA_DELIVERY_MODE_SHIFT)
+#define  MSI_DATA_DELIVERY_NMI		(4 << MSI_DATA_DELIVERY_MODE_SHIFT)
 
 #define MSI_DATA_LEVEL_SHIFT		14
 #define	 MSI_DATA_LEVEL_DEASSERT	(0 << MSI_DATA_LEVEL_SHIFT)
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index d6ba2d660dc5..4f71737c34eb 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -46,7 +46,7 @@ void native_compose_msi_msg(struct pci_dev *pdev,
 		MSI_DATA_LEVEL_ASSERT |
 		((apic->irq_delivery_mode != dest_LowestPrio) ?
 			MSI_DATA_DELIVERY_FIXED :
-			MSI_DATA_DELIVERY_LOWPRI) |
+			MSI_DATA_DELIVERY_NMI) |
 		MSI_DATA_VECTOR(cfg->vector);
 }
 

  reply	other threads:[~2015-03-24 14:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 15:14 [Patch v5] x86: irq_comm: Add check for RH bit in kvm_set_msi_irq James Sullivan
2015-03-13 15:48 ` Radim Krčmář
2015-03-17 15:23 ` James Sullivan
2015-03-18 22:52 ` Marcelo Tosatti
2015-03-19  0:59   ` James Sullivan
2015-03-19  1:09     ` Marcelo Tosatti
2015-03-19 13:00       ` Radim Krčmář
2015-03-19 22:51         ` James Sullivan
2015-03-20 15:15           ` Radim Krčmář
2015-03-20 15:22             ` James Sullivan
2015-03-20 17:50               ` James Sullivan
2015-03-23 21:13                 ` Radim Krčmář
2015-03-23 22:46                   ` James Sullivan
2015-03-24 14:03                     ` Radim Krčmář [this message]
2015-03-24 14:17                       ` James Sullivan
2015-04-02 22:08                       ` James Sullivan
2015-04-03 10:11                         ` Radim Krčmář
2015-04-21 12:18           ` Paolo Bonzini
2015-04-21 12:44             ` Radim Krčmář
2015-03-19  1:11     ` Marcelo Tosatti

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=20150324140301.GD21522@potion.brq.redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=sullivan.james.f@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.