From patchwork Fri Mar 24 16:54:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9643357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9681602C9 for ; Fri, 24 Mar 2017 16:56:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8B8520700 for ; Fri, 24 Mar 2017 16:56:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB90D26E4C; Fri, 24 Mar 2017 16:56:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4487020700 for ; Fri, 24 Mar 2017 16:56:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crSTr-0007DV-Ru; Fri, 24 Mar 2017 16:54:27 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crSTq-0007DL-Fo for xen-devel@lists.xenproject.org; Fri, 24 Mar 2017 16:54:26 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id A3/02-27678-14F45D85; Fri, 24 Mar 2017 16:54:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBIsWRWlGSWpSXmKPExsWyU9JRQtfB/2q Ewakn2hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8b0r+tZC35yVnS/WcrSwDiHo4uRk0NCwE/i +voOli5GDg4WAVWJM//tQUw2AXuJ6V8rQEwRARWJ23sNQIqZgYrPLH/NDGILCxhKvLq9hhHE5 hXwlOif9Z0dwhaUODnzCQtEvY7Egt2f2EDGMAtISyz/B7ZTFGjixtevwMYICShK9M97wAZxS7 rE1r+/mCcw8s5CMmkWkkmzECYtYGRexahRnFpUllqka2Sml1SUmZ5RkpuYmaNraGCml5taXJy YnpqTmFSsl5yfu4kRGEoMQLCD8cyCwEOMkhxMSqK8btuuRAjxJeWnVGYkFmfEF5XmpBYfYpTh 4FCS4L3vezVCSLAoNT21Ii0zBxjUMGkJDh4lEV4HP6A0b3FBYm5xZjpE6hSjLsec2bvfMAmx5 OXnpUqJ88aAFAmAFGWU5sGNgEXYJUZZKWFeRqCjhHgKUotyM0tQ5V8xinMwKgnzSoFM4cnMK4 Hb9AroCCagI2ZvuAJyREkiQkqqgdHoj4TzUj6J12t+8fTsjHWudtesirp/O13B9oyB4I7qtqy eWuf6oJh9Tqs9WKX33xXiWHnu39reUg+D8hylMuukrOvlybltZm+YnW6or+Hwa5JnPqp2MMXz +0IJj7O28R+Ztra9+sCktDV44/ktb++EeNUu1tFp91iX1/NGQkx7cVNB95IXSizFGYmGWsxFx YkA5asKwqsCAAA= X-Env-Sender: prvs=249050677=roger.pau@citrix.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1490374464!62357895!1 X-Originating-IP: [185.25.65.24] X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51556 invoked from network); 24 Mar 2017 16:54:24 -0000 Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24) by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 24 Mar 2017 16:54:24 -0000 X-IronPort-AV: E=Sophos;i="5.36,215,1486425600"; d="scan'208";a="43079666" Date: Fri, 24 Mar 2017 16:54:19 +0000 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Message-ID: <20170324165419.oragzj3dcbs36smj@dhcp-3-128.uk.xensource.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170306 (1.8.0) X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) Cc: Andrew Cooper , Jan Beulich Subject: [Xen-devel] Legacy PCI interrupt {de}assertion count X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hello, I have a question related to how Xen accounts the legacy PCI interrupt assertions when binding interrupts to HVM guests. It's probably just me not properly understand this code (or missing bits of it). As I understand it, for level triggered legacy PCI interrupts Xen sets up a timer in order to perform the EOI if the guest takes too long in deasserting the line. This is done in pt_irq_time_out. What I don't understand is why this function also does a deassertion of the guest view of the PCI interrupt, ie: why it calls hvm_pci_intx_deassert. This AFAICT will clear the pending assert in the guest, and thus the guest will end up loosing one interrupt. IMHO it should be: Again, it might well just be that I'm missing something obvious, so I would appreciate some clarification here. Thanks, Roger. diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 080183ea31..e0b19ee8c9 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -182,7 +182,6 @@ static void pt_irq_time_out(void *data) pirq_dpci(pirq)->flags |= HVM_IRQ_DPCI_EOI_LATCH; } - hvm_pci_intx_deassert(irq_map->dom, digl->device, digl->intx); } pt_pirq_iterate(irq_map->dom, pt_irq_guest_eoi, NULL);