From patchwork Tue Feb 7 08:09: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: 9559417 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 82AC060434 for ; Tue, 7 Feb 2017 08:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7571A262F0 for ; Tue, 7 Feb 2017 08:29:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A41A2818B; Tue, 7 Feb 2017 08:29:31 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 796B3262F0 for ; Tue, 7 Feb 2017 08:29:30 +0000 (UTC) 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 1cb19Q-0000sb-Lk; Tue, 07 Feb 2017 08:29:24 +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 1cb0q2-0004la-9S for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2017 08:09:29 +0000 Received: by mail-pf0-f175.google.com with SMTP id 189so31317895pfu.3 for ; Tue, 07 Feb 2017 00:09:04 -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=hv+7HAtoFrkDvJb5oRzowO8tEkh5qOsNti78+NS50Ec=; b=JSfqCsC6gRYBXoJGltul4TkJfHMUDnt/2km30bIfjczevNcCMaZwdg0/JLitc0bBUB KfI8yFjpi+hCV7PchlkTl+9Nh1BU4cYRslsd562EzDDGCeed9xrwhobBOL+SoV3HZyGW fNA7n0Twb5z1ht7opV1ExVIFMPw8YA0NL7T0s= 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=hv+7HAtoFrkDvJb5oRzowO8tEkh5qOsNti78+NS50Ec=; b=tRiahzFaFeih825LKjXbTD6jdM9JrDE0HiTsXCAEEPyHOOfZWv7Hd37i2DT1CpDYBJ BLMSyBpxlsqhISv5gHzebbCAvJeYnIaNPtXLb6nJ3wqEBeyh2gDtVXz2cknJDPhBU6lb ILKkd3uMvFyUKkpmBja4JQ6KWbcy/Prggjt19ECIhC40HSQM9MxBaNWhlKr1R10eP/kz nLkywT9HClDVghyOj2/evDZOt3/tzu9hl2KXdA/JRS/1blPmLpPFj1ql605ZLlwFh1fo PbUknKYAuWV8U84a6Z65YQ3CRDv0GAFIJJ+k0BbPkZ2ITrVHhNngEwgKg+kI7YOq8wLi HYLw== X-Gm-Message-State: AIkVDXIIwUg/Ttpl0IR8ywONAfIDi1K94yvy/fjLfPaucUvuc53wYC9x9gbm1RRGEopHlzRw X-Received: by 10.99.174.4 with SMTP id q4mr18797670pgf.186.1486454883672; Tue, 07 Feb 2017 00:08:03 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id j192sm8501611pfc.60.2017.02.07.00.08.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 00:08:03 -0800 (PST) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v32 09/13] arm64: kdump: add VMCOREINFO's for user-space tools Date: Tue, 7 Feb 2017 17:09:01 +0900 Message-Id: <20170207080904.5974-7-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170207080601.5816-1-takahiro.akashi@linaro.org> References: <20170207080601.5816-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_000922_877578_0F51CF78 X-CRM114-Status: GOOD ( 10.65 ) 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+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 cd0cbb9a897d..79825e2844df 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -284,3 +285,13 @@ void arch_kexec_unprotect_crashkres(void) __phys_to_virt(crashk_res.start), resource_size(&crashk_res), PAGE_KERNEL, true); } + +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); +}