From patchwork Tue Jan 24 08:50:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 92292 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1613572qgi; Tue, 24 Jan 2017 00:54:40 -0800 (PST) X-Received: by 10.55.68.74 with SMTP id r71mr23299028qka.157.1485248080162; Tue, 24 Jan 2017 00:54:40 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id z59si12666562qtc.317.2017.01.24.00.54.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 00:54:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cVwsA-0001y7-Hw; Tue, 24 Jan 2017 08:54:38 +0000 Received: from mail-pf0-f175.google.com ([209.85.192.175]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVwp7-0000HR-IL for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2017 08:51:32 +0000 Received: by mail-pf0-f175.google.com with SMTP id e4so48670521pfg.1 for ; Tue, 24 Jan 2017 00:51:08 -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=iItLECIdcsb47NvzAUmuEPhkUz55+9UqLtX7wRmEARk=; b=Sl2y2Jm4+KWYh1p3SMlttA3vvNQyLPhGrE7v1B38J760RXKBXVcQ+HFKAwpsfPwx5Q Zur3/ndlS32CkDfDJTUFouZWhBVAWGbslFYHEOy4MBQ364L0v90cfb0JjYGE2Dw9FLeU wOC8bh76UGcMfFri7juTRqkRnxzMFU4KHRyfk= 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=iItLECIdcsb47NvzAUmuEPhkUz55+9UqLtX7wRmEARk=; b=feiW//g5WON33azbk7+XHRHc8H7Dyf4Lx7G24NSfxuq+BgjIGRnFamFsS/U7/jcXXi BHHWqZpYjddI6fEVa5t1aR1Z6d2OxStBVMfOVIzvotwxbhDfHV9suWvu0rAvCMa9jMFp 5klLQJoKLXW+k/f32D8ON5UbkIVSxTesPzkkCHKxUSqhq+vdCjSlDwXg6VRalwqFmbuu OT29a0uZ81hoj96p6pGkMziUp4217k71b7QYmJqi7Zso/LWXr24NPzbxwtC9imRU8DUO qEKusuCW0hFEubNgjC4h9367y7fITxX5RB0uvKbNNDSQB5LL9aPQ/QTIjWXHHMG2lZtJ fM2Q== X-Gm-Message-State: AIkVDXLJVtXxqFin+tmd67brHy0fMcegKJIEN8M7NBH1MdD+RPDhZAr8iLiHZGq5gw1wZMLE X-Received: by 10.98.210.3 with SMTP id c3mr36858788pfg.7.1485247808204; Tue, 24 Jan 2017 00:50:08 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id z70sm42706101pff.26.2017.01.24.00.50.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 00:50:07 -0800 (PST) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v30 07/11] arm64: kdump: add VMCOREINFO's for user-space tools Date: Tue, 24 Jan 2017 17:50:01 +0900 Message-Id: <20170124085004.3892-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170124084638.3770-1-takahiro.akashi@linaro.org> References: <20170124084638.3770-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170124_005129_839356_8E2A7A60 X-CRM114-Status: GOOD ( 10.88 ) X-Spam-Score: -3.9 (---) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-3.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.2 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.175 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.175 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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+patch=linaro.org@lists.infradead.org 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(+) -- 2.11.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index d56ea8c805a8..84c5761af336 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -275,3 +276,13 @@ void arch_kexec_unprotect_crashkres(void) flush_tlb_all(); } + +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); +}