From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH 3/3] drivers/vfio/pci: Fix MSIx message lost Date: Mon, 03 Mar 2014 16:00:49 +1100 Message-ID: <1393822849.10727.26.camel@pasglop> References: <1393817042-13758-1-git-send-email-shangw@linux.vnet.ibm.com> <1393817042-13758-3-git-send-email-shangw@linux.vnet.ibm.com> <1393818710.10727.22.camel@pasglop> <5314086F.10108@ozlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Gavin Shan , kvm@vger.kernel.org, alex.williamson@redhat.com To: Alexey Kardashevskiy Return-path: Received: from gate.crashing.org ([63.228.1.57]:39255 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbaCCFBP (ORCPT ); Mon, 3 Mar 2014 00:01:15 -0500 In-Reply-To: <5314086F.10108@ozlabs.ru> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2014-03-03 at 15:43 +1100, Alexey Kardashevskiy wrote: > While it works for our particular problem and seems correct, it has one > flaw - hw/pci/msix.c will not generate this backtrace if masking bit does > not change which can happen in general: > === > static void msix_handle_mask_update(PCIDevice *dev, int vector, bool > was_masked) > { > bool is_masked = msix_is_masked(dev, vector); > > if (is_masked == was_masked) { > return; > } > === > > Or if masking bit is the same, nothing bad is expected?... Hrm ok, so it will work in this specific case but might not in the general case of a driver triggering some kind of local reset on the device requiring the MSI-X to be restored. The guest will write but qemu will swallow them ... I think that needs to be fixed but it might be hard without introducing a new ioctl from what I can see of the way the code is structured... Unless qemu turns that into a disable/enable pair I suppose. Cheers, Ben.