Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4829559imj; Wed, 13 Feb 2019 01:40:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IZgYHjm0e9f+tfdRnbQtSb6YQBOuaRSI9i8/LqXU3U5NLaxvJhAeRh9Oes72ouc+2DP3uB0 X-Received: by 2002:a17:902:20e2:: with SMTP id v31mr8964637plg.307.1550050838519; Wed, 13 Feb 2019 01:40:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550050838; cv=none; d=google.com; s=arc-20160816; b=Ac4oeUrsjiAFTt2DvBGm4txyX3BPt345RaynFsD0jpquGwkJyyONmG+SR02oVdhS8c jOem988MvP6c2YN5uQvaezz1oqMku0c8xxEtw7PTxg0QwrA4uc4q0meJ5e6x6JRB54GY aoVltq7aJS0UGvbNZUiaMEcqQSj6AdIgeKncTBvbS5rj7KFv1Ubr9X14YVZjzRWRzgKY Aq/u328RmRsyuu/lFJisE77ankqDi354RYI+aErNKszk/3k3s0saJ7g+7qB52GptMvEX uOifLYSJMB10Di+072R+R96q+h/nld4amuCX/axvJuQncD0mcmRyujGJ5dUMBrGyR8e6 5E4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :wdcipoutbound:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:dkim-signature:dkim-signature; bh=I8qCA2Iv5UJ1d1yEkinn+T39/F/zEuxMl5ljAL1ZXGM=; b=SCDIHKEJxrjI3Cjl4I+oolEtyDqnrd5JbQhEqm/AA8P+EKdzucPVL18S7ogIJ0Z9L9 R32dTSOFeQgnE6fGlltLXNPv0V0QhJMMPJrYcp4vAkOcfDbhXi0/Dm1ja6OhEN1hmrjZ 6Mo3b2TKOngNFO8kkmNR6ccltT0ilZXfvp5AyCSqKsRViyHEw4Bwt1Uqg/pwo2tcEL4d qHtKU9Hw8/XQa/xmBeWd813dx1LUZ5oKfr/YLzM5FHPEwXiIwQ9IMzdl2swLVCp3tQUJ 3d3e5RvOILapkqWecuTGm5a8HTRYBxz/eccjC+VYc4yocI3Xk3OBIXkEX1HRz44siVq+ jJMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="r23/9/z2"; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b="m/oukO1M"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb2si18688375plb.201.2019.02.13.01.40.21; Wed, 13 Feb 2019 01:40:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="r23/9/z2"; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b="m/oukO1M"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733154AbfBMGcb (ORCPT + 99 others); Wed, 13 Feb 2019 01:32:31 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:32464 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733119AbfBMGc0 (ORCPT ); Wed, 13 Feb 2019 01:32:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1550039546; x=1581575546; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=h25QTCPdlhMfqtz+zmztEhyRxhdRVXagsuYHINwV8lo=; b=r23/9/z2B+9jqkj3oxXI/Ko45pLaUzM9c9z9+e2gLo2hF2yyeiAWo3QW hRXvXrI28Hvd3jOM68MG/VCxXahY/2WQ6ZipG3Wc0cy0cdoulD8OTo232 yZDIYZYx6z8XPtx3YVmZNm1vMQ+d5fX8nvhluU6Qy/lbG5Jit8UTpxXKR G6f5nEpeOkMfUx/02dGPGqCP8Cbrd/a+iKJRsqtRvCdIgx3FKLPrzFLRe 7VqNKBhDMj5j/5HC2X/ILr/fRf+3psk247wgHD5S6RG1UH+3EsA2s8z6x rxDxwZdC4o4Kh9kE+5xNzSzpGGlmNxYO2OKL4QQl9CY7PCb4b0vjvlHb4 Q==; X-IronPort-AV: E=Sophos;i="5.58,364,1544457600"; d="scan'208";a="102859901" Received: from mail-co1nam05lp2050.outbound.protection.outlook.com (HELO NAM05-CO1-obe.outbound.protection.outlook.com) ([104.47.48.50]) by ob1.hgst.iphmx.com with ESMTP; 13 Feb 2019 14:32:25 +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=I8qCA2Iv5UJ1d1yEkinn+T39/F/zEuxMl5ljAL1ZXGM=; b=m/oukO1MXLU7grl9pGZVN8I2FUBamNt5QjLOayGTVm80CiW6ckS6o+UFz6HK0QA6CoBVHj4s11n87w5YrZZWp+Hw02aUWci8Q1NTmwaL1NY0jZZa6O1lJPsr1mGtFrZ5UaqXXVljl8l/UTKimoL5mYQfr1TQ+TxQbzOFc8rJLuY= Received: from DM6PR04MB6059.namprd04.prod.outlook.com (20.178.226.89) by DM6PR04MB5515.namprd04.prod.outlook.com (20.178.224.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Wed, 13 Feb 2019 06:32:07 +0000 Received: from DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::d006:5be7:c3f:ba6c]) by DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::d006:5be7:c3f:ba6c%2]) with mapi id 15.20.1601.023; Wed, 13 Feb 2019 06:32:07 +0000 From: Anup Patel To: Palmer Dabbelt , Albert Ou CC: Atish Patra , Paul Walmsley , Christoph Hellwig , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Anup Patel Subject: [PATCH v4 2/6] RISC-V: Setup init_mm before parse_early_param() Thread-Topic: [PATCH v4 2/6] RISC-V: Setup init_mm before parse_early_param() Thread-Index: AQHUw2XXY56X4eWHMkuwX0WnD4R8rA== Date: Wed, 13 Feb 2019 06:32:07 +0000 Message-ID: <20190213063127.28703-3-anup.patel@wdc.com> References: <20190213063127.28703-1-anup.patel@wdc.com> In-Reply-To: <20190213063127.28703-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0027.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::13) To DM6PR04MB6059.namprd04.prod.outlook.com (2603:10b6:5:129::25) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [129.253.179.161] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5ed4c8e0-c26d-4f5a-47ba-08d6917cf972 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:DM6PR04MB5515; x-ms-traffictypediagnostic: DM6PR04MB5515: wdcipoutbound: EOP-TRUE x-microsoft-exchange-diagnostics: =?iso-8859-1?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hv?= =?iso-8859-1?Q?XxjAwTSlo+aMqUfdyaV7yt8wjYKbWouxteNw1QN76hMHebIQD0+afIxBsN?= =?iso-8859-1?Q?03vt4QMaufUdQHbozw4+soGnfUcyljli48KNPDrs97xeocsluqLuKisAht?= =?iso-8859-1?Q?gMbOwMq4y3nK6KwRwaIEO+TU3WAtXx15s+7uoPG31IB9AZtqgj0Kzuem7N?= =?iso-8859-1?Q?7xF+WOdCcbxKf4jzyXnQVIp730WmoOuv6im+7uonlX6KRyKy09Y0bklYmm?= =?iso-8859-1?Q?qedio6t3uSYKsx2vbk8r5DHG8wV8zPDXeJLRifD+Wqpchbz2uce+RP3+72?= =?iso-8859-1?Q?aAeOGPYXmF4GbvD339XnmlwpAyVvrnsKvgkveUMg88K1QLM77Xza7dllFh?= =?iso-8859-1?Q?BbOQctUeLlca5i9oGwiw6cO3XT0k9H5j2qR94yLdtEbSJp3+l5ubTMTVmc?= =?iso-8859-1?Q?FvAK08fhtuIOlIFCwjEtD2l?= x-microsoft-antispam-prvs: x-forefront-prvs: 094700CA91 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(366004)(39860400002)(346002)(396003)(376002)(199004)(189003)(1076003)(6512007)(2171002)(478600001)(72206003)(446003)(386003)(6346003)(2616005)(11346002)(102836004)(6506007)(476003)(2906002)(256004)(50226002)(4326008)(97736004)(14454004)(6486002)(110136005)(25786009)(6436002)(68736007)(316002)(44832011)(486006)(99286004)(36756003)(8936002)(186003)(6116002)(106356001)(81156014)(81166006)(8676002)(3846002)(86362001)(26005)(105586002)(71200400001)(71190400001)(66066001)(305945005)(53936002)(52116002)(7736002)(76176011)(54906003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR04MB5515;H:DM6PR04MB6059.namprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Z5K61Xf4Kf4a0zlwo1cfGlFQKMyi1Md1daORb9HUwnsHXoHAgf93qvQjf8NqxbITj6DhMzOOZCdbcnvoWXdeOj2WIkpGtkDeWZeGGSa4I53xnupstcNYpBOQq6uycEeQtjR3nzddRtR9tBaX7i2Ia62A2OMA5JqfvJIdSoARi/j2HY/p3OpSLZTC1nr4e3ubKWT8dj0iMLu0tdz6/BQKPPWGs4VMA0hMTexNvEJ3B4GCHccYijVY1flV7qOs+25XI5Hl3fshdCT+Lx+4rJ3g+ttDuIu655f9vcD8no1V8jpT7eKKVgJZ4Unh/jlwgE73CMR0E1CU3eovQLdUzjHxvFPrTF55KoK2rm6nz9koFW66hC2eJdIWOvkdIpb1KEVsNGggMMqv1bcwuUgt+YEPosw0ENGh1zFpM5248R/Ofdk= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ed4c8e0-c26d-4f5a-47ba-08d6917cf972 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2019 06:32:03.6391 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5515 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should setup init_mm before doing parse_early_param() in setup_arch() to be consistent with setup_arch() of other architectures such as x86, ARM, and ARM64. Signed-off-by: Anup Patel Reviewed-by: Christoph Hellwig Reviewed-by: Palmer Dabbelt --- arch/riscv/kernel/setup.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 36f60b4d2147..9e6395b7d409 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -208,15 +208,15 @@ static void __init setup_bootmem(void) =20 void __init setup_arch(char **cmdline_p) { - *cmdline_p =3D boot_command_line; - - parse_early_param(); - init_mm.start_code =3D (unsigned long) _stext; init_mm.end_code =3D (unsigned long) _etext; init_mm.end_data =3D (unsigned long) _edata; init_mm.brk =3D (unsigned long) _end; =20 + *cmdline_p =3D boot_command_line; + + parse_early_param(); + setup_bootmem(); paging_init(); unflatten_device_tree(); @@ -235,4 +235,3 @@ void __init setup_arch(char **cmdline_p) =20 riscv_fill_hwcap(); } - --=20 2.17.1