From patchwork Wed Aug 24 13:40:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 111372 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 9A0FCB6F68 for ; Thu, 25 Aug 2011 01:03:51 +1000 (EST) Received: from localhost ([::1]:37598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwDig-0000Fl-8e for incoming@patchwork.ozlabs.org; Wed, 24 Aug 2011 09:42:14 -0400 Received: from eggs.gnu.org ([140.186.70.92]:41633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwDhf-0005re-K8 for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwDhZ-0007Kt-2f for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:41:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwDhY-0007Jk-JU for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:41:04 -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 p7ODf3Ax026796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Aug 2011 09:41:03 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7ODf376031921 for ; Wed, 24 Aug 2011 09:41:03 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 0BD05250B58; Wed, 24 Aug 2011 16:41:01 +0300 (IDT) From: Avi Kivity To: qemu-devel@nongnu.org Date: Wed, 24 Aug 2011 16:40:49 +0300 Message-Id: <1314193259-27092-13-git-send-email-avi@redhat.com> In-Reply-To: <1314193259-27092-1-git-send-email-avi@redhat.com> References: <1314193259-27092-1-git-send-email-avi@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 Subject: [Qemu-devel] [PATCH v2 12/22] piix_pci: wrap memory update in a transaction 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 The code will remap all PAMs, even if just one is updated, resulting in reduced performance. Wrap in a transaction to detect that those other PAMs have not changed. Signed-off-by: Avi Kivity --- hw/piix_pci.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/piix_pci.c b/hw/piix_pci.c index f892994..8f6ea42 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -142,6 +142,7 @@ static void i440fx_update_memory_mappings(PCII440FXState *d) int i, r; uint32_t smram; + memory_region_transaction_begin(); update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM] >> 4) & 3, &d->pam_regions[0]); for(i = 0; i < 12; i++) { @@ -162,6 +163,7 @@ static void i440fx_update_memory_mappings(PCII440FXState *d) d->smram_enabled = false; } } + memory_region_transaction_commit(); } static void i440fx_set_smm(int val, void *arg)