All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH 1/2] x86/vMSI-X: honor all mask requests
Date: Tue, 14 Apr 2015 15:17:54 +0100	[thread overview]
Message-ID: <552D2192.5080800@citrix.com> (raw)
In-Reply-To: <550C5881020000780006C2AE@mail.emea.novell.com>

On 20/03/15 16:27, Jan Beulich wrote:
> Commit 74fd0036de ("x86: properly handle MSI-X unmask operation from
> guests") didn't go far enough: it fixed an issue with unmasking, but
> left an issue with masking in place: Due to the (late) point in time
> when qemu requests the hypervisor to set up MSI-X interrupts (which is
> where the MMIO intercept gets put in place), the hypervisor doesn't
> see all guest writes, and hence shouldn't make assumptions on the state
> the virtual MSI-X resources are in. Bypassing the rest of the logic on
> a guest mask operation leads to
>
> [00:04.0] pci_msix_write: Error: Can't update msix entry 1 since MSI-X is already enabled.
>
> which surprisingly enough doesn't lead to the device not working
> anymore (I didn't dig in deep enough to figure out why that is). But it
> does prevent the IRQ to be migrated inside the guest, i.e. all
> interrupts will always arrive in vCPU 0.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/hvm/vmsi.c
> +++ b/xen/arch/x86/hvm/vmsi.c
> @@ -286,11 +286,11 @@ static int msixtbl_write(struct vcpu *v,
>          goto out;
>      }
>  
> -    /* exit to device model if address/data has been modified */
> -    if ( test_and_clear_bit(nr_entry, &entry->table_flags) )
> +    /* Exit to device model when unmasking and address/data got modified. */
> +    if ( !(val & PCI_MSIX_VECTOR_BITMASK) &&
> +         test_and_clear_bit(nr_entry, &entry->table_flags) )
>      {
> -        if ( !(val & PCI_MSIX_VECTOR_BITMASK) )
> -            v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
> +        v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
>          goto out;
>      }
>  
>
>
>

  parent reply	other threads:[~2015-04-14 14:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 15:52 [PATCH 0/2] x86/vMSI-X: table read/write emulation adjustments Jan Beulich
2015-03-20 16:27 ` [PATCH 1/2] x86/vMSI-X: honor all mask requests Jan Beulich
2015-03-23 19:15   ` Konrad Rzeszutek Wilk
2015-03-25  5:40   ` Wu, Feng
2015-03-25  5:49     ` Wu, Feng
2015-03-25 10:36     ` Jan Beulich
2015-04-14 14:17   ` Andrew Cooper [this message]
2015-03-20 16:27 ` [PATCH 2/2] x86/vMSI-X: add valid bits for read acceleration Jan Beulich
2015-03-23 19:11   ` Konrad Rzeszutek Wilk
2015-03-24  7:49     ` Jan Beulich
2015-04-14 14:37   ` Andrew Cooper
2015-04-14 10:11 ` Ping: [PATCH 0/2] x86/vMSI-X: table read/write emulation adjustments Jan Beulich

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=552D2192.5080800@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xenproject.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.