qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Eugenio Pérez" <eperezma@redhat.com>
Cc: qemu-devel@nongnu.org, si-wei.liu@oracle.com,
	qemu-stable@nongnu.org,  Hawkins Jiawei <yin31149@gmail.com>
Subject: Re: [PATCH] vdpa: set old virtio status at cvq isolation probing end
Date: Wed, 26 Jul 2023 10:07:26 +0800	[thread overview]
Message-ID: <CACGkMEsqbZNGKdK1kM-qQeZShNeonQKK4_65vtCueQxUsRFTsQ@mail.gmail.com> (raw)
In-Reply-To: <20230725182143.1523091-1-eperezma@redhat.com>

On Wed, Jul 26, 2023 at 2:21 AM Eugenio Pérez <eperezma@redhat.com> wrote:
>
> The device already has a virtio status set by vhost_vdpa_init by the
> time vhost_vdpa_probe_cvq_isolation is called. vhost_vdpa_init set
> S_ACKNOWLEDGE and S_DRIVER, so it is invalid to just reset it.
>
> It is invalid to start the device after it, but all devices seems to be
> fine with it.  Fixing qemu so it follows virtio start procedure.
>
> Fixes: 152128d64697 ("vdpa: move CVQ isolation check to net_init_vhost_vdpa")
> Reported-by: Dragos Tatulea <dtatulea@nvidia.com>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>  net/vhost-vdpa.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 9795306742..d7e2b714b4 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -1333,6 +1333,8 @@ static int vhost_vdpa_probe_cvq_isolation(int device_fd, uint64_t features,
>  out:
>      status = 0;
>      ioctl(device_fd, VHOST_VDPA_SET_STATUS, &status);
> +    status = VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER;
> +    ioctl(device_fd, VHOST_VDPA_SET_STATUS, &status);

So if we fail after FEATURES_OK, this basically clears that bit. Spec
doesn't say it can or not, I wonder if a reset is better?

Btw, spec requires a read of status after setting FEATURES_OK, this
seems to be missed in the current code.

Thanks

>      return r;
>  }
>
> --
> 2.39.3
>



       reply	other threads:[~2023-07-26  2:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230725182143.1523091-1-eperezma@redhat.com>
2023-07-26  2:07 ` Jason Wang [this message]
2023-07-26  6:27   ` [PATCH] vdpa: set old virtio status at cvq isolation probing end Eugenio Perez Martin
2023-07-31  6:35     ` Jason Wang
2023-07-31  8:04       ` Eugenio Perez Martin
2023-07-31  8:42         ` Jason Wang
2023-07-31  9:40           ` Eugenio Perez Martin
2023-08-01  3:28             ` Jason Wang
2023-08-02  2:34               ` Jason Wang
2024-02-17  9:17   ` Michael Tokarev

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=CACGkMEsqbZNGKdK1kM-qQeZShNeonQKK4_65vtCueQxUsRFTsQ@mail.gmail.com \
    --to=jasowang@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=si-wei.liu@oracle.com \
    --cc=yin31149@gmail.com \
    /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).