[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/15] pc: memhp: force gaps between DIMM's GPA
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 13/15] pc: memhp: force gaps between DIMM's GPA |
Date: |
Fri, 2 Oct 2015 16:45:51 +0300 |
From: Igor Mammedov <address@hidden>
mapping DIMMs non contiguously allows to workaround
virtio bug reported earlier:
http://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg00522.html
in this case guest kernel doesn't allocate buffers
that can cross DIMM boundary keeping each buffer
local to a DIMM.
Suggested-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i386/pc.h | 1 +
hw/i386/pc.c | 6 ++++--
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index ab5413f..c13e91d 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -60,6 +60,7 @@ struct PCMachineClass {
/*< public >*/
bool broken_reserved_end;
+ bool inter_dimm_gap;
HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
DeviceState *dev);
};
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ef02736..efbd41a 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1629,6 +1629,7 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev,
HotplugHandlerClass *hhc;
Error *local_err = NULL;
PCMachineState *pcms = PC_MACHINE(hotplug_dev);
+ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
PCDIMMDevice *dimm = PC_DIMM(dev);
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
MemoryRegion *mr = ddc->get_memory_region(dimm);
@@ -1644,8 +1645,8 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev,
goto out;
}
- pc_dimm_memory_plug(dev, &pcms->hotplug_memory, mr, align, false,
- &local_err);
+ pc_dimm_memory_plug(dev, &pcms->hotplug_memory, mr, align,
+ pcmc->inter_dimm_gap, &local_err);
if (local_err) {
goto out;
}
@@ -1946,6 +1947,7 @@ static void pc_machine_class_init(ObjectClass *oc, void
*data)
PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
+ pcmc->inter_dimm_gap = true;
pcmc->get_hotplug_handler = mc->get_hotplug_handler;
mc->get_hotplug_handler = pc_get_hotpug_handler;
mc->cpu_index_to_socket_id = pc_cpu_index_to_socket_id;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 52fdd55..4514cd1 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -489,6 +489,7 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m)
m->alias = NULL;
m->is_default = 0;
pcmc->broken_reserved_end = true;
+ pcmc->inter_dimm_gap = false;
SET_MACHINE_COMPAT(m, PC_COMPAT_2_4);
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 837e430..1f100b1 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -392,6 +392,7 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
pc_q35_2_5_machine_options(m);
m->alias = NULL;
pcmc->broken_reserved_end = true;
+ pcmc->inter_dimm_gap = false;
SET_MACHINE_COMPAT(m, PC_COMPAT_2_4);
}
--
MST
- [Qemu-devel] [PULL 00/15] virtio,pc features, fixes, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 01/15] virtio: introduce virtqueue_unmap_sg(), Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 06/15] exec: allocate PROT_NONE pages on top of RAM, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 08/15] virtio: Notice when the system doesn't support MSIx at all, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 11/15] vhost-user: unit test for new messages, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 12/15] memhp: extend address auto assignment to support gaps, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 07/15] pc: Add a comment explaining why pc_compat_2_4() doesn't exist, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 03/15] virtio-net: correctly drop truncated packets, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 05/15] oslib: allocate PROT_NONE pages on top of RAM, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 10/15] vhost-user-test: do not reinvent glib-compat.h, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 13/15] pc: memhp: force gaps between DIMM's GPA,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 02/15] virtio: introduce virtqueue_discard(), Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 09/15] virtio-9p: migrate virtio subsections, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 04/15] oslib: rework anonimous RAM allocation, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 15/15] vhost-user-test: fix predictable filename on tmpfs, Michael S. Tsirkin, 2015/10/08
- [Qemu-devel] [PULL 14/15] vhost-user-test: use tmpfs by default, Michael S. Tsirkin, 2015/10/08