From patchwork Thu Apr 30 16:31:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11520931 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 CF67115AB for ; Thu, 30 Apr 2020 16:32:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 AA90C2082E for ; Thu, 30 Apr 2020 16:32:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="splpGj5x"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="fiRnfsbh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA90C2082E 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=bombadil.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=j7a6XG74JVQMLgRPn5VGYEtbdZDcUi6oM4f64sFSEUE=; b=splpGj5xWi28Ar jwB4G8s1OM1+ukO3UZ/J6rnOHc+XXq4izKfHJkpw9nua3x46rPxYBL9dV7Wo+GFtfJe8aN8wQsUXm yHz9BR6uCGjWy70arCX7pxxUnqboUP/gP/D3wPXEfsjzNzoYb9i0mZ3iqJBnIFMdue4JD/sncKPAp ugg7j1KSlej28ilaJBerP5Fq3/HuiWJfkh8kCyfDwt5foXFCjlEcVAIbKCXQsjDcc/Oj1fr2bFV28 fU2/FDdqSxtQiFmbc/l8Ld3otS/UyGElkQGopJnohWhhBzODsfaviqQnqDcQV/cjfg2ztaoY+HFRh jOcDOohU2Teeb5SvUuSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUC7H-0006y7-NY; Thu, 30 Apr 2020 16:32:51 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUC6m-0006Xp-0C for linux-arm-kernel@lists.infradead.org; Thu, 30 Apr 2020 16:32:21 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200430163218euoutp0268b77041903c72c744e887058c14149c~KpgA-dhTR3143631436euoutp023 for ; Thu, 30 Apr 2020 16:32:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200430163218euoutp0268b77041903c72c744e887058c14149c~KpgA-dhTR3143631436euoutp023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1588264338; bh=7QE3VHZ7MPCtYt13bWDgB4+62v21P5g7HbzKzNmuRs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fiRnfsbhvflbPEU3Y/0VHe1k11ThcpeuT1K7eAK0GAMqetMS5882tXLqC1cDnsFPs aKIGVVxUu5idQ7pq9rQJPlsaz1gknUANVW7DjU+EL41DE7BffViOxSKedeFuYiDoL5 BCOnf0VzDgGE3iv3sYPqPxP/hbg970Kng4hVwOVA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200430163218eucas1p27b766f65eec97aabce6a69a69fd47637~KpgAuUttp1131211312eucas1p2x; Thu, 30 Apr 2020 16:32:18 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 25.6A.60698.29DFAAE5; Thu, 30 Apr 2020 17:32:18 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200430163218eucas1p1e89bdacc1cb8f1819d72cd789e972648~KpgAc8rwl1989019890eucas1p16; Thu, 30 Apr 2020 16:32:18 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200430163218eusmtrp20c91cf7ccc4c38135b833571ced7e676~KpgAcUP3F1116911169eusmtrp2k; Thu, 30 Apr 2020 16:32:18 +0000 (GMT) X-AuditID: cbfec7f5-a29ff7000001ed1a-66-5eaafd923f45 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E1.BB.07950.19DFAAE5; Thu, 30 Apr 2020 17:32:17 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200430163217eusmtip28cd53c2abd3f287d82030a9d6a4357cb~KpgAP6wNa1765417654eusmtip2Y; Thu, 30 Apr 2020 16:32:17 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Catalin Marinas , Will Deacon , Mark Rutland , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] x86: kexec_file: print appropriate variable Date: Thu, 30 Apr 2020 18:31:42 +0200 Message-Id: <20200430163142.27282-3-l.stelmach@samsung.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200430163142.27282-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUhTYRTHee7brubsuiQPZkXDPii4NCOeMEqpDzcS6kv0Qmqzbiq+VLup GZlmL5aaykZvajZLm0zJmmWmNmNFmpLiqi3LqFhhRq/OaopZzmvkt985z//8z//Aw5KK97Q/ m5S2X9CkqVOUjCfV9HC0N0T72xgbWtbmjTvszTSu+tRFY+f1CQZ/vVqE8Nkbfvi12UDgfkst wiaHjcZPWioYXGPvI7D1np7A4+2jFG40nSGx7YWZwUPfOynsuu6gIzn+1/Fiiq+vrEe8yXiK 4QdsbQz/padHxr+xNFJ8Y3UO/9X8jOGLbxoR7zQt4DuPjdAbZ23zXLlLSEnKEDRLVu3wTNTn NRB7P3AHvjUUolxU6V2APFjglkHv41KmAHmyCq4WwYWKYZlUjCDoqWynpcKJQPdSNyljp0YG r4RKfQOCd7Z8JBWDCAyvtDK3L8NFQUlNJ+1mX66fgPP6SDeTnJaAWl2gm+dwa6CypJVxM8Ut hhHnRcLNci4CHKPjjJRvIZQf6Z5iD24l1NT1kZLGBx5deEe5eTYXDPV5dkryXwhHb5WT7kDA VbHgKr5NSqnXwlsdkjznwMeOmzKJA+DPnUuEJMkBnXa5NFqEoKnCRUmaCBjoGZs6nuSCoKFl idSOgoEvXdOj3vD8s4+UwBu0Teeml8rh5AmFpA6EayVt04b+cPpjLSpFyrIZt5TNyF/2f5ce kUbkJ6SLqQmCGJ4mZKpEdaqYnpag2rkn1YQmP1/3RMePZmQej7cgjkVKLzlrMsYqaHWGmJVq QcCSSl/525jJlnyXOuugoNkTp0lPEUQLmsdSSj95+OWhGAWXoN4vJAvCXkHz75VgPfxzkSw/ bzB7fajjRlFB/P35hqw3E5kPymMzsxVal8rqc7dwbEX+1u2+iwKHkk/4dpH808Pl98e2BOSu e7VbZTPoN8cZF3Vk80HhquKfm5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KckWioxVxUnAgABN726wsDAAA= X-CMS-MailID: 20200430163218eucas1p1e89bdacc1cb8f1819d72cd789e972648 X-Msg-Generator: CA X-RootMTR: 20200430163218eucas1p1e89bdacc1cb8f1819d72cd789e972648 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200430163218eucas1p1e89bdacc1cb8f1819d72cd789e972648 References: <20200430105034.17513-1-l.stelmach@samsung.com> <20200430163142.27282-1-l.stelmach@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200430_093220_185228_750C164D X-CRM114-Status: GOOD ( 15.23 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High 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: Bhupesh Sharma , =?utf-8?q?=C5=81ukasz_Stelmach?= , AKASHI Takahiro , James Morse , Thiago Jung Bauermann , Vivek Goyal Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The value of kbuf->memsz may be different than kbuf->bufsz after calling kexec_add_buffer(). Hence both values should be logged. Fixes: ec2b9bfaac44e ("kexec_file: Change kexec_add_buffer to take kexec_buf as argument.") Fixes: 27f48d3e633be ("kexec-bzImage64: support for loading bzImage using 64bit entry") Fixes: dd5f726076cc7 ("kexec: support for kexec on panic using new system call") Cc: Vivek Goyal Cc: Thiago Jung Bauermann Signed-off-by: Ɓukasz Stelmach --- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/kexec-bzimage64.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index fd87b59452a3..d408e5b536fa 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -420,7 +420,7 @@ int crash_load_segments(struct kimage *image) } image->arch.elf_load_addr = kbuf.mem; pr_debug("Loaded ELF headers at 0x%lx bufsz=0x%lx memsz=0x%lx\n", - image->arch.elf_load_addr, kbuf.bufsz, kbuf.bufsz); + image->arch.elf_load_addr, kbuf.bufsz, kbuf.memsz); return ret; } diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index db6578d45157..420393c58a73 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -434,7 +434,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, goto out_free_params; bootparam_load_addr = kbuf.mem; pr_debug("Loaded boot_param, command line and misc at 0x%lx bufsz=0x%lx memsz=0x%lx\n", - bootparam_load_addr, kbuf.bufsz, kbuf.bufsz); + bootparam_load_addr, kbuf.bufsz, kbuf.memsz); /* Load kernel */ kbuf.buffer = kernel + kern16_size; @@ -464,7 +464,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, initrd_load_addr = kbuf.mem; pr_debug("Loaded initrd at 0x%lx bufsz=0x%lx memsz=0x%lx\n", - initrd_load_addr, initrd_len, initrd_len); + initrd_load_addr, kbuf.bufsz, kbuf.memsz); setup_initrd(params, initrd_load_addr, initrd_len); }