Ashish Bijlani
2007-Oct-21 13:59 UTC
Re: [Xen-devel] hvm iret [also xen interrupt handling deltails]
thanks for the response. i understand the concept of events and xen event injection process. but what i'd like to know is what happens when a guest(hvm) OS krnl executes iret? does it trap to xen? would it _always_ trap to xen in paravirtualized environment ( i.e. no hardware assisted virtualization)? also, i understand that when a physical interrupt comes, xen sets bits in some event bitmask to inject events (or virtual interrupts) into guest VMs, but when does xen send EOI to the IOAPIC? does it send after all the guest VMs have executed their ISRs or does it send immediately upon receiving a physical interrupt? thanks again. On 10/21/07, Cui, Dexuan <dexuan.cui@intel.com> wrote:> > For HVM guest, i.e., VMX guest, the execution of IRET is similar to that > on native system, but of course there are important differences :) -- you > should read the related chapters (i.e., "event injection") in Intel > Software Developer's Manual 3B, and you should also look at the Xen code ( > i.e., the vioapic.c, vlapic.c, vmx/vmx.c, vmx/intr.c in the directory > xen/arch/x86/hvm/). > > > > Note: HVM guest doesn't touch physical interrupt (and the physical > pic/ioapic /local_apic) --here we don't consider VT-d; > > Xen only "injects" *virtual* interrupts into HVM guest with the help of > the emulation of Device Model. > > When HVM vcpu is running, if a physical interrupt happens, a VMExit will occur > to interrupt the execution of the HVM vcpu, then Xen handles the physical > interrupt. > > > > -- Dexuan > > ------------------------------ > *From:* xen-devel-bounces@lists.xensource.com [mailto: > xen-devel-bounces@lists.xensource.com] *On Behalf Of *Ashish Bijlani > *Sent:* 2007年10月21日 4:21 > *To:* Xen-devel@lists.xensource.com > *Subject:* [Xen-devel] hvm iret > > could anybody guide me to some pointers on iret execution by hvms. > something like what happens when a HVM executes an iret instruction? when is > the physical interrupt acknowledged so that IOAPIC can send more interrupts. > thanks. > > -a >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Cui, Dexuan
2007-Oct-21 16:39 UTC
RE: [Xen-devel] hvm iret [also xen interrupt handling deltails]
> From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ashish Bijlani > Sent: 2007年10月21日 21:59 > To: Xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] hvm iret [also xen interrupt handling deltails]> i''d like to know is what happens when a guest(hvm) OS krnl executes iret? does it trap to xen?Usually no trap to Xen. The execution of guest OS is just restored to where it was interrupted -- however, if there is pending vINTR/vNMI, and no vINTR/vNMI blocking any longer and Xen set some VIRTUAL_INTR/NMI_PENDING, certain kinds of VMexits can occur before guest continues to run, allowing Xen to inject the pending events in time.> would it _always_ trap to xen in paravirtualized environment ( i.e. no hardware assisted virtualization)? > also, i understand that when a physical interrupt comes, xen sets bits in some event bitmask to inject events (or virtual interrupts) into > guest VMs, but when does xen send EOI to the IOAPIC? does it send after all the guest VMs have executed their ISRs or does it send > immediately upon receiving a physical interrupt? thanks again.Sorry, I''m not very sure about everything for the case of para-guest. For HVM guest in Xen (here we don''t consider VT-d), no physical devices are owned by HVM guest at all. The devices HVM guest sees are all emulated by the Qemu process in Dom0 -- from this perspective, we don''t care when/how Xen sends physical EOI to physical IOAPIC. -- Dexuan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel