Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2790854rdb; Mon, 4 Dec 2023 07:38:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3QseZVB63rkggpp6I/BRfz1KPX1o2DRAFGzJHnxWQ+WkHgKlaiZw7JmqeUVTVgK03fXhN X-Received: by 2002:a17:90b:23cb:b0:286:6cc1:3f19 with SMTP id md11-20020a17090b23cb00b002866cc13f19mr3713990pjb.80.1701704309001; Mon, 04 Dec 2023 07:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701704308; cv=none; d=google.com; s=arc-20160816; b=ZANOMUfQcYFJm9J6V5PAZrxY9IRF1fRw1Huwc3HjXkDzZe/24m21Z+CY1pMWFR26Xx afT4lM1x22Yqf8/wyGeMWgqlnG6bZgvU9OHsD+uib+LRjZ7+srh+dOqAPelV0aJa8CuA Z1XfrYQp/u2msknemEUxJeg2VjW2IybMmGdhmenEiFbXAGLSQ/1t0g50QW8nMfq7uW9P TxAlUE3TVjDc0eDbPRHnDD5yu08mVEudpV4qObWqqgQ9rTIZgm0xkQculVogfc4MC/In f0vvct7C2ueus+TDGvLV0iU3pubOoWa42oOXzWLuOxVcadGEDaABCrJxRAa1To+jXBtv lIGg== 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=seX/SDI/jMTwPP8d5rMNciSYOZJKlVgmv/OT9coCj5g=; fh=F05lZ9ixZ7an65FM4NYdRG6RFp77/iLPX/dR70Qbj0M=; b=BIH04nnl86gn28rEzdTej6oNzUPAev9riNdfVJbyJa8/lz+WXDpoO4cDj31WM+oF4n Jjg3y87IF/HTvEzfk1VYXn9IbjN9BQMAG0nEBD652fn95ljsXmnWdjfYW/j5ZbvONa/y tsdVKCZoUr6Ybh8SlsTHKJc9RQTnrcoNKIpeHGMen684cb7S/tY7dq8fHl0zr4+LY7nF Lcr9nsZNRao+VXM0aPdLHTIabPTNLAckTs+pOSQUkvnB1/AqhQshEgZMEkFYs/vHAEqc 5PCxvxyq8c0RDxZrC9U5rqoCtNdfAq9N/Q9LHJNHSRpsPpZ39abFd09W4fI7lX6Rrj70 RcOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VtPuj32a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id p8-20020a17090ab90800b00285b8673bb8si3157149pjr.101.2023.12.04.07.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 07:38:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VtPuj32a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8829080BE7E7; Mon, 4 Dec 2023 07:38:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232627AbjLDPiM (ORCPT + 99 others); Mon, 4 Dec 2023 10:38:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjLDPiL (ORCPT ); Mon, 4 Dec 2023 10:38:11 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C981FC0 for ; Mon, 4 Dec 2023 07:38:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701704296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=seX/SDI/jMTwPP8d5rMNciSYOZJKlVgmv/OT9coCj5g=; b=VtPuj32avMUCXSv9s3xCshzDc4hjUeAKOutK8XbSLdsbBmN23Ba85vCwEpqTra8ykvn0Pn Qx4XyoT9nnwgTCh5YW/ahwouQACs8cKSyCZVtGnO2bk2AC4y8BqL9AXolIQuYedtmwS07M 0zr8VCkEqJcAd0Kf2TWA9UrsNakDDFw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-9-BwYS5IDnOmyxJYurhDYIqw-1; Mon, 04 Dec 2023 10:38:10 -0500 X-MC-Unique: BwYS5IDnOmyxJYurhDYIqw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C350811E88; Mon, 4 Dec 2023 15:38:09 +0000 (UTC) Received: from localhost (unknown [10.72.113.121]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B081E1C060AE; Mon, 4 Dec 2023 15:38:08 +0000 (UTC) Date: Mon, 4 Dec 2023 23:38:05 +0800 From: Baoquan He To: Conor Dooley Cc: 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: References: <20231130023955.5257-1-bhe@redhat.com> <20231130023955.5257-6-bhe@redhat.com> <20231201-blog-blasphemy-985d2665903c@wendy> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231201-blog-blasphemy-985d2665903c@wendy> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 07:38:26 -0800 (PST) On 12/01/23 at 10:38am, Conor Dooley wrote: > On Thu, Nov 30, 2023 at 10:39:53AM +0800, Baoquan He wrote: > > $subject has a typo in the arch bit :) Indeed, will fix if need report. Thanks for careful checking. > > > Replace pr_debug() with the newly added kexec_dprintk() in kexec_file > > loading related codes. > > 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? 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. > > > > > And also remove kexec_image_info() because the content has been printed > > out in generic code. > > > > 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(-) > > > > diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.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 = image->start; > > - pr_notice("The entry point of kernel at 0x%lx\n", image->start); > > > > /* Add the kernel binary to the image */ > > ret = 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 = kbuf.mem; > > image->elf_headers_sz = headers_sz; > > > > - pr_debug("Loaded elf core header at 0x%lx bufsz=0x%lx memsz=0x%lx\n", > > - image->elf_load_addr, kbuf.bufsz, kbuf.memsz); > > + kexec_dprintk("Loaded elf core header at 0x%lx bufsz=0x%lx memsz=0x%lx\n", > > + image->elf_load_addr, kbuf.bufsz, kbuf.memsz); > > > > /* Setup cmdline for kdump kernel case */ > > modified_cmdline = 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=%d\n", ret); > > goto out; > > } > > + kexec_dprintk("Loaded purgatory at 0x%lx\n", kbuf.mem); > > + > > ret = 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 = kbuf.mem; > > > - pr_notice("Loaded initrd at 0x%lx\n", initrd_pbase); > > + kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_pbase); > > This is not a pr_debug(). > > > } > > > > /* 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 = fdt; > > > - pr_notice("Loaded device tree at 0x%lx\n", kbuf.mem); > > + kexec_dprintk("Loaded device tree at 0x%lx\n", kbuf.mem); > > Neither is this. Why are they being moved from pr_notice()? You are right. 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(). 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; Thanks Baoquan