Hi, I am reading the code, but I can''t understand how an interrupt dispatch to all guests? As code description that do_IRQ() -->vgic_vcpu_inject_irq(), but it seems only inject an irq into ONE VCPU. Is there a case that one irq registered by many guests? Thanks, josh zhao _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
On Mon, 2013-03-11 at 07:13 +0000, Josh Zhao wrote:> Hi, > > I am reading the code, but I can''t understand how an interrupt > dispatch to all guests? As code description that do_IRQ() > -->vgic_vcpu_inject_irq(), but it seems only inject an irq into ONE > VCPU. Is there a case that one irq registered by many guests?A single interrupt source (be it physical hardware or a purely software construct) can only ever be associated with a single domain. What use case were you imagining where this may not be true? Ian.
Hi lan, Thanks for answering my question. I was imagining that some hardware drivers might be sharing in domains, such as ethernet, SD card. Two more domains may access to the device same time. I thought the same IRQ may be associated with each domain. Now I am thinking that the vIRQs should be dispatched between domains by event channels. A channel means one 2 one domain mapping. Each channel is a vIRQ. Am I right? BTW, I have 2 other questions in this thread: (1) The tranditional Linux kernel without virtualization is running on SVC mode. With virtualization,the Linux kernel in DomU is on ARM''s SVC mode and the Dom0 is in Hyper Mode? (2) I am wondering How xen pass memory to domains( Dom0/DomU)? Are there any key fields associated with memory in domain/vcpu structs, such like Linux kernel ''s mm struct? josh zhao 2013/3/12 Ian Campbell <Ian.Campbell@citrix.com>> On Mon, 2013-03-11 at 07:13 +0000, Josh Zhao wrote: > > Hi, > > > > I am reading the code, but I can''t understand how an interrupt > > dispatch to all guests? As code description that do_IRQ() > > -->vgic_vcpu_inject_irq(), but it seems only inject an irq into ONE > > VCPU. Is there a case that one irq registered by many guests? > > A single interrupt source (be it physical hardware or a purely software > construct) can only ever be associated with a single domain. > > What use case were you imagining where this may not be true? > > Ian. > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Please don''t top post. On Wed, 2013-03-13 at 02:28 +0000, Josh Zhao wrote:> Hi lan, > > Thanks for answering my question. I was imagining that some hardware > drivers might be sharing in domains, such as ethernet, SD card. Two > more domains may access to the device same time.This is not possible, a single device can only ever be associated with one domain. Technologies like SR-IOV provide some sort of "illusion" of passing a device to multiple domains by providing multiple MMIO regions and IRQs, but each of those can still only be associated with a single domain.> I thought the same IRQ may be associated with each domain. Now I am > thinking that the vIRQs should be dispatched between domains by event > channels. A channel means one 2 one domain mapping. Each channel is > a vIRQ. Am I right?I''m afraid I don''t understand what you are saying so I don''t know if you are right.> BTW, I have 2 other questions in this thread: > > (1) The tranditional Linux kernel without virtualization is running on > SVC mode. With virtualization,the Linux kernel in DomU is on ARM''s > SVC mode and the Dom0 is in Hyper Mode?No. Xen (the hypervisor itself) runs in HYP mode. The kernel (dom0 or domu) always runs in SVC mode. Dom0 is really just another guest, albeit with some special privileges.> (2) I am wondering How xen pass memory to domains( Dom0/DomU)? Are > there any key fields associated with memory in domain/vcpu structs, > such like Linux kernel ''s mm struct?Not sure what you mean, each domain has a list of pages which belong to it (struct domain.page_list) as well as data structures like the p2m which describes to domains IPA->PA mapping. Ian.