[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/6] msi: Guard msi/msix_write_config with msi_prese
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 1/6] msi: Guard msi/msix_write_config with msi_present |
Date: |
Sun, 4 Dec 2011 14:22:09 +0100 |
From: Jan Kiszka <address@hidden>
Terminate msi/msix_write_config early if support is not enabled. This
allows to remove checks at the caller site if MSI is optional.
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/msi.c | 3 ++-
hw/msix.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/msi.c b/hw/msi.c
index f214fcf..541e4e1 100644
--- a/hw/msi.c
+++ b/hw/msi.c
@@ -264,7 +264,8 @@ void msi_write_config(PCIDevice *dev, uint32_t addr,
uint32_t val, int len)
unsigned int vector;
uint32_t pending;
- if (!ranges_overlap(addr, len, dev->msi_cap, msi_cap_sizeof(flags))) {
+ if (!msi_present(dev) ||
+ !ranges_overlap(addr, len, dev->msi_cap, msi_cap_sizeof(flags))) {
return;
}
diff --git a/hw/msix.c b/hw/msix.c
index 149eed2..32fd9b2 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -156,7 +156,7 @@ void msix_write_config(PCIDevice *dev, uint32_t addr,
int vector;
bool was_masked;
- if (!range_covers_byte(addr, len, enable_pos)) {
+ if (!msix_present(dev) || !range_covers_byte(addr, len, enable_pos)) {
return;
}
--
1.7.3.4
[Qemu-devel] [PATCH 6/6] msi: Generalize msix_supported to msi_supported, Jan Kiszka, 2011/12/04
[Qemu-devel] [PATCH 5/6] msi: Invoke msi/msix_write_config from PCI core, Jan Kiszka, 2011/12/04
[Qemu-devel] [PATCH 3/6] msi: Use msi/msix_present more consistently, Jan Kiszka, 2011/12/04