qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RESEND PATCH 0/1] ide: fix halted IO segfault at reset
@ 2016-07-27 14:51 John Snow
  2016-07-27 14:51 ` [Qemu-devel] [RESEND PATCH 1/1] " John Snow
  0 siblings, 1 reply; 3+ messages in thread
From: John Snow @ 2016-07-27 14:51 UTC (permalink / raw)
  To: qemu-stable; +Cc: pbonzini, lersek, qemu-devel, armbru, mreitz, John Snow

Resending for qemu-stable, fixing commit message in the process.
Patch is identical to the version tagged for-2.7.

________________________________________________________________________________

For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch ide-reset-segfault
https://github.com/jnsnow/qemu/tree/ide-reset-segfault

This version is tagged ide-reset-segfault-v1:
https://github.com/jnsnow/qemu/releases/tag/ide-reset-segfault-v1

John Snow (1):
  ide: fix halted IO segfault at reset

 hw/ide/core.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.7.4

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

* [Qemu-devel] [RESEND PATCH 1/1] ide: fix halted IO segfault at reset
  2016-07-27 14:51 [Qemu-devel] [RESEND PATCH 0/1] ide: fix halted IO segfault at reset John Snow
@ 2016-07-27 14:51 ` John Snow
  2016-07-27 15:21   ` Laszlo Ersek
  0 siblings, 1 reply; 3+ messages in thread
From: John Snow @ 2016-07-27 14:51 UTC (permalink / raw)
  To: qemu-stable; +Cc: pbonzini, lersek, qemu-devel, armbru, mreitz, John Snow

If one attempts to perform a system_reset after a failed IO request
that causes the VM to enter a paused state, QEMU will segfault trying
to free up the pending IO requests.

These requests have already been completed and freed, though, so all
we need to do is NULL them before we enter the paused state.

Existing AHCI tests verify that halted requests are still resumed
successfully after a STOP event.

Analyzed-by: Laszlo Ersek <lersek@redhat.com>
---
 hw/ide/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 081c9eb..d117b7c 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -823,6 +823,7 @@ static void ide_dma_cb(void *opaque, int ret)
     }
     if (ret < 0) {
         if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {
+            s->bus->dma->aiocb = NULL;
             return;
         }
     }
-- 
2.7.4

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

* Re: [Qemu-devel] [RESEND PATCH 1/1] ide: fix halted IO segfault at reset
  2016-07-27 14:51 ` [Qemu-devel] [RESEND PATCH 1/1] " John Snow
@ 2016-07-27 15:21   ` Laszlo Ersek
  0 siblings, 0 replies; 3+ messages in thread
From: Laszlo Ersek @ 2016-07-27 15:21 UTC (permalink / raw)
  To: John Snow, qemu-stable; +Cc: pbonzini, qemu-devel, armbru, mreitz

On 07/27/16 16:51, John Snow wrote:
> If one attempts to perform a system_reset after a failed IO request
> that causes the VM to enter a paused state, QEMU will segfault trying
> to free up the pending IO requests.
> 
> These requests have already been completed and freed, though, so all
> we need to do is NULL them before we enter the paused state.
> 
> Existing AHCI tests verify that halted requests are still resumed
> successfully after a STOP event.
> 
> Analyzed-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  hw/ide/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 081c9eb..d117b7c 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -823,6 +823,7 @@ static void ide_dma_cb(void *opaque, int ret)
>      }
>      if (ret < 0) {
>          if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {
> +            s->bus->dma->aiocb = NULL;
>              return;
>          }
>      }
> 

You forgot your S-o-b from the end of the commit message, and also my
R-b from round #1. Looks like my un-orthodox Analyzed-by distracted you
too much! ;)

Care to resend once more with those two tags added?

Thanks!
Laszlo

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

end of thread, other threads:[~2016-07-27 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-27 14:51 [Qemu-devel] [RESEND PATCH 0/1] ide: fix halted IO segfault at reset John Snow
2016-07-27 14:51 ` [Qemu-devel] [RESEND PATCH 1/1] " John Snow
2016-07-27 15:21   ` Laszlo Ersek

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