Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp936046rdb; Fri, 1 Dec 2023 02:39:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvDv2taxDZmR339foP9VjyYr0C+IYrTP7hSdtfpkGtLqd/C6orVTF/4TN1BwMgWYYybsPO X-Received: by 2002:a05:6830:314d:b0:6d6:4e53:c81a with SMTP id c13-20020a056830314d00b006d64e53c81amr2648152ots.29.1701427165960; Fri, 01 Dec 2023 02:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701427165; cv=none; d=google.com; s=arc-20160816; b=E7tQ+GgVff+6pfB6ZevjiNETextw8oJzK50FDZPIsfnAEAtspdI+y1O4lnWNQuP2c0 uhvCNFGMIR0GuHr6QaT8kBT28S6pzVy+9++GBihDdrwk6nXowL1BZSeKPPEVBteWqDSS mWhlnApICw10cXsCVR9gn/W1JktgspnLbVZ5MQg/E8/EnyaCiTRLCzd2zOfz550VKo6c 0+qi9+bYsAbLVLoWB5QxKZh0e9en6i05ZZCx9VLWn0gD9qYK+NMZhNtZSzkB4TxWksWy 8PnEFae5Mmt9T+/ssRdeFKOEHhJpfufER/X+LkDmoiDp975mcZdCkr7JXgy7/exRUL40 Oceg== 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=lrsihHd+mQt6snVSgdbYrqB8HAsrSWNFWYbGu6Y9tVk=; fh=zAChUWkDYqbnjR8aVIWVEm1uO4fZBem8VR82gW747+k=; b=mFmN0MY1pk1Z4cK/mtNogDa2wjN3t5XC2S4Hdp36b2DTeoSTWX4M/rW23/NVZ+/mdP iVzrEQtwBYjVMcPSIunu+OV7lW1C2PTZeUi3bjjEaFHC4giiyVyei6rhh9pxwldGdE7a 4L5ZqrgQ6/BfM0T1AaYPzJg165ofAVxLh5p8heyhY0zy9S1ieleIu+Km4MpdodXzTTiZ SDf3G33JDWAwzqtEl6j83w6Ew7J35KnriZP6HnCD9R1bHVG9RELBQC05cOJVSRwgcf8J /6SxBepqniDdkv3DdKFgdZFRB056oQdIkJV8qGz0+QfD5feFnVX6DHeodt16CdgUlbY6 CQTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="lY0s/ikL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u11-20020a6540cb000000b005c278ba0fe3si3108685pgp.556.2023.12.01.02.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 02:39:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="lY0s/ikL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 599EE8266250; Fri, 1 Dec 2023 02:39:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378322AbjLAKjH (ORCPT + 99 others); Fri, 1 Dec 2023 05:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378300AbjLAKjF (ORCPT ); Fri, 1 Dec 2023 05:39:05 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D88A10FC; Fri, 1 Dec 2023 02:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1701427151; x=1732963151; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=kND13bhhr35acgxOCU8wE4eGgbORidUOksqg08kH6S0=; b=lY0s/ikLC2f2srTDuKkZMdD98ImPLGy6eFz1k23zCxqdpj0EfKy9WrQg 3++opUka+Bm7LSxMlmVoCD0Ei0sdbxcjNxTll7Z9t7ZyP2BvxFbu+pzOw 64bc2rRuTBXno3NBiVsSS2DUDp/BnZC3PuQdgcvc6ujOW9krclZlu7nFK 1PcI44WdNvtVUqDdxv8BM2Pjff84LTpknXTCYnjk1xIUcQLYoT1xYwSgf 8mxFozj6K4opRXBJ9NOSjVpf+OL7eqebP46a0J2jwEpCfTc8ZMP2Tp6ko CcM/AQUj4cM8xbdnE6NkVT3XjUvkViIkkyv708WEUHT3xTMnJkrYnxJtu w==; X-CSE-ConnectionGUID: 7PeIiSJ3S3Sf51tB+gQejg== X-CSE-MsgGUID: 5laFXParRc6ZcUs/oGnMUw== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.04,241,1695711600"; d="asc'?scan'208";a="13412417" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Dec 2023 03:39:10 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 1 Dec 2023 03:38:44 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 1 Dec 2023 03:38:42 -0700 Date: Fri, 1 Dec 2023 10:38:13 +0000 From: Conor Dooley To: Baoquan He CC: , , , , , , , , , Subject: Re: [PATCH v3 5/7] kexec_file, ricv: print out debugging message if required Message-ID: <20231201-blog-blasphemy-985d2665903c@wendy> References: <20231130023955.5257-1-bhe@redhat.com> <20231130023955.5257-6-bhe@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wYVOP/ERUSSrsdpK" Content-Disposition: inline In-Reply-To: <20231130023955.5257-6-bhe@redhat.com> 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 01 Dec 2023 02:39:22 -0800 (PST) --wYVOP/ERUSSrsdpK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 30, 2023 at 10:39:53AM +0800, Baoquan He wrote: $subject has a typo in the arch bit :) > 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? >=20 > And also remove kexec_image_info() because the content has been printed > 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_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, cha= r *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, cha= r *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=3D0= x%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, cha= r *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, cha= r *kernel_buf, > if (ret) > goto out; > initrd_pbase =3D 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(). > } > =20 > /* Add the DTB to the image */ > @@ -318,7 +319,7 @@ static void *elf_kexec_load(struct kimage *image, cha= r *kernel_buf, > } > /* Cache the fdt buffer address for memory cleanup */ > image->arch.fdt =3D 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()? Thanks, Conor. > goto out; > =20 > out_free_fdt: > diff --git a/arch/riscv/kernel/machine_kexec.c b/arch/riscv/kernel/machin= e_kexec.c > index 2d139b724bc8..ed9cad20c039 100644 > --- a/arch/riscv/kernel/machine_kexec.c > +++ b/arch/riscv/kernel/machine_kexec.c > @@ -18,30 +18,6 @@ > #include > #include > =20 > -/* > - * kexec_image_info - Print received image details > - */ > -static void > -kexec_image_info(const struct kimage *image) > -{ > - unsigned long i; > - > - pr_debug("Kexec image info:\n"); > - pr_debug("\ttype: %d\n", image->type); > - pr_debug("\tstart: %lx\n", image->start); > - pr_debug("\thead: %lx\n", image->head); > - pr_debug("\tnr_segments: %lu\n", image->nr_segments); > - > - for (i =3D 0; i < image->nr_segments; i++) { > - pr_debug("\t segment[%lu]: %016lx - %016lx", i, > - image->segment[i].mem, > - image->segment[i].mem + image->segment[i].memsz); > - pr_debug("\t\t0x%lx bytes, %lu pages\n", > - (unsigned long) image->segment[i].memsz, > - (unsigned long) image->segment[i].memsz / PAGE_SIZE); > - } > -} > - > /* > * machine_kexec_prepare - Initialize kexec > * > @@ -60,8 +36,6 @@ machine_kexec_prepare(struct kimage *image) > unsigned int control_code_buffer_sz =3D 0; > int i =3D 0; > =20 > - kexec_image_info(image); > - > /* Find the Flattened Device Tree and save its physical address */ > for (i =3D 0; i < image->nr_segments; i++) { > if (image->segment[i].memsz <=3D sizeof(fdt)) > --=20 > 2.41.0 >=20 --wYVOP/ERUSSrsdpK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZWm3lQAKCRB4tDGHoIJi 0nX0AQCpYcMDvEZkiURX4HuWR6f07qzIgnGA3t5YUQXybVgkdgEA8aFCzMsJ+OAw e4Eamn2O6nkQzVIqTW2OfkCeXoYouAk= =MSGD -----END PGP SIGNATURE----- --wYVOP/ERUSSrsdpK--