From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757361AbdAJX2i convert rfc822-to-8bit (ORCPT ); Tue, 10 Jan 2017 18:28:38 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:31179 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756274AbdAJX2e (ORCPT ); Tue, 10 Jan 2017 18:28:34 -0500 Subject: Re: [Xen-devel] [PATCH] xen: do not re-use pirq number cached in pci device msi msg data To: Dan Streetman , Stefano Stabellini References: <20170105192856.25559-1-dan.streetman@canonical.com> <20170107010651.GV16608@char.us.oracle.com> <42d912c2-596e-29f6-8385-dc82a891895c@oracle.com> <20170109155929.GA10991@char.us.oracle.com> Cc: Konrad Rzeszutek Wilk , Dan Streetman , Bjorn Helgaas , xen-devel@lists.xenproject.org, linux-kernel , linux-pci@vger.kernel.org From: Boris Ostrovsky Message-ID: Date: Tue, 10 Jan 2017 18:28:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8BIT X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> In the Xen code I can still see: >> >> case ECS_PIRQ: { >> struct pirq *pirq = pirq_info(d1, chn1->u.pirq.irq); >> >> if ( !pirq ) >> break; >> if ( !is_hvm_domain(d1) ) >> pirq_guest_unbind(d1, pirq); >> >> which means that pirq_guest_unbind should only be called on evtchn_close >> if the guest is not an HVM guest. A few lines further down we have: pirq->evtchn = 0; pirq_cleanup_check(pirq, d1); unlink_pirq_port(chn1, d1->vcpu[chn1->notify_vcpu_id]); #ifdef CONFIG_X86 if ( is_hvm_domain(d1) && domain_pirq_to_irq(d1, pirq->pirq) > 0 ) unmap_domain_pirq_emuirq(d1, pirq->pirq); #endif which is where we free up the pirq. -boris