All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Butsykin <pbutsykin@virtuozzo.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>,
	qemu-devel@nongnu.org
Cc: John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] ide: don't loose pending dma state
Date: Thu, 24 Mar 2016 12:24:25 +0300	[thread overview]
Message-ID: <56F3B249.50605@virtuozzo.com> (raw)
In-Reply-To: <56F2FDE5.5020908@redhat.com>

On 23.03.2016 23:34, Paolo Bonzini wrote:
>
>
> On 23/03/2016 11:26, Denis V. Lunev wrote:
>> If the migration occurs after the IDE DMA has been set up but before it
>> has been initiated, the state gets lost upon save/restore. Specifically,
>> ->dma_cb callback gets cleared, so, when the guest eventually starts bus
>> mastering, the DMA never completes, causing the guest to time out the
>> operation.
>>
>> OTOH all the infrastructure is already in place to restart the DMA if
>> the migration happens while the DMA is in progress.
>>
>> So reuse that infrastructure, by calling the DMA callback with an
>> artificial error code in pre_save if the callback is already set but
>> DMAING is clear. The callback then sets bus->error_status to indicate
>> the need for restart; however since DMAING is clear the state upon
>> restore will be exactly "ready forDMA" as before the save.
>
> Could you just use the dma_cmd field to build the error_status?
>
> For extra points, make ide_handle_rw_error convert IDE_DMA_* to
> IDE_RETRY_* so that the callers only need to pass in IDE_RETRY_DMA (like
> they only need to pass in IDE_RETRY_PIO).
>
> Paolo
>
You mean to do something like that:

ide_handle_rw_error(s, -ret, s->dma_cmd | IDE_RETRY_DMA)

?

  reply	other threads:[~2016-03-24  9:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 10:26 [Qemu-devel] [PATCH for 2.6 0/3] ide: fix loss of the dma/atapi state during migration Denis V. Lunev
2016-03-23 10:26 ` [Qemu-devel] [PATCH 1/3] ide: don't loose pending dma state Denis V. Lunev
2016-03-23 20:34   ` Paolo Bonzini
2016-03-24  9:24     ` Pavel Butsykin [this message]
2016-03-24 11:23       ` Paolo Bonzini
2016-03-24 13:38         ` Pavel Butsykin
2016-03-24 14:07           ` Paolo Bonzini
2016-03-24 15:11             ` Pavel Butsykin
2016-03-24 15:12               ` Paolo Bonzini
2016-03-24 15:20                 ` Pavel Butsykin
2016-03-24 14:47       ` Eric Blake
2016-03-24 15:40         ` Pavel Butsykin
2016-03-30 17:35   ` John Snow
2016-03-30 17:38     ` Denis V. Lunev
2016-03-30 17:44       ` John Snow
2016-03-23 10:26 ` [Qemu-devel] [PATCH 2/3] ide: restart atapi dma by re-evaluating command packet Denis V. Lunev
2016-03-23 10:26 ` [Qemu-devel] [PATCH 3/3] ide: really restart pending and in-flight atapi dma Denis V. Lunev
2016-03-23 19:36   ` John Snow
2016-03-24  8:34     ` Pavel Butsykin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F3B249.50605@virtuozzo.com \
    --to=pbutsykin@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.