Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1159406imu; Thu, 13 Dec 2018 10:16:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xopp/Pe+1olMIIaJ/qDHinJj+8184CnX0ktaNzYyGNHiGfxGM+WmTtZ3pWzUireIY9X1J4 X-Received: by 2002:a63:4c04:: with SMTP id z4mr23095205pga.312.1544724968415; Thu, 13 Dec 2018 10:16:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544724968; cv=none; d=google.com; s=arc-20160816; b=IFYkjFQTCAxsxlU6YBI9TeWbdBKPj1c+1/AaZ6VJGkkGl5foAG0KctUSrxcGPNZ1ap fyOJaHDqcvxsCxlHl0uACgCHp3jp0Wo0SBf+I8wiS/TZSpA2nrLY24WS+6BPfqWlbCxU tRmL5O76pbgmM0Yt+m6Lf/Dr2YEC2Sq6YWn/aSaMO3e2R7rWp5FvBL2LGs9+8xhaeJqr 7U49auOjAYankDFN/JazvaXIRHu1tp+0Up1PH0eDM98DT0ArcN33G1dGtByn2d2GLZRB a70fjQudqHrUTlkWE00+nJd+KpzF9WMqYsnyfI++GliIpSpKkyUKMsK4Qoh9wKC9WoL5 VfMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5kKhrHLWE6tVr2SeUfH2YzeUQwK8K7ZPMKKsIQaZRZs=; b=Zt0J4KGj5mwzbgagDTCPN0jX/3g1IK5V8fKerJJBTY4cKTGv2eTfEo8TGLeBZS1jMk KmfkjaUDbTRD4ujSGCOKkKc2ZJwPjITUAXH9su1Cq9JKFEFzFM9iNF9Pm6tY7Hoz9UDw B2QGd4gC7iQP7zJ8t3HyRy7XEpp2ZpOatM+rj6TOEWdQwpXEKnlIOs1lfhTnBFEWWymT HeZQnbWS48xqroIz9XxiCOdjwUgs4/w19NNuLH6dhGTLanc7Z+2+6HrohJUCKtKbVot/ jnf4wwCEg2w236vEVXAY4+XRS0sXA/SuFQK2qPiNMRieptYn5dMzw8CbCiqXAsxKvGHY ay7Q== 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 b14si2131125pfc.156.2018.12.13.10.15.52; Thu, 13 Dec 2018 10:16:08 -0800 (PST) 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 S1729661AbeLMSMz (ORCPT + 99 others); Thu, 13 Dec 2018 13:12:55 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39962 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727929AbeLMSMy (ORCPT ); Thu, 13 Dec 2018 13:12:54 -0500 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 63347A78; Thu, 13 Dec 2018 10:12:54 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 32EA13F575; Thu, 13 Dec 2018 10:12:54 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 16B9A1AE0838; Thu, 13 Dec 2018 18:13:18 +0000 (GMT) Date: Thu, 13 Dec 2018 18:13:18 +0000 From: Will Deacon To: Miles Chen Cc: Catalin Marinas , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com, ard.biesheuvel@linaro.org Subject: Re: [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset() Message-ID: <20181213181317.GD18185@edgewater-inn.cambridge.arm.com> References: <1544612209-13660-1-git-send-email-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1544612209-13660-1-git-send-email-miles.chen@mediatek.com> User-Agent: Mutt/1.11.1+30 (d10eec459b35) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+Ard because I'll basically go with his preference on this one] On Wed, Dec 12, 2018 at 06:56:49PM +0800, Miles Chen wrote: > When debug with kaslr, it is sometimes necessary to have PHYS_OFFSET to > perform linear virtual address to physical address translation. > Sometimes we're debugging with only few information such as a kernel log > and a symbol file, print PHYS_OFFSET in dump_kernel_offset() for that case. > > Tested by: > echo c > /proc/sysrq-trigger > [ 11.996161] SMP: stopping secondary CPUs > [ 11.996732] Kernel Offset: 0x2522200000 from 0xffffff8008000000 > [ 11.996881] PHYS_OFFSET: 0xffffffeb40000000 > > Signed-off-by: Miles Chen > Tested-by: Miles Chen > --- > arch/arm64/kernel/setup.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c > index f4fc1e0544b7..4b0e1231625c 100644 > --- a/arch/arm64/kernel/setup.c > +++ b/arch/arm64/kernel/setup.c > @@ -388,6 +388,7 @@ static int dump_kernel_offset(struct notifier_block *self, unsigned long v, > if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && offset > 0) { > pr_emerg("Kernel Offset: 0x%lx from 0x%lx\n", > offset, KIMAGE_VADDR); > + pr_emerg("PHYS_OFFSET: 0x%llx\n", PHYS_OFFSET); > } else { > pr_emerg("Kernel Offset: disabled\n"); > } > -- > 2.18.0 >