From: Wei Liu <liuw@liuw.name>
To: qemu-devel@nongnu.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Qemu-devel] Xen: enabling emulated MSI injection
Date: Thu, 26 May 2011 12:57:41 +0800 [thread overview]
Message-ID: <BANLkTik7kyyyMhuj+Upi5Jn_tCeF5dy+vg@mail.gmail.com> (raw)
commit 0ad7c9289253b9fd496ac695ce5bf1f23027d97a
Author: Wei Liu <liuw@liuw.name>
Date: Thu May 26 10:16:18 2011 +0800
MSI injection for Xen.
This is supposed to be used in conjunction with Xen's
new hypercall interface for emualted MSI injection.
Signed-off-by: Wei Liu <liuw@liuw.name>
diff --git a/hw/msix.c b/hw/msix.c
index af40e26..1057eff 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -15,6 +15,7 @@
#include "msix.h"
#include "pci.h"
#include "range.h"
+#include "xen.h"
/* MSI-X capability structure */
#define MSIX_TABLE_OFFSET 4
@@ -369,7 +370,12 @@ void msix_notify(PCIDevice *dev, unsigned vector)
address = pci_get_long(table_entry + MSIX_MSG_UPPER_ADDR);
address = (address << 32) | pci_get_long(table_entry + MSIX_MSG_ADDR);
data = pci_get_long(table_entry + MSIX_MSG_DATA);
- stl_phys(address, data);
+
+ if (xen_enabled()) {
+ xen_hvm_inj_msi(address, data);
+ } else {
+ stl_phys(address, data);
+ }
}
void msix_reset(PCIDevice *dev)
diff --git a/hw/xen.h b/hw/xen.h
index d435ca0..11a3c4a 100644
--- a/hw/xen.h
+++ b/hw/xen.h
@@ -43,6 +43,7 @@ static inline int xen_mapcache_enabled(void)
int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
void xen_piix3_set_irq(void *opaque, int irq_num, int level);
void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
+void xen_hvm_inj_msi(uint64_t addr, uint32_t data);
void xen_cmos_set_s3_resume(void *opaque, int irq, int level);
qemu_irq *xen_interrupt_controller_init(void);
diff --git a/xen-all.c b/xen-all.c
index 0944673..a553992 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -100,6 +100,11 @@ void xen_piix_pci_write_config_client(uint32_t
address, uint32_t val, int len)
}
}
+void xen_hvm_inj_msi(uint64_t addr, uint32_t data)
+{
+ xc_hvm_inj_msi(xen_xc, xen_domid, addr, data);
+}
+
void xen_cmos_set_s3_resume(void *opaque, int irq, int level)
{
pc_cmos_set_s3_resume(opaque, irq, level);
diff --git a/xen-stub.c b/xen-stub.c
index a4f35a1..c18c62f 100644
--- a/xen-stub.c
+++ b/xen-stub.c
@@ -39,3 +39,7 @@ int xen_init(void)
{
return -ENOSYS;
}
+
+void xen_hvm_inj_msi(uint64_t addr, uint32_t data)
+{
+}
--
Best regards
Wei Liu
Twitter: @iliuw
Site: http://liuw.name
next reply other threads:[~2011-05-26 4:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-26 4:57 Wei Liu [this message]
2011-05-26 7:21 ` [Qemu-devel] Xen: enabling emulated MSI injection Jan Kiszka
2011-05-26 7:35 ` Wei Liu
2011-05-26 7:41 ` Jan Kiszka
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=BANLkTik7kyyyMhuj+Upi5Jn_tCeF5dy+vg@mail.gmail.com \
--to=liuw@liuw.name \
--cc=anthony.perard@citrix.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.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;
as well as URLs for NNTP newsgroup(s).