From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtObG-0004QH-RU for qemu-devel@nongnu.org; Thu, 01 Oct 2009 12:33:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtObB-0004JC-CC for qemu-devel@nongnu.org; Thu, 01 Oct 2009 12:33:49 -0400 Received: from [199.232.76.173] (port=45454 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtObB-0004Io-7h for qemu-devel@nongnu.org; Thu, 01 Oct 2009 12:33:45 -0400 Received: from mx20.gnu.org ([199.232.41.8]:59269) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtObA-0004xI-DF for qemu-devel@nongnu.org; Thu, 01 Oct 2009 12:33:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtOb8-0007Hv-SQ for qemu-devel@nongnu.org; Thu, 01 Oct 2009 12:33:43 -0400 Message-ID: <4AC4D9E1.50402@redhat.com> Date: Thu, 01 Oct 2009 18:33:37 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 61/61] pc_q35: apic mode for pci interrupt routing. References: <1254305917-14784-1-git-send-email-yamahata@valinux.co.jp> <1254305917-14784-62-git-send-email-yamahata@valinux.co.jp> <4AC46D57.9060608@redhat.com> In-Reply-To: <4AC46D57.9060608@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On 10/01/2009 10:50 AM, Avi Kivity wrote: > On 09/30/2009 12:18 PM, Isaku Yamahata wrote: >> apic mode for pci interrupt routing. >> >> +static void ich9_lpc_ioapic_update_fn(void *opaque, int reset) >> +{ >> + struct ICH9_LPCIrqState *irq_state = opaque; >> + struct ICH9_LPCState *ich9_lpc = irq_state->lpc; >> + >> + /* this can be called via gmch_init() where ich9_lpc isn't >> + allocated yet */ >> + if (ich9_lpc == NULL) >> + return; >> + >> + if (reset) >> + ich9_lpc->apic_mode = 0; >> + else >> + ich9_lpc->apic_mode = 1; >> +} >> + > > > My understanding was that the OS calls ACPI to set APIC mode. The > ACPI routine (_PIC) can then access a register to re-program the > interrupt router. > > Does this reflect how Q35 works, or is this a shortcut? > > On my desktop, I have: > > Name (\GPIC, Zero) > Method (\_PIC, 1, NotSerialized) > { > Store (Arg0, \GPIC) > } > > With GPIC later referenced by the various interrupt management > routines like _PRT; if GPIC is set they return interrupts in the range > 16-19, otherwise LNKA-LNKD. A real P35 does the same thing. I think it's implemented by having the interrupt lines go to both the PCI links and the ioapic INTI16-INTI19 inputs; when APIC mode is selected the pci links will be disabled and the ioapic activated. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.