From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Interrupt/8259 simulation Date: Sun, 24 Dec 2006 10:27:35 +0200 Message-ID: <458E39F7.10507@qumranet.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: To: James Jacobsson In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org 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