All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Klaus Jensen <its@irrelevant.dk>
Cc: Kevin Wolf <kwolf@redhat.com>, Qemu-block <qemu-block@nongnu.org>,
	Klaus Jensen <k.jensen@samsung.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Max Reitz <mreitz@redhat.com>, Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH for-6.0 v2 1/2] hw/block/nvme: fix invalid msix exclusive uninit
Date: Fri, 23 Apr 2021 16:46:47 +0100	[thread overview]
Message-ID: <CAFEAcA-k7fgH_JqBDqbtNuuBtOO4EEJO6T3YS06t5_CjPFuh+w@mail.gmail.com> (raw)
In-Reply-To: <20210423052127.512489-2-its@irrelevant.dk>

On Fri, 23 Apr 2021 at 06:21, Klaus Jensen <its@irrelevant.dk> wrote:
>
> From: Klaus Jensen <k.jensen@samsung.com>
>
> Commit 1901b4967c3f changed the nvme device from using a bar exclusive
> for MSI-x to sharing it on bar0.
>
> Unfortunately, the msix_uninit_exclusive_bar() call remains in
> nvme_exit() which causes havoc when the device is removed with, say,
> device_del. Fix this.
>
> Additionally, a subregion is added but it is not removed on exit which
> causes a reference to linger and the drive to never be unlocked.
>
> Fixes: 1901b4967c3f ("hw/block/nvme: move msix table and pba to BAR 0")
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
>  hw/block/nvme.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 624a1431d072..5fe082ec34c5 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -6235,7 +6235,8 @@ static void nvme_exit(PCIDevice *pci_dev)
>      if (n->pmr.dev) {
>          host_memory_backend_set_mapped(n->pmr.dev, false);
>      }
> -    msix_uninit_exclusive_bar(pci_dev);
> +    msix_uninit(pci_dev, &n->bar0, &n->bar0);
> +    memory_region_del_subregion(&n->bar0, &n->iomem);
>  }
>
>  static Property nvme_props[] = {

Looks plausible, but if you want this in rc5 could somebody review
it, please ?

thanks
-- PMM


  reply	other threads:[~2021-04-23 15:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23  5:21 [PATCH for-6.0 v2 0/2] hw/block/nvme: fix msix uninit Klaus Jensen
2021-04-23  5:21 ` [PATCH for-6.0 v2 1/2] hw/block/nvme: fix invalid msix exclusive uninit Klaus Jensen
2021-04-23 15:46   ` Peter Maydell [this message]
2021-04-26  4:40   ` Klaus Jensen
2021-04-26  9:27     ` Philippe Mathieu-Daudé
2021-04-26  9:39       ` Klaus Jensen
2021-04-26 13:08       ` Michael S. Tsirkin
2021-04-26 15:23   ` Peter Maydell
2021-04-23  5:21 ` [PATCH for-6.0 v2 2/2] hw/block/nvme: disable hotplugging for subsystem-linked controllers Klaus Jensen
2021-04-23 13:21   ` Peter Maydell
2021-04-23 13:25     ` Klaus Jensen
2021-04-23 13:25       ` Peter Maydell
2021-04-23 13:33         ` Klaus Jensen
2021-04-23 10:38 ` [PATCH for-6.0 v2 0/2] hw/block/nvme: fix msix uninit Klaus Jensen
2021-04-23 10:50   ` Peter Maydell

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=CAFEAcA-k7fgH_JqBDqbtNuuBtOO4EEJO6T3YS06t5_CjPFuh+w@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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.