From patchwork Mon Apr 3 02:24:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 9658733 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 0ACDF60353 for ; Mon, 3 Apr 2017 02:22:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0906271CB for ; Mon, 3 Apr 2017 02:22:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4D5427FAE; Mon, 3 Apr 2017 02:22:36 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham 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 A0F93271CB for ; Mon, 3 Apr 2017 02:22:36 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: 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=WTtUGjQ3RM3Ic6Y8o06MC+8lIjkZrTZ5v6OHWwuWIU0=; b=cxm8Ji04cVJwUf2XzzJEhpkcJG znmLMIf0ekm2mxElRFQ81Og9/N6w10vCOcQ6fT0Nqdkt69eBDN7F52XrS0iiGaL+UPA5XVVeBOsHR DJdyFA01VZ+sdIC0KiyD84A6iM5+NNBATH7M+ist61ZEYDX6FTEU04wgf2g/Pi1h11xTfMBglpF0g WgnOL10swA+RBjkUu79HlQmWhCfohTp5QcjJ27R/KgZ8vsvIrUkF4zB+KTsFnovxz9YVtl1x8q4uD t4yqEw0E+83qW9CKbkgrTHJYu3gZN1lvqEheCdMSkQYCao88tFdQI5VGBv3cVESrhUXajY4xPzKTz Hgm1zFMA==; 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 1curdb-0005Gm-AX; Mon, 03 Apr 2017 02:22:35 +0000 Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1curdM-0004sp-00 for linux-arm-kernel@lists.infradead.org; Mon, 03 Apr 2017 02:22:24 +0000 Received: by mail-pg0-x22d.google.com with SMTP id x125so105482959pgb.0 for ; Sun, 02 Apr 2017 19:21:59 -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=pagVYWtcqq19KmUSADe1Hud4VfLLBHrRqQ4GZoc0AiE=; b=XxREzI016y2tKTdhPeM5epKrOJPuL5NZ1iemUGPVmc3q37XWr39NWYQLOQNGzpm7pV CHRxTQU2OpZrcdXeoUM5vIJAaAcyyCykQYG18ofdHHPelX0aaI+uKka/KbujgBe21MON rUQmsS1ERxqy9xD3ueW+KuIhkMlBsX0A34HYw= 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=pagVYWtcqq19KmUSADe1Hud4VfLLBHrRqQ4GZoc0AiE=; b=YV255k7/ME1yhuFKPabYCe5xyspOgi7oT1HJYIA98GPDm2aexash9aPEsrXZ4AhmRy a4rzrhdMCEQnOTi+i/ADYo0FBZWJrCJOFtBSspYm5KIqf5x1+2UIsarfj7thrPIGhEqp clfPqrMdT/LkRCBL8hFP6tCNWngf+7JJhnyoE75niG60GkQRFjOmq/HUhv5CFZIaABvq aChwFQp11w+bkORG5E2jcwrSYubOYbHAxHWbmJJEaMlj1+mmhFtNMQiXuNj7uaFnp+Ze YmIxnwuzlkem/hb9DvNwojHD6HBhOJBK4/aF7skTL/At6wCa5y5SNaWlr4YtYRpcu6ut zfXQ== X-Gm-Message-State: AFeK/H3md2W+Wasb33H6oifhtjW+cwN+E+o4AjvfHp1XWIAMsMvD+1WLBsw2lXt+Z8fG97jA X-Received: by 10.84.130.2 with SMTP id 2mr18426219plc.24.1491186119179; Sun, 02 Apr 2017 19:21:59 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id d63sm22089818pfg.132.2017.04.02.19.21.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Apr 2017 19:21:58 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v35 09/14] arm64: kdump: add VMCOREINFO's for user-space tools Date: Mon, 3 Apr 2017 11:24:37 +0900 Message-Id: <20170403022440.12515-7-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170403022139.12383-1-takahiro.akashi@linaro.org> References: <20170403022139.12383-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170402_192220_176410_FACB1ACA X-CRM114-Status: GOOD ( 10.82 ) 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, panand@redhat.com, ard.biesheuvel@linaro.org, geoff@infradead.org, dwmw2@infradead.org, kexec@lists.infradead.org, AKASHI Takahiro , james.morse@arm.com, bauerman@linux.vnet.ibm.com, sgoel@codeaurora.org, 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 779a80046066..481f54a866c5 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -351,3 +352,13 @@ void crash_free_reserved_phys_range(unsigned long begin, unsigned long end) } } #endif /* CONFIG_HIBERNATION */ + +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); +}