From patchwork Tue Jul 23 16:22:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 261138 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5099B2C00CF for ; Wed, 24 Jul 2013 02:25:19 +1000 (EST) Received: from localhost ([::1]:38189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1fOm-0007IR-PT for incoming@patchwork.ozlabs.org; Tue, 23 Jul 2013 12:25:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1fNJ-0005PM-Gz for qemu-devel@nongnu.org; Tue, 23 Jul 2013 12:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1fNH-0006uO-Ax for qemu-devel@nongnu.org; Tue, 23 Jul 2013 12:23:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1fNH-0006u6-4L for qemu-devel@nongnu.org; Tue, 23 Jul 2013 12:23:43 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6NGNdIh008995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Jul 2013 12:23:39 -0400 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6NGNV1P018088; Tue, 23 Jul 2013 12:23:36 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Tue, 23 Jul 2013 18:22:57 +0200 Message-Id: <1374596592-7027-2-git-send-email-imammedo@redhat.com> In-Reply-To: <1374596592-7027-1-git-send-email-imammedo@redhat.com> References: <1374596592-7027-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: vasilis.liaskovitis@profitbricks.com, hutao@cn.fujitsu.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 01/16] pc: use pci_hole64 info consistently 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 Signed-off-by: Igor Mammedov --- patch causes false positive checkpatch error: ERROR: need consistent spacing around '*' (ctx:WxV) + PcGuestInfo *guest_info, Signed-off-by: Igor Mammedov --- hw/i386/pc_piix.c | 5 +---- hw/pci-host/piix.c | 17 ++++++++--------- hw/pci-host/q35.c | 7 ++++--- include/hw/i386/pc.h | 3 +-- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 77e4260..c8afe5e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -168,10 +168,7 @@ static void pc_init1(MemoryRegion *system_memory, system_memory, system_io, ram_size, below_4g_mem_size, 0x100000000ULL - below_4g_mem_size, - 0x100000000ULL + above_4g_mem_size, - (sizeof(hwaddr) == 4 - ? 0 - : ((uint64_t)1 << 62)), + guest_info, pci_memory, ram_memory); } else { pci_bus = NULL; diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index c36e725..26bb844 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -233,8 +233,7 @@ static PCIBus *i440fx_common_init(const char *device_name, ram_addr_t ram_size, hwaddr pci_hole_start, hwaddr pci_hole_size, - hwaddr pci_hole64_start, - hwaddr pci_hole64_size, + PcGuestInfo *guest_info, MemoryRegion *pci_address_space, MemoryRegion *ram_memory) { @@ -244,6 +243,7 @@ static PCIBus *i440fx_common_init(const char *device_name, PCIHostState *s; PIIX3State *piix3; PCII440FXState *f; + Range *pci_hole64 = &guest_info->pci_info.w64; unsigned i; dev = qdev_create(NULL, "i440FX-pcihost"); @@ -264,10 +264,10 @@ static PCIBus *i440fx_common_init(const char *device_name, pci_hole_start, pci_hole_size); memory_region_add_subregion(f->system_memory, pci_hole_start, &f->pci_hole); memory_region_init_alias(&f->pci_hole_64bit, "pci-hole64", - f->pci_address_space, - pci_hole64_start, pci_hole64_size); - if (pci_hole64_size) { - memory_region_add_subregion(f->system_memory, pci_hole64_start, + f->pci_address_space, pci_hole64->begin, + pci_hole64->end - pci_hole64->begin); + if (pci_hole64->end > pci_hole64->begin) { + memory_region_add_subregion(f->system_memory, pci_hole64->begin, &f->pci_hole_64bit); } memory_region_init_alias(&f->smram_region, "smram-region", @@ -321,8 +321,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, ram_addr_t ram_size, hwaddr pci_hole_start, hwaddr pci_hole_size, - hwaddr pci_hole64_start, - hwaddr pci_hole64_size, + PcGuestInfo *guest_info, MemoryRegion *pci_memory, MemoryRegion *ram_memory) { @@ -332,7 +331,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, piix3_devfn, isa_bus, pic, address_space_mem, address_space_io, ram_size, pci_hole_start, pci_hole_size, - pci_hole64_start, pci_hole64_size, + guest_info, pci_memory, ram_memory); return b; } diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 667bd20..237b8ab 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -252,6 +252,7 @@ static int mch_init(PCIDevice *d) int i; hwaddr pci_hole64_size; MCHPCIState *mch = MCH_PCI_DEVICE(d); + Range *pci_hole64 = &mch->guest_info->pci_info.w64; /* Leave enough space for the biggest MCFG BAR */ /* TODO: this matches current bios behaviour, but @@ -270,14 +271,14 @@ static int mch_init(PCIDevice *d) memory_region_add_subregion(mch->system_memory, mch->below_4g_mem_size, &mch->pci_hole); pci_hole64_size = (sizeof(hwaddr) == 4 ? 0 : - ((uint64_t)1 << 62)); + pci_hole64->end - pci_hole64->begin); memory_region_init_alias(&mch->pci_hole_64bit, "pci-hole64", mch->pci_address_space, - 0x100000000ULL + mch->above_4g_mem_size, + pci_hole64->begin, pci_hole64_size); if (pci_hole64_size) { memory_region_add_subregion(mch->system_memory, - 0x100000000ULL + mch->above_4g_mem_size, + pci_hole64->begin, &mch->pci_hole_64bit); } /* smram */ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 2ac97d3..7574d92 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -180,8 +180,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, ram_addr_t ram_size, hwaddr pci_hole_start, hwaddr pci_hole_size, - hwaddr pci_hole64_start, - hwaddr pci_hole64_size, + PcGuestInfo *guest_info, MemoryRegion *pci_memory, MemoryRegion *ram_memory);