From mboxrd@z Thu Jan 1 00:00:00 1970 From: Blue Swirl Subject: Re: [Qemu-devel] [PATCH v3 1/5] hpet 'driftfix': add hooks required to detect coalesced interrupts (x86 apic only) Date: Sat, 30 Apr 2011 00:44:01 +0300 Message-ID: References: <4DB9EF36.1010803@web.de> <722267231.277846.1304070351482.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Jan Kiszka , qemu-devel@nongnu.org, aliguori@us.ibm.com, kvm@vger.kernel.org, gcosta@redhat.com, avi@redhat.com To: Ulrich Obergfell Return-path: Received: from mail-qy0-f174.google.com ([209.85.216.174]:45432 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932208Ab1D2VoV (ORCPT ); Fri, 29 Apr 2011 17:44:21 -0400 Received: by qyk7 with SMTP id 7so482448qyk.19 for ; Fri, 29 Apr 2011 14:44:21 -0700 (PDT) In-Reply-To: <722267231.277846.1304070351482.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Apr 29, 2011 at 12:45 PM, Ulrich Obergfell wrote: > >> On 2011-04-28 20:51, Blue Swirl wrote: >>> On Thu, Apr 28, 2011 at 5:24 PM, Ulrich Obergfell wrote: >>>> 'target_get_irq_delivered' and 'target_reset_irq_delivered' contain >>>> entry addresses of functions that are utilized by update_irq() to >>>> detect coalesced interrupts. apic code loads these pointers during >>>> initialization. >>> >>> I'm not so happy with this approach, but probably then the i386 >>> dependencies can be removed from RTC and it can be compiled only once >>> for all targets. >> >> This whole series is really the minimalistic approach. The callbacks >> defined here must remain a temporary "shortcut". Just like proper >> abstraction of periodic tick compensation for reuse in other timers has >> to be added later on. And the limitation to edge-triggered legacy HPET >> INTs has to be removed. > > Since QEMU doesn't have a generic infrastructure to track interrupt > delivery, I decided to reuse something that is currently available. > The only mechanism that I'm aware of is the one that is utilized by > RTC code ('rtc_td_hack'), i.e. apic_get_irq_delivered() etc. I think your approach is slightly better (while not the best possible one), so it should be used also for RTC. Some more comments: - instead of global variables, there could be a setter function (maybe inline) - pc.h would be a better place instead of sysemu.h > The changes that would be introduced by part 1/5 and part 4/5 of > this patch series could be replaced if a generic infrastructure > to track interrupt delivery becomes available. OK.