From patchwork Wed Dec 28 04:36:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 9489969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5C6ED62AB0 for ; Wed, 28 Dec 2016 04:38:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FB2320144 for ; Wed, 28 Dec 2016 04:38:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FEE62094F; Wed, 28 Dec 2016 04:38:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A853520144 for ; Wed, 28 Dec 2016 04:38:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cM5zH-0006QA-OU; Wed, 28 Dec 2016 04:37:15 +0000 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cM5yc-0005xM-As for linux-arm-kernel@lists.infradead.org; Wed, 28 Dec 2016 04:36:36 +0000 Received: by mail-pf0-x22d.google.com with SMTP id d2so57162537pfd.0 for ; Tue, 27 Dec 2016 20:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bo8D/+0ALAIBcWIbvh4mzxcEnuJ/CqpSvJ6zvCaa10Y=; b=WebD+qDyUICSmAJrZvLuLxQ8/2rxb8fXaYdzAGZJ6abZbtO1EHwIodSk2xXQGXMR/+ bwlQV5qFLgURBroKFwBLIDsEz4p2ArWSW4dMo1i1XIiq7OGmGchAXHiALHBMUtM4SmSS +LBfKP9abVameNiXsf3eZrB6ORt/Be2i8BPm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bo8D/+0ALAIBcWIbvh4mzxcEnuJ/CqpSvJ6zvCaa10Y=; b=AqRXi7UvdtZlu3vzS44fpSdXUzoIwRYgHDpLVk4qd31qCYmHdNzBkLDvX2NwFklUhk 6a2iaGw87z0+KfkKJ2uYNTBqe/rHZ4mNYNZR8IL1YMTbvGIQanY9bHzTm5bxbik2af2v 6aVP/PmVXBHx/+Da3PLelKRxmoKC4BcPob8q2zdAIZAe3B5AMyVDmPd5uxII009YPXzn QhHlYB1LDv0VSarVXOmySVxRWbElVUl2FCgnV+4Pnha7Ku5gCBnRWcMUs9LWTgW+YMID Z7cMA1cytXqxRTLOdbyBfs4O21FBRY23UnSgQkk9SMoCJ41mFA8O6Qhlu2dcON5jMzEf maIA== X-Gm-Message-State: AIkVDXKrrAlEd3NN3xikVywokyG1/y45JHHKDjgM8eXacYRCR5Tpn2/QEyLA+TUGRC9TOT01 X-Received: by 10.84.218.11 with SMTP id q11mr73512349pli.138.1482899773324; Tue, 27 Dec 2016 20:36:13 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id a68sm93563750pgc.31.2016.12.27.20.36.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 20:36:12 -0800 (PST) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v29 5/9] arm64: kdump: add VMCOREINFO's for user-space tools Date: Wed, 28 Dec 2016 13:36:02 +0900 Message-Id: <20161228043605.27470-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161228043347.27358-1-takahiro.akashi@linaro.org> References: <20161228043347.27358-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161227_203634_656093_E897ADBA X-CRM114-Status: GOOD ( 10.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, geoff@infradead.org, kexec@lists.infradead.org, AKASHI Takahiro , james.morse@arm.com, bauerman@linux.vnet.ibm.com, dyoung@redhat.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In addition to common VMCOREINFO's defined in crash_save_vmcoreinfo_init(), we need to know, for crash utility, - kimage_voffset - PHYS_OFFSET to examine the contents of a dump file (/proc/vmcore) correctly due to the introduction of KASLR (CONFIG_RANDOMIZE_BASE) in v4.6. - VA_BITS is also required for makedumpfile command. arch_crash_save_vmcoreinfo() appends them to the dump file. More VMCOREINFO's may be added later. Signed-off-by: AKASHI Takahiro Reviewed-by: James Morse Acked-by: Catalin Marinas --- arch/arm64/kernel/machine_kexec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index c60346d33bb1..994fe0bc5cc0 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -17,6 +17,7 @@ #include #include +#include #include #include "cpu-reset.h" @@ -260,3 +261,13 @@ void machine_crash_shutdown(struct pt_regs *regs) pr_info("Starting crashdump kernel...\n"); } + +void arch_crash_save_vmcoreinfo(void) +{ + VMCOREINFO_NUMBER(VA_BITS); + /* Please note VMCOREINFO_NUMBER() uses "%d", not "%x" */ + vmcoreinfo_append_str("NUMBER(kimage_voffset)=0x%llx\n", + kimage_voffset); + vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n", + PHYS_OFFSET); +}