* xen interrupt
@ 2013-03-17 13:18 zhangwqh
2013-03-18 11:36 ` Ian Campbell
2013-03-18 13:28 ` Konrad Rzeszutek Wilk
0 siblings, 2 replies; 5+ messages in thread
From: zhangwqh @ 2013-03-17 13:18 UTC (permalink / raw)
To: xen-devel
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
decide the disk interrupt was generated by its requested file?
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xen interrupt
2013-03-17 13:18 xen interrupt zhangwqh
@ 2013-03-18 11:36 ` Ian Campbell
2013-03-18 12:05 ` 张伟
2013-03-18 13:28 ` Konrad Rzeszutek Wilk
1 sibling, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2013-03-18 11:36 UTC (permalink / raw)
To: zhangwqh; +Cc: xen-devel@lists.xensource.com
On Sun, 2013-03-17 at 13:18 +0000, 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
> decide the disk interrupt was generated by its requested file?
Even channels are per domain, so if a guest receives one then it knows
inherently that it is for itself.
There is no concept of multiple VMs being registered to receive a single
interrupt.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xen interrupt
2013-03-18 11:36 ` Ian Campbell
@ 2013-03-18 12:05 ` 张伟
2013-03-18 12:10 ` Ian Campbell
0 siblings, 1 reply; 5+ messages in thread
From: 张伟 @ 2013-03-18 12:05 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel@lists.xensource.com
[-- Attachment #1.1: Type: text/plain, Size: 1762 bytes --]
Thank you very much for your reply, lan.
In your reply, you said that there is no concept of multiple VMs being registered to receive a single interrupt. For disk interrupt or network interrupt, every virtual machine needs to read or write data from or to disk or network card. I can not understand why there is no concept of multiple VMs being registered to receive a single interrupt.
I am waiting and looking forward to your reply!
At 2013-03-18 19:36:12,"Ian Campbell" <Ian.Campbell@citrix.com> wrote:
>On Sun, 2013-03-17 at 13:18 +0000, 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
>> decide the disk interrupt was generated by its requested file?
>
>Even channels are per domain, so if a guest receives one then it knows
>inherently that it is for itself.
>
>There is no concept of multiple VMs being registered to receive a single
>interrupt.
>
>Ian.
>
[-- Attachment #1.2: Type: text/html, Size: 3588 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xen interrupt
2013-03-18 12:05 ` 张伟
@ 2013-03-18 12:10 ` Ian Campbell
0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2013-03-18 12:10 UTC (permalink / raw)
To: 张伟; +Cc: xen-devel@lists.xensource.com
Please do not top post.
On Mon, 2013-03-18 at 12:05 +0000, 张伟 wrote:
> In your reply, you said that there is no concept of multiple VMs
> being registered to receive a single interrupt. For disk interrupt or
> network interrupt, every virtual machine needs to read or write data
> from or to disk or network card. I can not understand why there is no
> concept of multiple VMs being registered to receive a single
> interrupt.
Only one guest sees the physical disk (typically dom0) and therefore
receives the physical interrupt for that disk.
Guests see a PV disk device, and there is one of those per virtual disk,
each with its own event channel tied to the appropriate guest.
The PV devices communicate with a PV backend in the domain which
contains the physical disk and it takes care of the underlying I/O.
So each domain has its own disk evtchn and the backend domain has an
evtchn corresponding to the physical disk controllers interrupt.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xen interrupt
2013-03-17 13:18 xen interrupt zhangwqh
2013-03-18 11:36 ` Ian Campbell
@ 2013-03-18 13:28 ` Konrad Rzeszutek Wilk
1 sibling, 0 replies; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-03-18 13:28 UTC (permalink / raw)
To: zhangwqh; +Cc: xen-devel
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 <pirq, event channel, dom> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-18 13:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-17 13:18 xen interrupt zhangwqh
2013-03-18 11:36 ` Ian Campbell
2013-03-18 12:05 ` 张伟
2013-03-18 12:10 ` Ian Campbell
2013-03-18 13:28 ` Konrad Rzeszutek Wilk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.