From patchwork Wed Sep 30 18:34:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11810035 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E252A112E for ; Wed, 30 Sep 2020 18:39:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E6FD2076B for ; Wed, 30 Sep 2020 18:39:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gZ0NdxqM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="uemZWrQD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E6FD2076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:MIME-Version:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EndN+BAPipMPqwyY2HlpYTsq+yZL49sktoaqQsQqe3I=; b=gZ0NdxqMiOkjAPHzRDflAvYbJ BfM56JjJs7uKbqlhy0O2bLqwEmX7Qg3FaOiL2hiTtSZM6tnbfExBtjB54Ev4WHFCpZbOWD5d9xK/s KJ+Aw6VlfgpGJQ/S4+rXx6HaHFE8ubNJP3iDl2AgY03fvqhArghJH40kynvSNp8y0WySfSkP/LyhA e/q2rTuCFT9XqrlqrkMYwDP6+Q75O74npQeI2YuQqdhkBxt+/pfK78UjXCR4hWn5KPGu1OCDbCf7f wXHvIb80521sHE4qrjLcbtJqadNSCl2cyKiXtAdlJRfHYlWZ171w9om4WI1rIxukeuiskenUaLXBf inOkgGgWQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNh0z-00040h-B6; Wed, 30 Sep 2020 18:39:45 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNh0h-0003t0-9x for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2020 18:39:30 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200930183925euoutp0232f9d15d2817df4b423e97e02a490d5d~5o7rcVHZh0171701717euoutp02p for ; Wed, 30 Sep 2020 18:39:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200930183925euoutp0232f9d15d2817df4b423e97e02a490d5d~5o7rcVHZh0171701717euoutp02p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1601491165; bh=VmU9hk7sPc2YuQEvFLqAo5Y66addDZ+CZ+WSSzVah+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uemZWrQDVzTIaOnLEwkajWVQktnlzBEFpX1IgFEVDsPIqiNjJUAis5oJ6WbNSLQmj eSnrA+Lnc8tXnwPvZJAKt2cDud3m3hMiakifKfnb4TowVwM6WZgzowzX9u0jKUFp6f 5fUUrUkro5jqGw83jjPaHTfBZ7q1r3EIhyj4XFEI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200930183925eucas1p1330ac8f4604e78248ee16f75f951b84e~5o7rJumvE1417114171eucas1p1R; Wed, 30 Sep 2020 18:39:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A8.10.06318.DD0D47F5; Wed, 30 Sep 2020 19:39:25 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200930183924eucas1p1eba72052e1723ce75e00cbadbe03b6fa~5o7qlcgEN0403504035eucas1p18; Wed, 30 Sep 2020 18:39:24 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200930183924eusmtrp2ca3ec9f629d8e5fbbb528bbff9b7990a~5o7qk0Aa93109431094eusmtrp2D; Wed, 30 Sep 2020 18:39:24 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-78-5f74d0ddeeb2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 84.F3.06017.CD0D47F5; Wed, 30 Sep 2020 19:39:24 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200930183924eusmtip201d1f06b3cbb8d76328fb13cf88a615e~5o7qcJD5P2698626986eusmtip2D; Wed, 30 Sep 2020 18:39:24 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Russell King , Masahiro Yamada , Nick Desaulniers , Thomas Gleixner , Enrico Weigelt , Kees Cook , Ingo Molnar , Ben Dooks , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro , kexec@lists.infradead.org, Dave Young Subject: [PATCH v3 3/4] arm: Add kexec_image_info Date: Wed, 30 Sep 2020 20:34:12 +0200 Message-Id: <20200930183413.17023-4-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200930183413.17023-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+3bOjsfp7LgiXzSLRhcSSrtQBzVJKThEQUEQCWYrD0t0yzaX GZZLIdM0Ny9pKiWVqavUps68LV2a2dK8ZYZaRmV5KykNLS85j5H//Z73e573Ah+JiYb4jmSg PJRVyCXBYkKAG55NvtrU2xLq75bQgtGP0gv5dFJBDY9Wa9U4/fZSJY9+eVVGV5rHefRbUx6i 9R87+XR7RRZBm1KrEf2wrteK/tDXxafvz7xA9KhmlkdPPZnE6WJ9KrabYto7WzEmU92KM9O6 rxiTrVcxel0swfR0VhHMt+ZmK6b4biSjGR0hmO/G1wRzrUSHmJ/6VQdtfQWeAWxw4FlW4ep1 XHAqf7IWC9HanTOnZfPUqNYmDlmTQG2H5Kf5RBwSkCIqD4H2TTPGiTEEHd39C+InAl3fH/Qv 8q4udp5FVC6Cynofjr8gaLjpYGGC8obEnOd8S3g51YfBYGoubhEYdQ/BbPow3+JaRm2BNE2R lYVxah3kabtxCwspD0iZjsO5aashJreMsLA15QltTXUE57GHxhuf5j1LKRd4EPVmnrE5f3Rp 5vzaQOWTUP7+6UKjPWCu/kFwvAwGG0qsOF4Js+W3eHGInONISE7awWXjERiyJhayHtDT/Juw eDBqIxRWuHJlbxi6Xs/nonbQNWLPrWAHSYY0jCsL4cplEedeCwWJVQsNHSFhMA9pkDhj0TEZ iw7I+D8rG2E65MCqlDIpq9wmZ8M2KyUypUou3XzytEyP5r6geaZh/DEyTp0wIYpEYluhRh7q L+JLzirDZSYEJCZeLvRpMh8TCQMk4edZxWl/hSqYVZqQE4mLHYTbbg/4iSipJJQNYtkQVvHv lUdaO6rRi/2NXeU1zw50fPay9tIVRa1ZssFnoElwznfXtI1b4RPV0juBE2U5F3cajw5u9T/v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5OonHCm1cbp/MuPV pFaWNBOTwFQGkd1b5Izyt8Vo+Ri4PQrawZImqaDEUpyRaKjFXFScCAC+VYu6EAMAAA== X-CMS-MailID: 20200930183924eucas1p1eba72052e1723ce75e00cbadbe03b6fa X-Msg-Generator: CA X-RootMTR: 20200930183924eucas1p1eba72052e1723ce75e00cbadbe03b6fa X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200930183924eucas1p1eba72052e1723ce75e00cbadbe03b6fa References: <20200601142754.26139-1-l.stelmach@samsung.com> <20200930183413.17023-1-l.stelmach@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200930_143927_510233_CD0E7CA9 X-CRM114-Status: GOOD ( 17.27 ) X-Spam-Score: -5.7 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.5 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Szyprowski , =?utf-8?q?=C5=81ukasz_Stelm?= =?utf-8?q?ach?= , Bartlomiej Zolnierkiewicz Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add kexec_image_info to print detailed information about a kexec image. Signed-off-by: Ɓukasz Stelmach --- arch/arm/kernel/machine_kexec.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index 5d84ad333f05..a0c229eec0b2 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c @@ -29,6 +29,32 @@ extern unsigned long kexec_boot_atags; static atomic_t waiting_for_crash_ipi; +/** + * kexec_image_info - For debugging output. + */ +#define kexec_image_info(_i) _kexec_image_info(__func__, __LINE__, _i) +static void _kexec_image_info(const char *func, int line, + const struct kimage *kimage) +{ + 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); + + for (i = 0; i < kimage->nr_segments; i++) { + pr_debug(" segment[%lu]: %08lx - %08lx, 0x%x 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); + } +} + /* * Provide a dummy crash_notes definition while crash dump arrives to arm. * This prevents breakage of crash_notes attribute in kernel/ksysfs.c. @@ -40,6 +66,8 @@ int machine_kexec_prepare(struct kimage *image) __be32 header; int i, err; + kexec_image_info(image); + image->arch.kernel_r2 = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;