[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 08/10] msi: Guard msi/msix_write_config with msi_
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v2 08/10] msi: Guard msi/msix_write_config with msi_present |
Date: |
Thu, 10 May 2012 17:08:24 -0300 |
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 b2903fc..da12f33 100644
--- a/hw/msi.c
+++ b/hw/msi.c
@@ -276,7 +276,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 3835eaa..84915d8 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -157,7 +157,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 v2 00/10] msi: Refactorings and reset fixes, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 02/10] intel-hda: Fix reset of MSI function, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 01/10] ahci: Fix reset of MSI function, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 04/10] ahci: Clean up reset functions, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 05/10] xhci: Clean up reset function, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 03/10] xhci: Fix reset of MSI function, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 06/10] msi: Guard msi_reset with msi_present, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 08/10] msi: Guard msi/msix_write_config with msi_present,
Jan Kiszka <=
- [Qemu-devel] [PATCH v2 07/10] msi: Invoke msi/msix_reset from PCI core, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 09/10] msi: Invoke msi/msix_write_config from PCI core, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 10/10] msi: Use msi/msix_present more consistently, Jan Kiszka, 2012/05/10