|
|
9ae3a8 |
From 1d05047c15ca1d8e29dcb0892e449987739682b4 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 13 Dec 2017 13:38:40 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 09/41] fw_cfg: unbreak migration compatibility
|
|
|
9ae3a8 |
MIME-Version: 1.0
|
|
|
9ae3a8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9ae3a8 |
Content-Transfer-Encoding: 8bit
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20171213133912.26176-10-marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78359
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v3 09/41] fw_cfg: unbreak migration compatibility
|
|
|
9ae3a8 |
Bugzilla: 1411490
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Upstream-status: RHEL only
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
fw_cfg DMA shouldn't be enabled by default on x86, or it will break
|
|
|
9ae3a8 |
migration from new (DMA) to old (non-DMA) qemu.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Thus we must maintain DMA disabled by default. Since we don't
|
|
|
9ae3a8 |
introduce a new machine, only if requested explicitely with -global
|
|
|
9ae3a8 |
fw_cfg.dma_enabled=on, or -device vmcoreinfo (see upcoming RHEL-only
|
|
|
9ae3a8 |
patch) should DMA be enabled.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
(this is somewhat similar to upstream commit
|
|
|
9ae3a8 |
e6915b5f3a874a467a9a65f7ec1d6ef8d251a51a, except that we can't enable
|
|
|
9ae3a8 |
DMA by default on RHEL qemu)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/nvram/fw_cfg.c | 9 ++++++---
|
|
|
9ae3a8 |
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
|
|
|
9ae3a8 |
index 1789487..a7bc98e 100644
|
|
|
9ae3a8 |
--- a/hw/nvram/fw_cfg.c
|
|
|
9ae3a8 |
+++ b/hw/nvram/fw_cfg.c
|
|
|
9ae3a8 |
@@ -677,13 +677,16 @@ fw_cfg_init_dma(uint32_t ctl_port, uint32_t data_port,
|
|
|
9ae3a8 |
SysBusDevice *d;
|
|
|
9ae3a8 |
FWCfgState *s;
|
|
|
9ae3a8 |
uint32_t version = FW_CFG_VERSION;
|
|
|
9ae3a8 |
- bool dma_enabled = dma_port && dma_as;
|
|
|
9ae3a8 |
+ bool dma_requested = dma_port && dma_as;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
dev = qdev_create(NULL, "fw_cfg");
|
|
|
9ae3a8 |
qdev_prop_set_uint32(dev, "ctl_iobase", ctl_port);
|
|
|
9ae3a8 |
qdev_prop_set_uint32(dev, "data_iobase", data_port);
|
|
|
9ae3a8 |
qdev_prop_set_uint32(dev, "dma_iobase", dma_port);
|
|
|
9ae3a8 |
- qdev_prop_set_bit(dev, "dma_enabled", dma_enabled);
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ if (!dma_requested) {
|
|
|
9ae3a8 |
+ qdev_prop_set_bit(dev, "dma_enabled", false);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
d = SYS_BUS_DEVICE(dev);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -702,7 +705,7 @@ fw_cfg_init_dma(uint32_t ctl_port, uint32_t data_port,
|
|
|
9ae3a8 |
if (data_addr) {
|
|
|
9ae3a8 |
sysbus_mmio_map(d, 1, data_addr);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
- if (dma_enabled) {
|
|
|
9ae3a8 |
+ if (s->dma_enabled) {
|
|
|
9ae3a8 |
/* 64 bits for the address field */
|
|
|
9ae3a8 |
s->dma = &dma_context_memory;
|
|
|
9ae3a8 |
s->dma_addr = 0;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|