qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergio Lopez <slp@redhat.com>
To: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [PATCH] virtio-mmio: Clear v2 transport state on soft reset
Date: Fri, 13 Dec 2019 11:26:04 +0100	[thread overview]
Message-ID: <87d0csttc3.fsf@redhat.com> (raw)
In-Reply-To: <20191213095410.1516119-1-jean-philippe@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]


Jean-Philippe Brucker <jean-philippe@linaro.org> writes:

> At the moment when the guest writes a status of 0, we only reset the
> virtio core state but not the virtio-mmio state. The virtio-mmio
> specification says (v1.1 cs01, 4.2.2.1 Device Requirements:
> MMIO Device Register Layout):
>
>     Upon reset, the device MUST clear all bits in InterruptStatus and
>     ready bits in the QueueReady register for all queues in the device.
>
> The core already takes care of InterruptStatus by clearing isr, but we
> still need to clear QueueReady.
>
> It would be tempting to clean all registers, but since the specification
> doesn't say anything more, guests could rely on the registers keeping
> their state across reset. Linux for example, relies on this for
> GuestPageSize in the legacy MMIO tranport.
>
> Fixes: 44e687a4d9ab ("virtio-mmio: implement modern (v2) personality (virtio-1)")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
> This fixes kexec of a Linux guest that uses the modern virtio-mmio
> transport.
> ---
>  hw/virtio/virtio-mmio.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)

LGTM, thanks!

Reviewed-by: Sergio Lopez <slp@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

      reply	other threads:[~2019-12-13 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13  9:54 [PATCH] virtio-mmio: Clear v2 transport state on soft reset Jean-Philippe Brucker
2019-12-13 10:26 ` Sergio Lopez [this message]

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=87d0csttc3.fsf@redhat.com \
    --to=slp@redhat.com \
    --cc=jean-philippe@linaro.org \
    --cc=mst@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 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).