From nobody Tue Feb 10 00:01:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521494531630254.8842255998594; Mon, 19 Mar 2018 14:22:11 -0700 (PDT) Received: from localhost ([::1]:43983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey2EB-0002hM-IR for importer@patchew.org; Mon, 19 Mar 2018 17:21:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey2C2-0001Jm-5u for qemu-devel@nongnu.org; Mon, 19 Mar 2018 17:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey2By-0002WD-DU for qemu-devel@nongnu.org; Mon, 19 Mar 2018 17:19:46 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:34943) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ey2By-0002Vk-56 for qemu-devel@nongnu.org; Mon, 19 Mar 2018 17:19:42 -0400 Received: by mail-pl0-x243.google.com with SMTP id p9-v6so8502426pls.2 for ; Mon, 19 Mar 2018 14:19:41 -0700 (PDT) Received: from monty.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id i127sm120500pfc.136.2018.03.19.14.19.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Mar 2018 14:19:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bAnmiNe0Jq/bKPe/yscQG8mYo4LaV7stvbgTiCOkIvc=; b=jVV2TjM6OxcoMzLqRCuPf5QUSSU+gU5ZN8FtLKmipWjU5w8CWeJuD6baYbwQsBviHX Y5/vLMHTyrVNAAksE8TWe+ExIdC0ddhCXxmK+2tGbKN/10AeGYN6JRub7OlkMjsBvVUk W68tJ35FGdySpyxgxquXmVIWAw0gDkMYjaBbr9u77IRjtK6Omy8FZenkvYrt8hvcqPqM eFkpKdYqFrPYeH2sO/u97ktdxGXFwjlFbkcKcVYk5N4/jS/5YfcNXYvR6TiLqRt/UleI hYiyr6WpMatLiiMg+geNh1eNu/k0SXd1QPNT+fZsDbIPMcGX2Wnu4+HYMFeSwJaHXdOU DLqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bAnmiNe0Jq/bKPe/yscQG8mYo4LaV7stvbgTiCOkIvc=; b=oWS6tiHUp72pJyxKgUZm7cyOEPYksZWzE+9zc2IIyeSYnj1k2hKSGqyoL0ujC0ee8P NppkV2dsD/8h2m1oQSsHKo6pMCLZ72Qoolu4G46odYMXrthE2e5q4+IWSXrynJYFYvGl 3OjVkhrq2X6kvGrc2aRvdgGExq8G+TzoR5OB0Z/yXSWJ9XfGTyYIXpe/MRAVMQCTc7AA ZKPJvii2bY6OqTR1dr2cr7yZNQfT9yBdwZC5ghFLIcFou4df0mEOJb80h0feNTvvAWvA K0VLLeSvYo5e5Fi1KcEOZ0w5vT0qu3EQqyCKsM0hKW/7tNst5eJ2EXFRHy54e4XiMRmT LENA== X-Gm-Message-State: AElRT7F5U/tHhd7Ulf4jxw4v0MvCqfGSAnWwVN+8QY/KWnXJO5W5qglI HFgfD3DwNwMSu3T6rUkFe2Br/iM9RBg= X-Google-Smtp-Source: AG47ELtpzC5Z17KXtm2sSRyKxxnPjZa2JFhFcuUGG7dtSe3RELKuoVFlJBqYITwCNcb6Fx+R230GNQ== X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr5709406pld.279.1521494381042; Mon, 19 Mar 2018 14:19:41 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Mon, 19 Mar 2018 14:18:24 -0700 Message-Id: <1521494329-19546-2-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1521494329-19546-1-git-send-email-mjc@sifive.com> References: <1521494329-19546-1-git-send-email-mjc@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::243 Subject: [Qemu-devel] [PATCH v4 01/26] RISC-V: Make virt create_fdt interface consistent 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: patches@groups.riscv.org, Michael Clark , Palmer Dabbelt , Sagar Karandikar , Bastian Koppelmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 create_fdt sets the fdt variable on RISCVVirtState and this is used to access the fdt. This reverts a change introduced in https://github.com/riscv/riscv-qemu/pull/109 which introduced a redundant return value, overlooking the RISCVVirtState structure member that made create_fdt inconsistent with the other RISC-V machines. The other alternative is to change the other boards to return the fdt. Note: the RISCVVirtState also contains fdt_size. Cc: Sagar Karandikar Cc: Bastian Koppelmann Signed-off-by: Michael Clark Signed-off-by: Palmer Dabbelt Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/riscv/virt.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index e2c214e..37968d2 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -108,7 +108,7 @@ static hwaddr load_initrd(const char *filename, uint64_= t mem_size, return *start + size; } =20 -static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memma= p, +static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, uint64_t mem_size, const char *cmdline) { void *fdt; @@ -264,8 +264,6 @@ static void *create_fdt(RISCVVirtState *s, const struct= MemmapEntry *memmap, qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename); qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); g_free(nodename); - - return fdt; } =20 static void riscv_virt_board_init(MachineState *machine) @@ -279,7 +277,6 @@ static void riscv_virt_board_init(MachineState *machine) char *plic_hart_config; size_t plic_hart_config_len; int i; - void *fdt; =20 /* Initialize SOC */ object_initialize(&s->soc, sizeof(s->soc), TYPE_RISCV_HART_ARRAY); @@ -299,7 +296,7 @@ static void riscv_virt_board_init(MachineState *machine) main_mem); =20 /* create device tree */ - fdt =3D create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdli= ne); + create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline); =20 /* boot rom */ memory_region_init_ram(boot_rom, NULL, "riscv_virt_board.bootrom", @@ -314,9 +311,9 @@ static void riscv_virt_board_init(MachineState *machine) hwaddr end =3D load_initrd(machine->initrd_filename, machine->ram_size, kernel_entry, &start); - qemu_fdt_setprop_cell(fdt, "/chosen", - "linux,initrd-start", start); - qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end", + qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-start", + start); + qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end", end); } } --=20 2.7.0