WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] FW: about VIRQ & PIRQ

To: "Gautham Kampalapur Shankar, TLS, Chennai" <gauthamk@xxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] FW: about VIRQ & PIRQ
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Tue, 5 Jun 2007 12:44:39 +0200
Delivery-date: Tue, 05 Jun 2007 03:43:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <D309264CD3651841AA75658A61044758AC48B3@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcenPBJOfIiAS62STBSYP2CUSDqZLgAFkerBAABBUJA=
Thread-topic: [Xen-devel] FW: about VIRQ & PIRQ
> what is VIRQ  ?How VIRQ is different from PIRQ ?How VIRQ & 
> PIRQ are related each other ?

To explain this, we need to understand the entire processing of
interrupts and how that relates to the guest kernel. 

In a normal (bare-metal/non-virtual) system, interrupts are used to
"wake up" the kernel when some non-CPU hardware is finished with some
activity (such as counting a counter to it's final count [timer],
storing a sector or data to a disk or sending a network packet). Almost
all of these events happen completely asynchronously to the execution of
instructions in the CPU, and they may well wake the CPU from a HLT
instruction (which is the way to say "I've got nothing better to do than
to wait for the next interrupt"). 

It gets more complicated in a virtual environment. Let's say that guest
A sends off a packet of network data, then goes to a HLT - which is a
"magic" instruction in a virtual environment, and thus tells the
hypervisor that "This guest hasn't got any work to do, let's run another
guest". Let's now assume that this other guest, Guest B, is doing some
pure calculation activity (say calculating the first 5 million positions
of PI), so it's not interacting with any hardware and will run for quite
some time without "stopping". 

Now an interrupt comes in. This interrupt BELONGS to A, but B is
currently running. That wouldn't work very well, right? 

So the way to solve this is to have the "real" interrupt go to the
hypervisor. This is the Physical IRQ or PIRQ. The hypervisor keeps a
list of which physical IRQ belongs to which guest(s) and issues the
relevant Virtual IRQ to the guest - this is done using an event-channel.


Note also that HVM guests are also dealing with physical interrupts by
doing a VMExit and then letting the hypervisor take the interrupt as per
usual. For the same reason, the physical interrupt may not be for the
guest that is currently running. [In fact, in an IO-intensive system,
it's most likely NOT the guest that cuased the interrupt that is active
when the interrupt arrives to the processor]. 

--
Mats
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>