From nobody Sat May 18 22:15:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) client-ip=209.85.221.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655438; cv=none; d=zohomail.com; s=zohoarc; b=TxHxZkevs8r+gbDSST06+Z+xHRtPOEqzZpvt26Zj0s/idIxsffUGK3egiwuptE2QLL2YJuI5bYVlD2MRqvgdf78NekQMOC//2OOjGTe6rgR32vieMF2AHlB1wxgfkDutXtO634LMxVzgquATV41FlSD2YLD6eWB8kGU+WgIv5ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655438; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HeEMfM8xls4IrDQ+W3vHIv1EqNRgEdPk82n7+iZ8zHs=; b=MLXgYRU1vgFRwuaMhN1REfQxBP49xCPPyFWf+2etN0WAs0dAQPxVK7cSdAjvUPugantkrgVBgfsCmxC9XNNPdzJxpshXo60P6a0swfM6p33ZE8jH/lenTrY2QoBM08LDQaLKO01QQBLxnEZs8hHlFeOqGj515v1wJatq8o5lvgA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.zohomail.com with SMTPS id 1618655438324157.35919187212744; Sat, 17 Apr 2021 03:30:38 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id w4so25300266wrt.5 for ; Sat, 17 Apr 2021 03:30:37 -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 e33sm11373819wmp.43.2021.04.17.03.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:30:36 -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=HeEMfM8xls4IrDQ+W3vHIv1EqNRgEdPk82n7+iZ8zHs=; b=czqEvhcG43xW7+3XWZZrmh7JMQKFKF+O72yip6Sz7CE9p9IFgyIhSL7wAkuDvsL+WD 320sgnlnUtO+2oCUgrWYedAneosLEROnhro20qukKFNwWBeg5s0l4AUHMHDsk5DNVISo E18h5A9op0WO8gFpwBBMrExZFjdSkp7/Ps8uCoNmouPvwJIAqZgQvQWiXZ6+lC7daElL cLJmqqyDEszHQOnO7ned5Oh+euw+yvsB68e1HjAdbZ1+V5rbU5IIWZIhUBa6N8cRviPa l1bSCIm76rfkiTlOp655x56/+Id1oLGLhmGw4idb5ztGxZkgJOXqtF8rQBXKxioaZeQn OfjQ== 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=HeEMfM8xls4IrDQ+W3vHIv1EqNRgEdPk82n7+iZ8zHs=; b=UIEHDr8qwvhxQtXGCvlHOnNS7IxJMfZoDLgflBRHXU8skx7JnZRa+U/2JOy5YopotI c1TrUzG+ojHk2p2SwRsU9VfgBcqtdcEaSRu1Ua+agXQbmV8ihn7hBRaJeqTrBGQnq5WC s3E/Jy7VVXuoJhX+7RH1I7t6Rim7nKUgpn6bJ2qJC4hl+nFoaNPFUnCUBUkXU+Vbb01b 60OTW043fZOJmF/ocR7bEZJhgOudekjdfKuywaE25AbiJzeAnG4YYG+apAPBDPYNJbkZ 5uSIGsJ6jdEDAcri/Bm7Y1qW4Wv8tfhvQFvkp9aTkKHBe3YSkv0imrYWlSDhWZxAAJcs Ybig== X-Gm-Message-State: AOAM531u0N3JynWIXnEzYWPlCh5PajLwHyoJSH4TYErelTj4fWpzH1B4 5frYj4ablFP0q1J5xDtfPq8= X-Google-Smtp-Source: ABdhPJxWrcyHQzF0FS+fpcGeplEaLL4CyLN1jomG0zxlsngQNRLbJO+nPT3171NUlQVMVN1YsPmTFg== X-Received: by 2002:adf:f948:: with SMTP id q8mr3744936wrr.296.1618655436524; Sat, 17 Apr 2021 03:30:36 -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?= , Andrew Jeffery , Joel Stanley Subject: [PATCH v2 01/11] hw/arm/aspeed: Do not directly map ram container onto main address bus Date: Sat, 17 Apr 2021 12:30:18 +0200 Message-Id: <20210417103028.601124-2-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 RAM container is exposed as an AddressSpace. AddressSpaces root MemoryRegion must not be mapped into other MemoryRegion, therefore map the RAM container using an alias. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/aspeed.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index a17b75f4940..daeef5b32a2 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -40,6 +40,7 @@ struct AspeedMachineState { =20 AspeedSoCState soc; MemoryRegion ram_container; + MemoryRegion ram_container_alias; MemoryRegion max_ram; bool mmio_exec; char *fmc_model; @@ -339,9 +340,12 @@ static void aspeed_machine_init(MachineState *machine) } qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort); =20 + memory_region_init_alias(&bmc->ram_container_alias, NULL, + "ram-container-alias", &bmc->ram_container, 0, + memory_region_size(&bmc->ram_container)); memory_region_add_subregion(get_system_memory(), sc->memmap[ASPEED_DEV_SDRAM], - &bmc->ram_container); + &bmc->ram_container_alias); =20 max_ram_size =3D object_property_get_uint(OBJECT(&bmc->soc), "max-ram-= size", &error_abort); --=20 2.26.3 From nobody Sat May 18 22:15:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) client-ip=209.85.128.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655443; cv=none; d=zohomail.com; s=zohoarc; b=h4cIM5v6H8Kh/DOLEtcqYYqQxXMaUejC5kGHWiNzrWbGMwm4dV+VNglZ468AjjfX36Ppm7TiErNPKW9RpiJgQWeq1L3+XlCIBXKVS+l2sOCbrf0dV600tpIP5DrZu38Rvav4j1WehqmufGWdpRva+ebSkmi6Pnatg97APWDMnP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655443; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kF/aV6qxhEEC7EHoDNvMenC0A38A0IZfHiqIOjgg71A=; b=bRK3/KviAtPRlXPt454EcgE0gEfAw3t7m4H6Uzih7ahbIJX9e9vxyEIOnDX8Qpr/QC8twvblwEZW8DKqZssZ1iK8QrngyOBHNahpjBHMD9XGKlsILYYf0SUt3Fg8Epir8sHmdja65m0pL+EHfRyHXSz0COqAciXJ3gqCOh8uktg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.zohomail.com with SMTPS id 1618655443383621.0703643437746; Sat, 17 Apr 2021 03:30:43 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id w186so11013144wmg.3 for ; Sat, 17 Apr 2021 03:30:42 -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 b15sm3794006wrt.57.2021.04.17.03.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:30:41 -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=kF/aV6qxhEEC7EHoDNvMenC0A38A0IZfHiqIOjgg71A=; b=DobbvUqA35+9kB1+MeSnWxw7nXURePdOwwkPQQA4JSO2GGux7pJHOVn5wp7nVsfIbk MZo7gt6QtAFh3OfuTD+n8G5vGx5/pe3yUULKtj5n++ZjZzxU1hB5BLxvwiLsRg52tm2/ d/B/pDKY9dMq39w7yWxVNyx2Gz7f2w4ZR9rXLWbED/yopVd7m1/Zt+Ooto0EkH2yxYyE V1MN0b9J9Df3p76lizDy9ZI0mqjb9FRmSKKpMwsFI5xotEyB2nHASZN6yld2YQFNBU0s o1cZ/rv8bO7Uls/fnG7eMzXfQi4O8+njSKf/VtcoX0ykSWP7OyFNL3VH9KaBabtiyn26 y0yQ== 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=kF/aV6qxhEEC7EHoDNvMenC0A38A0IZfHiqIOjgg71A=; b=EDNcij/MLxZAD8EHYAiPO4HIWJQsBxgxD1cPy/wyp/bJdR5gOhH5CLWzXq1IjAxwRs c9suVbP30D/DBzkTNt7NpykLBKrSZPYIQL4t6QzK08NVa2avlHh8sS7IIh9yRSuJTklu Q7B1J2a9bTQB/+cA30xWyoV+Vwj1v7S/UzJfpgfS5LVJMS5ddWkvp1O7FLHJXQyQwhsV d/Vs9GyPI/OISQRHH07Y2q1N/gjlvlv7ItTop/Voj2jSr6OCSIJu8jQptYYr0AhDKWyX +1js7j9NReSZx15bgJ+vYV9/2gIc0vsFmbOk5IMz66qPaVPAZVJLCCuuDQ93bpr+squH X0Vw== X-Gm-Message-State: AOAM532Hmll1TOjMRVeBYcKc2f+676ECe69AnnRFjkVVU3U0+LSDFLXL f2vjkpyGk1z1onC25xTZJA0= X-Google-Smtp-Source: ABdhPJw18Y79CyTqdwhK3G8j+fklRqnjpDS7m3jTSAVnOIq1dGLlZ4s9Zb88OlasQ352TjHTnNeihA== X-Received: by 2002:a1c:f305:: with SMTP id q5mr12212974wmq.96.1618655441662; Sat, 17 Apr 2021 03:30:41 -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?= , Andrew Jeffery , Joel Stanley , Alistair Francis Subject: [PATCH v2 02/11] hw/aspeed/smc: Use the RAM memory region for DMAs Date: Sat, 17 Apr 2021 12:30:19 +0200 Message-Id: <20210417103028.601124-3-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) From: C=C3=A9dric Le Goater Instead of passing the memory address space region, simply use the RAM memory region instead. This simplifies RAM accesses. This patch breaks migration compatibility. Fixes: c4e1f0b48322 ("aspeed/smc: Add support for DMAs") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20210407171637.777743-2-clg@kaod.org> Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed.c | 2 +- hw/ssi/aspeed_smc.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index daeef5b32a2..4033ffd314c 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -328,7 +328,7 @@ static void aspeed_machine_init(MachineState *machine) object_property_set_int(OBJECT(&bmc->soc), "num-cs", amc->num_cs, &error_abort); object_property_set_link(OBJECT(&bmc->soc), "dram", - OBJECT(&bmc->ram_container), &error_abort); + OBJECT(machine->ram), &error_abort); if (machine->kernel_filename) { /* * When booting with a -kernel command line there is no u-boot diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 16addee4dc8..6f72fb028e5 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -178,8 +178,7 @@ * 0: 4 bytes * 0x7FFFFF: 32M bytes */ -#define DMA_DRAM_ADDR(s, val) ((s)->sdram_base | \ - ((val) & (s)->ctrl->dma_dram_mask)) +#define DMA_DRAM_ADDR(s, val) ((val) & (s)->ctrl->dma_dram_mask) #define DMA_FLASH_ADDR(s, val) ((s)->ctrl->flash_window_base | \ ((val) & (s)->ctrl->dma_flash_mask)) #define DMA_LENGTH(val) ((val) & 0x01FFFFFC) --=20 2.26.3 From nobody Sat May 18 22:15:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) client-ip=209.85.128.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655448; cv=none; d=zohomail.com; s=zohoarc; b=nsk4s9ruKjM4l2LMzw4WicW/d7aYEMMi/nBb+8xyNEEVFXhQdjGyqpY+w6e9XZJEqg7D6J5b8rSrktEShOJw7SVL5WbGM1GdYJVuuZZOLHPs2OPxYcWBMDeQvzSGHlSgzCXWqSS0ZAOQpIhMZL44YwRrtlVeVmp6jZSH3yxX3Vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655448; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YqA3p/T6rcC/vVj1HlfKqNVV1sNmO1FDscy1JV4DYeo=; b=D+pZosrx0+Srh/c6m1U403H4CKZoMaCPqZOLBuTusfJKMVUSJLGPV8j/1RhbTMP5FQRRh2IDXdEHFH0sRfwk+tYn4yesknXLx08Wl/NiP3M3nQFXKw9sdsOtEJDjIil6Qh7Ud+w6Ali9N7I4S71ZiUNvpv+g4bW5F+PJSiN9JsE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.zohomail.com with SMTPS id 1618655448448314.9855033712463; Sat, 17 Apr 2021 03:30:48 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id k4-20020a7bc4040000b02901331d89fb83so3340394wmi.5 for ; Sat, 17 Apr 2021 03:30:47 -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 y17sm14860403wrq.76.2021.04.17.03.30.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:30:46 -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=YqA3p/T6rcC/vVj1HlfKqNVV1sNmO1FDscy1JV4DYeo=; b=XI7cLY00hk+yXTbKsmzHu/oYlxDQQudJzwQwG/hcVHrLJn4wjSHjyhSWTAjNoFYuLm L62JpBkacfuh/kDvtxF2qpEpmiO4QT+ryMz7V17W0nksdqYlhJS6a/81r30rC7IPTyKT 40oCZLHrDhuDlKjMNBmvtuPGp1lQi/PSizj2aYJypM/Lo5Z5LiBPASpWWec1JmynZwZ4 nWeqv0QH3ppLJrdPfv4+ePy2/dOxuDDkl9Dcf6o/Jd1Cy/iz3D8F2D31ovASvesEXPxm 6x1/rO+U6vfW1vf8dO+4zzyym4ZLtlfg6hCWG79N0N4w8nFDV5c1yNVHuYUz2P5O+dzL PJHQ== 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=YqA3p/T6rcC/vVj1HlfKqNVV1sNmO1FDscy1JV4DYeo=; b=JOGwejG4w6Rn/tSA0NKdDUvk22row945moBw7AvwGTmxBinvjD0MlNdS9tklhSdrc1 xY30i2HM+SacXk9IPYarYW6Y2doEUvS6TN0voAvnUnqur2szBQtuA7Sg47kdLPEH5V49 PJw10iwo3UM1574DWiI0nymBgyOFnNCbBQBO0l7mC5VSPwwiXkdVqD9lOjCrlA84VGZP O9+Wrtoztvig/0LtoXHcfzhyixUB2sq+Hecw5zhqge8LSib2CoXj0Slv8Nz+3rIYWiqv TG6iYfIXn/t/s3oQtXXKb/Z5XX0imiQYftL1LftXkmalqPCs0RKI12cRYoUyQmmMHlGn 8dvw== X-Gm-Message-State: AOAM530S30cZYuZGQMC3c1Ecanvk0EBY+GCC16cL83lekITJ0OecCxhN +hykOyuU4mN0hUwx5WEAMBM= X-Google-Smtp-Source: ABdhPJxucS85w39EI6XBhb6Lg/u6tG6gQyirJ0OQ/luTscbm6jHhfaA04KZn/0WwWJqXRz5Pwewurw== X-Received: by 2002:a7b:cb42:: with SMTP id v2mr11996034wmj.120.1618655446702; Sat, 17 Apr 2021 03:30:46 -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?= , Andrew Jeffery , Joel Stanley , Alistair Francis Subject: [PATCH v2 03/11] hw/arm/aspeed: Do not sysbus-map mmio flash region directly, use alias Date: Sat, 17 Apr 2021 12:30:20 +0200 Message-Id: <20210417103028.601124-4-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 flash mmio region is exposed as an AddressSpace. AddressSpaces must not be sysbus-mapped, therefore map the region using an alias. Signed-off-by: Philippe Mathieu-Daud=C3=A9 [ clg : Fix DMA_FLASH_ADDR() ] Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20210312182851.1922972-3-f4bug@amsat.org> --- include/hw/ssi/aspeed_smc.h | 1 + hw/ssi/aspeed_smc.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index 16c03fe64f3..e3c96cecbd8 100644 --- a/include/hw/ssi/aspeed_smc.h +++ b/include/hw/ssi/aspeed_smc.h @@ -84,6 +84,7 @@ struct AspeedSMCState { =20 MemoryRegion mmio; MemoryRegion mmio_flash; + MemoryRegion mmio_flash_alias; =20 qemu_irq irq; int irqline; diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 6f72fb028e5..e06a3b0c5bd 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -179,8 +179,7 @@ * 0x7FFFFF: 32M bytes */ #define DMA_DRAM_ADDR(s, val) ((val) & (s)->ctrl->dma_dram_mask) -#define DMA_FLASH_ADDR(s, val) ((s)->ctrl->flash_window_base | \ - ((val) & (s)->ctrl->dma_flash_mask)) +#define DMA_FLASH_ADDR(s, val) ((val) & (s)->ctrl->dma_flash_mask) #define DMA_LENGTH(val) ((val) & 0x01FFFFFC) =20 /* Flash opcodes. */ @@ -1385,7 +1384,9 @@ static void aspeed_smc_realize(DeviceState *dev, Erro= r **errp) memory_region_init_io(&s->mmio_flash, OBJECT(s), &aspeed_smc_flash_default_ops, s, name, s->ctrl->flash_window_size); - sysbus_init_mmio(sbd, &s->mmio_flash); + memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s), name, + &s->mmio_flash, 0, s->ctrl->flash_window_size= ); + sysbus_init_mmio(sbd, &s->mmio_flash_alias); =20 s->flashes =3D g_new0(AspeedSMCFlash, s->ctrl->max_peripherals); =20 --=20 2.26.3 From nobody Sat May 18 22:15:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) client-ip=209.85.128.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655453; cv=none; d=zohomail.com; s=zohoarc; b=TiKVqIQrVeo3qE+NJ7N5bnPB3/sqWSRia9v7oiuyLvjAbrdSAxmAzXuUmjArZOcOgOmVdc+8hioj1QVWCISur4c9njzpHhT2pj/nnF8UDUANQXzIiuVCOnQmUAGxuUci19lhMz1lLmaCMz/mfN4Z+f66a4J2sprKEXGintQDm0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655453; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Qo9mc7C04yVXRYuUPrtzG1r/qxsKimgZXzxtcjqOeGs=; b=UBDbCeMdRyXjGb7blE4EHM+lkcCF1nvg+QNMsOAsV+V1eF+W2/k23K+yN+bOv2pdNhDoY6hMio/iuKsNA8jJKMp6Z7k8ROceQ7rLeXvRVq1Gf1WcmHH47SDNHD5eaArDtlk+lgzOuIGlfV5QRUtBVZkzsPVDusoFyScUn2ZojgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.zohomail.com with SMTPS id 161865545343664.29148058046223; Sat, 17 Apr 2021 03:30:53 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id f195-20020a1c1fcc0000b029012eb88126d7so5472573wmf.3 for ; Sat, 17 Apr 2021 03:30:52 -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 y17sm14860750wrq.76.2021.04.17.03.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:30:51 -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=Qo9mc7C04yVXRYuUPrtzG1r/qxsKimgZXzxtcjqOeGs=; b=C9Kb5qhbFu0DU2JQIy6zdLf/jnz7EfMekOWbA1c4qigXSRO69yKPL8AiQFaysa5AYY oH/3RDr8jm0vLo1nsCaKbEy5wcWmg58oyb/+KZNZfPOfFcFZLDzkoVuQ4ea0XkxMCyVG tHt11QMT6I1LZgdrqnbg1t9odjYY3OeO1nnrskcxFN0xBmGXw4wT1ZNDJbiN30vrApO1 gOgGME64aQq3Isfav6g0s/yJf5Lbsj/CCU8EutZQyYxzl4abisDn9hoqpBRX6LU0b3BF UHESzjZ6fo2LKUIyaLEMOIWhPCOfkFCb34UhnXrPy40TkaKGPG1tqrWd8enwFEzcqQFl H1ng== 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=Qo9mc7C04yVXRYuUPrtzG1r/qxsKimgZXzxtcjqOeGs=; b=BqA5IMCsJ3/GU1Knt3uHqggdymnI83NVFcBb/bTNRSiPPyFoLYIzZPMGP7m2kFR8O/ Bz87BMjfFgVeF6KDT5W3Ee5RzjHhwnmhChFCp/BG6TGbhCmoGX8DpOK5oueA0cTnXW/n KbK6QPgEvrGbFDqfNqsu0Eu7QQ0bFN+YOs7c6Lvj1uZDN4MnBXOaYRu2y+O30w+p6RYp YFBlFMfhkvalDJCAFobIpPSuUooTMdujPytxKTWNvB4ATGVIAmYH8LQZKwrsyFBdMYqD lLbRjk0qvqz2YMjY5lLn/FczYwr11BzhIArHdQu4M0sH3/ThwMHiP4ROO2SVJu8kui83 32Ig== X-Gm-Message-State: AOAM53229ZlnFORazg5//zzeXYuGNzsrdzZWf+pKWDp53bSAN1pCBIM5 FZRXOm81UuLgtToVXtSSlb0= X-Google-Smtp-Source: ABdhPJxHoCUDbrVVMvsui27eiMs8qKCktuSkesb9A2r7N5u2Ikg7aknAHLrwzD46xZX08TNtZ3atJw== X-Received: by 2002:a1c:f20f:: with SMTP id s15mr12523015wmc.61.1618655451744; Sat, 17 Apr 2021 03:30:51 -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 04/11] hw/pci-host: Rename Raven ASIC PCI bridge as raven.c Date: Sat, 17 Apr 2021 12:30:21 +0200 Message-Id: <20210417103028.601124-5-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 ASIC PCI bridge chipset from Motorola is named 'Raven'. This chipset is used in the PowerPC Reference Platform (PReP), but not restricted to it. Rename it accordingly. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- hw/pci-host/{prep.c =3D> raven.c} | 0 MAINTAINERS | 2 +- hw/pci-host/Kconfig | 2 +- hw/pci-host/meson.build | 2 +- hw/ppc/Kconfig | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename hw/pci-host/{prep.c =3D> raven.c} (100%) diff --git a/hw/pci-host/prep.c b/hw/pci-host/raven.c similarity index 100% rename from hw/pci-host/prep.c rename to hw/pci-host/raven.c diff --git a/MAINTAINERS b/MAINTAINERS index 36055f14c59..0e8f9cbc2ab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1302,7 +1302,7 @@ S: Maintained F: hw/ppc/prep.c F: hw/ppc/prep_systemio.c F: hw/ppc/rs6000_mc.c -F: hw/pci-host/prep.[hc] +F: hw/pci-host/raven.c F: hw/isa/i82378.c F: hw/isa/pc87312.c F: hw/dma/i82374.c diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig index 2ccc96f02ce..593d90e5588 100644 --- a/hw/pci-host/Kconfig +++ b/hw/pci-host/Kconfig @@ -6,7 +6,7 @@ config XEN_IGD_PASSTHROUGH default y depends on XEN && PCI_I440FX =20 -config PREP_PCI +config RAVEN_PCI bool select PCI select OR_IRQ diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build index 87a896973e7..2460f365471 100644 --- a/hw/pci-host/meson.build +++ b/hw/pci-host/meson.build @@ -13,7 +13,7 @@ pci_ss.add(when: 'CONFIG_SH_PCI', if_true: files('sh_pci.c')) =20 # PPC devices -pci_ss.add(when: 'CONFIG_PREP_PCI', if_true: files('prep.c')) +pci_ss.add(when: 'CONFIG_RAVEN_PCI', if_true: files('raven.c')) pci_ss.add(when: 'CONFIG_GRACKLE_PCI', if_true: files('grackle.c')) # NewWorld PowerMac pci_ss.add(when: 'CONFIG_UNIN_PCI', if_true: files('uninorth.c')) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index d11dc30509d..ebbe95eb90f 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -73,7 +73,7 @@ config PREP imply PCI_DEVICES imply TEST_DEVICES select CS4231A - select PREP_PCI + select RAVEN_PCI select I82378 select LSI_SCSI_PCI select M48T59 --=20 2.26.3 From nobody Sat May 18 22:15:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) client-ip=209.85.221.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655458; cv=none; d=zohomail.com; s=zohoarc; b=gF50C+CxPkSKmtUvcehCexi2AvKVuXPfS/tpVi5sqZl+iukVUKtLf3qINzWA8HjyEO7sWye50RMSkfaPg+gd8UfPB0AGdkJWs5wLcwVf1kbAqfXrDNgiVjf4/8E0Jz5ioTbBss9/bxRCGsW+W4lCRyVjOS3PnU6yyHPoab3vZl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655458; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PdnzmuhsTLw4wdID7+EL8uOV5BaW8a1hwDqQzxQSeJ0=; b=QJh7cSrcygzjEpewbO+dppweoTc31AeafIM6lyj/RqCQ/+WS1mwLa+JPnMSq2AlA+rup9u1QMUTWOrIUWOLMg6ClcXsaHRi0UZNIf5D0QV5evKqIT6KNFHa7SS2je47AAYzGug+XLWSsQG7N6FzERLPuu+17auwxYgfSqGkvJgw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.zohomail.com with SMTPS id 161865545857465.71797981904479; Sat, 17 Apr 2021 03:30:58 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id k26so12607242wrc.8 for ; Sat, 17 Apr 2021 03:30:57 -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 n14sm12291808wmk.5.2021.04.17.03.30.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:30:56 -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=PdnzmuhsTLw4wdID7+EL8uOV5BaW8a1hwDqQzxQSeJ0=; b=hSqDwzKh64y708YkvLg3y0px7fNMVmIgZ87o384zCIyj/bvt0rxsvOTBeGJO+FnW7d 4XRsU76R6wKADEyo/hpfAjNWGRmpddcoTliMsJGJ9VPRZnb95dsw/UgxnvRN+oZ5Sa6n Mv4Q0uNd2QdRQ7G31kef6enuBOU4pDX9m9OuDB3mwx+MtigifWDu7Z3w1J17F+9EpK0R yU9mB6I9EE4Hi2gxXa3yQWXuknScHBSnBtaDBbjW7znGl3y9oryOp9BTazPX9vAmnPl2 MWddrw2FqZ1+6mNAIcACwrVX17mdaTRfoemOT2vQMWbu2g5PkRYEZQMycTS11shloP0V f+fw== 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=PdnzmuhsTLw4wdID7+EL8uOV5BaW8a1hwDqQzxQSeJ0=; b=s49Ps+kh3MoE6HcEipSkfMlXyWrmJu5rHP9i2BsnUD6ob6iyEQq+bl6wVAqgzT8Dvz Qm69KpzJpsRqessMy0t39nm9p7JOas6B5udxsdbczS4qBQtvroZWKkfJS6ZQP2P//uP+ vZ2M4M+kDf0Klw80Yk/jz3R3ATSrWKZvSeOZcYPlYZpzTqDMr2MYZg9q+0V94eND+7AA cCuI/wx2vY4LiqnniM5DRRLaECikoEUiuXmN1vRNCBZ1U8sZ4Zxn2CyXXMDytn877OZK MIzPRFo4jOMehtCXJBf4uQ/PWb1aopjpJ2Zs+e+VsQt+CER+kQsliVFHtmQqKKBEJlap qDCQ== X-Gm-Message-State: AOAM530sCeFTQwoN45FNw5+To/AgI560rN1S7HImE86uGuzpPM7MESc8 Fstz27G9WybrKYEdUGEzTow= X-Google-Smtp-Source: ABdhPJyG9lVl3E9j8Dn9ghsQfNozVY8AKsTsQYSW1++kRRv0s5UP7NiwTBVYB54nHUKSaZD07KVV1w== X-Received: by 2002:adf:dc8d:: with SMTP id r13mr3654992wrj.339.1618655456749; Sat, 17 Apr 2021 03:30:56 -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 05/11] hw/pci-host/raven: Add PCI_IO_BASE_ADDR definition Date: Sat, 17 Apr 2021 12:30:22 +0200 Message-Id: <20210417103028.601124-6-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) Rather than using the magic 0x80000000 number for the PCI I/O BAR physical address on the main system bus, use a definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- hw/pci-host/raven.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 0a9162fba97..730f31a8931 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -82,6 +82,8 @@ struct PRePPCIState { =20 #define BIOS_SIZE (1 * MiB) =20 +#define PCI_IO_BASE_ADDR 0x80000000 /* Physical address on main bus */ + static inline uint32_t raven_pci_io_config(hwaddr addr) { int i; @@ -159,7 +161,7 @@ static uint64_t raven_io_read(void *opaque, hwaddr addr, uint8_t buf[4]; =20 addr =3D raven_io_address(s, addr); - address_space_read(&s->pci_io_as, addr + 0x80000000, + address_space_read(&s->pci_io_as, addr + PCI_IO_BASE_ADDR, MEMTXATTRS_UNSPECIFIED, buf, size); =20 if (size =3D=3D 1) { @@ -191,7 +193,7 @@ static void raven_io_write(void *opaque, hwaddr addr, g_assert_not_reached(); } =20 - address_space_write(&s->pci_io_as, addr + 0x80000000, + address_space_write(&s->pci_io_as, addr + PCI_IO_BASE_ADDR, MEMTXATTRS_UNSPECIFIED, buf, size); } =20 @@ -294,8 +296,9 @@ static void raven_pcihost_initfn(Object *obj) address_space_init(&s->pci_io_as, &s->pci_io, "raven-io"); =20 /* CPU address space */ - memory_region_add_subregion(address_space_mem, 0x80000000, &s->pci_io); - memory_region_add_subregion_overlap(address_space_mem, 0x80000000, + memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, + &s->pci_io); + memory_region_add_subregion_overlap(address_space_mem, PCI_IO_BASE_ADD= R, &s->pci_io_non_contiguous, 1); 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, --=20 2.26.3 From nobody Sat May 18 22:15:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) client-ip=209.85.128.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655463; cv=none; d=zohomail.com; s=zohoarc; b=HUkNbpQrAVwLve/Y9INYS1VDqLkBBpBG7ir0KuO5sbOBRVz8gFp4nQxwh8QHu5HxkLSFPI6bqx7iFt9bA84bID/GXmYoeCLEdJ59sIRTvpNJvySMealQmnmu9t9dIBKp128bhOK46fMP4+jAwfimcaAUZPv+Uv6mvz7b3DEzEZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655463; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VLE3I1k3IJfuJNE04qzx4N5NNPVf33qPSjT+93d2QLc=; b=bMJdjlCCEH5OtGDfzyTpBP3aWw9LCWPQjbzq1y1K5MWxHvYo8djTHN1MLAagW5d9yQH0gJqKiooJi6dGxYQMHnbb5z/+AfS7q2L7xJoEPvk3HgE4J5j42jWaQ6Vk0HenWJ+b2V/hFnQbGJ8Wqbzm0dAX8e5XP2Jmm5n3eLFvfPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.zohomail.com with SMTPS id 1618655463530353.5139123907202; Sat, 17 Apr 2021 03:31:03 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id u20so10996759wmj.0 for ; Sat, 17 Apr 2021 03:31:02 -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 m11sm13996085wri.44.2021.04.17.03.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:31:01 -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=VLE3I1k3IJfuJNE04qzx4N5NNPVf33qPSjT+93d2QLc=; b=tmfZs3MCmYdxjGh6o1UJtIaEBHAP6sNCG2Pym2EeygJzUNuuHqg37NV06C7ByB9rhK sbLxZueophscqQkRKCL0ipo0l70IShlxrF0bE4GwaHR6bmIttzXHaWJNSCIET70V+RR9 udp2vCPfw5Up8Oh5t51v2+taCF9FQzfEdDaJa+RK9cOE+Bu9qFGc34hk/cDhuWbv1LSL mEpT3hVYxoA5s5eV+G9njyERm3r2yrgtWVIRmBgVDLUyNJi2IvlbgOx0j4iM9ajaofAz TAKfKge8Gkc9nr6rqiBMV/XWDGEtwylmu3gOJc05V1liom0CKQwXgtOrG7SzHeTlfaJh lnVw== 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=VLE3I1k3IJfuJNE04qzx4N5NNPVf33qPSjT+93d2QLc=; b=fV7herpez5xGMS9cl7O240vq8mZ6NawV88DDWy4bnixEs1sdV/KKJ1Plpwf8Zah5yE pB9bmMIPgV0veM0FsNeP1kDlQTQjhJtP6OaSTjJyZoq7Kq+mY4OYRCJFidVzrhwSOuQ3 45O8oifWltEFR1DPmisXoqf73a8QuJlY8vc5bbbX/YKqxxOcYT4IAhyfK06NTiWCn167 IOb6frLXqT+EZCSbx45cyj+O3gk+2h0OG7jdkhzUnIjkGlCaPo6OMj6AKL3vXDohvvYY 0KDXPlJUxQBM8y35i7DbDzXRbvjAoORBnBaPFc49UPIC9rf2M73KVZ+G5PX2ANeS0bi5 kT3Q== X-Gm-Message-State: AOAM532uxkkkfA5ufiFe3SWWaICSoQrZbhWSbflHNx3u8WFkO0KmK5uW Lp05nJlWhWC3ncIQlApqVSI= X-Google-Smtp-Source: ABdhPJzw1E06YjdNsiB2yEdIaN4rYV7HJHzKHamdey1Mv8Ni9ANAOFK6szhDiyuj33hghT+iCDdNVQ== X-Received: by 2002:a05:600c:4f4f:: with SMTP id m15mr12113042wmq.29.1618655461755; Sat, 17 Apr 2021 03:31:01 -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 06/11] hw/pci-host/raven: Assert PCI I/O AddressSpace is based at 0x80000000 Date: Sat, 17 Apr 2021 12:30:23 +0200 Message-Id: <20210417103028.601124-7-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) Commit 1ae1dc5ba24 ("raven: Set a correct PCI I/O memory region") abused an AddressSpace API weakness which allows set non-zero base address to AddressSpace root region. We will fix that in the next commit. First add an assertion to ensure no regression is introduced. As raven_io_address() is called by both MemoryRegionOps handlers, it is a good place for such assert call. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- hw/pci-host/raven.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 730f31a8931..36652122424 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -141,6 +141,17 @@ static const MemoryRegionOps raven_intack_ops =3D { static inline hwaddr raven_io_address(PREPPCIState *s, hwaddr addr) { + /* + * We shouldn't access AddressSpace internals. However this assert + * is temporarily introduced to prove a subtle inconsistency from + * commit 1ae1dc5ba24 ("raven: Set a correct PCI I/O memory region"): + * AddressSpace root region must be zero-based, but the Raven use is n= ot. + * + * Assert the root region is based on physical address 0x80000000 + * until the issue is fixed. + */ + assert(s->pci_io_as.root->addr =3D=3D PCI_IO_BASE_ADDR); + if (s->contiguous_map =3D=3D 0) { /* 64 KB contiguous space for IOs */ addr &=3D 0xFFFF; --=20 2.26.3 From nobody Sat May 18 22:15:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655468; cv=none; d=zohomail.com; s=zohoarc; b=Nc8h8H8uG/6kHS5cLieJcVHX2DHJrFYbaVLoYLWLb9TzPX6w0M7zQHIklUesMBb/quQTHm9k5vHxGT/XWJe06ubf7At7r20A0hCk5XFYC547qnm5ngPa9iaMTF2KsG4b0aaNbi78qngtwljKDidfhqTvCG86oaFqcmrbSlNDhYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655468; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L5A08oqJfnwHuu4IIvHVyo2CuhBx8oIfeNWXxwFL7uE=; b=jNzqhDQ7BirLOnp1bpxH6pSVDjx7+EM4YzMQ8t8wrq8O5j0uj2USZ+P+kzaZYDZIbaAD+ArLPCnFkMQj0wzczNC5g/SFw2a71+zgXwtGQJBQx59gUi37gcWf8J0XYoRiGRY8fMcuU1x+OllRtkwxqiPWRzVlgj0JiK9orxG6wjM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1618655468643980.9554608384675; Sat, 17 Apr 2021 03:31:08 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id h4so19980999wrt.12 for ; Sat, 17 Apr 2021 03:31:08 -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 n9sm11795815wmo.27.2021.04.17.03.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:31:06 -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=L5A08oqJfnwHuu4IIvHVyo2CuhBx8oIfeNWXxwFL7uE=; b=QvJcVwgjwo/yqaRENhIL6JYzDNYm0QfGCfHXA36JgYq698gGRG+bGZ98BrpmcbPNen 9odV19fsxLa5woaotQsV3fOExc/BH1OAuBeBFw9QzsTmvda50Sf/6FDp3vQzzY7y6LRP R+0eFzWsDEyJT6Ytd17YwAgDxYM4TIwtYVSZT5wiQIwi8rB6a/YJSHvaDwWMDF4XPzUx Fe91kag1X1/M4+sm2NrLWGTohS82XGvrTulAE/E1/kdlpcliBPm61JzWF/iHOqcIa5qr qGE2TeEUWovktEIt4IFjuc09jrlBFV+13jHwPApoB5Kc3jVyx6gycNo91+Ma5UKvm3wj H03A== 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=L5A08oqJfnwHuu4IIvHVyo2CuhBx8oIfeNWXxwFL7uE=; b=Qe5aCnZZkY6Twa0I7qgXu2Il1dlV0AJBJKuhNtePycgg/gRV+E090AJu42ZPLQ9g/G juytde/CGDgB8KPBAey3NoLjMH4GiMKa6LnecufMqrUb99K/Wt/Ux5ur6hIIJztwAgNV f8qiKho8z6eMYw2XLmbrPMd/0QzeBT+TFT7LQQiI68U2YTrTXK533ixRDlVzQSgNzoGx VzYaBb4+WQ1oxsOlEFVmfYWMaQ9Mi9r/0SMtCIObiGFF8csbUA/oioJobFOi74vrflAQ AU5s6f8V8su0TKASvVqG/SHHZuTralEo92INz3NwwT5KthssyBXRh+mYGJlCGsF8pf7S 8deQ== X-Gm-Message-State: AOAM532bHeFDgPWUWKrz4BIIKXLG0eO8i/bThnhI3UQl2wkR7Nen0yF8 taQCYRGRyx1pATRjmpQeW7k= X-Google-Smtp-Source: ABdhPJzvD0QAKxHmespnrW3MzoXZhd7Of64fnGKfU8KE/1YYIcN2qgkVDpZqmJeEsJ42UFwUfxZzJQ== X-Received: by 2002:adf:dc8d:: with SMTP id r13mr3655698wrj.339.1618655466854; Sat, 17 Apr 2021 03:31:06 -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 07/11] hw/pci-host/raven: Use MR alias for AS root, not sysbus mapped MR Date: Sat, 17 Apr 2021 12:30:24 +0200 Message-Id: <20210417103028.601124-8-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 PCI I/O region is exposed as AddressSpace. AddressSpaces must not be sysbus-mapped (to be zero-based), therefore map the region using an alias. As the new AdressSpace root memory region is now zero-based, we do not need anymore to add the PCI I/O base address to the MemoryRegionOps handlers. Update the temporary assertion and its comment. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/raven.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 36652122424..7bbb7ef0a29 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -67,6 +67,7 @@ struct PRePPCIState { PCIBus pci_bus; AddressSpace pci_io_as; MemoryRegion pci_io; + MemoryRegion pci_io_alias; MemoryRegion pci_io_non_contiguous; MemoryRegion pci_memory; MemoryRegion pci_intack; @@ -143,14 +144,13 @@ static inline hwaddr raven_io_address(PREPPCIState *s, { /* * We shouldn't access AddressSpace internals. However this assert - * is temporarily introduced to prove a subtle inconsistency from - * commit 1ae1dc5ba24 ("raven: Set a correct PCI I/O memory region"): - * AddressSpace root region must be zero-based, but the Raven use is n= ot. + * is temporarily used to prove a subtle inconsistency from commit + * 1ae1dc5ba24 ("raven: Set a correct PCI I/O memory region") which + * expected the PCI I/O root region base address to be 0x80000000. * - * Assert the root region is based on physical address 0x80000000 - * until the issue is fixed. + * We now use an alias memory region as root, which is zero-based. */ - assert(s->pci_io_as.root->addr =3D=3D PCI_IO_BASE_ADDR); + assert(s->pci_io_as.root->addr =3D=3D 0); =20 if (s->contiguous_map =3D=3D 0) { /* 64 KB contiguous space for IOs */ @@ -172,8 +172,7 @@ static uint64_t raven_io_read(void *opaque, hwaddr addr, uint8_t buf[4]; =20 addr =3D raven_io_address(s, addr); - address_space_read(&s->pci_io_as, addr + PCI_IO_BASE_ADDR, - MEMTXATTRS_UNSPECIFIED, buf, size); + address_space_read(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED, buf, s= ize); =20 if (size =3D=3D 1) { return buf[0]; @@ -204,8 +203,7 @@ static void raven_io_write(void *opaque, hwaddr addr, g_assert_not_reached(); } =20 - address_space_write(&s->pci_io_as, addr + PCI_IO_BASE_ADDR, - MEMTXATTRS_UNSPECIFIED, buf, size); + address_space_write(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED, buf, = size); } =20 static const MemoryRegionOps raven_io_ops =3D { @@ -301,6 +299,8 @@ static void raven_pcihost_initfn(Object *obj) DeviceState *pci_dev; =20 memory_region_init(&s->pci_io, obj, "pci-io", 0x3f800000); + memory_region_init_alias(&s->pci_io_alias, obj, "pci-io", + &s->pci_io, 0, memory_region_size(&s->pci_io)= ); memory_region_init_io(&s->pci_io_non_contiguous, obj, &raven_io_ops, s, "pci-io-non-contiguous", 0x00800000); memory_region_init(&s->pci_memory, obj, "pci-memory", 0x3f000000); @@ -308,7 +308,7 @@ static void raven_pcihost_initfn(Object *obj) =20 /* CPU address space */ memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, - &s->pci_io); + &s->pci_io_alias); memory_region_add_subregion_overlap(address_space_mem, PCI_IO_BASE_ADD= R, &s->pci_io_non_contiguous, 1); memory_region_add_subregion(address_space_mem, 0xc0000000, &s->pci_mem= ory); --=20 2.26.3 From nobody Sat May 18 22:15:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655473; cv=none; d=zohomail.com; s=zohoarc; b=hPwwK3JhP+vZYWwO+NR7r96g0v/AS7tQlPSFDBeDetrakmcAvNvkR2huJxWtimhin6bnXDr5CLoRO6xVtz2xvjBi9+HyavMxnlvqGM396oktYZYzV9yowp7WkdzKr1iw1V4RKH6KAD8GUezMXOI5lakGuN/+ALyC80gkOBHlYGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655473; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cT/Vrzb6/GOtxumkXOhTgGmRp7jm4YS4nNjhVoL+0R8=; b=Oj6TkZKYPWbJ9XAhigSGyF4X80mveVcJS1HA1FxXyLrSI8zNZS0JrCiwGmyCDz0JPZmgNnjyTU0LaM7kH9Ab3yfi2dzUns04WGeVI73slgsS7kpoc4nr6ndhOgTBTZN50f+aMp+bGkmDikINLYMEqq/7BzhjIreA/MkRy4Z9448= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 161865547352489.1487000546183; Sat, 17 Apr 2021 03:31:13 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id e7so20051141wrs.11 for ; Sat, 17 Apr 2021 03:31:12 -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 n9sm14395212wrq.86.2021.04.17.03.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:31:11 -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=cT/Vrzb6/GOtxumkXOhTgGmRp7jm4YS4nNjhVoL+0R8=; b=I7Sv3v0v6goLZQBTBwy61vr+YsJG2YDxR+mwyoDdBx26bH58MG0S5sUdNpi1BRhepU +eHEr+FtDBaXJid1tXh/LiZPViT6HJwPwwhcvRTxXyIt8rhe7OTFUkfwIhEQjv1SQdbd DxtgFcwzmUpwe+s4y+d7O36kYvjCHUm1uXOkkQXHWpTvmxm8r2Pd44bnO+WTuq9ZxsYi y6lUBYOwYjgW8hqTyW9ipQXjbRuDwraL7Eob+pXC1nMRKJyhq5CWVNWjtLXBJ75Hbmf0 Od7P0VdTl+C/91fo8/9gepLPAdFM++/a2KWdHbZ519HT9UvhssVCjGJpb4upRHRtj6Ch 9YqA== 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=cT/Vrzb6/GOtxumkXOhTgGmRp7jm4YS4nNjhVoL+0R8=; b=t4Mm2oGCInNE5SzE7mLi6//W2NoyLYyA+jGa+XrqyrYrYJivcq+gDd1/fxBmtKuwWj BWxdr4Nc8x2QsINQregEdSgRBOnCSreVExMYIafrrF1y/Mc/YhlkcAdcVJz2cSbTlhC9 Zq6a5gTh+c7TGQFTzEHnZNIi+T2vJKXTxLuqT09T5aoc4kDy5JriazxQDKbJP2uMmKb3 QBkSWGdd254zuJojJ10c6YjsFHfOGrIo/iDqg84GrS0py1b5QsaaasLtFUoKwAIv684S RiDIHBJB0AaxbscSKfOqc7LfPb+eQG6rZ7bbZSuFV6CvP/xTKhQAgVY0UoEJuAjUZiKt bbjw== X-Gm-Message-State: AOAM531tHqQoCbX7+5bpMQUJ2FTHppCkxzSILGpOI774K3gAgQ2ZyeMH 2fBzwIQaiP1ZNq+6IaTF0kQ= X-Google-Smtp-Source: ABdhPJwtaeBHEUhbEHb92jZ9d32OnQp18zwnWAGYOSOj27FqY5AgQL9TmpyRCkuU1P8UFZusrZTjTw== X-Received: by 2002:adf:f106:: with SMTP id r6mr3677206wro.214.1618655471739; Sat, 17 Apr 2021 03:31:11 -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: [RFC PATCH v2 08/11] hw/pci-host/raven: Remove pointless alias mapping onto system bus Date: Sat, 17 Apr 2021 12:30:25 +0200 Message-Id: <20210417103028.601124-9-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 'pci-io' alias (mapped with priority 0) ends up masked by the 'pci-io-non-contiguous' I/O region (mapped with priority 1). The flatview rendering is ('pci-io-non-contiguous' is written 'pci-io-nc'): (base addr) [ MemoryRegion ] [ FlatVie= w ] +----------------------------+---------------+ | priority 0 | priority 1 | +----------------------------+---------------+ 8000.0000 +- +--------------+---------------+ +-----------= ----+ | "pci-io" | "pci-io-nc" | | "pci-io-n= c" | | | | | = | | / - isadev | | | = | | | - isadev | | | = | | | - isadev | +----> | = | | \ - isadev | | | = | | | | | = | | | | | = | | | | | = | 8080.0000 +-------------+ +---------------+ +-----------= ----+ | "pciio" | | | "pciio"= | | | | | = | | | | | = | | + - - - - |--------------------> | = | | | | | = | | | | | = | | | | | = | 80c0.0000 +-------------+ | +-----------= ----+ | | +----------= ---+ | | | "???" = | | | | = | | | ???????-----> | unassigne= d? | | | | = | | | | = | | | | = | bf80.0000 +- +--------------+ +----------= ---+ The before/after this commit memory tree diff is: (qemu) info mtree memory-region: system 0000000000000000-ffffffffffffffff (prio 0, i/o): system 0000000000000000-0000000001ffffff (prio 0, ram): simm.0 0000000002000000-0000000003ffffff (prio 1, ram): simm.1 0000000004000000-0000000005ffffff (prio 2, ram): simm.2 0000000006000000-0000000007ffffff (prio 3, ram): simm.3 0000000080000000-00000000807fffff (prio 1, i/o): pci-io-non-contiguous - 0000000080000000-00000000bf7fffff (prio 0, i/o): alias pci-io @pci-io= 0000000000000000-000000003f7fffff 0000000080800000-0000000080bfffff (prio 0, i/o): pciio 00000000bfffeff0-00000000bfffeff3 (prio 0, i/o): ppc-parity 00000000bffffff0-00000000bffffff0 (prio 0, i/o): pci-intack 00000000c0000000-00000000feffffff (prio 0, i/o): pci-memory 00000000c00a0000-00000000c00bffff (prio 1, i/o): vga-lowmem 00000000f0000510-00000000f0000511 (prio 0, i/o): fwcfg.ctl 00000000f0000512-00000000f0000512 (prio 0, i/o): fwcfg.data 00000000fff00000-00000000ffffffff (prio 0, rom): bios We can see it in the monitor, before/after this patch, the flatview rendering is left unchanged (note the unassigned 80c0.0000-bf7f.ffff range): (qemu) info mtree -f FlatView #1 AS "memory", root: system AS "cpu-memory-0", root: system Root memory region: system 0000000000000000-0000000001ffffff (prio 0, ram): simm.0 0000000002000000-0000000003ffffff (prio 1, ram): simm.1 0000000004000000-0000000005ffffff (prio 2, ram): simm.2 0000000006000000-0000000007ffffff (prio 3, ram): simm.3 0000000080000000-00000000807fffff (prio 1, i/o): pci-io-non-contiguous 0000000080800000-0000000080bfffff (prio 0, i/o): pciio 00000000bfffeff0-00000000bfffeff3 (prio 0, i/o): ppc-parity 00000000bffffff0-00000000bffffff0 (prio 0, i/o): pci-intack 00000000c00a0000-00000000c00bffff (prio 1, i/o): vga-lowmem 00000000f0000510-00000000f0000511 (prio 0, i/o): fwcfg.ctl 00000000f0000512-00000000f0000512 (prio 0, i/o): fwcfg.data 00000000fff00000-00000000ffffffff (prio 0, rom): bios Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC because I can't justify the unassigned 80c0.0000-bf7f.ffff range. --- hw/pci-host/raven.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 7bbb7ef0a29..f9c92b83770 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -67,7 +67,6 @@ struct PRePPCIState { PCIBus pci_bus; AddressSpace pci_io_as; MemoryRegion pci_io; - MemoryRegion pci_io_alias; MemoryRegion pci_io_non_contiguous; MemoryRegion pci_memory; MemoryRegion pci_intack; @@ -299,8 +298,6 @@ static void raven_pcihost_initfn(Object *obj) DeviceState *pci_dev; =20 memory_region_init(&s->pci_io, obj, "pci-io", 0x3f800000); - memory_region_init_alias(&s->pci_io_alias, obj, "pci-io", - &s->pci_io, 0, memory_region_size(&s->pci_io)= ); memory_region_init_io(&s->pci_io_non_contiguous, obj, &raven_io_ops, s, "pci-io-non-contiguous", 0x00800000); memory_region_init(&s->pci_memory, obj, "pci-memory", 0x3f000000); @@ -308,9 +305,7 @@ static void raven_pcihost_initfn(Object *obj) =20 /* CPU address space */ memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, - &s->pci_io_alias); - memory_region_add_subregion_overlap(address_space_mem, PCI_IO_BASE_ADD= R, - &s->pci_io_non_contiguous, 1); + &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 2.26.3 From nobody Sat May 18 22:15:02 2024 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 From nobody Sat May 18 22:15:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655484; cv=none; d=zohomail.com; s=zohoarc; b=RRw8YD71b/scIYuYBwi4u3j4SFGt3u56a/pjhbFx5QuJrKk3RfdN8Xy2NQfXmp9lB/OQrwDQordDtj3XXA9EEj5ynAIOb09Y7r+VdQcAxuI7hfJpP6qE7QbvdxnoSC60z97CitqEqyNfyRDg7L4HbQHorhOc4ERa8tMvmRdJWz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655484; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GuQcix62yOxi2GAeMBvDGe0wgnFu8eqZ7dkSeHfqLw0=; b=YIm7iv7U0N2YLpZVp8LEudLWGztX+4ZzCWBasbt+oM+brA2VJlLfZwA/s6DEUoaAQrSnR7DXSzow117etoLMSdUISwnwd9BmO0qI0B7OQhCrXT1J2wzbSzvX+vkgm1HMSXkblwd9J+1EihZ9iGSslPQE3X19vPY0A3k7zQ8tzXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 16186554843361021.1811158191667; Sat, 17 Apr 2021 03:31:24 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id s7so28926937wru.6 for ; Sat, 17 Apr 2021 03:31:23 -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 v7sm14384268wrs.2.2021.04.17.03.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:31:21 -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=GuQcix62yOxi2GAeMBvDGe0wgnFu8eqZ7dkSeHfqLw0=; b=ntha4+cB1beVYLQnUCS8Wgj495JCB/z4VRNAfEG1eDoLRcn85ncmkg7e9qlkt7UKRq HTRZWPj++lPAy7KvRTWfqn/uQNxwxiAzF3yx5Bu1HiZY1ts2Rkxp74MXAQAlji60sRTo r1Lc4XSBzjouk+7HE7ErQ+qQwOD1a9bSQ7GcwkAohvw+24l25uqDMTxvA6x7ZHRoWLua l5q+BRtzvpxd7VYozqtsOgmjUFK2nZ/gyVs7VV3b8ky/KRXdRgI82gmqzHq8LqTCw53l HOyzjMUoOw1edItCEClP7LpBzrR+uB9//Kzfrydg1Z1TXfhGept51g1lEilnbpsIlqpI JsiA== 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=GuQcix62yOxi2GAeMBvDGe0wgnFu8eqZ7dkSeHfqLw0=; b=A5amU/YeGSsCQ6e3BIoxaII08yJEUFnVrhQPVGzWMaxrfCGgdv1XEH9F+KqXoRTdg3 wW3z3QwKZ6hrbKb5FjZnLlNIQUQHvT4tM4kmw+eiK1jP2isApzrN/7TnsE3/mGAtRzFp Nfn4Ypk/6RIfwyEQVf4DEzwI5n0Fr0wodLmg2Ad3hvsqtImTIby0rvBFKR/j13lRI540 4y7/lmCj8QlYahGOEMcc6pyfroQsfeSHj71/se8T0fmZHP90F22kABK4g7JISMjcLKsK OCQvQzfiHznu8HxtLcLsE8N2OkL0vUu5bKWsjzWiS/E8DyafUAWY+dgeLvR3ASpZ5Of+ ZYKQ== X-Gm-Message-State: AOAM5311P4iKp6V2tbMUzt0NrdV6nbWGGzEIr0A8yyeTEKAW2LFaPnjd tKRFFfgHu5WHa3JU7+8nQJ4= X-Google-Smtp-Source: ABdhPJx4emBAv9xbgtO89BBRVK6AwkJj5KZsCAwn9++TAdcv5u1y0hZ888huEa6wvEnwCd+PrRmryQ== X-Received: by 2002:a5d:4584:: with SMTP id p4mr3591191wrq.383.1618655482669; Sat, 17 Apr 2021 03:31:22 -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 Subject: [PATCH v2 10/11] memory: Make sure root MR won't be added as subregion Date: Sat, 17 Apr 2021 12:30:27 +0200 Message-Id: <20210417103028.601124-11-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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Type: text/plain; charset="utf-8" From: Peter Xu Add a bool for MR to mark whether this MR is a root MR of an AS. We bail o= ut asap if this MR is added as a subregion of another MR. Signed-off-by: Peter Xu --- include/exec/memory.h | 1 + softmmu/memory.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 5728a681b27..83ac86525b2 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -477,6 +477,7 @@ struct MemoryRegion { bool ram_device; bool enabled; bool warning_printed; /* For reservations */ + bool is_root_mr; uint8_t vga_logging_count; MemoryRegion *alias; hwaddr alias_offset; diff --git a/softmmu/memory.c b/softmmu/memory.c index d4493ef9e43..409bcaec7f5 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -2443,6 +2443,7 @@ static void memory_region_add_subregion_common(Memory= Region *mr, MemoryRegion *subregion) { assert(!subregion->container); + assert(!subregion->is_root_mr); subregion->container =3D mr; subregion->addr =3D offset; memory_region_update_container_subregions(subregion); @@ -2820,6 +2821,7 @@ void address_space_init(AddressSpace *as, MemoryRegio= n *root, const char *name) { memory_region_ref(root); as->root =3D root; + root->is_root_mr =3D true; as->current_map =3D NULL; as->ioeventfd_nb =3D 0; as->ioeventfds =3D NULL; --=20 2.26.3 From nobody Sat May 18 22:15:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) client-ip=209.85.128.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618655489; cv=none; d=zohomail.com; s=zohoarc; b=dbfdnjjs0Q/M2uLJon3muqCksnYd0IxMerEffTroDQUaZFLz696mdnAx6dbRZ4Qt/aYaoSpGOJb1FKB59cprLTmoJWc8hM+h/MkoQxhlxraqpWAlgx+05C+moMrvDoalUsp+obvjm3H7E4Dw91DvIlf0Nlw8dfQPGa8+h5emCD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618655489; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gigBM1s+F8HC4WmipCGGWWK+Zc3mdWdnCe6+x4OghgQ=; b=cY79AhXfymcIu05qDFJSJzYV6O3dx86VG3Gujn3ByVTMHo7mD1sfveE3kMVgaGkq877q82ZgPJrp8GFYXaB5lQXv00c7y+eyLFoOPZFOTCD/yammZSWrcv2uSbgfQHwxVMxTJX9ZIkFlYFudgvdCxZwr6FKSBb1Z9wsnANX5VKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.zohomail.com with SMTPS id 161865548937170.42182724146926; Sat, 17 Apr 2021 03:31:29 -0700 (PDT) Received: by mail-wm1-f42.google.com with SMTP id u20so10997094wmj.0 for ; Sat, 17 Apr 2021 03:31:28 -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 61sm15406177wrm.52.2021.04.17.03.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:31:27 -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=gigBM1s+F8HC4WmipCGGWWK+Zc3mdWdnCe6+x4OghgQ=; b=MwueMmS8oD6spzk9WFw3065ohzOuSqbF7Js6YfDzNUHUDb+LpLdKYoGJH79SASQ5zm X4KjvPEBF0ixmvPdDFZQv/Bz9d3Gb9JNnPaEiZBALqvJoWY5y2YeW9u7D8Vx5pnVHzve XIGNsp4vnZcilKnGAToxNREVYEDpsUrH+kVGRx5VoW4KTsJVTdwAde63QKb6F0oVoGzh k3NzazNFFcsxfBU+cL4+BsYs4PnD+5+GHZag65/X6M2hZBelqfAJ3vLE2uKfQLenE59h EOSnyTRTXzQD0RPzu3PyMevn9g7hMuAi9emukm0k1Rok5Qyc9QgAtE+S7kVPXPn+qiKx JQLw== 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=gigBM1s+F8HC4WmipCGGWWK+Zc3mdWdnCe6+x4OghgQ=; b=kfgtl0fFslgv/r+QLc6Y50MgbRdHrZbt4QUoqyrIQEq9+PbXU4ReME5KXWpJqmSphx KxR98fnE/6SRzjFlBY3Z+e8tzU6e+fj7um6TKV5PtPGDqqjCJe2T7BYffgQLpG4PKGh+ KZVV12sJIPKH9HDpIG7VlCra3K6wkugF4TlnUJ5/BvzodmZBBnTZuHwd6gD0NU0KfwLV 3EFkJE0NVxdLNiOn0U8ifccRU6QCy8AanVDv5vYHwWDB8RMWPCFIvslONelxP7/4+2H4 XkI9povNhI8e/NB5fnXSUPTB+wW0M9kb8/K6e23mNe4siPGr7dQqsCGItZjMYCXIuDUc 1clQ== X-Gm-Message-State: AOAM532cKmT9uyTGYjJzZVVFqGxOcAbYVfjpvskaGOW+198QTVJitL0I Azo1ABuWQaMsBbUfDdEiQcI= X-Google-Smtp-Source: ABdhPJw/dZBzwMZUey7yEHd29htp+tWvJn/VFSVNoujvvp9sF4mqO2yIEefGyv5XXLvaUfEAhKTqcQ== X-Received: by 2002:a7b:c098:: with SMTP id r24mr12066647wmh.77.1618655487679; Sat, 17 Apr 2021 03:31:27 -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 11/11] hw/pci-host/raven: Remove temporary assertion 'root MR is zero-based' Date: Sat, 17 Apr 2021 12:30:28 +0200 Message-Id: <20210417103028.601124-12-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) Previous commit added a check in memory_region_add_subregion_common() to ensure AS root MR can't be added as subregion (changing the MR base address doing so). We can now remove the temporary assert in the raven model. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/raven.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index d8c1aaa11f5..3f8508bd467 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -141,16 +141,6 @@ static const MemoryRegionOps raven_intack_ops =3D { static inline hwaddr raven_io_address(PREPPCIState *s, hwaddr addr) { - /* - * We shouldn't access AddressSpace internals. However this assert - * is temporarily used to prove a subtle inconsistency from commit - * 1ae1dc5ba24 ("raven: Set a correct PCI I/O memory region") which - * expected the PCI I/O root region base address to be 0x80000000. - * - * We now use an alias memory region as root, which is zero-based. - */ - assert(s->pci_io_as.root->addr =3D=3D 0); - if (s->contiguous_map =3D=3D 0) { /* 64 KB contiguous space for IOs */ addr &=3D 0xFFFF; --=20 2.26.3