From patchwork Tue Jun 20 13:50:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ~rlakshmibai X-Patchwork-Id: 1804711 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qy8Sq5Fzhz20ZC for ; Fri, 7 Jul 2023 20:16:42 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHiVK-0000Yc-A2; Fri, 07 Jul 2023 06:15:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHiVI-0000XO-6D; Fri, 07 Jul 2023 06:15:56 -0400 Received: from mail-b.sr.ht ([173.195.146.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHiVG-0003z4-6L; Fri, 07 Jul 2023 06:15:55 -0400 Authentication-Results: mail-b.sr.ht; dkim=none Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 47CAE11F042; Fri, 7 Jul 2023 10:15:52 +0000 (UTC) From: ~rlakshmibai Date: Tue, 20 Jun 2023 19:20:06 +0530 Subject: [PATCH qemu v3 1/1] fdt_load_addr is getting assigned as the result of riscv_compute_fdt_addr(), which is an uint64_t. Message-ID: <168872495192.6334.3845988291412774261-1@git.sr.ht> X-Mailer: git.sr.ht In-Reply-To: <168872495192.6334.3845988291412774261-0@git.sr.ht> To: alistair.francis@wdc.com, dbarboza@ventanamicro.com, qemu-riscv@nongnu.org Cc: qemu-devel@nongnu.org, lakshmi.bai.rajasubramanian@bodhicomputing.com, rathinabalan.thalaiappan@bodhicomputing.com MIME-Version: 1.0 Received-SPF: pass client-ip=173.195.146.151; envelope-from=outgoing@sr.ht; helo=mail-b.sr.ht X-Spam_score_int: 15 X-Spam_score: 1.5 X-Spam_bar: + X-Spam_report: (1.5 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~rlakshmibai Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Lakshmi Bai Raja Subramanian fdt_load_addr is declared as uint32_t which is not matching with the return data type of riscv_compute_fdt_addr. Modified fdt_load_addr data type to uint64_t to match the riscv_compute_fdt_addr() return data type. This fix also helps in calculating the right fdt address when DRAM is mapped to higher 64-bit address. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Lakshmi Bai Raja Subramanian Reviewed-by: Alistair Francis --- hw/riscv/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 95708d890e..c348529ac0 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1244,7 +1244,7 @@ static void virt_machine_done(Notifier *notifier, void *data) target_ulong start_addr = memmap[VIRT_DRAM].base; target_ulong firmware_end_addr, kernel_start_addr; const char *firmware_name = riscv_default_firmware_name(&s->soc[0]); - uint32_t fdt_load_addr; + uint64_t fdt_load_addr; uint64_t kernel_entry = 0; BlockBackend *pflash_blk0;