From patchwork Tue Nov 14 15:32:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 165000 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a59:b0:164:83eb:24d7 with SMTP id 25csp2005018rwb; Tue, 14 Nov 2023 07:34:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWydNYNh7UwIWIlYPpsDt7sSi/MnZdB9WzU2WxFJwj01vbuOKuAqRuui/3BywUe9mP2jxv X-Received: by 2002:a05:6a20:8e26:b0:17b:9d92:7d0 with SMTP id y38-20020a056a208e2600b0017b9d9207d0mr11913481pzj.52.1699976080637; Tue, 14 Nov 2023 07:34:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699976080; cv=none; d=google.com; s=arc-20160816; b=mAQIGYoCxeoOTHmUfbUY8rP/X9/L9X/xT2MC03EyyZ16dcEA2/ZllEvFOFJZz0zgjM Wcmx0/SXgsOP6MVolFBgDtTQz9wTQQVYVSNRyvbzXwhslUC+33FFsR53WiknKptE70RG orT+ltz51gKfcLelOZK9rvXXmvDoUY8rvmNcA7VKg4N8T9dT1418ooiikH/jobWevCdY qD/rg3Pzh3se5PY0OpI/5UGqNtENlcBIrPvPj+3R99banFOGZ40oxJKV094jxbhy6zNP V2I+Pw+CUO3izeZiPdnTad1EXy7wuiyYGFDLZdR3ABeWLWQ5M0yad643jJdrY+DbDVJL br/Q== 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=Kb4+DII7/6KHxSjJBHtbYVb2dsfK5cLaIKA4IYKpJm4=; fh=Dzl3/7KOWujfoM5E1QGa6vmlFfKO2meWm3ktMyZ/hPo=; b=LtctwaDcTDAdtzJqSUGdfAa09RVp+8ppgz3yNOb8asiEEiluMhlEGrD9OArXb/eXrH YYiMdgfBm54rndICy6OXJ0xMocir5QMccNlsuFbAHVe7/P5lS0fKt3OvcxDlEcDxxg9e nLlXMHTqQK2qcgTIrsQtd/T44+oKbWhT4ZO30MRwBffixTcbbkUoc6FoOAdNPqZqK830 JLiXcqRhN8NxqkV6gjUYNswqC3SwnbfLv25jR3YBnF44YpQ2PAoMlgr5Fhi5eCRJhYh4 qGCDOVWlmmeGxMAS93BEYo66wWENF2A4T5NdagjB8P2dfG6nsYTHSb043z/ePoSXtnCG ob0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ieg8lfBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id u9-20020a632349000000b005a0737404a7si8352685pgm.258.2023.11.14.07.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 07:34:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ieg8lfBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 1B09B80BD3AA; Tue, 14 Nov 2023 07:34:38 -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 S233782AbjKNPdw (ORCPT + 29 others); Tue, 14 Nov 2023 10:33:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233732AbjKNPdp (ORCPT ); Tue, 14 Nov 2023 10:33:45 -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 87C2BD4D for ; Tue, 14 Nov 2023 07:33:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699976017; 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=Kb4+DII7/6KHxSjJBHtbYVb2dsfK5cLaIKA4IYKpJm4=; b=ieg8lfBtur3GUApza3tT2Rfl41dE3VhKBbpVBN5HfmzGQjqqWALhWrQPFEH9sTVKUvPf07 SBm2/NkA4GX5x4ZoQKgx6NKO8fxVasOAaoVKYFGRW8ou7yts56HMrIcctyCYo5KhETl7n6 SLC37G7HOHqUQV0CxgMmA4oqbvo7/gA= 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-341-olRfaV0IOx2JxEGyaN4nSw-1; Tue, 14 Nov 2023 10:33:30 -0500 X-MC-Unique: olRfaV0IOx2JxEGyaN4nSw-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 BC12310499B7; Tue, 14 Nov 2023 15:33:14 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EDAE1C060B0; Tue, 14 Nov 2023 15:33:11 +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, Baoquan He Subject: [PATCH 4/7] kexec_file, arm64: print out debugging message if required Date: Tue, 14 Nov 2023 23:32:50 +0800 Message-ID: <20231114153253.241262-5-bhe@redhat.com> In-Reply-To: <20231114153253.241262-1-bhe@redhat.com> References: <20231114153253.241262-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain 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 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]); Tue, 14 Nov 2023 07:34:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782554118901498466 X-GMAIL-MSGID: 1782554118901498466 Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. And also remove the kimage->segment[] printing because the generic code has done the printing. Signed-off-by: Baoquan He --- arch/arm64/kernel/kexec_image.c | 2 +- arch/arm64/kernel/machine_kexec.c | 24 ++++++------------------ arch/arm64/kernel/machine_kexec_file.c | 6 +++--- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c index 636be6715155..df71965178f5 100644 --- a/arch/arm64/kernel/kexec_image.c +++ b/arch/arm64/kernel/kexec_image.c @@ -122,7 +122,7 @@ static void *image_load(struct kimage *image, kernel_segment->memsz -= text_offset; image->start = kernel_segment->mem; - pr_debug("Loaded kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n", + kexec_dprintk("Loaded kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n", kernel_segment->mem, kbuf.bufsz, kernel_segment->memsz); diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 078910db77a4..efd4e03b95d3 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -34,24 +34,12 @@ static void _kexec_image_info(const char *func, int line, { unsigned long i; - pr_debug("%s:%d:\n", func, line); - pr_debug(" kexec kimage info:\n"); - pr_debug(" type: %d\n", kimage->type); - pr_debug(" start: %lx\n", kimage->start); - pr_debug(" head: %lx\n", kimage->head); - pr_debug(" nr_segments: %lu\n", kimage->nr_segments); - pr_debug(" dtb_mem: %pa\n", &kimage->arch.dtb_mem); - pr_debug(" kern_reloc: %pa\n", &kimage->arch.kern_reloc); - pr_debug(" el2_vectors: %pa\n", &kimage->arch.el2_vectors); - - for (i = 0; i < kimage->nr_segments; i++) { - pr_debug(" segment[%lu]: %016lx - %016lx, 0x%lx bytes, %lu pages\n", - i, - kimage->segment[i].mem, - kimage->segment[i].mem + kimage->segment[i].memsz, - kimage->segment[i].memsz, - kimage->segment[i].memsz / PAGE_SIZE); - } + kexec_dprintk("%s:%d:\n", func, line); + kexec_dprintk(" kexec kimage info:\n"); + kexec_dprintk(" type: %d\n", kimage->type); + kexec_dprintk(" head: %lx\n", kimage->head); + kexec_dprintk(" kern_reloc: %pa\n", &kimage->arch.kern_reloc); + kexec_dprintk(" el2_vectors: %pa\n", &kimage->arch.el2_vectors); } void machine_kexec_cleanup(struct kimage *kimage) diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c index a11a6e14ba89..9f82401d99f4 100644 --- a/arch/arm64/kernel/machine_kexec_file.c +++ b/arch/arm64/kernel/machine_kexec_file.c @@ -127,7 +127,7 @@ int load_other_segments(struct kimage *image, 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", + kexec_dprintk("Loaded elf core header at 0x%lx bufsz=0x%lx memsz=0x%lx\n", image->elf_load_addr, kbuf.bufsz, kbuf.memsz); } @@ -148,7 +148,7 @@ int load_other_segments(struct kimage *image, goto out_err; initrd_load_addr = kbuf.mem; - pr_debug("Loaded initrd at 0x%lx bufsz=0x%lx memsz=0x%lx\n", + kexec_dprintk("Loaded initrd at 0x%lx bufsz=0x%lx memsz=0x%lx\n", initrd_load_addr, kbuf.bufsz, kbuf.memsz); } @@ -179,7 +179,7 @@ int load_other_segments(struct kimage *image, image->arch.dtb = dtb; image->arch.dtb_mem = kbuf.mem; - pr_debug("Loaded dtb at 0x%lx bufsz=0x%lx memsz=0x%lx\n", + kexec_dprintk("Loaded dtb at 0x%lx bufsz=0x%lx memsz=0x%lx\n", kbuf.mem, kbuf.bufsz, kbuf.memsz); return 0;