Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2815737rdb; Mon, 4 Dec 2023 08:15:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFunRUfhce6Qof+MIkeRiNTi4wVSb/58IiHIHXH1PY1Dvb2SJrz7iVwsTUd0n1fqmnUVVPq X-Received: by 2002:a17:90b:124e:b0:286:8f94:bafa with SMTP id gx14-20020a17090b124e00b002868f94bafamr1266808pjb.38.1701706504935; Mon, 04 Dec 2023 08:15:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701706504; cv=none; d=google.com; s=arc-20160816; b=JbKPMGLXrJ0V7G/+vSYeT57zL/cA9HKoB9NNPpowBaKBP6vEXQ7igocYTbEl0xMcUI 2NdHaQ2s+7IAuG857+XTwepSazto3JA6Y4DTj3o9LsNITVftTVym1iPuoOep7Au8eCms GeuFQwV1C7Ov8rew80s4Nh9FcTi4dSh7vKvfw+xBCivdI4Fmu+D/39MhYfDMT1GxbWBi Bgfugx/Z/2/+dsKP4zgvKBWASJSfobEFmWwz0hmL4SyJLWPFfqcjzCxPUzy52lGvncMB 1bSga5HwJxWuB7APvUFo0/qBB0Q90ec7zKF19zo6jIpLnsg260alQ85EEu1+dq6ULiHm Tisw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5Bk/8h0F8dH2sRviwfhPldtWfaMZhwiChX23dFJ4s24=; fh=rowZHtAuv9n9dKvi4sLo4b1WYOPatCswF9pOq3l/9s0=; b=I/yl9xERL7pmlQGsxmOwYwGxYMW/II22RdGlv5YwOmyrzDAwKkjg5qwWXxSMXKAoi1 tBLNGqELngLsFQccLp0ovMIK8omwLE/xJFAJd4rpXx/KF753L74Z5NgdVhUTbx1f48dU 6THVFYXgl3PFDNW8e9xa90kua4Zh5WQ1ZeShJHqQpIFr7NaVjaM+lcbagrbA0qVthRhK pkuJ24a8F8rVMlAcbDVrORUEIy9eFq7twGLJVmJNYKmvhOHun3uX/gKmdvqbdZXS9+YK lKLnk3Q6t82wS1DiggidN2VvvcpOwfTg2vH2GsrCAaneNT4DiX1gsAZgF++q5uCkSHvr lIDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N346Pnds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b3-20020a17090a800300b0028644ca706dsi7520784pjn.171.2023.12.04.08.15.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 08:15:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N346Pnds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B1D3B8050D33; Mon, 4 Dec 2023 08:15:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344538AbjLDQOp (ORCPT + 99 others); Mon, 4 Dec 2023 11:14:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbjLDQOo (ORCPT ); Mon, 4 Dec 2023 11:14:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50CBFB0 for ; Mon, 4 Dec 2023 08:14:50 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 970F3C433C7; Mon, 4 Dec 2023 16:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701706490; bh=SwEWkG/uCW/5Tacu2wjWGIOYBAsWvLMMutQ89lrq+CE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N346Pndsdr5C3wi2upjUoGzHZNenjnIGD4awErFqjGNAAdRyPnZdWSK8JGYpdoecv j/BmEMplNLzOiX8xkbp2i6KKX0XN590J9vy+PaNwoTjR4Ks9XfnMLlbAT89oOXWGaJ C/MzQOdwR1dBxtaOl5bhVKKCBLT20JGnqv+04pxBF3G/hop5GCe7OCL4WfZiTTCK9c AMVvchAGsdLiSHvA1gqpPpFayD2mU0+vw31B0dcDkFVFh3fGD4X8/MV354FPbcqm3y XYVBD6GcYW35X7iBaNISLOsOy2/da0trz/ZBL950aRavFOcNHgIxCOpcT/3+f2oqvy 2njAfgN4yL/+g== Date: Mon, 4 Dec 2023 16:14:45 +0000 From: Conor Dooley To: Baoquan He Cc: Conor Dooley , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-parisc@vger.kernel.org, akpm@linux-foundation.org, joe@perches.com, nathan@kernel.org Subject: Re: [PATCH v3 5/7] kexec_file, ricv: print out debugging message if required Message-ID: <20231204-liftoff-enclosure-d3e3daf0ab6e@spud> References: <20231130023955.5257-1-bhe@redhat.com> <20231130023955.5257-6-bhe@redhat.com> <20231201-blog-blasphemy-985d2665903c@wendy> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rDkxBxq3zHBt7ZDu" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 04 Dec 2023 08:15:01 -0800 (PST) --rDkxBxq3zHBt7ZDu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 04, 2023 at 11:38:05PM +0800, Baoquan He wrote: > On 12/01/23 at 10:38am, Conor Dooley wrote: > > On Thu, Nov 30, 2023 at 10:39:53AM +0800, Baoquan He wrote: > >=20 > > $subject has a typo in the arch bit :) >=20 > Indeed, will fix if need report. Thanks for careful checking. >=20 > >=20 > > > Replace pr_debug() with the newly added kexec_dprintk() in kexec_file > > > loading related codes. > >=20 > > Commit messages should be understandable in isolation, but this only > > explains (part of) what is obvious in the diff. Why is this change > > being made? >=20 > The purpose has been detailedly described in cover letter and patch 1 > log. Andrew has picked these patches into his tree and grabbed the cover > letter log into the relevant commit for people's later checking. All > these seven patches will be present in mainline together. This is common > way when posting patch series? Please let me know if I misunderstand > anything. Each patch having a commit message that explains why a change is being made is the expectation. It is especially useful to explain the why here, since it is not just a mechanical conversion of pr_debug()s as the commit message suggests. > >=20 > > >=20 > > > And also remove kexec_image_info() because the content has been print= ed > > > out in generic code. > > >=20 > > > Signed-off-by: Baoquan He > > > --- > > > arch/riscv/kernel/elf_kexec.c | 11 ++++++----- > > > arch/riscv/kernel/machine_kexec.c | 26 -------------------------- > > > 2 files changed, 6 insertions(+), 31 deletions(-) > > >=20 > > > diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_ke= xec.c > > > index e60fbd8660c4..5bd1ec3341fe 100644 > > > --- a/arch/riscv/kernel/elf_kexec.c > > > +++ b/arch/riscv/kernel/elf_kexec.c > > > @@ -216,7 +216,6 @@ static void *elf_kexec_load(struct kimage *image,= char *kernel_buf, > > > if (ret) > > > goto out; > > > kernel_start =3D image->start; > > > - pr_notice("The entry point of kernel at 0x%lx\n", image->start); > > > =20 > > > /* Add the kernel binary to the image */ > > > ret =3D riscv_kexec_elf_load(image, &ehdr, &elf_info, > > > @@ -252,8 +251,8 @@ static void *elf_kexec_load(struct kimage *image,= char *kernel_buf, > > > image->elf_load_addr =3D kbuf.mem; > > > image->elf_headers_sz =3D headers_sz; > > > =20 > > > - pr_debug("Loaded elf core header at 0x%lx bufsz=3D0x%lx memsz=3D0x= %lx\n", > > > - image->elf_load_addr, kbuf.bufsz, kbuf.memsz); > > > + kexec_dprintk("Loaded elf core header at 0x%lx bufsz=3D0x%lx memsz= =3D0x%lx\n", > > > + image->elf_load_addr, kbuf.bufsz, kbuf.memsz); > > > =20 > > > /* Setup cmdline for kdump kernel case */ > > > modified_cmdline =3D setup_kdump_cmdline(image, cmdline, > > > @@ -275,6 +274,8 @@ static void *elf_kexec_load(struct kimage *image,= char *kernel_buf, > > > pr_err("Error loading purgatory ret=3D%d\n", ret); > > > goto out; > > > } > > > + kexec_dprintk("Loaded purgatory at 0x%lx\n", kbuf.mem); > > > + > > > ret =3D kexec_purgatory_get_set_symbol(image, "riscv_kernel_entry", > > > &kernel_start, > > > sizeof(kernel_start), 0); > > > @@ -293,7 +294,7 @@ static void *elf_kexec_load(struct kimage *image,= char *kernel_buf, > > > if (ret) > > > goto out; > > > initrd_pbase =3D kbuf.mem; > >=20 > > > - pr_notice("Loaded initrd at 0x%lx\n", initrd_pbase); > > > + kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_pbase); > >=20 > > This is not a pr_debug(). > >=20 > > > } > > > =20 > > > /* Add the DTB to the image */ > > > @@ -318,7 +319,7 @@ static void *elf_kexec_load(struct kimage *image,= char *kernel_buf, > > > } > > > /* Cache the fdt buffer address for memory cleanup */ > > > image->arch.fdt =3D fdt; > >=20 > > > - pr_notice("Loaded device tree at 0x%lx\n", kbuf.mem); > > > + kexec_dprintk("Loaded device tree at 0x%lx\n", kbuf.mem); > >=20 > > Neither is this. Why are they being moved from pr_notice()? >=20 > You are right.=20 >=20 > While always printing out the loaded location of purgatory and > device tree doesn't make sense. It will be confusing when users > see these even when they do normal kexec/kdump loading. It should be > changed to pr_debug(). >=20 > Which way do you suggest? > 1) change it back to pr_debug(), fix it in another patch; > 2) keep it as is in the patch; Personally I think it is fine to change them all in one patch, but the rationale for converting pr_notice() to your new debug infrastructure needs to be in the commit message. Thanks, Conor. --rDkxBxq3zHBt7ZDu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZW369QAKCRB4tDGHoIJi 0nMJAP4uVUovqQeQ+fYVKmAG4c00oB2z4haO+u5+2U2Cf9yrYwD/f9u0S9FMCfzY i2AY9z+9fRLSvxY457Xg9s0W3YULlwE= =OJ5C -----END PGP SIGNATURE----- --rDkxBxq3zHBt7ZDu--