Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp413142imi; Fri, 22 Jul 2022 01:40:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tnUmdJneU+/FEUFeQtmmmmrpYRqHQ8RIbxNrxUZ7LvhXy63TCZCM3uz/e0caXEv37ECnWJ X-Received: by 2002:a05:6402:34c8:b0:43b:c782:2419 with SMTP id w8-20020a05640234c800b0043bc7822419mr2362917edc.158.1658479214179; Fri, 22 Jul 2022 01:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658479214; cv=none; d=google.com; s=arc-20160816; b=vgwuBul+e4y1OLI/pjChxz7zrZqFi4cPIFmwnDgyXGjM5nm3DpfpI2E0X7oy/io9rw HoB456IIUW07YVlbL4TuQvK2mIx588fz2f2TxzVaVklNWPcj27271APU6jtFJzwAXZdA J3BXs3ufSgbYZmCOFJxjjFHnjgD6npfzFngEPSBfHU3J/Rn1ERzE+AhEkEaBNrdwGq5e esVPjxUcWJiySXKoa518foaF0LMavaNaQC2K37S28ETsvqYysZ8Ul5JNDx4E7g94nD2C T5xGT4J4S6n1KEJdHS7qz3iuwM0aVjUsS+m/Wju+NxQJZSHFzaRPQUQ+D27f5kp1rQv+ sWKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=50DPVoEjoXB+EtnbRGVLingTJFg82el8pxJ7Zm5hlPk=; b=UCNeA2jU/S5grCmt5aSJwQg3l/ohx9wm6mHqwPz9fFVwJrfLa9euFe1Ysq10Va691l gexMr+87v1dUSoviO8vUwjAv6kzsRTFY4aRgsAxxUp92584iHqdhVQz/JiVyFLGeYaU+ 32rJ9ocKT3XHSkwob6Tn7JN4vvXkUoFi3LKscIYrUB26XMfi3Tis6WB6etK0pg1sC6E3 ekIjoaspDooAVsemi2Xd3Dh2B3SKEvCWWtOCdY51gU/d7zl6tgebc2VhW5lfGA+nLW1q Y1ph5J8Ow4F7zB8kdlG17if+D58U1uZ1WX1Tv8QYWf7AHYJf8Vcpf6NCFulEPmIkA+H9 hDOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Plax3rlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp15-20020a170906c14f00b0072b45412527si5309716ejc.843.2022.07.22.01.39.48; Fri, 22 Jul 2022 01:40:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Plax3rlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234623AbiGVHvc (ORCPT + 99 others); Fri, 22 Jul 2022 03:51:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbiGVHva (ORCPT ); Fri, 22 Jul 2022 03:51:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A114315A1C for ; Fri, 22 Jul 2022 00:51:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 27D5AB826E7 for ; Fri, 22 Jul 2022 07:51:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6431C385A2 for ; Fri, 22 Jul 2022 07:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658476286; bh=hteyvn0yaPK0/2NRgzXD5OW+6qZL0byNi3OkzsX0uAo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Plax3rlzJiMmzpB6iCmEXJOLiz1IPvdRO43uG5cjEa1GxxHIlTcmaQS00VPFdUrl0 K8jOjpp1OuC76WpQ9zmLPW4WbPKKYK4dubUlkICjfULKU/hqOjF8jkKk3Cu4HUII1I /bIzTPzcFRyzxpwaK/IjG9GurGBYxJiZa/K7p4w4T/XPlwMrm7yMKM2rD9Byu5DriT V1Aj2v2I2Y/HfK4Ff9eeYG+yIjOStKiodKRGXD8yFP7+qDnLi5ug+D8ktpvyW0VfvH 3liLaG8uOedx0l+W6yzd62XXnmTnZA2YYvi/bqjaaab5UnPCw40ZO6P8645BO/vsel qLi02lzHsemWw== Received: by mail-lf1-f47.google.com with SMTP id z25so6441187lfr.2 for ; Fri, 22 Jul 2022 00:51:26 -0700 (PDT) X-Gm-Message-State: AJIora9cAOQkSKSCA6me5YhYCnsPILAuOoqQBph+MaBRjEvdjpuaMDhs WCz/PCMgoIIuB07mNrLNJbAXDoGmj+tKDdPOPU8= X-Received: by 2002:a05:6512:1191:b0:48a:2269:e87 with SMTP id g17-20020a056512119100b0048a22690e87mr826633lfr.122.1658476284840; Fri, 22 Jul 2022 00:51:24 -0700 (PDT) MIME-Version: 1.0 References: <20220717101323.370245-1-xianting.tian@linux.alibaba.com> <20220717101323.370245-5-xianting.tian@linux.alibaba.com> <7405851.EvYhyI6sBW@diego> In-Reply-To: <7405851.EvYhyI6sBW@diego> From: Guo Ren Date: Fri, 22 Jul 2022 15:51:12 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/5] riscv: Add modules to virtual kernel memory layout dump To: =?UTF-8?Q?Heiko_St=C3=BCbner?= Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Nick Kossifidis , Alexandre Ghiti , Xianting Tian , linux-riscv , Linux Kernel Mailing List , crash-utility@redhat.com, huanyi.xj@alibaba-inc.com, Heinrich Schuchardt , k-hagio-ab@nec.com, hschauhan@nulltrace.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 22, 2022 at 3:24 PM Heiko St=C3=BCbner wrote: > > Am Sonntag, 17. Juli 2022, 12:13:22 CEST schrieb Xianting Tian: > > Modules always live before the kernel, MODULES_END is fixed but > > MODULES_VADDR isn't fixed, it depends on the kernel size. > > Let's add it to virtual kernel memory layout dump. > > > > As MODULES is only defined for CONFIG_64BIT, so we dump it when > > CONFIG_64BIT=3Dy. > > > > eg, > > MODULES_VADDR - MODULES_END > > 0xffffffff01133000 - 0xffffffff80000000 > > > > Signed-off-by: Xianting Tian > > I'm still not sure if it would be better to define MODULES_* constants > even on 32bit (with their VMALLOC_START etc values) and prevent > needing the CONFIG_64BIT ifdef, but that's for others to decide :-) There is no MODULES_VADDR for 32-bit, because it reuses vmalloc area. We should print MODULES_VADDR here to make people clear to know. Reviewed-by: Guo Ren > > The below also looks good, so > Reviewed-by: Heiko Stuebner > > > --- > > arch/riscv/mm/init.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > > index d466ec670e1f..2c4a64e97aec 100644 > > --- a/arch/riscv/mm/init.c > > +++ b/arch/riscv/mm/init.c > > @@ -135,6 +135,10 @@ static void __init print_vm_layout(void) > > (unsigned long)VMEMMAP_END); > > print_ml("vmalloc", (unsigned long)VMALLOC_START, > > (unsigned long)VMALLOC_END); > > +#ifdef CONFIG_64BIT > > + print_ml("modules", (unsigned long)MODULES_VADDR, > > + (unsigned long)MODULES_END); > > +#endif > > print_ml("lowmem", (unsigned long)PAGE_OFFSET, > > (unsigned long)high_memory); > > if (IS_ENABLED(CONFIG_64BIT)) { > > > > > > --=20 Best Regards Guo Ren