Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4919042imm; Tue, 31 Jul 2018 02:20:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe2Ph9qtcJJWbFvBICH98v7dvh9rT8/dfJ52D7S2nwfTzvBUY3Th6jx7TrJ0T+y5jqHmxVE X-Received: by 2002:a63:1063:: with SMTP id 35-v6mr19748106pgq.249.1533028839130; Tue, 31 Jul 2018 02:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533028839; cv=none; d=google.com; s=arc-20160816; b=eXhht5tlOZbnf1UhhqSjipaT7hvoxpnKGaV8iRuWWlA9/4/Jy5QSQrwK4j/PYa7ioD 4yuFQv4wChbNccTKielXA3giCm1vsF/temJCfOTWMi2E6iDUm8MEkeVxKfVMkWNNrDhk csUxlyu7XRwduXBwt42n/bmeRMUc7QPBZ0XYzEUdfwkBBSEHnpSto5qTGLZONLsd6B24 g020xzZVyhPE0IEgj0qvSWa6CAERzT0CZdt0JIbEeJjdkrzsz7qRtrNRl2+lpic0cMIR NPWAMESb+qkHX/b/JXGNVedHzdeb+mTf9F0ZX+ggKn6WtzuH9tuilr8IYaLUKkmMKdNw Yb8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=+zsQW2DXSr1xtcFzMSWBtrrZ/EQQnRuN1DiixQluJJQ=; b=YBarU91K7nFVT5GHv8hYHE51ciJMDZk5Wb00C8Lr1ITS5tHQa7brEfvT4gM5eidMtY Ue/Y/M1hTLXoddiY0ZIvLHHvz+gqLZRIyed/eQksVhIRiOhXv+yOGaWmZ01/iDMIBCcT JNPHFcy5YwS9odpQ4ou25K/VeJkltdl7xjHUnM78ZhWU54/H+tN2ljXRhRDRLTEeBVYR g1WsX4PkfAo3tMlbURqiqAaaGzf1N00EXABJmzwCGaFVo7BA4nmXb22kOLuDByPY63dh O2eesAvB7I0h3m8DKFQ0khkYWnQeU7aa16quCo5EGTJtG+/1Lo4h81AdcrghhKRCXy5D WNSg== 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 c197-v6si13906755pfc.74.2018.07.31.02.20.24; Tue, 31 Jul 2018 02:20:39 -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 S1729982AbeGaK7B (ORCPT + 99 others); Tue, 31 Jul 2018 06:59:01 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50530 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729485AbeGaK7B (ORCPT ); Tue, 31 Jul 2018 06:59:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 658AA7A9; Tue, 31 Jul 2018 02:19:38 -0700 (PDT) Received: from [10.4.12.81] (melchizedek.emea.arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B97233F5BA; Tue, 31 Jul 2018 02:19:36 -0700 (PDT) Subject: Re: [PATCH v2] arm64, kaslr: export offset in VMCOREINFO ELF notes To: Bhupesh Sharma Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, bhupesh.linux@gmail.com, takahiro.akashi@linaro.org, catalin.marinas@arm.com, Ard Biesheuvel , Will Deacon , Mark Rutland References: <1532931883-16132-1-git-send-email-bhsharma@redhat.com> From: James Morse Message-ID: <303e32f7-ff47-ea9b-d5a0-45a22e44d0a9@arm.com> Date: Tue, 31 Jul 2018 10:19:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1532931883-16132-1-git-send-email-bhsharma@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bhupesh, On 30/07/18 07:24, Bhupesh Sharma wrote: > Include KASLR offset in arm64 VMCOREINFO ELF notes to assist in > debugging. vmcore parsing in user-space already expects this value in > the notes and we are providing it for portability of those existing > tools with x86. > > Ideally we would like core code to do this (so that way this > information won't be missed when an architecture adds KASLR support), > but mips has CONFIG_RANDOMIZE_BASE, and doesn't provide kaslr_offset(), > so I am not sure if this is needed for mips (and other such similar arch > cases in future). So, lets keep this architecture specific for now. (heh, I assumed you would rewrite my train-of-thought, but I guess this works!) > As an example of a user-space use-case, consider the > makedumpfile user-space utility which will need fixup to use this > KASLR offset to work with cases where we need to find a way to > translate symbol address from vmlinux to kernel run time address > in case of KASLR boot on arm64. Acked-by: James Morse If we want to send this to stable, it looks like it should have been part of the KASLR series, f80fb3a3d5084 ("arm64: add support for kernel ASLR") was merged for v4.6. CC: # 4.6.x Thanks, James > diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c > index f62effc6e064..028df356a5fd 100644 > --- a/arch/arm64/kernel/machine_kexec.c > +++ b/arch/arm64/kernel/machine_kexec.c > @@ -360,4 +360,5 @@ void arch_crash_save_vmcoreinfo(void) > kimage_voffset); > vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n", > PHYS_OFFSET); > + vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset()); > } >