From patchwork Mon May 11 13:49:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 470856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4594714018C for ; Tue, 12 May 2015 00:09:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=pAXvdVGr; dkim-atps=neutral Received: from localhost ([::1]:37696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YroOd-0002SK-1R for incoming@patchwork.ozlabs.org; Mon, 11 May 2015 10:09:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yro60-0002mI-88 for qemu-devel@nongnu.org; Mon, 11 May 2015 09:50:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yro5z-0007Di-BE for qemu-devel@nongnu.org; Mon, 11 May 2015 09:50:12 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:34484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yro5z-0007DY-5S for qemu-devel@nongnu.org; Mon, 11 May 2015 09:50:11 -0400 Received: by wicmc15 with SMTP id mc15so28700120wic.1 for ; Mon, 11 May 2015 06:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Az7/VIFH3ePNDI3PxgHp7Ml29qfPqKf+0JjhZT7zKxI=; b=pAXvdVGrmG6Q85WCKTyulS40Gttlx+fV9+3EH2H0thjEQmritLUaqS9F89zVfjakkr 7miWtu7h88NlRG1yrwiq3CBx7G0/AU65Hrl6Cu9FDbPVmtraD/oO0rVntOmdAgAlsNA/ cLzrsvJW/yTsLJrFxT79HNwmsg9BSHudpfbGfAX9uyPxvb87TutL0P976WIyKfDbqNc4 dKVz6ANbi0K51gFF+MjoDs3SGCnasgut72SpBUEEQOdcjyOJxdrMtfXuixnQ5Tkt2ZGy HnusZRhMdf0ka3J6mfo4NKSpO3u2bgf5Vq8UBwm6QeoLJ7gDn8551hiWgJ/zN98HJdbX z80A== X-Received: by 10.180.39.147 with SMTP id p19mr20839470wik.15.1431352210548; Mon, 11 May 2015 06:50:10 -0700 (PDT) Received: from 640k.localdomain (dynamic-adsl-94-39-186-233.clienti.tiscali.it. [94.39.186.233]) by mx.google.com with ESMTPSA id m1sm167235wiw.7.2015.05.11.06.50.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 06:50:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 May 2015 15:49:02 +0200 Message-Id: <1431352157-40283-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1431352157-40283-1-git-send-email-pbonzini@redhat.com> References: <1431352157-40283-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22f Cc: lersek@redhat.com, kraxel@redhat.com, mst@redhat.com Subject: [Qemu-devel] [PATCH 16/31] hw/i386: remove smram_update 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 It's easier to inline it now that most of its work is done by the CPU (rather than the chipset) through /machine/smram and the memory API. Signed-off-by: Paolo Bonzini --- hw/pci-host/pam.c | 6 ------ hw/pci-host/piix.c | 3 ++- hw/pci-host/q35.c | 3 ++- include/hw/pci-host/pam.h | 1 - 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/pci-host/pam.c b/hw/pci-host/pam.c index 99d7af9..17d826c 100644 --- a/hw/pci-host/pam.c +++ b/hw/pci-host/pam.c @@ -31,12 +31,6 @@ #include "sysemu/sysemu.h" #include "hw/pci-host/pam.h" -void smram_update(MemoryRegion *smram_region, uint8_t smram) -{ - bool smram_enabled = (smram & SMRAM_D_OPEN); - memory_region_set_enabled(smram_region, !smram_enabled); -} - void init_pam(DeviceState *dev, MemoryRegion *ram_memory, MemoryRegion *system_memory, MemoryRegion *pci_address_space, PAMMemoryRegion *mem, uint32_t start, uint32_t size) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 46c0278..e67b24f 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -138,7 +138,8 @@ static void i440fx_update_memory_mappings(PCII440FXState *d) pam_update(&d->pam_regions[i], i, pd->config[I440FX_PAM + ((i + 1) / 2)]); } - smram_update(&d->smram_region, pd->config[I440FX_SMRAM]); + memory_region_set_enabled(&d->smram_region, + !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN)); memory_region_set_enabled(&d->smram, pd->config[I440FX_SMRAM] & SMRAM_G_SMRAME); memory_region_transaction_commit(); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index bd17a05..e7372b1 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -268,7 +268,8 @@ static void mch_update_smram(MCHPCIState *mch) PCIDevice *pd = PCI_DEVICE(mch); memory_region_transaction_begin(); - smram_update(&mch->smram_region, pd->config[MCH_HOST_BRIDGE_SMRAM]); + memory_region_set_enabled(&mch->smram_region, + !(pd->config[MCH_HOST_BRIDGE_SMRAM] & SMRAM_D_OPEN)); memory_region_set_enabled(&mch->smram, pd->config[MCH_HOST_BRIDGE_SMRAM] & SMRAM_G_SMRAME); memory_region_transaction_commit(); diff --git a/include/hw/pci-host/pam.h b/include/hw/pci-host/pam.h index 80dd605..6116c63 100644 --- a/include/hw/pci-host/pam.h +++ b/include/hw/pci-host/pam.h @@ -86,7 +86,6 @@ typedef struct PAMMemoryRegion { unsigned current; } PAMMemoryRegion; -void smram_update(MemoryRegion *smram_region, uint8_t smram); void init_pam(DeviceState *dev, MemoryRegion *ram, MemoryRegion *system, MemoryRegion *pci, PAMMemoryRegion *mem, uint32_t start, uint32_t size); void pam_update(PAMMemoryRegion *mem, int idx, uint8_t val);