* [Qemu-devel] [PULL 0/1] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
@ 2016-02-29 9:53 Gerd Hoffmann
2016-02-29 9:53 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
2016-02-29 11:49 ` [Qemu-devel] [PULL 0/1] " Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2016-02-29 9:53 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
fwcfg acpi series which I planned to include here is blocked by unexpected
apci test behavior. So I'm sending this patch alone so it doesn't has to
wait until our acpi experts figured what is going on (and maybe the
fwcfg acpi series then goes through the acpi queue anyway).
please pull,
Gerd
The following changes since commit 0c6940d086f39bbf725d96104abe46da87429cb6:
build: [bsd-user] Rename "syscall.h" to "target_syscall.h" in target directories (2016-02-25 16:41:08 +0000)
are available in the git repository at:
git://git.kraxel.org/qemu tags/pull-fw-cfg-20160226-1
for you to fetch changes up to e6915b5f3a874a467a9a65f7ec1d6ef8d251a51a:
fw_cfg: unbreak migration compatibility for 2.4 and earlier machines (2016-02-26 10:06:40 +0100)
----------------------------------------------------------------
fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
----------------------------------------------------------------
Laszlo Ersek (1):
fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
hw/nvram/fw_cfg.c | 20 ++++++++++++--------
include/hw/compat.h | 8 ++++++++
2 files changed, 20 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL 1/1] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
2016-02-29 9:53 [Qemu-devel] [PULL 0/1] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines Gerd Hoffmann
@ 2016-02-29 9:53 ` Gerd Hoffmann
2016-02-29 11:49 ` [Qemu-devel] [PULL 0/1] " Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2016-02-29 9:53 UTC (permalink / raw)
To: qemu-devel
Cc: Marc Marí, Laszlo Ersek, Gerd Hoffmann, Alexandre DERUMIER,
qemu-stable
From: Laszlo Ersek <lersek@redhat.com>
When I reviewed Marc's fw_cfg DMA patches, I completely missed that the
way we set dma_enabled would break migration.
Gerd explained the right way (see reference below): dma_enabled should be
set to true by default, and only true->false transitions should be
possible:
- when the user requests that with
-global fw_cfg_mem.dma_enabled=off
or
-global fw_cfg_io.dma_enabled=off
as appropriate for the platform,
- when HW_COMPAT_2_4 dictates it,
- when board code initializes fw_cfg without requesting DMA support.
Cc: Marc Marí <markmb@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Alexandre DERUMIER <aderumier@odiso.com>
Cc: qemu-stable@nongnu.org
Ref: http://thread.gmane.org/gmane.comp.emulators.qemu/390272/focus=391042
Ref: https://bugs.launchpad.net/qemu/+bug/1536487
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1455823860-22268-1-git-send-email-lersek@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/nvram/fw_cfg.c | 20 ++++++++++++--------
include/hw/compat.h | 8 ++++++++
2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 79c5742..f3acb47 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -778,17 +778,19 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
DeviceState *dev;
FWCfgState *s;
uint32_t version = FW_CFG_VERSION;
- bool dma_enabled = dma_iobase && dma_as;
+ bool dma_requested = dma_iobase && dma_as;
dev = qdev_create(NULL, TYPE_FW_CFG_IO);
qdev_prop_set_uint32(dev, "iobase", iobase);
qdev_prop_set_uint32(dev, "dma_iobase", dma_iobase);
- qdev_prop_set_bit(dev, "dma_enabled", dma_enabled);
+ if (!dma_requested) {
+ qdev_prop_set_bit(dev, "dma_enabled", false);
+ }
fw_cfg_init1(dev);
s = FW_CFG(dev);
- if (dma_enabled) {
+ if (s->dma_enabled) {
/* 64 bits for the address field */
s->dma_as = dma_as;
s->dma_addr = 0;
@@ -814,11 +816,13 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
SysBusDevice *sbd;
FWCfgState *s;
uint32_t version = FW_CFG_VERSION;
- bool dma_enabled = dma_addr && dma_as;
+ bool dma_requested = dma_addr && dma_as;
dev = qdev_create(NULL, TYPE_FW_CFG_MEM);
qdev_prop_set_uint32(dev, "data_width", data_width);
- qdev_prop_set_bit(dev, "dma_enabled", dma_enabled);
+ if (!dma_requested) {
+ qdev_prop_set_bit(dev, "dma_enabled", false);
+ }
fw_cfg_init1(dev);
@@ -828,7 +832,7 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
s = FW_CFG(dev);
- if (dma_enabled) {
+ if (s->dma_enabled) {
s->dma_as = dma_as;
s->dma_addr = 0;
sysbus_mmio_map(sbd, 2, dma_addr);
@@ -873,7 +877,7 @@ static Property fw_cfg_io_properties[] = {
DEFINE_PROP_UINT32("iobase", FWCfgIoState, iobase, -1),
DEFINE_PROP_UINT32("dma_iobase", FWCfgIoState, dma_iobase, -1),
DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled,
- false),
+ true),
DEFINE_PROP_END_OF_LIST(),
};
@@ -913,7 +917,7 @@ static const TypeInfo fw_cfg_io_info = {
static Property fw_cfg_mem_properties[] = {
DEFINE_PROP_UINT32("data_width", FWCfgMemState, data_width, -1),
DEFINE_PROP_BOOL("dma_enabled", FWCfgMemState, parent_obj.dma_enabled,
- false),
+ true),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/include/hw/compat.h b/include/hw/compat.h
index 2ebe739..a5dbbf8 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -42,6 +42,14 @@
.driver = "virtio-pci",\
.property = "migrate-extra",\
.value = "off",\
+ },{\
+ .driver = "fw_cfg_mem",\
+ .property = "dma_enabled",\
+ .value = "off",\
+ },{\
+ .driver = "fw_cfg_io",\
+ .property = "dma_enabled",\
+ .value = "off",\
},
#define HW_COMPAT_2_3 \
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL 0/1] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
2016-02-29 9:53 [Qemu-devel] [PULL 0/1] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines Gerd Hoffmann
2016-02-29 9:53 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
@ 2016-02-29 11:49 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-02-29 11:49 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 29 February 2016 at 09:53, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hi,
>
> fwcfg acpi series which I planned to include here is blocked by unexpected
> apci test behavior. So I'm sending this patch alone so it doesn't has to
> wait until our acpi experts figured what is going on (and maybe the
> fwcfg acpi series then goes through the acpi queue anyway).
>
> please pull,
> Gerd
>
> The following changes since commit 0c6940d086f39bbf725d96104abe46da87429cb6:
>
> build: [bsd-user] Rename "syscall.h" to "target_syscall.h" in target directories (2016-02-25 16:41:08 +0000)
>
> are available in the git repository at:
>
> git://git.kraxel.org/qemu tags/pull-fw-cfg-20160226-1
>
> for you to fetch changes up to e6915b5f3a874a467a9a65f7ec1d6ef8d251a51a:
>
> fw_cfg: unbreak migration compatibility for 2.4 and earlier machines (2016-02-26 10:06:40 +0100)
>
> ----------------------------------------------------------------
> fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-29 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-29 9:53 [Qemu-devel] [PULL 0/1] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines Gerd Hoffmann
2016-02-29 9:53 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
2016-02-29 11:49 ` [Qemu-devel] [PULL 0/1] " Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).