From patchwork Mon Oct 17 09:27:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 120148 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 26624B6F9F for ; Mon, 17 Oct 2011 21:38:25 +1100 (EST) Received: from localhost ([::1]:51160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFjVc-0007eV-Tq for incoming@patchwork.ozlabs.org; Mon, 17 Oct 2011 05:29:24 -0400 Received: from eggs.gnu.org ([140.186.70.92]:32940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFjUm-0005FH-Ja for qemu-devel@nongnu.org; Mon, 17 Oct 2011 05:28:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFjUi-0004IN-D8 for qemu-devel@nongnu.org; Mon, 17 Oct 2011 05:28:32 -0400 Received: from david.siemens.de ([192.35.17.14]:19053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFjUh-0004GF-JS for qemu-devel@nongnu.org; Mon, 17 Oct 2011 05:28:27 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id p9H9SPLh023413; Mon, 17 Oct 2011 11:28:25 +0200 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p9H9SKVT023511; Mon, 17 Oct 2011 11:28:25 +0200 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Mon, 17 Oct 2011 11:27:47 +0200 Message-Id: X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.14 Cc: Alex Williamson , qemu-devel@nongnu.org, kvm@vger.kernel.org, "Michael S. Tsirkin" Subject: [Qemu-devel] [RFC][PATCH 13/45] hpet: Use msi_deliver 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 Avoid the slow-path MSI delivery via stl_phys by switching to msi_deliver. This also allows to prepare these rarely changing messages in advance. Signed-off-by: Jan Kiszka --- hw/hpet.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/hw/hpet.c b/hw/hpet.c index d8e6b8e..c6d6e35 100644 --- a/hw/hpet.c +++ b/hw/hpet.c @@ -31,6 +31,7 @@ #include "hpet_emul.h" #include "sysbus.h" #include "mc146818rtc.h" +#include "msi.h" //#define HPET_DEBUG #ifdef HPET_DEBUG @@ -55,6 +56,8 @@ typedef struct HPETTimer { /* timers */ uint8_t wrap_flag; /* timer pop will indicate wrap for one-shot 32-bit * mode. Next pop will be actual timer expiration. */ + MSIMessage msi_msg; + MSIRoutingCache msi_cache; } HPETTimer; typedef struct HPETState { @@ -192,7 +195,7 @@ static void update_irq(struct HPETTimer *timer, int set) qemu_irq_lower(s->irqs[route]); } } else if (timer_fsb_route(timer)) { - stl_le_phys(timer->fsb >> 32, timer->fsb & 0xffffffff); + msi_deliver(&timer->msi_msg, &timer->msi_cache); } else if (timer->config & HPET_TN_TYPE_LEVEL) { s->isr |= mask; qemu_irq_raise(s->irqs[route]); @@ -533,9 +536,11 @@ static void hpet_ram_writel(void *opaque, target_phys_addr_t addr, break; case HPET_TN_ROUTE: timer->fsb = (timer->fsb & 0xffffffff00000000ULL) | new_val; + timer->msi_msg.data = new_val; break; case HPET_TN_ROUTE + 4: timer->fsb = (new_val << 32) | (timer->fsb & 0xffffffff); + timer->msi_msg.address = new_val; break; default: DPRINTF("qemu: invalid hpet_ram_writel\n");