From patchwork Wed Jun 10 13:10:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1306926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49hnWF3s3hz9sRh for ; Wed, 10 Jun 2020 23:14:01 +1000 (AEST) Received: from localhost ([::1]:41926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj0YJ-00043u-0q for incoming@patchwork.ozlabs.org; Wed, 10 Jun 2020 09:13:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj0Uq-0007kG-Dh; Wed, 10 Jun 2020 09:10:24 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:56225) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj0Up-0003cP-3r; Wed, 10 Jun 2020 09:10:23 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MEmAV-1jhdZJ3B8t-00GFv7; Wed, 10 Jun 2020 15:10:18 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 08/16] hw/arm/aspeed: Correct DRAM container region size Date: Wed, 10 Jun 2020 15:10:03 +0200 Message-Id: <20200610131011.1941209-9-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200610131011.1941209-1-laurent@vivier.eu> References: <20200610131011.1941209-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:aoyblYvsxNs/VaIf9aNl95oG04olgSvD6l6khwnqzdMTlTYHqgl UEjXCX7l3XJ8HnTryfuiHK4bEvKYLzVnym1o4R3pnSYwxikSQ1ZcsLub42RkWfNCbPVzjw5 WuzMReXW+1b3qZVeCQAIemzMZDJsrNWVfV6TznKkdYh41E+3Fw92dFf/AtewYlXtDqBriCr 3Iha14j7AFGtkpaePrgnQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:ga1Vdo8ob8c=:yfGYd7nSifPd9m5FG0rh8R ZvbTK/rLHlBMX6QP+IvJ6BInveyYoGgz2IFmBjkghgXu6sL0dUa5jpSLpVT1c4Nedf74goC6C u6WSnY9ia2KDStyJrGX8N7bMa8vJjQJqgKxlLlPji8PgrmCESYrqk9Sk7El4KMX+1vCDaz7lE VrHTFS/u6ROjH0MTmR7+ixIaJZmKhSaQiojBpTf1to9CQuKC0CfvPTnrhZf8QWcERtVuRl6UN 9kwg7mt3W50uiEcrdm+unUtcnsqXFdYgGTDawul7kaRrbr50BzDcWAUUw63rWBzBXL3MGZRp5 5CM5xdhggoMtRacCcOQOsxAnR6i/oE1dfiZD31yXbjTpSfvvoNGflaWME4N+EZQ+yjop78gZ7 FB/SFVFT6fsjddZyYNMmB84cU9N7JQCblbWjNPR1xp58pwegXdwCSsHXF3rtLGnowlis5dyzS wGvlOFrdLCvn/s6cTc9c/d9RV/VNCUt/f6Wn8NOiAGn9yg0uns8moHZj6bUto/8bSMPhzuAh4 le8UeDZEt1vKnrNYHvXNgmpeO2zS3VYOC+AOCnv9RA0hrnQHDkezVfJgfWfJqMIeaDnbBtXoO 58xxAOytoNK6WAyncz0wB/QQ/Ba0w4z1Nmk93/ma9DnzWCTMYvR/hoWbF9NGGCsvzoFN/sDwf 7T/c/vU3k1avy9tMBBfXZBv42QQZVQHOhoPQAqENHFr7T+TBdMqKpb+RzxeVMk0gU4D9LzqbH PdME4exr7IFscO78Ywit/QdbPo24BVfXsxJLyPuHGWKmGaG7uo9353h6UmRvagZrhqeJnHwte VNdzCODUyXRGfXFpgnEihUgdEyI9u7zBe+/wDMggHVkLmucYYjWVsyIcQoNZS+0+EyS2rZ6 Received-SPF: none client-ip=212.227.126.133; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/10 09:10:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-trivial@nongnu.org, Richard Henderson , Michael Tokarev , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé memory_region_set_size() handle the 16 Exabytes limit by special-casing the UINT64_MAX value. This is not a problem for the 32-bit maximum, 4 GiB. By using the UINT32_MAX value, the aspeed-ram-container MemoryRegion ends up missing 1 byte: $ qemu-system-arm -M ast2600-evb -S -monitor stdio (qemu) info mtree address-space: aspeed.fmc-ast2600-dma-dram 0000000080000000-000000017ffffffe (prio 0, i/o): aspeed-ram-container 0000000080000000-00000000bfffffff (prio 0, ram): ram 00000000c0000000-ffffffffffffffff (prio 0, i/o): max_ram Fix by using the correct value. We now have: address-space: aspeed.fmc-ast2600-dma-dram 0000000080000000-000000017fffffff (prio 0, i/o): aspeed-ram-container 0000000080000000-00000000bfffffff (prio 0, ram): ram 00000000c0000000-ffffffffffffffff (prio 0, i/o): max_ram Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Richard Henderson Message-Id: <20200601142930.29408-2-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/arm/aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 2c23297edf07..62344ac6a3a2 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -262,7 +262,7 @@ static void aspeed_machine_init(MachineState *machine) bmc = g_new0(AspeedBoardState, 1); memory_region_init(&bmc->ram_container, NULL, "aspeed-ram-container", - UINT32_MAX); + 4 * GiB); memory_region_add_subregion(&bmc->ram_container, 0, machine->ram); object_initialize_child(OBJECT(machine), "soc", &bmc->soc,