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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1EB32C4321E for ; Tue, 29 Nov 2022 12:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2TCe0bbRjOxasPWlGrHEteauoR1UMc1mmismUTGPwL8=; b=DjHG9uywXqx3Lg PKE32rslicPHoM3LVWi9NhFuyXPfhTl04goGHqllsgsccUFN/RuB/5oF7I0ShfmCwtyPQskMIIY+y 34zaaxhpzDz2Vr6FikYD5hZh+yxFcYvs5Hz5d9XByTbjVb1tJtIO9zUAo85O4JgKi2yOM79XI6v8E UjfYjiVZ94dT0E2pxW2O0v4lQAaaVyfUv7mkO8VoisdLm7AsYNfLf3/WvMhM2CdHN38UBeVFMS7lD hGyDLra7/plSa2D1U/xoiJ06cHl8go+8CAhydjkL9mCxob//KJ/9ron60FOVeX+VV0nWUb+kPUMJ4 ZSBSVvGZRuDsrykXrdEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p007y-008hRh-5R; Tue, 29 Nov 2022 12:54:22 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p007v-008hRK-Tk for linux-arm-kernel@lists.infradead.org; Tue, 29 Nov 2022 12:54:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 57AC1B8162B; Tue, 29 Nov 2022 12:54:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 077EEC433C1; Tue, 29 Nov 2022 12:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669726457; bh=WmG5BwFA17+1Z4uKek2cmuEEJb2n3C3wLugQAFiNPgc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QGHHAOMTPV2eMu7ke4JPh1VaZLWZ6n04kQL/ozurtNdrr3rwPfBsqGn7r0jowWQ5J uBJSdxRjs3fd9xGNwa+uhNLAEK2wc2teWUoQL6hkJMIWywmzmjUbIGxAKteyUYMhlI oQnCQmKUUsBa8UyJe3dQBu8YEpOH7FtyV8hmtjuAQxojC3oq9EgocGKtFiSyqbo5JD 0Y1W52V6xqEGRqtpWxshg+gupOJkfk6XO4Xb/z5vjhQ5Xe7mrjTVJ/n/34fBFIE+Vd ZUMyO5Fz5jDc0l305ofIyiU9YXVTN+4mzWak7ekwPogLnIkbyImpsbW99xw5Cs7mNT 3kUQzGTe5I7rQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p007q-009Lwz-Om; Tue, 29 Nov 2022 12:54:14 +0000 Date: Tue, 29 Nov 2022 12:54:14 +0000 Message-ID: <86fse1ncp5.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon Cc: Ard Biesheuvel , Catalin Marinas , linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com Subject: Re: [PATCH] arm64: mm: Align PGDs to at least 64 bytes In-Reply-To: <20221129122259.GB25960@willie-the-truck> References: <20221122165618.2453224-1-ardb@kernel.org> <20221129095113.GA25960@willie-the-truck> <20221129122259.GB25960@willie-the-truck> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: will@kernel.org, ardb@kernel.org, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221129_045420_270137_989A3A8E X-CRM114-Status: GOOD ( 34.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Tue, 29 Nov 2022 12:23:00 +0000, Will Deacon wrote: > > On Tue, Nov 29, 2022 at 12:18:20PM +0100, Ard Biesheuvel wrote: > > On Tue, 29 Nov 2022 at 10:51, Will Deacon wrote: > > > > > > On Mon, Nov 28, 2022 at 05:50:48PM +0000, Catalin Marinas wrote: > > > > On Tue, Nov 22, 2022 at 05:56:18PM +0100, Ard Biesheuvel wrote: > > > > > My copy of the ARM ARM (DDI 0487G.a) no longer describes the 64 byte > > > > > > > > G.a is nearly two years old. You may want to upgrade to H.a ;). > > > > > > H.a is over eight months old. You may want to upgrade to I.a :p > > > > > > (Actually, don't bother -- it's written using these unreadable rule things. > > > H.a, all is forgiven). > > > > > > > > minimum alignment of root page tables as being conditional on whether > > > > > 52-bit physical addressing is supported and enabled, even though I seem > > > > > to remember that this was the case formerly (and our code suggests the > > > > > same). > > > > > > > > The wording in the ARM ARM implies that it's only needed if we go beyond > > > > 48 bits for the base address: > > > > > > > > A translation table must be aligned to the size of the table, except > > > > that when using a translation table base address larger than 48 bits > > > > the minimum alignment of a table containing fewer than eight entries > > > > is 64 bytes. > > > > > > FWIW, this wording is the same in I.a. > > > > > > > But I'm fine with the patch, always forcing the 64 byte alignment. With > > > > the 'max_t' instead of 'max' (or whatever solves Anshuman's error): > > > > > > > > Acked-by: Catalin Marinas > > > > > > Happy to take a v2 or add the max_t() to this version. > > > > > > > In spite of the off-list discussion we just had where we concluded > > that this patch is not necessary, I think we still do: > > in revision I.a, I still see the following wording > > > > D17.2.147 TTBR1_EL1, Translation Table Base Register 1 (EL1) > > > > ------- Note -------- > > A translation table is required to be aligned to the size of the > > table. If a table contains fewer than > > eight entries, it must be aligned on a 64 byte address boundary. > > > > > > with no mention whatsoever regarding this requirement being > > conditional on the configured PA range. > > Ha, so the text is different between stage-1 (e.g. TTBRx_EL1) and stage-2 > (e.g. VTTBR_EL2)! I wonder if that's deliberate? Maybe something to do with > coalescing? :/ I think the whole VTTBR_EL2.BADDR section is full of crap, and has been for a long time (since 0487B.a). It talks about S1 translation all over the shop, and feels like a copy-paste gone horribly wrong... Coalescing actually forces a stronger alignment, as you have to align on the full size of the top-level table. M. /puzzled -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel