From patchwork Mon Oct 8 18:25:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10631249 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D690E174A for ; Mon, 8 Oct 2018 18:27:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB2A32994A for ; Mon, 8 Oct 2018 18:27:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFB8D2995F; Mon, 8 Oct 2018 18:27:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4857E2994A for ; Mon, 8 Oct 2018 18:27:37 +0000 (UTC) Received: from localhost ([::1]:47777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9aFk-00066M-4y for patchwork-qemu-devel@patchwork.kernel.org; Mon, 08 Oct 2018 14:27:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9aEI-0004wS-23 for qemu-devel@nongnu.org; Mon, 08 Oct 2018 14:26:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9aED-00086G-Eg for qemu-devel@nongnu.org; Mon, 08 Oct 2018 14:26:04 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:54562) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9aEA-00082C-Re for qemu-devel@nongnu.org; Mon, 08 Oct 2018 14:26:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1539023158; x=1570559158; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=JKmwYqXzMe9uPvDxlMigv4t6eYaZrnT2/jM5MubK5Lc=; b=NBFAILg2336jz6hr9FlSN187RBrSfKi8WPcjgJseqak/TwD9JWPQdF76 LdmKYzhQ+TRnqdlMe60eweo1+6GsZrM2+ngChAiKDk452ArMZOji/F7cf VmQuT4MYl/fS14qWv8d79DIzcAKdottvy/+pBvRWHHEMyPdMwWag7htVY u24hDBIYfM/MrvihF3QKtX25B4Li0oUgbmSuRJbkPRXddoV9DPwTkqY2O kbd0z8fM6K+EkqltBivkffqQfHneimnMK/G6kaXNpzHPZVUBsPlKHZezw 1fk3iM+2CrZFWVWUV0vc556NdRXcOLsaIuGqrptKIPRdoRlrsSgcKgX3b w==; X-IronPort-AV: E=Sophos;i="5.54,357,1534780800"; d="scan'208";a="195809410" Received: from mail-co1nam04lp0054.outbound.protection.outlook.com (HELO NAM04-CO1-obe.outbound.protection.outlook.com) ([216.32.181.54]) by ob1.hgst.iphmx.com with ESMTP; 09 Oct 2018 02:25:57 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SokNWZ0KPHkdJTteohXVUkmss/fO17+c89RTbfR29vE=; b=jVgRDf5L4QSrNxhezDVzh3lXa47dd98x3IQYxLW+lfUp/VDnrLiUJcxVemUvQIe68fM0by2b5HA4I35vETXoVXjioogSK2d+k7oULUAA/I6rFmDtq8ASnaEu0d89S8ZYK8BQJ/HCLloIZ5TIuTo1XOh7YCM1Sdmv4wNAAj6nxS4= Received: from MWHPR04MB0401.namprd04.prod.outlook.com (10.173.48.18) by MWHPR04MB0320.namprd04.prod.outlook.com (10.169.202.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Mon, 8 Oct 2018 18:25:56 +0000 Received: from MWHPR04MB0401.namprd04.prod.outlook.com ([fe80::f94c:102e:8dce:7c02]) by MWHPR04MB0401.namprd04.prod.outlook.com ([fe80::f94c:102e:8dce:7c02%6]) with mapi id 15.20.1207.024; Mon, 8 Oct 2018 18:25:56 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" , "mjc@sifive.com" Thread-Topic: [PATCH v1 5/5] RISC-V: Don't add NULL bootargs to device-tree Thread-Index: AQHUXzRaVBpiEwO3A0q9c41FVkmtWw== Date: Mon, 8 Oct 2018 18:25:56 +0000 Message-ID: <17e897f16e0972da80a22d50b50293dc893731b0.1539023064.git.alistair.francis@wdc.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: BYAPR07CA0038.namprd07.prod.outlook.com (2603:10b6:a03:60::15) To MWHPR04MB0401.namprd04.prod.outlook.com (2603:10b6:300:70::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR04MB0320; 6:Uvjm3xqlZcaIxR/8hDRKalFl98UPar9Pgpoz+1QdrnKimSQuCv41zkkLLSEhn2rMjZDL1UAzY+M4+ra6nb5KVrJxx2yWtpHCZvc6NqqHP8CUfkFiwNSqTXPKLfRzYzcwIvB1s/YQyhoBIN1J9iJo+tc/hkxSRnGDeg1H7GT5ALLV9Cx7FXSwAxvMYDwbxox8cmYv5XCnTWHxAEO4awz/v7OTrP27+V+aSLmCa8qRkB3jsvQJimJbozeU9j8tYuWk47tpiO+bLLKl83Giq7ZRluomXD3ZYF3uxqhgbf5TNOV3yZxL1xabEdLylL9CUT0Gy2/Zxl1BCCxeAUxKxYSUx3V+cf+zUrs3PMlk/Dt0sEqCYwJqghvAsE0xafd7Ur0pcRQGJV1oxHpyTIKR1kyq7KmRcWy8AqN9FEwk5zaUHZJYNIa0eTnfO8jID+y7UFq/PWNTGxPByiTlrD4RKuYY8Q==; 5:6PF654GHbbt0IOyfba7LP1lzsnyKe6ydK2GjARDC4UODUTomRLXjtGrtmMUCYGHTaqd9PXi5OAWyxJzhx0Ah5jYJTCE8/qIdeC/Nl7f64/Ni3uCR9zp2nIqpRsnVIoRuSWIc5XOSo+/rU2T7nX8AfobSuNHmpQVfDNBb5n/qJBE=; 7:YT8yoSUQb+3j3mHMTzJ6ZTXBwd2HAqK3oRutcP3/Z+dHUtd/BGjUgfVxQbjl07MMV0nxKB1KX15B5gZ2bS9xE4V1PDd41Yd2Bx5kbyXOxMJNl2tLlP9RjsFp2laB/GoDbDq8XohzoxlvKxoaDmNER9JjBINIvasnP63rcRFK3Mae26/AkUNdK3Zei9PB0iLJiad8m42rseJxAbsKDVTDmezNSWWTXXef8olcUUiKZLbPM51ikjoUfD6fPZ+rFf8p x-ms-office365-filtering-correlation-id: 28c9fe6c-9c4c-4738-3317-08d62d4b7cb5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:MWHPR04MB0320; x-ms-traffictypediagnostic: MWHPR04MB0320: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051); SRVR:MWHPR04MB0320; BCL:0; PCL:0; RULEID:; SRVR:MWHPR04MB0320; x-forefront-prvs: 081904387B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(136003)(376002)(346002)(366004)(39860400002)(199004)(189003)(106356001)(186003)(102836004)(26005)(71200400001)(5660300001)(71190400001)(68736007)(6116002)(81156014)(118296001)(2906002)(50226002)(25786009)(305945005)(3846002)(7736002)(8676002)(478600001)(39060400002)(105586002)(8936002)(81166006)(2501003)(14454004)(6436002)(54906003)(110136005)(86362001)(6486002)(316002)(53936002)(99286004)(386003)(52116002)(6506007)(76176011)(446003)(6512007)(44832011)(476003)(36756003)(5250100002)(11346002)(486006)(72206003)(4326008)(66066001)(97736004)(2616005)(256004)(2900100001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR04MB0320; H:MWHPR04MB0401.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-microsoft-antispam-message-info: DlW6rVSGuUH0IMqFJpkIiaFW786AUSyiJbYu4Sry2xxCNewzgLqHIDUyRWH6FT9ETn02wEG1Dq4aEXezTucHxdqyEm9gmpRW5yiCJAfaR47RDsssLZ9RVNFgnRqYu+wODm5gpXzHRgOG1En0g/h94Y7AHxwP63Kb5H+8gZ2amsXRsIkjAkZZ8TPGn/bLCoZBur2ols7t3da39lFUhISBt1iTJYaVqFj7B/YXlx+2RZUqjMN7Rcb1m1FKBNJLABAgsTSl2i0OBgR9iyNfZTZaA5NMZIe+khU7Akxk7geZJEgsaYRoW8JNY0LzO/uXWEi2EluJiTNlS1/+Fu12wY4KCCdIQ2DwZdU2n7dyIWDh+Kc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28c9fe6c-9c4c-4738-3317-08d62d4b7cb5 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2018 18:25:56.1063 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR04MB0320 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 68.232.141.245 Subject: [Qemu-devel] [PATCH v1 5/5] RISC-V: Don't add NULL bootargs to device-tree 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: "alistair23@gmail.com" , Alistair Francis Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Michael Clark Cc: Palmer Dabbelt Cc: Alistair Francis Signed-off-by: Michael Clark Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 4 +++- hw/riscv/spike.c | 6 ++++-- hw/riscv/virt.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 862f8ff5f7..ef07df2442 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -230,7 +230,9 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap, qemu_fdt_add_subnode(fdt, "/chosen"); qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename); - qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + if (cmdline) { + qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + } g_free(nodename); } diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index be5ef85e81..8a712ed490 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -156,8 +156,10 @@ static void create_fdt(SpikeState *s, const struct MemmapEntry *memmap, g_free(cells); g_free(nodename); - qemu_fdt_add_subnode(fdt, "/chosen"); - qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + if (cmdline) { + qemu_fdt_add_subnode(fdt, "/chosen"); + qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + } } static void spike_v1_10_0_board_init(MachineState *machine) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 6bd723dc3a..4a137a503c 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -254,7 +254,9 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, qemu_fdt_add_subnode(fdt, "/chosen"); qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename); - qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + if (cmdline) { + qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + } g_free(nodename); return fdt;