From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14D7B332EC8 for ; Wed, 19 Aug 2026 20:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787171256; cv=none; b=kDmXjBxYTxcxq4bWRUQOuD4HSHCkFJ6YB2OJeHKxNQiwY3k+Csnmfh4aP1sSr9/sCh3CXMu0gWD1IgaOlBjb4PKqupRsmqOV4U5SR/ZRc/4ovT8t6Uc0m9zxJycsMEscDn97x7bnFQli4UJ7y8+FRR7Ib9XVDQfabNz1wXxZQSE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787171256; c=relaxed/simple; bh=cYejRJXTkP1aTBY2qgR2HF/4MQNH60r9YGktnx+01Mo=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=KkpcsYjaplWz4djMz4wjHf/V1sfagOh215Sw/dphwuFZrnjFuZG1Ajl+xZzvo+Ffa93dv0n7QSYpHq5e9Oc3gPR+crxWDMVom8nYQcyRXhU/pmC4YQ1nYXBbeQl9zuFv6g6T9hpaPDDXJEed958BH3IsRYAYr3mwdcztqeXR02s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=Z33Bmwc2; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=aQifVuQs; arc=none smtp.client-ip=103.168.172.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="Z33Bmwc2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="aQifVuQs" Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfout.phl.internal (Postfix) with ESMTP id 66007EC0177; Wed, 19 Aug 2026 16:27:32 -0400 (EDT) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Wed, 19 Aug 2026 16:27:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1787171251; x=1787257651; bh=7gjPQ9geWQUzmY0HHZDN1BH0YbohllYXnVzPU8aiejM=; b= Z33Bmwc2OvXTelCUpnTwIGJ3IH693L2KZYONfsgppHiTRB5c4fHtcydZItAbRoZT eTUHuRAIDZWc59a3hv/ECfme3/440KczdvWC8SvFCTP8wpKR/FkZxfw2qo16IsqY B6njwHFVDZaM25w63jPjIfoWBS7+DiZiroVIQq56hGTMv7or3bcGcNq9l90WakpP scHPvLPefBXRm9njdJxSapm8keNZ4pRtixi/k/X4EBCBlg4O0jvpyLkDyrRP1V5k yAOA1eDF+Vh88ecyYqAfwKNlPTBkJ/0JTf/2XuW1Jro4/oBv/K4zT55RuDJZUr+z jceGmVowciGS9kKdW7ZQ/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1787171251; x= 1787257651; bh=7gjPQ9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6cMGaR6AoX8/VmsZKLtMIw0nr2Gwfcm4lMMg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id 09BEC32A0071; Wed, 19 Aug 2026 16:27:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: Aqm_jcT6PvEF Date: Wed, 19 Aug 2026 22:27:06 +0200 From: "Arnd Bergmann" To: "Karl Mehltretter" Cc: "Catalin Marinas" , "Will Deacon" , "Mark Rutland" , "Ard Biesheuvel" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Message-Id: <20969b87-a073-491b-960d-8c4c2087845b@app.fastmail.com> In-Reply-To: References: <20260817000231.21311-1-kmehltretter@gmail.com> <4078f942-e29a-4f6f-b6fc-780e8c6d6874@app.fastmail.com> Subject: Re: [PATCH] arm64: compat: Keep alignment address arithmetic 32-bit Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, Aug 19, 2026, at 20:55, Karl Mehltretter wrote: > On Wed, Aug 19, 2026 at 01:19:20PM +0100, Arnd Bergmann wrote: >> >> I don't see yet why 64K_PAGES makes a difference. I had >> expected TASK_SIZE to be 4GiB regardless of the page size, and >> the top page (but not the bottom page) to be reachable from normal >> userspace. > > There is a special case in arch/arm64/include/asm/processor.h: > > #if defined(CONFIG_ARM64_64K_PAGES) && defined(CONFIG_KUSER_HELPERS) > #define TASK_SIZE_32 UL(0x100000000) > #else > #define TASK_SIZE_32 (UL(0x100000000) - PAGE_SIZE) > #endif > > Only ARM64_64K_PAGES with KUSER_HELPERS gives compat tasks the > full 4 GiB. The 64K kuser mapping then occupies the last > page. Ok, I wasn't aware of this bit at all. I think you can just skip explaining it in the changelog then and not spend too much time worrying about the case of userspace intentionally overflowing the 32-bit address space, as we clearly try hard to make that impossible in all kinds of ways. Just explain the important bit with the decrement causing the compat mode to be completely wrong. Arnd