Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp876116rdh; Thu, 23 Nov 2023 23:17:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHk3m1hCc+/8ODFqvO2ix+/M7dO5fxquwez2R1vz4g0GV7jznHBPYqr0CPf5yR01uh1sfy X-Received: by 2002:a05:6a20:1388:b0:187:e1cc:8cfc with SMTP id hn8-20020a056a20138800b00187e1cc8cfcmr1780094pzc.35.1700810247556; Thu, 23 Nov 2023 23:17:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700810247; cv=none; d=google.com; s=arc-20160816; b=xsrhcamRjiIkJ/6K42A2Xlg3XE/dXRE7utJtM3cUmtWlcKfA+aAAlVtj9NfGFs21D1 Zs7M/vQdEJwHpqxryb5n3iPhlYYQH6KU34FqwwSFkseg/aWiTy1yLtcNy6YumoIiWSXy 5b5cZmsr3hjhRXZUntyx+VhD2GFvgv0xuyOrFmOOeaKuQLV8Ex8dg4dO+vqybkBJmHNX qwDaXWSLEZdZF2g3KJFWt2E7zgDBAx1nVL2HN0B8e8Z+si8hGjIZfV1cAELRsyQUZ/eR +42l3eqoWRxz1MhRDfApjujNxSC1ytFqEcyvVIq7Uq9IhN0UePBk766cQhIAXCFwSy6Q 38rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=q/lET/FSiKhZVVdTlL2ONNlhqKMC0zp/6Wub30Zfxr0=; fh=mHSDuc2j6YVvhUxAwWXHHa0qsa8zjxct0/3Q9QqHbqk=; b=xlmMsvv7yr+paphYpSzHUdxRZDxKNkc0BEIVFgaZFCE3/acOHwBfit7VBaI0Hh4+tp MvdB5UYIHzmRco8Val6naYDSM8OvzdOtSyWcD1f5xzu0tdu5NUl2eJhPnXQLhQatg+gs 0KBZ6MHGmZmIleui82p2HYtLHwYOqgrgE786y1pgaVI4h4STe+AXSaElFioNqE/BXHDd SkEjE5CRw0mtFl20sMqvJFkDCoa1y/WcvCHk1yPQA9+0/Dro8bIdC2c84gu9NxD0A+kw 5NApl9NHPEk/rO0jEPu378tISN1/L88hQeJvEBWxhGQJSq0B9yCKhbCIsVNmJKJzurAV 6P1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id f22-20020a056a00229600b006cb8ea1f1besi3085543pfe.65.2023.11.23.23.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:17:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3BBCD805A891; Thu, 23 Nov 2023 23:17:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229518AbjKXHRH convert rfc822-to-8bit (ORCPT + 99 others); Fri, 24 Nov 2023 02:17:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjKXHRG (ORCPT ); Fri, 24 Nov 2023 02:17:06 -0500 Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2258BD5E; Thu, 23 Nov 2023 23:16:52 -0800 (PST) Received: from omf01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6CC5C409CB; Fri, 24 Nov 2023 07:16:50 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA id 8CAE160009; Fri, 24 Nov 2023 07:16:47 +0000 (UTC) Message-ID: <971ed2ceaeeba882d2b4c39015ee5ae5db3f5e82.camel@perches.com> Subject: Re: [PATCH v2 2/7] kexec_file: print out debugging message if required From: Joe Perches To: Baoquan He , linux-kernel@vger.kernel.org Cc: 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, nathan@kernel.org, yujie.liu@intel.com Date: Thu, 23 Nov 2023 23:16:46 -0800 In-Reply-To: <20231124033642.520686-3-bhe@redhat.com> References: <20231124033642.520686-1-bhe@redhat.com> <20231124033642.520686-3-bhe@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Rspamd-Queue-Id: 8CAE160009 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Stat-Signature: r4oqtahenar8h64oxpqpoeo1n6zbhmda X-Rspamd-Server: rspamout08 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19c0OHTlDrKhb/Xt6M9rvhAh1ufC3tVTnk= X-HE-Tag: 1700810207-170549 X-HE-Meta: U2FsdGVkX1+zlhNkZ9x3SOlShl6+X96epMaKjfHehHKyBsMtcvgR7F6Ii1tgURKZMXTJ4v77gzWxOCKJjrZ32dyx27aEd7KJtn+JaKan9d1JoOg5vx5spjNriOlsrJsAsKTNWoXgbsaaF0Aw9htJa6iNVZZnaP/omO8ddnk/a1hUgTJ/UY7dIv6hTgWYnyt0dTxqhxdXpQIY0i9zYhv989Np0jXyZefmSBvNLtvm6dtRPbiigZYQ2nQLsoXdSGX2/vxVXndB66Niab3Fp1e04lrREsrM7se2cR96ydP7F6f9OXdC0ttkSA5n1SXD5cD7 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 23 Nov 2023 23:17:25 -0800 (PST) On Fri, 2023-11-24 at 11:36 +0800, Baoquan He wrote: > Replace pr_debug() with the newly added kexec_dprintk() in kexec_file > loading related codes. trivia for pr_debug -> kexec_dprintk conversions for the entire patch set: > diff --git a/kernel/crash_core.c b/kernel/crash_core.c [] > @@ -551,9 +551,12 @@ int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map, > phdr->p_filesz = phdr->p_memsz = mend - mstart + 1; > phdr->p_align = 0; > ehdr->e_phnum++; > - pr_debug("Crash PT_LOAD ELF header. phdr=%p vaddr=0x%llx, paddr=0x%llx, sz=0x%llx e_phnum=%d p_offset=0x%llx\n", > +#ifdef CONFIG_KEXEC_FILE > + kexec_dprintk("Crash PT_LOAD ELF header. phdr=%p vaddr=0x%llx, paddr=0x%llx, " > + "sz=0x%llx e_phnum=%d p_offset=0x%llx\n", > phdr, phdr->p_vaddr, phdr->p_paddr, phdr->p_filesz, > ehdr->e_phnum, phdr->p_offset); It's good form to rewrap continuation lines to the open parenthesis > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c [] > @@ -389,11 +391,12 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd, > if (ret) > goto out; > > + kexec_dprintk("nr_segments = %lu\n", image->nr_segments); > for (i = 0; i < image->nr_segments; i++) { > struct kexec_segment *ksegment; > > ksegment = &image->segment[i]; > - pr_debug("Loading segment %d: buf=0x%p bufsz=0x%zx mem=0x%lx memsz=0x%zx\n", > + kexec_dprintk("segment[%d]: buf=0x%p bufsz=0x%zx mem=0x%lx memsz=0x%zx\n", > i, ksegment->buf, ksegment->bufsz, ksegment->mem, > ksegment->memsz); here too etc...