[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/28] hw/pci: add support for NUMA nodes
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 20/28] hw/pci: add support for NUMA nodes |
Date: |
Thu, 4 Jun 2015 13:11:14 +0200 |
From: Marcel Apfelbaum <address@hidden>
PCI root buses can be attached to a specific NUMA node.
PCI buses are not attached by default to a NUMA node.
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Laszlo Ersek <address@hidden>
---
include/hw/pci/pci.h | 1 +
include/hw/pci/pci_bus.h | 1 +
include/sysemu/sysemu.h | 1 +
hw/pci/pci.c | 11 +++++++++++
4 files changed, 14 insertions(+)
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 7940700..c2a427f 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -382,6 +382,7 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
PCIDevice *pci_vga_init(PCIBus *bus);
int pci_bus_num(PCIBus *s);
+int pci_bus_numa_node(PCIBus *bus);
void pci_for_each_device(PCIBus *bus, int bus_num,
void (*fn)(PCIBus *bus, PCIDevice *d, void *opaque),
void *opaque);
diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bus.h
index 7b9939e..403fec6 100644
--- a/include/hw/pci/pci_bus.h
+++ b/include/hw/pci/pci_bus.h
@@ -15,6 +15,7 @@ typedef struct PCIBusClass {
bool (*is_root)(PCIBus *bus);
int (*bus_num)(PCIBus *bus);
+ uint16_t (*numa_node)(PCIBus *bus);
} PCIBusClass;
struct PCIBus {
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 8a52934..4fcc20e 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -137,6 +137,7 @@ extern const char *mem_path;
extern int mem_prealloc;
#define MAX_NODES 128
+#define NUMA_NODE_UNASSIGNED MAX_NODES
/* The following shall be true for all CPUs:
* cpu->cpu_index < max_cpus <= MAX_CPUMASK_BITS
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index a956640..4989408 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -101,6 +101,11 @@ static int pcibus_num(PCIBus *bus)
return bus->parent_dev->config[PCI_SECONDARY_BUS];
}
+static uint16_t pcibus_numa_node(PCIBus *bus)
+{
+ return NUMA_NODE_UNASSIGNED;
+}
+
static void pci_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *k = BUS_CLASS(klass);
@@ -115,6 +120,7 @@ static void pci_bus_class_init(ObjectClass *klass, void
*data)
pbc->is_root = pcibus_is_root;
pbc->bus_num = pcibus_num;
+ pbc->numa_node = pcibus_numa_node;
}
static const TypeInfo pci_bus_info = {
@@ -402,6 +408,11 @@ int pci_bus_num(PCIBus *s)
return PCI_BUS_GET_CLASS(s)->bus_num(s);
}
+int pci_bus_numa_node(PCIBus *bus)
+{
+ return PCI_BUS_GET_CLASS(bus)->numa_node(bus);
+}
+
static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
{
PCIDevice *s = container_of(pv, PCIDevice, config);
--
MST
- [Qemu-devel] [PULL 10/28] hw/i386: query only for q35/pc when looking for pci host bridge, (continued)
- [Qemu-devel] [PULL 10/28] hw/i386: query only for q35/pc when looking for pci host bridge, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 11/28] hw/pci: extend PCI config access to support devices behind PXB, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 12/28] hw/acpi: add support for i440fx 'snooping' root busses, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 13/28] hw/apci: add _PRT method for extra PCI root busses, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 14/28] hw/acpi: add _CRS method for extra root busses, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 15/28] hw/acpi: remove from root bus 0 the crs resources used by other buses., Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 16/28] hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 17/28] hw/pci: introduce PCI Expander Bridge (PXB), Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 18/28] hw/pci: inform bios if the system has extra pci root buses, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 19/28] hw/pxb: add map_irq func, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 20/28] hw/pci: add support for NUMA nodes,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 21/28] hw/pxb: add numa_node parameter, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 22/28] apci: fix PXB behaviour if used with unsupported BIOS, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 24/28] pc-dimm: don't assert if pc-dimm alignment != hotpluggable mem range size, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 23/28] docs: Add PXB documentation, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 25/28] hw/acpi: acpi_pm1_cnt_init(): take "disable_s3" and "disable_s4", Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 26/28] hw/acpi: move "etc/system-states" fw_cfg file from PIIX4 to core, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 27/28] hw/acpi: piix4_pm_init(): take fw_cfg object no more, Michael S. Tsirkin, 2015/06/04
- [Qemu-devel] [PULL 28/28] vhost: logs sharing, Michael S. Tsirkin, 2015/06/04
- Re: [Qemu-devel] [PULL 00/28] pc, acpi, virtio, tpm, Peter Maydell, 2015/06/05