From patchwork Thu Apr 28 14:24:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Obergfell X-Patchwork-Id: 93223 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 85AFEB6EF2 for ; Fri, 29 Apr 2011 00:25:22 +1000 (EST) Received: from localhost ([::1]:60339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFS9f-0004RN-Hq for incoming@patchwork.ozlabs.org; Thu, 28 Apr 2011 10:25:19 -0400 Received: from eggs.gnu.org ([140.186.70.92]:53634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFS9G-0004RE-9Z for qemu-devel@nongnu.org; Thu, 28 Apr 2011 10:24:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFS9F-0006v5-AS for qemu-devel@nongnu.org; Thu, 28 Apr 2011 10:24:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFS9E-0006v0-VM for qemu-devel@nongnu.org; Thu, 28 Apr 2011 10:24:53 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3SEOqCP007874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Apr 2011 10:24:52 -0400 Received: from localhost.localdomain (vpn2-9-111.ams2.redhat.com [10.36.9.111]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3SEOmh0018437; Thu, 28 Apr 2011 10:24:50 -0400 From: Ulrich Obergfell To: qemu-devel@nongnu.org Date: Thu, 28 Apr 2011 16:24:56 +0200 Message-Id: <1304000700-3640-2-git-send-email-uobergfe@redhat.com> In-Reply-To: <1304000700-3640-1-git-send-email-uobergfe@redhat.com> References: <1304000700-3640-1-git-send-email-uobergfe@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, jan.kiszka@siemens.com, uobergfe@redhat.com, gcosta@redhat.com, avi@redhat.com Subject: [Qemu-devel] [PATCH v3 1/5] hpet 'driftfix': add hooks required to detect coalesced interrupts (x86 apic only) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org '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. This change can be replaced if a generic feedback infrastructure to track coalesced IRQs for periodic, clock providing devices becomes available. Signed-off-by: Ulrich Obergfell --- hw/apic.c | 4 ++++ sysemu.h | 3 +++ vl.c | 3 +++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/apic.c b/hw/apic.c index a45b57f..eb0f6d9 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -24,6 +24,7 @@ #include "sysbus.h" #include "trace.h" #include "kvm.h" +#include "sysemu.h" /* APIC Local Vector Table */ #define APIC_LVT_TIMER 0 @@ -1143,6 +1144,9 @@ static SysBusDeviceInfo apic_info = { static void apic_register_devices(void) { + target_get_irq_delivered = apic_get_irq_delivered; + target_reset_irq_delivered = apic_reset_irq_delivered; + sysbus_register_withprop(&apic_info); } diff --git a/sysemu.h b/sysemu.h index 07d85cd..75b0139 100644 --- a/sysemu.h +++ b/sysemu.h @@ -98,6 +98,9 @@ int qemu_savevm_state_complete(Monitor *mon, QEMUFile *f); void qemu_savevm_state_cancel(Monitor *mon, QEMUFile *f); int qemu_loadvm_state(QEMUFile *f); +extern int (*target_get_irq_delivered)(void); +extern void (*target_reset_irq_delivered)(void); + /* SLIRP */ void do_info_slirp(Monitor *mon); diff --git a/vl.c b/vl.c index 0c24e07..7bab315 100644 --- a/vl.c +++ b/vl.c @@ -233,6 +233,9 @@ const char *prom_envs[MAX_PROM_ENVS]; const char *nvram = NULL; int boot_menu; +int (*target_get_irq_delivered)(void) = 0; +void (*target_reset_irq_delivered)(void) = 0; + typedef struct FWBootEntry FWBootEntry; struct FWBootEntry {