public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Interrupt/8259 simulation
@ 2006-12-23 10:43 James Jacobsson
       [not found] ` <fe247b50612230243g3c6fbe29g5134b9523e75c44f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: James Jacobsson @ 2006-12-23 10:43 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

I've started writing a simulation environment based on KVM, and so far
everything is working as expected.
However, I've reached a point where I need to start simulating the
8259A PIC, and I can't really seem to grasp how the interrupts are to
be simulated in KVM.

kvm_inject_irq() takes a vector-number as an input. I'm assuming this
is a reference to the IDT, i.e, if I kvm_inject_irq(kvm,0,63), IDT
entry #63 will be called.

So, is it safe to assume that kvm_inject_irq(kvm,0,63) will call IDT
entry #63 immediately (assuming IF is set correctly), and that the IRQ
should be considered serviced when the CPU executes "outb 0x20,0x20"
to IAK the PIC ?

Best regards,
James

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Interrupt/8259 simulation
       [not found] ` <fe247b50612230243g3c6fbe29g5134b9523e75c44f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2006-12-24  8:27   ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2006-12-24  8:27 UTC (permalink / raw)
  To: James Jacobsson; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

James Jacobsson wrote:
> I've started writing a simulation environment based on KVM, and so far
> everything is working as expected.
> However, I've reached a point where I need to start simulating the
> 8259A PIC, and I can't really seem to grasp how the interrupts are to
> be simulated in KVM.
>
> kvm_inject_irq() takes a vector-number as an input. I'm assuming this
> is a reference to the IDT, i.e, if I kvm_inject_irq(kvm,0,63), IDT
> entry #63 will be called.
>   

Yes.

> So, is it safe to assume that kvm_inject_irq(kvm,0,63) will call IDT
> entry #63 immediately (assuming IF is set correctly), 

In general yes.  The processor will go through the steps described in 
the Intel manual for the 'int' instruction.  Note that interrupt 
injection may fail for a number of reasons (for example, a fault during 
reading the idt entry).

> and that the IRQ
> should be considered serviced when the CPU executes "outb 0x20,0x20"
> to IAK the PIC ?
>   

Yes.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-24  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-23 10:43 Interrupt/8259 simulation James Jacobsson
     [not found] ` <fe247b50612230243g3c6fbe29g5134b9523e75c44f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2006-12-24  8:27   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox