From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E157C433E7 for ; Thu, 15 Oct 2020 10:48:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAF6622249 for ; Thu, 15 Oct 2020 10:48:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oFAuoE/4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qSFZZ93k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAF6622249 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=coPnL+5zEiw75cdWmZa4XLxBBTtBd0Zr23lQhIG+NfA=; b=oFAuoE/4MoGvQzQHxIOHmG84a BRlVHfWCn2hcxny3Tr88Bhp3sYi1Ki7fF2lixCscDXAEDTV9DzBgmbQbJ1I2GgQswvlYNJdVYf7AL 9WlG8boaXIjH+EpIm6rBGJzFwC/gQI500awB8IiUoKgcUVGfcz7HSCaGW+muAPH5xqTHT6+p3QedO EC9lnuhRIBA1+zuDdKEL6TLzPb41kmkVTtGcwICQe4qSy9aCPSH7fujmxhOKK6Kgoe6HWpvfSUoJt 7AiSXZ1Jp+sC4u4C/ry8VV7M0Yw93RXLjYdGki0IyW+wXzG7Tulz3e372dA1nvX7uaDXNW0Wcc4U5 HOx60W3xw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT0nE-0002Av-AX; Thu, 15 Oct 2020 10:47:32 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT0nC-00029z-Mc for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2020 10:47:31 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC51522250; Thu, 15 Oct 2020 10:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602758849; bh=Y4gIJTGhqBky5bHu9HHcJyOBV3BsTGkphSFwVnhWIyg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qSFZZ93ku5i0XfLhpYnSvnxLW8OGDth0LWLwolJsNGQvYjgDPmrTBt4S4EnGh34MY 3KKhlBOKV05KsVu7dK27ScyP/Hixw/nZ194sV2CBAz75bdKs/Bk1I0E62P4grf4lqJ lmxwNJkxFDlrgFbfp1oFcxlAchWJTuc8WToCJ0OE= Date: Thu, 15 Oct 2020 11:47:25 +0100 From: Will Deacon To: Ard Biesheuvel Subject: Re: [PATCH v2 1/4] arm64: mm: use single quantity to represent the PA to VA translation Message-ID: <20201015104725.GD5064@willie-the-truck> References: <20201008153602.9467-1-ardb@kernel.org> <20201008153602.9467-2-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201008153602.9467-2-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201015_064730_831578_854AEF02 X-CRM114-Status: GOOD ( 21.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, Anshuman Khandual , linux-arm-kernel@lists.infradead.org, Steve Capper Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 08, 2020 at 05:35:59PM +0200, Ard Biesheuvel wrote: > On arm64, the global variable memstart_addr represents the physical > address of PAGE_OFFSET, and so physical to virtual translations or > vice versa used to come down to simple additions or subtractions > involving the values of PAGE_OFFSET and memstart_addr. > > When support for 52-bit virtual addressing was introduced, we had to > deal with PAGE_OFFSET potentially being outside of the region that > can be covered by the virtual range (as the 52-bit VA capable build > needs to be able to run on systems that are only 48-bit VA capable), > and for this reason, another translation was introduced, and recorded > in the global variable physvirt_offset. > > However, if we go back to the original definition of memstart_addr, > i.e., the physical address of PAGE_OFFSET, it turns out that there is > no need for two separate translations: instead, we can simply subtract > the size of the unaddressable VA space from memstart_addr to make the > available physical memory appear in the 48-bit addressable VA region. > > This simplifies things, but also fixes a bug on KASLR builds, which > may update memstart_addr later on in arm64_memblock_init(), but fails > to update vmemmap and physvirt_offset accordingly. > > Fixes: 5383cc6efed13 ("arm64: mm: Introduce vabits_actual") > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/include/asm/memory.h | 5 ++-- > arch/arm64/include/asm/pgtable.h | 4 +-- > arch/arm64/mm/init.c | 30 +++++++------------- > 3 files changed, 14 insertions(+), 25 deletions(-) I'll pick this one patch up for 5.10, thanks. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel