From nobody Mon Feb 9 04:03:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549859670923438.69843035468705; Sun, 10 Feb 2019 20:34:30 -0800 (PST) Received: from localhost ([127.0.0.1]:44063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt3Ib-0005NL-VY for importer@patchew.org; Sun, 10 Feb 2019 23:34:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt3FH-0003MO-8g for qemu-devel@nongnu.org; Sun, 10 Feb 2019 23:31:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gt32F-0006IZ-5J for qemu-devel@nongnu.org; Sun, 10 Feb 2019 23:17:37 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:41250) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gt327-0005pG-UA for qemu-devel@nongnu.org; Sun, 10 Feb 2019 23:17:30 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 15C8B7456B9; Mon, 11 Feb 2019 05:17:21 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id F00447456B3; Mon, 11 Feb 2019 05:17:20 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Date: Mon, 11 Feb 2019 05:01:56 +0100 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:738:2001:2001::2001 Subject: [Qemu-devel] [PATCH 1/4] hw/pci-host/bonito.c: Add PCI mem region mapped at the correct address X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Huacai Chen , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Stop using system memory as PCI memory otherwise devices such as VGA that have regions mapped to PCI memory clash with RAM. Use a separate memory region for PCI memory and map it to the correct address in system memory which allows PCI mem regions to show at the correct address where clients expect them. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/bonito.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 9f33582706..c940ec6e48 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -598,11 +598,14 @@ static const VMStateDescription vmstate_bonito =3D { static void bonito_pcihost_realize(DeviceState *dev, Error **errp) { PCIHostState *phb =3D PCI_HOST_BRIDGE(dev); + MemoryRegion *mr =3D g_new0(MemoryRegion, 1); =20 + memory_region_init(mr, OBJECT(dev), "pci.mem", BONITO_PCILO_SIZE); phb->bus =3D pci_register_root_bus(DEVICE(dev), "pci", pci_bonito_set_irq, pci_bonito_map_ir= q, - dev, get_system_memory(), get_system_= io(), + dev, mr, get_system_io(), 0x28, 32, TYPE_PCI_BUS); + memory_region_add_subregion(get_system_memory(), BONITO_PCILO_BASE, mr= ); } =20 static void bonito_realize(PCIDevice *dev, Error **errp) --=20 2.13.7