Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2213759pxj; Sun, 30 May 2021 18:10:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYe6FI4WeWhJtWhbRD+GwrvprlQyEdB8rtdrzSybyIIxtlviP/AC+87wDGRIRVzHWzfO/5 X-Received: by 2002:a17:906:8394:: with SMTP id p20mr17773592ejx.170.1622423435058; Sun, 30 May 2021 18:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622423435; cv=none; d=google.com; s=arc-20160816; b=R6IgBcOJ1GsXkSIAqsB3u45wxPYpoc6P17fu7NqFHkLg6Y7g/rc8q4FYduKyg1whuZ /H1fUtjZqonu9ZcrTXND5CWyNkuX11qYY2JPkjPNHDaaTNZpsXx8bS+QPequ8dZ0r2nH qgY9AAOEuG00RfOUls8XjLT3YNkHwtVAkDkEmeV80+0UVZbu2iRy+/GjBgO8Bttrftug ZbgW/gNasRC5b8TsI0e/tZtnL12NSMdg68P1zSDa3DCefxi/C0h2un+R7mXj9/N5RpZo 2f0Reb1K5X0SyzzVtlV+d/Ctp4MPu9C9il4fMMiHMgRRZ85+E4mtMrNnnPYSzPoatlN+ D6Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ZDaIWJWvVxItRUCH6FsQr2jcu05JqEmi2Tap9Ym7JAQ=; b=PybSev6M7xaH60lYAiRqvgTbB7uHYgzfDKy/hroUCi0AQ6rC0q3A9/05gCL3LzAutS Q7bk6D5ULkmnchGbulslzOgKDFExGoySjQoZ88bON81tL9BwQxTj/kYHkbEwnFKuZcyM rLJTsxkLwai4Cjdpl+oL9HJYE17llQtm+qVHjX/Ecrc5FFWVSCCYbW5Ai28WUzd2j6bb HrCd/KQA1CfezAPOO2YlrZrhy6PdiTB6Va47Of505Ghs8mkW4J6LH2fXNk1ZBgsmpy/9 +6HwLB/H+pW55dwmQIL6g7XI6NZ8buC8zcgCOUn9eFGilfTeZESMnTZPlSCLmehNcsRf S7vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p3si10589588edu.599.2021.05.30.18.10.12; Sun, 30 May 2021 18:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229952AbhEaBHc (ORCPT + 99 others); Sun, 30 May 2021 21:07:32 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:3288 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbhEaBHb (ORCPT ); Sun, 30 May 2021 21:07:31 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4FtcRq29ZCz1BGCy; Mon, 31 May 2021 09:01:11 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 09:05:50 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 09:05:50 +0800 Subject: Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm() To: Christophe Leroy CC: , , "Andrew Morton" References: <20210529105504.180544-1-wangkefeng.wang@huawei.com> <20210529105504.180544-12-wangkefeng.wang@huawei.com> <20210529181630.Horde.rvXKyt8t9f8DiqTVTuSKUw3@messagerie.c-s.fr> From: Kefeng Wang Message-ID: Date: Mon, 31 May 2021 09:05:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20210529181630.Horde.rvXKyt8t9f8DiqTVTuSKUw3@messagerie.c-s.fr> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/5/30 0:16, Christophe Leroy wrote: > Kefeng Wang a écrit : > >> Use setup_initial_init_mm() helper to simplify code. >> >> Cc: Michael Ellerman >> Cc: Benjamin Herrenschmidt >> Cc: linuxppc-dev@lists.ozlabs.org >> Signed-off-by: Kefeng Wang >> --- >>  arch/powerpc/kernel/setup-common.c | 5 +---- >>  1 file changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/arch/powerpc/kernel/setup-common.c >> b/arch/powerpc/kernel/setup-common.c >> index 046fe21b5c3b..c046d99efd18 100644 >> --- a/arch/powerpc/kernel/setup-common.c >> +++ b/arch/powerpc/kernel/setup-common.c >> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p) >> >>      klp_init_thread_info(&init_task); >> >> -    init_mm.start_code = (unsigned long)_stext; >> -    init_mm.end_code = (unsigned long) _etext; >> -    init_mm.end_data = (unsigned long) _edata; >> -    init_mm.brk = klimit; >> +    setup_initial_init_mm(_stext, _etext, _edata, _end); > > This looks wrong, should be klimit instead of _end IIUC see  arch/powerpc/kernel/setup-common.c: unsigned long klimit = (unsigned long) _end; the setup_initial_init_mm helper [1] should use the original _end +static inline void setup_initial_init_mm(char *start_code, + char *end_code, + char *end_data, + char *brk) +{ + init_mm.start_code = (unsigned long)start_code; + init_mm.end_code = (unsigned long)end_code; + init_mm.end_data = (unsigned long)end_data; + init_mm.brk = (unsigned long)brk; +} [1] https://lkml.org/lkml/2021/5/29/84 > >> >>      mm_iommu_init(&init_mm); >>      irqstack_early_init(); >> -- >> 2.26.2 > > > . >