From patchwork Tue Aug 9 01:56:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 9270063 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 2EB81607D6 for ; Tue, 9 Aug 2016 01:53:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E67C2656B for ; Tue, 9 Aug 2016 01:53:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12FE4281A7; Tue, 9 Aug 2016 01:53:58 +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 81EFA2656B for ; Tue, 9 Aug 2016 01:53:57 +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 1bWwDP-0004Zh-WD; Tue, 09 Aug 2016 01:52:24 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bWwCX-0003j2-7b for linux-arm-kernel@lists.infradead.org; Tue, 09 Aug 2016 01:51:36 +0000 Received: by mail-pa0-x232.google.com with SMTP id pp5so124710pac.3 for ; Mon, 08 Aug 2016 18:51:09 -0700 (PDT) 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=/FPfmAAJG7R9mCli4ZR8ayUGAdWaNX4oOp3vX9Zknv0=; b=UcUkmdGkevz8XWuIW83TEr2xpHajnPHEKDg+Yecqzhwh3rbxz0opKa/bk9MOBYq9u1 GIBYtpYT4yVw8f08YjTFb+sgJ3hPK6HhJ3b39OqG7rNxlERFMZ+IWM3QRkecDMz9kf7o 2FcQMmJ0v0b57FNUlaJwavZR9pevAA9bd6OuM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/FPfmAAJG7R9mCli4ZR8ayUGAdWaNX4oOp3vX9Zknv0=; b=lEdMXmgWfzH3fnr8ErLBho8pnXAyVZ/DS+SdKM0FXtDqavBYh2jcTgFg7uU0A42ARd YiAFpHDb5xNVYIq/zk7Q63hj6l7WhiKIGpmryt2o+TrmLKQjqPdHmYRc/orBQucNMzjT xqzThpsCOE+n1V+dNuj39bUPVj/rUEpc2GWlmttKMjmgbwkhXFGxy4cgv6w1FmOn7K7d ikWKB91ts5l86abXBSNnWdKhYuy8PinWfXXgYm54dgB3PZBGvuQwEvjYVm5utzFOdYQh zSPYW0H4kHUeo1SnmEirkSTfgCyRna/LFauD9dkyOdXdphS+dBtWBxxem7i0oLxnh5x8 1diQ== X-Gm-Message-State: AEkoousO+nLdlqkVQdqSgXatufUWdcafRs7vQO3Jih+nP30ewnCBUZeIi5waEDW74INw9/lY X-Received: by 10.66.139.227 with SMTP id rb3mr41393612pab.26.1470707468396; Mon, 08 Aug 2016 18:51:08 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id g24sm50991821pfk.56.2016.08.08.18.51.07 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 08 Aug 2016 18:51:07 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v24 6/9] arm64: kdump: add VMCOREINFO's for user-space coredump tools Date: Tue, 9 Aug 2016 10:56:13 +0900 Message-Id: <20160809015615.28527-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160809015615.28527-1-takahiro.akashi@linaro.org> References: <20160809015248.28414-2-takahiro.akashi@linaro.org> <20160809015615.28527-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160808_185129_687878_2FB65E6A X-CRM114-Status: GOOD ( 10.74 ) 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 For the current crash utility, we need to know, at least, - kimage_voffset - PHYS_OFFSET to handle the contents of core dump file (/proc/vmcore) correctly due to the introduction of KASLR (CONFIG_RANDOMIZE_BASE) in v4.6. This patch puts them as VMCOREINFO's into the file. - VA_BITS is also added for makedumpfile command. More VMCOREINFO's may be added later. Signed-off-by: AKASHI Takahiro --- 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 8ac9dba8..38b4411 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); +}