From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVd15-0004vh-46 for qemu-devel@nongnu.org; Mon, 27 Jul 2009 23:06:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVd0z-0004vT-Lo for qemu-devel@nongnu.org; Mon, 27 Jul 2009 23:06:13 -0400 Received: from [199.232.76.173] (port=58420 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVd0z-0004vQ-Gx for qemu-devel@nongnu.org; Mon, 27 Jul 2009 23:06:09 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:52688) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVd0z-0001Uj-0I for qemu-devel@nongnu.org; Mon, 27 Jul 2009 23:06:09 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e35.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n6S2viSi024789 for ; Mon, 27 Jul 2009 20:57:44 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6S367Y3243982 for ; Mon, 27 Jul 2009 21:06:07 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6S366WN010696 for ; Mon, 27 Jul 2009 21:06:06 -0600 Message-ID: <4A6E6B3B.5010603@us.ibm.com> Date: Mon, 27 Jul 2009 23:06:35 -0400 From: Beth Kon MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] HPET fixes for reg writes References: <1248452819-5503-1-git-send-email-eak@us.ibm.com> <4A69EA85.8090502@icyb.net.ua> In-Reply-To: <4A69EA85.8090502@icyb.net.ua> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andriy Gapon Cc: qemu-devel@nongnu.org Andriy Gapon wrote: > on 24/07/2009 19:26 Beth Kon said the following: > >> This patch addresses the problems found by Andriy Gapon: >> >> - The code was incorrectly overwriting the high order 32 >> bits of the timer and hpet config registers. This didn't show up >> in testing because linux and windows use hpet in legacy mode, >> where the high order 32 bits (advertising available interrupts) >> of the timer config register are ignored, and the high order 32 >> bits of the hpet config register are reserved and unused. >> >> >> - The mask for level-triggered interrupts was off by a bit. (hpet >> doesn't currently support level-triggered interrupts). >> >> In addition, I removed some unused #defines, and corrected the ioapic >> interrupt values advertised. I'd set this up early in hpet development >> and never went back to correct it, and no bugs resulted since linux and >> windows use hpet in legacy mode where available interrupts are ignored. >> >> > > Beth, > > thanks a lot! > > And a comment: it seems that the code doesn't verify interrupt configured by > software, it happily uses any interrupt even if it's not advertised in interrupt > capabilities. I know, the software should not do that, but it happens :) > Yes, that is absolutely a good suggestion. I will add a check for correctness in the event of future expansion of hpet emulation capabilities, but see below. > Also, maybe it would be a good idea to keep support for some additional > interrupts? E.g. irq 10, 11 or some such, or maybe something >= 16 for APIC mode > (if possible at all). But I know that this needs some careful thinking to not > interfere with other emulated devices. > Your probing on this subject has made clear that this hpet implementation really supports only legacy mode, because there are no other interrupts available for non-legacy mode hpet timers. QEMU currently supports only a single IOAPIC, with irqs 0-15 identity mapped on to it (with the exception of irq0->inti2 override), and no capability for IOAPIC interrupts above 15. And since the hpet implementation is currently edge-triggered, it can not share interrupt lines with PCI. This leaves no interrupts other than the legacy timer interrupts. I will submit another patch that will make this clear. I will reduce the number of available timers to 2 (the 2 legacy mode timers), and not advertise any IOAPIC interrupt capability. This could all be changed with qemu enhancements of course, but at the moment, hpet legacy replacement mode appears to reasonably cover the requirements of linux and windows guests.