From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: [PATCH] pci-assign: Fix transition MSI->INTx
Date: Tue, 04 Jan 2011 22:04:30 +0100 [thread overview]
Message-ID: <4D238B5E.9010102@web.de> (raw)
From: Jan Kiszka <jan.kiszka@siemens.com>
Make sure to re-register the IRQ of an assigned device as INTx when the
guest disables MSI[X] mode again.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/device-assignment.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index f6410f8..fce7567 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1192,7 +1192,10 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev, unsigned int ctrl_pos)
if (kvm_assign_irq(kvm_context, &assigned_irq_data) < 0)
perror("assigned_dev_enable_msi: assign irq");
+ assigned_dev->girq = -1;
assigned_dev->irq_requested_type = assigned_irq_data.flags;
+ } else {
+ assign_irq(assigned_dev);
}
}
#endif
@@ -1332,7 +1335,10 @@ static void assigned_dev_update_msix(PCIDevice *pci_dev, unsigned int ctrl_pos)
perror("assigned_dev_enable_msix: assign irq");
return;
}
+ assigned_dev->girq = -1;
assigned_dev->irq_requested_type = assigned_irq_data.flags;
+ } else {
+ assign_irq(assigned_dev);
}
}
#endif
--
1.7.1
next reply other threads:[~2011-01-04 21:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 21:04 Jan Kiszka [this message]
2011-01-06 13:40 ` [PATCH] pci-assign: Fix transition MSI->INTx Avi Kivity
2011-01-06 13:51 ` Alex Williamson
2011-01-06 14:23 ` Michael S. Tsirkin
2011-01-07 9:59 ` 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=4D238B5E.9010102@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox