From: Sander Eikelenboom Subject: Re: [RFC PATCH] dpci: Put the dpci back on the list if running on another CPU. Date: Tue, 17 Mar 2015 09:42:21 +0100 Message-ID: <1853939556.20150317094221@eikelenboom.it> References: <1421081130-22959-1-git-send-email-konrad.wilk@oracle.com> <54B4FF600200007800054376@mail.emea.novell.com> <20150202142920.GA661@l.oracle.com> <54CFA395020000780005C072@mail.emea.novell.com> <20150202153159.GA3163@l.oracle.com> <54CFAA53020000780005C103@mail.emea.novell.com> <20150202174446.GA8348@l.oracle.com> <54D09BE2020000780005C407@mail.emea.novell.com> <20150316175924.GA26409@l.oracle.com> <5507F168020000780006A93D@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YXn50-0005Ml-5e for xen-devel@lists.xenproject.org; Tue, 17 Mar 2015 08:42:26 +0000 In-Reply-To: <5507F168020000780006A93D@mail.emea.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, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Tuesday, March 17, 2015, 9:18:32 AM, you wrote: >>>> On 16.03.15 at 18:59, wrote: >> Hence was wondering if it would just be easier to put >> this patch in (see above) - with the benfit that folks have >> an faster interrupt passthrough experience and then I work on another >> variant of this with tristate cmpxchg and ->mapping atomic counter. > Considering how long this issue has been pending I think we really > need to get _something_ in (or revert); if this something is the > patch in its most recent form, so be it (even if maybe not the > simplest of all possible variants). So please submit as a proper non- > RFC patch. > Jan I'm still running with this first simple stopgap patch from Konrad, and it has worked fine for me since. I will see if this new one also "works-for-me", somewhere today :-) -- Sander diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index ae050df..d1421b0 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -804,7 +804,18 @@ static void dpci_softirq(void) d = pirq_dpci->dom; smp_mb(); /* 'd' MUST be saved before we set/clear the bits. */ if ( test_and_set_bit(STATE_RUN, &pirq_dpci->state) ) - BUG(); + { + unsigned long flags; + + /* Put back on the list and retry. */ + local_irq_save(flags); + list_add_tail(&pirq_dpci->softirq_list, &this_cpu(dpci_list)); + local_irq_restore(flags); + + raise_softirq(HVM_DPCI_SOFTIRQ); + continue; + } + /* * The one who clears STATE_SCHED MUST refcount the domain. */