From nobody Tue Feb 10 14:32:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) client-ip=209.85.128.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1618655479; cv=none; d=zohomail.com; s=zohoarc; b=OgQkEUSWTBW+bvWLgjXdDGUeYDhFK2yGZ2i9vSRlp0ovwU5nj//iuYaAuOR7sQ9xDa7iaid6xlu3qSk5S0OjXtvUJl/Pjyt9pltulSItAXyID4/DX+tjnQZnyCJWGR4pnz4iqxAM/kgm6MI3YtML/SRymQnKiI3sP20r+8tS8Fo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655479; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H87QzDiZPuBQ9eTqYywlU8zauYyWci4oQ6E2mLqaLQ4=; b=dC0ZPgXvzRznMwNQc2pmz0PJtqO0AXDL88IHV0jGF/qkRNi3hIHgfopcC8XhKSiF11IHdKyvTo3Tnr31tFbSEdYOKUfqICSSHsAQIu54tfCdeqLYCFLV4j2xtD2yvy1qbTCJFYVXLGwLkPzD4mYTJokUmAIzPrmo4mP7TSAumLA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.zohomail.com with SMTPS id 1618655479091674.8773674307843; Sat, 17 Apr 2021 03:31:19 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id y20-20020a1c4b140000b029011f294095d3so17794778wma.3 for ; Sat, 17 Apr 2021 03:31:18 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id s10sm13952026wrt.23.2021.04.17.03.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H87QzDiZPuBQ9eTqYywlU8zauYyWci4oQ6E2mLqaLQ4=; b=B8XTj1eSX5Z61m2jd98jl0TwesKxcpUQMAJzpJBkfTlZPUuUI2gDvEt/xFNixlgEw3 VNuBdCYeV5v0vHuMA1DK/l/b02LQx5tubcKuXhZbUIay5tqu5FWKJDO8RMOsp+ATUQta otjOmtWd0LHd8R538FK01e7UATB1ttLlLOwXoUgOjBe6VjrQSnV+Esdi5te2lXnBN/nX S9xiIBVjdRq2isgbh67CoNDAZVtY8O+L7hYwjk71iVQ9uoTVfbAWAZ9+0S/RHPXkS1VU QQjIGrh5XK6hxJ8WSniFwaKr4+AKw9eUKtru9A0/uwHQDAuAd5drC9bOBIl8QwWrhtx6 VeOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=H87QzDiZPuBQ9eTqYywlU8zauYyWci4oQ6E2mLqaLQ4=; b=VHNtvq/nl/AHz1idNP+JEc5gqWY8nIr8Fm2FTQ5bndRzs1+9OMAICY5LrKlBRRp5T3 iKHFNQYDgEj1wwzPKXVsA/jhYPaZ+VGsdFmcQSClXkSb9neWNhwQMrb9HYh9UCAkYDOR OWERMvE7L/Eh76elJBPTwFi6/xxARrLkvfRhUZVI+6hFSPdfOn8uSdkaXzDvOu84xznB pykp1lwKXMVjZyHFjDVnm7qRH6fKOqoW7ENSlzZnrCl0e7Vlns5qy918TPmhwzJ4BINf p9DqGSY5kRrm0lsMPBu8vrPNnVl1AJm538FiTPKbj6L6ApJptEmi2DYlt0RwxeBIK4Pl C+Nw== X-Gm-Message-State: AOAM530yoMcka3Eh+PMwP1aKT3FZKWvH5to7CaUY3SPoQQaIpLJZ+DZb 9hfAaG2jh8LfSOdCHhKmwdM= X-Google-Smtp-Source: ABdhPJyQocOTkwS7Q1Zv7kSIdVoats4dgVtn8k7jr0NwqdbX0GUUDodrmg0B35nLZwTEw4VnZLdOBA== X-Received: by 2002:a7b:c4d5:: with SMTP id g21mr11847698wmk.55.1618655477336; Sat, 17 Apr 2021 03:31:17 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Peter Maydell , Peter Xu , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz Subject: [PATCH v2 09/11] hw/pci-host/prep: Do not directly map bus-master region onto main bus Date: Sat, 17 Apr 2021 12:30:26 +0200 Message-Id: <20210417103028.601124-10-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210417103028.601124-1-f4bug@amsat.org> References: <20210417103028.601124-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The raven bus-master memory region is exposed as an AddressSpace. AddressSpaces root MemoryRegion must not be mapped into other MemoryRegion, therefore map the region using its alias. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/raven.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index f9c92b83770..d8c1aaa11f5 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -307,8 +307,6 @@ static void raven_pcihost_initfn(Object *obj) memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, &s->pci_io_non_contiguous); memory_region_add_subregion(address_space_mem, 0xc0000000, &s->pci_mem= ory); - pci_root_bus_new_inplace(&s->pci_bus, sizeof(s->pci_bus), DEVICE(obj),= NULL, - &s->pci_memory, &s->pci_io, 0, TYPE_PCI_BUS); =20 /* Bus master address space */ memory_region_init(&s->bm, obj, "bm-raven", 4 * GiB); @@ -320,6 +318,10 @@ static void raven_pcihost_initfn(Object *obj) memory_region_add_subregion(&s->bm, 0 , &s->bm_pci_memory_alia= s); memory_region_add_subregion(&s->bm, 0x80000000, &s->bm_ram_alias); address_space_init(&s->bm_as, &s->bm, "raven-bm"); + + pci_root_bus_new_inplace(&s->pci_bus, sizeof(s->pci_bus), DEVICE(obj),= NULL, + &s->bm_pci_memory_alias, &s->pci_io, 0, + TYPE_PCI_BUS); pci_setup_iommu(&s->pci_bus, raven_pcihost_set_iommu, s); =20 h->bus =3D &s->pci_bus; --=20 2.26.3