Skip to contentSkip to conversation

ide save/restore current transfer fields

PATCH Applied Juan Quintela 2 participants 2 messages Jan 20, 2010 – Jan 26, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide save/restore current transfer fields

From: Marcelo Tosatti <[email protected]>

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)

---
 hw/ide/pci.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
hw/ide/pci.c +6 -2
index 780fc5f..4d95cc5 100644
@@ -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,
Signature · 1 line
1.6.6
#1 lore raw
Quoted 11 lines · Juan Quintela

From: Marcelo Tosatti<[email protected]>

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 }

Quoted 9 lines

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)

Applied. Thanks.

This is one of those nasty stable situations. If we backport to stable, we fix a potentially bug but we max migration within stable impossible. We really ought to blacklist the old version too without an explicit override.

Any thoughts on how to handle this? We at least have to record this as an issue.

Regards,

Anthony Liguori