[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/25] intel_iommu: remove X86_IOMMU_PCI_DEVFN_MAX
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 21/25] intel_iommu: remove X86_IOMMU_PCI_DEVFN_MAX |
Date: |
Thu, 21 Dec 2017 16:33:40 +0200 |
From: Peter Xu <address@hidden>
We have PCI_DEVFN_MAX now.
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Liu, Yi L <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i386/x86-iommu.h | 1 -
hw/i386/intel_iommu.c | 10 +++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h
index ef89c0c..7c71fc7 100644
--- a/include/hw/i386/x86-iommu.h
+++ b/include/hw/i386/x86-iommu.h
@@ -31,7 +31,6 @@
#define X86_IOMMU_GET_CLASS(obj) \
OBJECT_GET_CLASS(X86IOMMUClass, obj, TYPE_X86_IOMMU_DEVICE)
-#define X86_IOMMU_PCI_DEVFN_MAX 256
#define X86_IOMMU_SID_INVALID (0xffff)
typedef struct X86IOMMUState X86IOMMUState;
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 3a5bb0b..c1fa08d 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -186,7 +186,7 @@ static void vtd_reset_context_cache(IntelIOMMUState *s)
g_hash_table_iter_init(&bus_it, s->vtd_as_by_busptr);
while (g_hash_table_iter_next (&bus_it, NULL, (void**)&vtd_bus)) {
- for (devfn_it = 0; devfn_it < X86_IOMMU_PCI_DEVFN_MAX; ++devfn_it) {
+ for (devfn_it = 0; devfn_it < PCI_DEVFN_MAX; ++devfn_it) {
vtd_as = vtd_bus->dev_as[devfn_it];
if (!vtd_as) {
continue;
@@ -1002,7 +1002,7 @@ static void vtd_switch_address_space_all(IntelIOMMUState
*s)
g_hash_table_iter_init(&iter, s->vtd_as_by_busptr);
while (g_hash_table_iter_next(&iter, NULL, (void **)&vtd_bus)) {
- for (i = 0; i < X86_IOMMU_PCI_DEVFN_MAX; i++) {
+ for (i = 0; i < PCI_DEVFN_MAX; i++) {
if (!vtd_bus->dev_as[i]) {
continue;
}
@@ -1294,7 +1294,7 @@ static void vtd_context_device_invalidate(IntelIOMMUState
*s,
vtd_bus = vtd_find_as_from_bus_num(s, bus_n);
if (vtd_bus) {
devfn = VTD_SID_TO_DEVFN(source_id);
- for (devfn_it = 0; devfn_it < X86_IOMMU_PCI_DEVFN_MAX; ++devfn_it) {
+ for (devfn_it = 0; devfn_it < PCI_DEVFN_MAX; ++devfn_it) {
vtd_as = vtd_bus->dev_as[devfn_it];
if (vtd_as && ((devfn_it & mask) == (devfn & mask))) {
trace_vtd_inv_desc_cc_device(bus_n, VTD_PCI_SLOT(devfn_it),
@@ -2699,7 +2699,7 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s,
PCIBus *bus, int devfn)
*new_key = (uintptr_t)bus;
/* No corresponding free() */
vtd_bus = g_malloc0(sizeof(VTDBus) + sizeof(VTDAddressSpace *) * \
- X86_IOMMU_PCI_DEVFN_MAX);
+ PCI_DEVFN_MAX);
vtd_bus->bus = bus;
g_hash_table_insert(s->vtd_as_by_busptr, new_key, vtd_bus);
}
@@ -2982,7 +2982,7 @@ static AddressSpace *vtd_host_dma_iommu(PCIBus *bus, void
*opaque, int devfn)
IntelIOMMUState *s = opaque;
VTDAddressSpace *vtd_as;
- assert(0 <= devfn && devfn < X86_IOMMU_PCI_DEVFN_MAX);
+ assert(0 <= devfn && devfn < PCI_DEVFN_MAX);
vtd_as = vtd_find_add_as(s, bus, devfn);
return &vtd_as->as;
--
MST
- Re: [Qemu-devel] [PULL 15/25] hw/block/nvme: QOM'ify PCI NVME, (continued)
- [Qemu-devel] [PULL 16/25] hw/pci-host/piix: QOM'ify the IGD Passthrough host bridge, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 17/25] hw/pci-host/xilinx: QOM'ify the AXI-PCIe host bridge, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 18/25] hw/pci: remove obsolete PCIDevice->init(), Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 19/25] vhost-user: fix indentation in protocol specification, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 20/25] vhost-user: document memory accesses, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 23/25] virtio-pci: Don't force Subsystem Vendor ID = Vendor ID, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 25/25] smbus: do not immediately complete commands, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 24/25] dump-guest-memory.py: fix "You can't do that without a process to debug", Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 21/25] intel_iommu: remove X86_IOMMU_PCI_DEVFN_MAX,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 22/25] intel_iommu: fix error param in string, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Peter Maydell, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Peter Maydell, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Philippe Mathieu-Daudé, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Philippe Mathieu-Daudé, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21