All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emre Can Sezer <ecsezer@ncsu.edu>
Cc: Xen Devel <xen-devel@lists.xensource.com>
Subject: Re: Interrupt for HVM guests
Date: Mon, 08 Jun 2009 15:24:58 -0400	[thread overview]
Message-ID: <4A2D658A.7030707@ncsu.edu> (raw)
In-Reply-To: <C64F2970.CF5A%keir.fraser@eu.citrix.com>

Keir Fraser wrote:
> On 05/06/2009 19:43, "Emre Can Sezer" <ecsezer@ncsu.edu> wrote:
>
>   
>> I am trying to figure out how an HVM guest is passed an interrupt.  Say
>> that a network packet has arrived and the QEMU driver in dom0 has to
>> notify an HVM guest of the packet's arrival.  Could someone please give
>> a brief, high-level description of this process?  I read the Intel
>> Architectures Software Developer's Guide on VM Execution bits and
>> Virtual interrupts and also some Xenwiki stuff about it but I'm still
>> not sure what's going on.  I don't have any device pass-through or
>> stubdom or PV Drivers for my HVM guest.  I would also appreciate
>> references to some Xen files/functions related to this process.
>>     
>
> Following will give you enough to grep around for the details:
> Hypercall is HVMOP_set_pci_intx_level: qemu-dm uses this to assert a PCI
> INTx virtual interrupt line. Handled by hvm_pci_intx_assert() ->
> vioapic_irq_positive_edge() -> vioapic_deliver() -> ioapic_inj_irq() ->
> vlapic_set_irq()&vcpu_kick(). Final function there wakes the guest vcpu
> which on vmentry calls vmx_intr_assist() -> hvm_vcpu_has_pending_irq() ->
> vlapic_has_pending_irq(), which will return a pending vector.
> Vmx_intr_assist() then delivers that vector via vmx_inject_extint().
> Hardware then delivers the interrupt automatically during vmentry.
>
>  -- Keir
>
>   
Thanks Keir.  I do have another question though.  I am trying to find 
out whether a page fault occurred during an interrupt handling.  I 
implemented two page tables for HVM guests that help me track execution 
within the guest kernel.  So there is a very good chance that an 
interrupt might also result in a page fault as soon as it is injected.  
I tried counting these events by checking the IF flags in regs->rflags 
and also looking at VIF and VIP flags without success.  Is this a viable 
method for determining whether a page fault was caused during interrupt 
handling?  If not, is there any VM state I can check?

Thanks,

John

  reply	other threads:[~2009-06-08 19:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 22:16 Xen Guest Memory Isolation Ahmed Azab
2009-04-15  8:34 ` Tim Deegan
2009-05-07 19:39   ` x86 instruction emulation in hvm Emre Can Sezer
2009-05-07 20:50     ` Keir Fraser
2009-05-11 22:15       ` Emre Can Sezer
2009-05-12  7:57         ` Keir Fraser
2009-06-05 18:43           ` Interrupt for HVM guests Emre Can Sezer
2009-06-05 18:58             ` Keir Fraser
2009-06-08 19:24               ` Emre Can Sezer [this message]
2009-06-08 21:29                 ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A2D658A.7030707@ncsu.edu \
    --to=ecsezer@ncsu.edu \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.