Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp396597ybj; Sat, 21 Sep 2019 03:59:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4BSVBLVVYmTV4jW4dPIxmKP8VqXuzFxpIFuXis5mWT8v4/OU4kLtC0R8Xk13iIwkUXQWN X-Received: by 2002:aa7:d48f:: with SMTP id b15mr26773895edr.159.1569063594225; Sat, 21 Sep 2019 03:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569063594; cv=none; d=google.com; s=arc-20160816; b=txxpmE6IU4Wl5clZf4TOu2XfECgaH/+O8E0ZAlpAPu+xSUnfe6D/A9khtYIems37ji MNIN9H7pLXgd+B6lTslzZRa/E1pYFiVJ5Tj4uSCY2yrYTy9Vp86MZd/aLa0Usi0IV5jc JkPrAYU0SEidQvht32KJ4t7GblswcdcQKHt91iDDYFkmqhS6TWUQeJ3p38e7ooF3OEVP y5lhdHZy2szHJ6ydtAAaerc5i9tFfgrBuJiKL8ge5jDVh2OLOQlQ5QXR5XYYNRdYnoUI auP216H/T0hZss8R0G4nBiqyP65gYtQ1Wu0sG+Y+cBeYLbtqt+3muU7qPJqHdfv6JX+d 5khw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=k/UMaN4DUp9fV+hxjIotkCzz0/mmRemo+QyFjdEMcHA=; b=FBicBhSu7t7XC60JoONDX2w8f7QasFlt9+mkJl8NrkuB5g2h1+M4ddKBjL2JalX8Mb V+V6z6Wr+HkUKn8I+byTCzi9dY0X91clfPF97X+qsLayuyhVPVInWDUPCj5n8Di/SWxV NApPMwSH5N1TbL169Of/h0ue/QHnri7Z0rrKac+plbXkiPLb0zh5dRA1Rb3DFZOnPlwY wBaMEF4ofmr2pX7LaOI332pGMlENtEy5XHcBJrZj69FyjzdwLdzs7sURVpsvoo1vt8ep PtHTjPyRH4IwOCKYMFKI5dfHKgJCnztw8fnzAMfg/SX56qQ7e+cvGiPEr/+qVkZJ8Fdr GQ5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si2856223edv.182.2019.09.21.03.59.30; Sat, 21 Sep 2019 03:59:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437907AbfITJZ6 (ORCPT + 99 others); Fri, 20 Sep 2019 05:25:58 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55894 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2408505AbfITJZf (ORCPT ); Fri, 20 Sep 2019 05:25:35 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 94655D4E98180711ED44; Fri, 20 Sep 2019 17:25:34 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Fri, 20 Sep 2019 17:25:26 +0800 From: Jason Yan To: , , , , , , , , CC: , , , , , , , Jason Yan Subject: [PATCH v7 11/12] powerpc/fsl_booke/kaslr: export offset in VMCOREINFO ELF notes Date: Fri, 20 Sep 2019 17:45:45 +0800 Message-ID: <20190920094546.44948-12-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190920094546.44948-1-yanaijie@huawei.com> References: <20190920094546.44948-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Like all other architectures such as x86 or arm64, include KASLR offset in VMCOREINFO ELF notes to assist in debugging. After this, we can use crash --kaslr option to parse vmcore generated from a kaslr kernel. Note: The crash tool needs to support --kaslr too. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/kernel/machine_kexec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index c4ed328a7b96..078fe3d76feb 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -86,6 +86,7 @@ void arch_crash_save_vmcoreinfo(void) VMCOREINFO_STRUCT_SIZE(mmu_psize_def); VMCOREINFO_OFFSET(mmu_psize_def, shift); #endif + vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset()); } /* -- 2.17.2