From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: xen interrupt Date: Mon, 18 Mar 2013 09:28:36 -0400 Message-ID: <20130318132836.GD24560@phenom.dumpdata.com> References: <1363526292698-5714885.post@n5.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1363526292698-5714885.post@n5.nabble.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: zhangwqh Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sun, Mar 17, 2013 at 06:18:12AM -0700, zhangwqh wrote: > Hi, all > > These days I read the source code about xen interrupts. When physical > interrupts arrive, in xen source code, do_IRQ will decide which will deal > with the physical interrupt, by xen or the guest os. If the physical > interrupt should be dealt with by guest os. Then the case __do_irq_guest() > will be executed. In __do_irq_guest() function, the corresponding event > channel will be delivered to the guests that are registered the irq. My > question is that in the guest os, how to decide whether the irq is to > itself? Eg, a guest A request a file from a disk, after the disk finished to > get the file, will generate a disk interrupt. The disk interrupt should only > be delivered to the guest A. Maybe all of the guest virtual machines > registered the disk interrupt. __do_irq_guest will deliver the disk > interrupt to all of the virtual machines. In the virtual machine, how to It will only deliever it to the guest that has the PIRQ / event assigned to it. > decide the disk interrupt was generated by its requested file? Simply - the driver (say ahci) ends up making an hypercall (PHYSDEVOP_map_pirq) to setup an PIRQ for a specific PCI device. The PIRQ (depending whether it is an MSI, MSI-X or GSI) is programmed in the IOAPIC/IDT and said pirq along with an event channel number is returned to the guest. The hypervisor remembers the information. When the do_irq happens the vector number is looked up to figure out where to deliever it. > > > > -- > View this message in context: http://xen.1045712.n5.nabble.com/xen-interrupt-tp5714885.html > Sent from the Xen - Dev mailing list archive at Nabble.com. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >