Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1585443imm; Thu, 19 Jul 2018 04:32:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfjAhcBn+7Pv30NzUf6JxNKlk/Vd4UfjC35/m8UATwqfVOEhwnOb1yOz20DyoXw6nZ3f7Kr X-Received: by 2002:a17:902:7b87:: with SMTP id w7-v6mr9821272pll.142.1531999933092; Thu, 19 Jul 2018 04:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531999933; cv=none; d=google.com; s=arc-20160816; b=o408GpIgnLlAaaXNUToTQPVvK7JtwMZYvmORXW9VUrbTKpFbQGDkMn/7V3pueiDhYj 08qAK2cEcV/p3Yvj3/QNwRd8ESKKPKE2i6aqknxZe0RrUi5otN3uIYeC5QubAayFmRbx +NUCam/ZZZHq+R0Aw5/NtrorqymWfrU9k0rQVj31GHBwk2rEK2Rq3J00+zq1ancN6IBN BELD4lErJoDWuyK9vpa6YXgnCmVhD4W02Cmz8KDeMh5YfVf81le0YZoIKZIrSR2E7e7d sM4kSNKF53R6QTPT2whwTAagkU12FXlQAVIZ7ru8OFMeDirKqG2/DQi551CcA44EuZ5B SbTA== 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=uxbK/zEdKbSEv/I8wkPsOESq0ARJrqx1dQqBdkbW0Rs=; b=Zkub4TS+ZXowVRm/JmJtIKfyUaNtLuVrUyN2L+lGF4aXfZg/tZO7K3HFFdj9CJaQDP IPcgqt5hXNY2ddUaRROzCbqBBnjakcFzhBunNBEB0leTlbm8SwYsJtuoiDG64jDAyR2o KnIcjUtZqMPfG3XMcB1mcdLyd6czPZYrz0oUqt2QHedFZ8ka48fb4cHTkJoa+xtwh/2R fjiqhoKldQC0QxLvW3oWQxkdYT3Vm3PGm7A2ZEyP5Qa4KJVC+bnnWfxmvldygUNd8EBi diYnjT41RcNNR7xtUwlspj81PGUhj42VToBsyOGI7crpm+VufKrYie2OZ6C5LRIES0ll FJ6w== 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 123-v6si5799953pfd.201.2018.07.19.04.31.58; Thu, 19 Jul 2018 04:32:13 -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 S1731178AbeGSMOB (ORCPT + 99 others); Thu, 19 Jul 2018 08:14:01 -0400 Received: from foss.arm.com ([217.140.101.70]:48110 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730053AbeGSMOA (ORCPT ); Thu, 19 Jul 2018 08:14:00 -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 CBCF97A9; Thu, 19 Jul 2018 04:31:16 -0700 (PDT) Received: from [10.1.206.34] (melchizedek.cambridge.arm.com [10.1.206.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 050CE3F246; Thu, 19 Jul 2018 04:31:14 -0700 (PDT) Subject: Re: [PATCH] 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, Ard Biesheuvel , Will Deacon , Mark Rutland , Catalin Marinas References: <1531949864-27447-1-git-send-email-bhsharma@redhat.com> From: James Morse Message-ID: Date: Thu, 19 Jul 2018 12:31:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1531949864-27447-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 18/07/18 22:37, Bhupesh Sharma wrote: > Include KASLR offset in VMCOREINFO ELF notes to assist in debugging. > > makedumpfile user-space utility 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. You need the kernel VA for a symbol. Isn't this what kallsyms is for? | root@frikadeller:~# cat /proc/kallsyms | grep swapper_pg_dir | ffff5404610d0000 B swapper_pg_dir This is the KASLR address, the vmlinux has: | root@frikadeller:~/linux/build_arm64# nm -s vmlinux | grep swapper_pg_dir | ffff0000096d0000 B swapper_pg_dir This is in the vmcoreinfo too, so you can work if out from the vmcore too: | root@frikadeller:~# dd if=/proc/kcore bs=8K count=1 2>/dev/null | strings | | grep swapper_pg_dir | SYMBOL(swapper_pg_dir)=ffff5404610d0000 I picked swapper_pg_dir, but you could use any of the vmcore:SYMBOL() addresses to work out this offset. (you should expect the kernel to rename these symbols at a whim). Thanks, James