qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ide save/restore current transfer fields
@ 2010-01-20 17:01 Juan Quintela
  2010-01-26 22:02 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Juan Quintela @ 2010-01-20 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marcelo Tosatti

From: Marcelo Tosatti <mtosatti@redhat.com>

If migration takes place between write of the bmdma address register and
write of the command register (to initiate DMA), the destination will
not properly start the DMA op, hanging the guest:

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
ata1.00: cmd c8/00:16:41:00:00/00:00:00:00:00/e0 tag 0 dma 11264 in
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }

Fix by sending current transfer information in the migration data.

We need to update ide version to 4 for this to work.  As we don't
have subsectios, we need to chain the update increase until
vmstate_ide_pci (quintela)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/ide/pci.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 780fc5f..4d95cc5 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -123,7 +123,7 @@ void bmdma_addr_writel(void *opaque, uint32_t addr, uint32_t val)

 static const VMStateDescription vmstate_bmdma = {
     .name = "ide bmdma",
-    .version_id = 3,
+    .version_id = 4,
     .minimum_version_id = 0,
     .minimum_version_id_old = 0,
     .fields      = (VMStateField []) {
@@ -133,6 +133,10 @@ static const VMStateDescription vmstate_bmdma = {
         VMSTATE_INT64(sector_num, BMDMAState),
         VMSTATE_UINT32(nsector, BMDMAState),
         VMSTATE_UINT8(unit, BMDMAState),
+        VMSTATE_UINT32_V(cur_addr, BMDMAState, 4),
+        VMSTATE_UINT32_V(cur_prd_last, BMDMAState, 4),
+        VMSTATE_UINT32_V(cur_prd_addr, BMDMAState, 4),
+        VMSTATE_UINT32_V(cur_prd_len, BMDMAState, 4),
         VMSTATE_END_OF_LIST()
     }
 };
@@ -152,7 +156,7 @@ static int ide_pci_post_load(void *opaque, int version_id)

 const VMStateDescription vmstate_ide_pci = {
     .name = "ide",
-    .version_id = 3,
+    .version_id = 4,
     .minimum_version_id = 0,
     .minimum_version_id_old = 0,
     .post_load = ide_pci_post_load,
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH] ide save/restore current transfer fields
@ 2010-01-20 16:22 Marcelo Tosatti
  0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2010-01-20 16:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Avi Kivity, Juan Quintela


If migration takes place between write of the bmdma address register and
write of the command register (to initiate DMA), the destination will
not properly start the DMA op, hanging the guest:

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
ata1.00: cmd c8/00:16:41:00:00/00:00:00:00:00/e0 tag 0 dma 11264 in
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }

Fix by sending current transfer information in the migration data.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 780fc5f..9f245ed 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -133,6 +135,10 @@ static const VMStateDescription vmstate_bmdma = {
         VMSTATE_INT64(sector_num, BMDMAState),
         VMSTATE_UINT32(nsector, BMDMAState),
         VMSTATE_UINT8(unit, BMDMAState),
+        VMSTATE_UINT32(cur_addr, BMDMAState),
+        VMSTATE_UINT32(cur_prd_last, BMDMAState),
+        VMSTATE_UINT32(cur_prd_addr, BMDMAState),
+        VMSTATE_UINT32(cur_prd_len, BMDMAState),
         VMSTATE_END_OF_LIST()
     }
 };

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-26 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 17:01 [Qemu-devel] [PATCH] ide save/restore current transfer fields Juan Quintela
2010-01-26 22:02 ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2010-01-20 16:22 Marcelo Tosatti

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).