From patchwork Fri Nov 24 03:36:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 169163 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp876200vqx; Thu, 23 Nov 2023 19:38:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoW/0g2zyB/+s42Svz2y6Yv7XVaKvnMnYDZtjg1BpYSWoKw6opzCKjZL6CHo2AHUTJvKDU X-Received: by 2002:a05:6a20:6a11:b0:18b:a310:f7d6 with SMTP id p17-20020a056a206a1100b0018ba310f7d6mr1465921pzk.57.1700797103440; Thu, 23 Nov 2023 19:38:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700797103; cv=none; d=google.com; s=arc-20160816; b=NP/VdfnFbHlEAPO/Q6Y6K5Z/p2F7ezvH2L/E1BVdoPlubH1VfeS8QSAlS0IiEw8xZo ukEwaLC3qKQAThzTRsQKTTsWDSuMvV6ufy3R9zVcIB0sXsJh6r4iQntnikhOW1OPyGl5 nD+Hgn0rglPrIwyFodhBd7jFE4fDJt9GTzqopOwVffR8dXAFzkpKf8xg/Xt1avg7oKJv D079SfM0NM7s3UUXtzuMOPQSn8DX6NbLEWHm6Op+Ih/P/8GoEI/2GSBgN3ix35zCLnU/ EiIwhICzZROs/NNPdd1J5O8Q8QKgNoiPWV6XYHWOcXv9kdvxUG90oI07nwEY78/TQPNH xsfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ddYSvqzlkNogyoNHz/ZYeptUXFMRcqTi26tdLDKHB50=; fh=f9/4L5WTkyMs0HwKLVSZtc0UzQZDbbmz4se+5IAJiu4=; b=pyYh0zup6EARF/vJ9JsWmby1uh9zr+ACg3gAlY3+/v1pV95ENcmfwPVZAXLS+dV1ko v0xy1G34/6Ludow5Y+ya2blfv+bsPzGrb/A2gt8yQ4C5apEX3G5NlS69tRWrN1IQ2DHk 244p2DS/3qZEzujrd9dLYvvNlU0VIa0NPM4KEPlhUC33gDMMpuGwMn3ksqt5vpHBcpkk yJMrktHN2bm+FPWiEt4WwXTvmfxZjDy+1fhgt6kDwaikLzRD3lO4p+/d3auhww4Udl2R 1VxUIZ+BJlLE08WmCOJq/ErQpthqj3pMy/SKBL6aCnVknaEkOQ+2OIKnszqrNfalZe7B OeCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LNp5qHbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id a5-20020a170902ee8500b001c724f997ffsi2396011pld.131.2023.11.23.19.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 19:38:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LNp5qHbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 5EA8D82AE5C4; Thu, 23 Nov 2023 19:38:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjKXDiI (ORCPT + 99 others); Thu, 23 Nov 2023 22:38:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232910AbjKXDhv (ORCPT ); Thu, 23 Nov 2023 22:37:51 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C383170B for ; Thu, 23 Nov 2023 19:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700797075; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ddYSvqzlkNogyoNHz/ZYeptUXFMRcqTi26tdLDKHB50=; b=LNp5qHbIj+lwVWW0OwznynPPGb77GrSNXxXcT4EVCByxeisS8XsxCmckLp13CjjkpxKsUx P/t7PF00MxYYvXbXo1aL6mILUWGVwjq4j2pZA2mJ9atHL9ZBVLqeX4v2VLzzuAI/RM/ptV tRnjp8YevK5HpupAys+BCC9WDRes070= 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-50-8nebnkVBMhyBq-CpvVeZag-1; Thu, 23 Nov 2023 22:37:21 -0500 X-MC-Unique: 8nebnkVBMhyBq-CpvVeZag-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 8D23F185A782; Fri, 24 Nov 2023 03:37:20 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19020492BE7; Fri, 24 Nov 2023 03:37:15 +0000 (UTC) From: Baoquan He To: 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, joe@perches.com, nathan@kernel.org, yujie.liu@intel.com, Baoquan He Subject: [PATCH v2 6/7] kexec_file, power: print out debugging message if required Date: Fri, 24 Nov 2023 11:36:41 +0800 Message-ID: <20231124033642.520686-7-bhe@redhat.com> In-Reply-To: <20231124033642.520686-1-bhe@redhat.com> References: <20231124033642.520686-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 19:38:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783415023719249407 X-GMAIL-MSGID: 1783415023719249407 Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. Signed-off-by: Baoquan He --- arch/powerpc/kexec/elf_64.c | 8 ++++---- arch/powerpc/kexec/file_load_64.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kexec/elf_64.c b/arch/powerpc/kexec/elf_64.c index eeb258002d1e..904016cf89ea 100644 --- a/arch/powerpc/kexec/elf_64.c +++ b/arch/powerpc/kexec/elf_64.c @@ -59,7 +59,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, if (ret) goto out; - pr_debug("Loaded the kernel at 0x%lx\n", kernel_load_addr); + kexec_dprintk("Loaded the kernel at 0x%lx\n", kernel_load_addr); ret = kexec_load_purgatory(image, &pbuf); if (ret) { @@ -67,7 +67,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, goto out; } - pr_debug("Loaded purgatory at 0x%lx\n", pbuf.mem); + kexec_dprintk("Loaded purgatory at 0x%lx\n", pbuf.mem); /* Load additional segments needed for panic kernel */ if (image->type == KEXEC_TYPE_CRASH) { @@ -99,7 +99,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, goto out; initrd_load_addr = kbuf.mem; - pr_debug("Loaded initrd at 0x%lx\n", initrd_load_addr); + kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_load_addr); } fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr, @@ -132,7 +132,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, fdt_load_addr = kbuf.mem; - pr_debug("Loaded device tree at 0x%lx\n", fdt_load_addr); + kexec_dprintk("Loaded device tree at 0x%lx\n", fdt_load_addr); slave_code = elf_info.buffer + elf_info.proghdrs[0].p_offset; ret = setup_purgatory_ppc64(image, slave_code, fdt, kernel_load_addr, diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c index 961a6dd67365..45089f53f875 100644 --- a/arch/powerpc/kexec/file_load_64.c +++ b/arch/powerpc/kexec/file_load_64.c @@ -577,7 +577,7 @@ static int add_usable_mem_property(void *fdt, struct device_node *dn, NODE_PATH_LEN, dn); return -EOVERFLOW; } - pr_debug("Memory node path: %s\n", path); + kexec_dprintk("Memory node path: %s\n", path); /* Now that we know the path, find its offset in kdump kernel's fdt */ node = fdt_path_offset(fdt, path); @@ -590,8 +590,8 @@ static int add_usable_mem_property(void *fdt, struct device_node *dn, /* Get the address & size cells */ n_mem_addr_cells = of_n_addr_cells(dn); n_mem_size_cells = of_n_size_cells(dn); - pr_debug("address cells: %d, size cells: %d\n", n_mem_addr_cells, - n_mem_size_cells); + kexec_dprintk("address cells: %d, size cells: %d\n", n_mem_addr_cells, + n_mem_size_cells); um_info->idx = 0; if (!check_realloc_usable_mem(um_info, 2)) { @@ -664,7 +664,7 @@ static int update_usable_mem_fdt(void *fdt, struct crash_mem *usable_mem) node = fdt_path_offset(fdt, "/ibm,dynamic-reconfiguration-memory"); if (node == -FDT_ERR_NOTFOUND) - pr_debug("No dynamic reconfiguration memory found\n"); + kexec_dprintk("No dynamic reconfiguration memory found\n"); else if (node < 0) { pr_err("Malformed device tree: error reading /ibm,dynamic-reconfiguration-memory.\n"); return -EINVAL; @@ -776,7 +776,7 @@ static void update_backup_region_phdr(struct kimage *image, Elf64_Ehdr *ehdr) for (i = 0; i < ehdr->e_phnum; i++) { if (phdr->p_paddr == BACKUP_SRC_START) { phdr->p_offset = image->arch.backup_start; - pr_debug("Backup region offset updated to 0x%lx\n", + kexec_dprintk("Backup region offset updated to 0x%lx\n", image->arch.backup_start); return; } @@ -850,7 +850,7 @@ int load_crashdump_segments_ppc64(struct kimage *image, pr_err("Failed to load backup segment\n"); return ret; } - pr_debug("Loaded the backup region at 0x%lx\n", kbuf->mem); + kexec_dprintk("Loaded the backup region at 0x%lx\n", kbuf->mem); /* Load elfcorehdr segment - to export crashing kernel's vmcore */ ret = load_elfcorehdr_segment(image, kbuf); @@ -858,7 +858,7 @@ int load_crashdump_segments_ppc64(struct kimage *image, pr_err("Failed to load elfcorehdr segment\n"); return ret; } - pr_debug("Loaded elf core header at 0x%lx, bufsz=0x%lx memsz=0x%lx\n", + kexec_dprintk("Loaded elf core header at 0x%lx, bufsz=0x%lx memsz=0x%lx\n", image->elf_load_addr, kbuf->bufsz, kbuf->memsz); return 0;