All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 4/5] msix: Don't process table changes while disabled
Date: Tue, 18 Oct 2011 13:18:09 +0200	[thread overview]
Message-ID: <20111018111809.GC28776@redhat.com> (raw)
In-Reply-To: <16be9aa8fe4b5ebef73192c487b3cdf61c7a14a9.1318924251.git.jan.kiszka@siemens.com>

On Tue, Oct 18, 2011 at 09:50:53AM +0200, Jan Kiszka wrote:
> As long as MSI-X is disabled, it's incorrect to invoke
> msix_handle_mask_update on per-vector mask changes. That may misguide
> the config notifier callback or spuriously trigger an MSI event.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Same question as on the previous patch. At the moment, the only user
(virtio) seems to check msix_enabled before registering
notifiers. See virtio_pci_query_guest_notifiers.
Is there some way you see to trigger incorrect behaviour?

> ---
>  hw/msix.c |   14 +++++++++-----
>  1 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/msix.c b/hw/msix.c
> index e351c68..f5c8d08 100644
> --- a/hw/msix.c
> +++ b/hw/msix.c
> @@ -277,12 +277,16 @@ static void msix_mmio_write(void *opaque, target_phys_addr_t addr,
>      bool was_masked = msix_is_masked(dev, vector);
>  
>      pci_set_long(dev->msix_table_page + offset, val);
> -    if (kvm_enabled() && kvm_irqchip_in_kernel()) {
> -        kvm_msix_update(dev, vector, was_masked, msix_is_masked(dev, vector));
> -    }
>  
> -    if (was_masked != msix_is_masked(dev, vector)) {
> -        msix_handle_mask_update(dev, vector);
> +    if (msix_enabled(dev)) {
> +        if (kvm_enabled() && kvm_irqchip_in_kernel()) {
> +            kvm_msix_update(dev, vector, was_masked,
> +                            msix_is_masked(dev, vector));
> +        }
> +
> +        if (was_masked != msix_is_masked(dev, vector)) {
> +            msix_handle_mask_update(dev, vector);
> +        }
>      }
>  }
>  
> -- 
> 1.7.3.4

  reply	other threads:[~2011-10-18 11:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18  7:50 [PATCH 0/5] qemu-kvm: MSI-X fixes Jan Kiszka
2011-10-18  7:50 ` [PATCH 1/5] qemu-kvm: msix: Don't fire notifier spuriously on set/unset Jan Kiszka
2011-10-18 11:06   ` Michael S. Tsirkin
2011-10-18 11:34     ` Jan Kiszka
2011-10-18  7:50 ` [PATCH 2/5] qemu-kvm: msix: Only invoke msix_handle_mask_update on changes Jan Kiszka
2011-10-18 11:43   ` Michael S. Tsirkin
2011-10-18 11:54     ` Jan Kiszka
2011-10-18 12:11       ` Michael S. Tsirkin
2011-10-18 12:22         ` Jan Kiszka
2011-10-18 12:37           ` Michael S. Tsirkin
2011-10-18 12:44             ` Jan Kiszka
2011-10-18 13:20               ` Michael S. Tsirkin
2011-10-18 13:49                 ` Michael S. Tsirkin
2011-10-18 13:52                   ` Jan Kiszka
2011-10-18  7:50 ` [PATCH 3/5] qemu-kvm: msix: Fire mask notifier on global mask changes Jan Kiszka
2011-10-18  7:50 ` [PATCH 4/5] msix: Don't process table changes while disabled Jan Kiszka
2011-10-18 11:18   ` Michael S. Tsirkin [this message]
2011-10-18 11:35     ` Jan Kiszka
2011-10-18 12:01       ` Michael S. Tsirkin
2011-10-18 11:26   ` Michael S. Tsirkin
2011-10-18  7:50 ` [PATCH 5/5] msix: Prevent bogus mask updates on MMIO accesses Jan Kiszka

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=20111018111809.GC28776@redhat.com \
    --to=mst@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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 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.