Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1948089rbb; Tue, 27 Feb 2024 06:21:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWROildEUOah9MqDAM2Zppr4TBENseEq/NG3BEDrqToV5m7HKcaZewJIBqRirvIuPaJqYQmDB85AKO6+JsAcYgv5Uk8RT3M/owKLip/Aw== X-Google-Smtp-Source: AGHT+IFan50jdRAzJjS2RYFefU7sb3UVABnwLM+GDbsk7xJhPBXWOszHivl7UXlIONFQQlc3/L4G X-Received: by 2002:a92:c9c2:0:b0:365:aaca:d171 with SMTP id k2-20020a92c9c2000000b00365aacad171mr1694010ilq.31.1709043666905; Tue, 27 Feb 2024 06:21:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709043666; cv=pass; d=google.com; s=arc-20160816; b=XC+I+ZQUYTeeW0rI+PRs/TEBLeW9kjz/4gJBjJsioKD6NmgTsHwk0UNWuoG93TU0Bt okJXf2dFLoyby6GbHiCXRE2lKLEv1iO5icKWUN40dMK0eSBTNy80Y6gK0SYlLFVhZtf6 v3eyqhmQqNr2rOf5VBG9TjBEUm+pxCQyB+6Ah8d0pOrveWNaPs3vtTZ+EKw3NcBObw4I SZwh6d6BHQKQXVgFzqJ8ZzZoQLY6y/dCepk7Cd5PhN4f85x5I1Magl8fWFODvuj+vTXV dBqNLKhyK8Rrs46dpcwmjgYxzF8wXWdT25QYf3qf1N5aQtHknXZIosiuq/4vY1oaypad kwWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=lgwXV027qrMgBZRGGg484htOjeaxN2ck0Zcve0Dmzhs=; fh=dDbKbmeealmL9sOVDVOQctfwwRy4wnCdzNFKA0w92j0=; b=E/RqSrI63pHS8DdrhGakDC7NfAIUqnW2ddR/10YdgAr7fRyRdu6tz9TJqWiNNQrxnL d11a4fLiFnIAM+g5QBVMkoMuiCl3YJt2ZKqlkEe7zEpa1+qyYO0DBAD96iWMVnU5GW2G Zt0fOZsreQGIGlzZCfy95Exlry+GDGnzUVh8hRbj7B3FysfiTYYCqOROpAiyek/y7R67 sG3FT9fjUjKo/twqyEJWQoRUHFBD9fqOPtn7ayUxKIQGqa0G+M263mJfJQhJV4ftDUJ6 mlsBXXAzAbiCCwkbYHZdCrEXIB0xngGcPJjVtIJp+WruUJ7nk4QxvBN3Af+X3F5MhxSu cP3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=lPUTGKxS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NPNMT8iD; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-83387-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x27-20020a056a000bdb00b006e46743e609si5519690pfu.132.2024.02.27.06.21.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 06:21:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83387-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=lPUTGKxS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NPNMT8iD; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-83387-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CA43F28C8EF for ; Tue, 27 Feb 2024 14:19:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4BEA13F016; Tue, 27 Feb 2024 14:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="lPUTGKxS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NPNMT8iD" Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) (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 9028913DBB3; Tue, 27 Feb 2024 14:19:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.224 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709043543; cv=none; b=NpiEFzp5GbYrQTiDiCowNp9hdkMYody/xhmLD768WJJR2Mh/HNysg9Nr6wkyTO0jCfvYVV94TIqI0Qqz4oQjTzk/upl6HAcxzmhAv0NJoZ2qQfecYhwPDkIshK3wH7ZDN7WVwNr/ytOi5qKIGtB0X4/v6EDdN/ij7HmWh1RfWYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709043543; c=relaxed/simple; bh=A0FSY37d+vGzCQkk6DyCbgJvMDTFHRlUqhEcd+SIv+U=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=raAGq+m+fkfn7kvBxaNnDJROWdQUg4qn+vOAUqhOu6Y5oP3utHAOOo9EhhyXaah/ULbHDx5NpN8wf+WTEmFy+XG58aMFp++Y2UyoGCvyXApNbOvDhlwO3xzK90CkjS3G9AnbNzxwfO2oaBIEGYq64o2hOMyUpJb0rs190flsmyw= 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=lPUTGKxS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NPNMT8iD; arc=none smtp.client-ip=66.111.4.224 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 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 8717758176A; Tue, 27 Feb 2024 09:19:00 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 27 Feb 2024 09:19:00 -0500 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=fm3; t=1709043540; x=1709050740; bh=lgwXV027qrMgBZRGGg484htOjeaxN2ck0Zcve0Dmzhs=; b= lPUTGKxSZWT3KviA8nwQtQixUNSRKDoofN2NivSWKtva1+uopGcYEEr4RC46c0a4 vwDyryLlG3/SO1o0IgHaIAKElGDgOIftHdg/t1LowfBfp6kWJ/02DSeWOd9gO01Y i2xNDAt65lcr61a9rbStiacnnPLSzVXxNfz+qirJEOwE6l4Mjsb9FPSq6beDfONs IfFnZ9bxqqqY3xHHTJ0xelGfB0mkN5vK/R1PlQWSfAeazO2LUPLczof7Is+mk4YY dS7xeAUB8mFbzZwvSoSrgsd+tbYj/Jm83Sm5bzumIEzMe8eZVlLb2zqJj5ACbn1Q xHdhr1utw0PFFSmpN8T17A== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709043540; x= 1709050740; bh=lgwXV027qrMgBZRGGg484htOjeaxN2ck0Zcve0Dmzhs=; b=N PNMT8iDaqBhcmripVnSD6nS3Lv42kN3UYBW99FRUWa3TpEGbwqC5etBXkzZPJQ97 b46+HgX1sO+sVYOqI7WWoftMMpP1d6mFgSc+COHXzownsJ7ep9c7luzipVKN/JSm WvBS91t32eqhnz4okM6kGJHX7ja6nxAsDWD2f8/n1iyXi5CXN1O8cRQmzdP0MN3P lXLGSaSOyRMNG2Klv5JGjNbEL+jZ99PzUXZkK0dRYXnY7Sh9tCeVVIPOdKairDq/ hVJllB8wVwsQCnLlNf4DWkeeaaUPJ42yyj0cK8PqRkYPiog+0wCNiowoUDAfMSZ0 TxOSo3YO5XIRZlykzYViQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgeehgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepgeefjeehvdelvdffieejieejiedvvdfhleeivdelveehjeelteegudektdfg jeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8FBCAB6008D; Tue, 27 Feb 2024 09:18:58 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-153-g7e3bb84806-fm-20240215.007-g7e3bb848 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <7b62e73d-d3fa-4432-807d-c2e667814b17@app.fastmail.com> In-Reply-To: References: <20240226161414.2316610-1-arnd@kernel.org> <20240226161414.2316610-4-arnd@kernel.org> <164616c2-94f6-40e8-86e0-850dc8da212e@app.fastmail.com> Date: Tue, 27 Feb 2024 15:18:38 +0100 From: "Arnd Bergmann" To: "Geert Uytterhoeven" Cc: "Arnd Bergmann" , "Thomas Gleixner" , "Vincenzo Frascino" , "Kees Cook" , "Anna-Maria Gleixner" , "Matt Turner" , "Vineet Gupta" , "Russell King" , "Catalin Marinas" , guoren , "Brian Cain" , "Huacai Chen" , "Michal Simek" , "Thomas Bogendoerfer" , "Helge Deller" , "Michael Ellerman" , "Christophe Leroy" , "Palmer Dabbelt" , "John Paul Adrian Glaubitz" , "Andreas Larsson" , "Richard Weinberger" , x86@kernel.org, "Max Filippov" , "Andy Lutomirski" , "Jan Kiszka" , "Kieran Bingham" , "Andrew Morton" , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, "linux-csky@vger.kernel.org" , linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, "linux-openrisc@vger.kernel.org" , linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, "Greg Ungerer" Subject: Re: [PATCH 3/4] arch: define CONFIG_PAGE_SIZE_*KB on all architectures Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Feb 27, 2024, at 12:12, Geert Uytterhoeven wrote: > On Tue, Feb 27, 2024 at 11:59=E2=80=AFAM Arnd Bergmann = wrote: >> On Tue, Feb 27, 2024, at 09:54, Geert Uytterhoeven wrote: >> I was a bit unsure about how to best do this since there >> is not really a need for a fixed page size on nommu kernels, >> whereas the three MMU configs clearly tie the page size to >> the MMU rather than the platform. >> >> There should be no reason for coldfire to have a different >> page size from dragonball if neither of them actually uses >> hardware pages, so one of them could be changed later. > > Indeed, in theory, PAGE_SIZE doesn't matter for nommu, but the concept > of pages is used all over the place in Linux. > > I'm mostly worried about some Coldfire code relying on the actual value > of PAGE_SIZE in some other context. e.g. for configuring non-cacheable > regions. Right, any change here would have to be carefully tested. I would expect that a 4K page size would reduce memory consumption even on NOMMU systems that should have the same tradeoffs for representing files in the page cache and in mem_map[]. > And does this impact running nommu binaries on a system with MMU? > I.e. if nommu binaries were built with a 4 KiB PAGE_SIZE, do they > still run on MMU systems with an 8 KiB PAGE_SIZE (coldfire and sun3), > or are there some subtleties to take into account? As far as I understand, binaries have to be built and linked for the largest page size they can run on, so running them on a kernel with smaller page size usually works. One notable exception is sys_mmap2(), which on most architectures takes units of 4KiB but on m68k is actually written to take PAGE_SIZE units. As Al pointed out in f8b7256096a2 ("Unify sys_mmap*"), it has always been wrong on sun3, presumably because users of that predate modern glibc. Running coldfire nommu binaries on coldfire mmu kernels would run into the same bug if either of them changes PAGE_SIZE. If you can run coldfire nommu binaries on classic m68k, that is already broken in the same way. Arnd