From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joby Poriyath Subject: Re: [PATCH v5] interrupts: allow guest to set/clear MSI-X mask bit Date: Thu, 15 Aug 2013 15:45:13 +0100 Message-ID: <20130815144513.GA17939@citrix.com> References: <20130815140235.GA17963@citrix.com> <520D023C02000078000EC491@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1V9ynd-0007an-Uw for xen-devel@lists.xenproject.org; Thu, 15 Aug 2013 14:45:18 +0000 Content-Disposition: inline In-Reply-To: <520D023C02000078000EC491@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: andrew.cooper3@citrix.com, malcolm.crossley@citrix.com, keir@xen.org, xen-devel List-Id: xen-devel@lists.xenproject.org On Thu, Aug 15, 2013 at 03:30:52PM +0100, Jan Beulich wrote: > >>> On 15.08.13 at 16:03, Joby Poriyath wrote: > > Guest needs the ability to enable and disable MSI-X interrupts > > by setting the MSI-X control bit, for a passed-through device. > > Guest is allowed to write MSI-X mask bit only if Xen *thinks* > > that mask is clear (interrupts enabled). If the mask is set by > > Xen (interrupts disabled), writes to mask bit by the guest is > > ignored. > > > > Currently, a write to MSI-X mask bit by the guest is silently > > ignored. > > > > A likely scenario is where we have a 82599 SR-IOV nic passed > > through to a guest. From the guest if you do > > > > ifconfig down > > ifconfig up > > > > the interrupts remain masked. On VF reset, the mask bit is set > > by the controller. At this point, Xen is not aware that mask is set. > > However, interrupts are enabled by VF driver by clearing the mask > > bit by writing directly to BAR3 region containing the MSI-X table. > > > > From dom0, we can verify that > > interrupts are being masked using 'xl debug-keys M'. > > > > Initially, guest was allowed to modify MSI-X bit. > > Later this behaviour was changed. > > See changeset 74c213c506afcd74a8556dd092995fd4dc38b225. > > > > Signed-off-by: Joby Poriyath > > --- > > You should start getting used to describe the changes compared > to at least the most recent previous revision here. I'll do this for the next version of the patch. > > > @@ -328,7 +358,8 @@ const struct hvm_mmio_handler msixtbl_mmio_handler = { > > static void add_msixtbl_entry(struct domain *d, > > struct pci_dev *pdev, > > uint64_t gtable, > > - struct msixtbl_entry *entry) > > + struct msixtbl_entry *entry, > > + struct pirq *pirq) > > Sill missing the const here (this is where Andrew had pointed it out > initially, the other change above just is a necessary consequence). > Somehow the compiler didn't catch the error. I'm on Debian 7. I'll send the updated patch. > Jan > Joby