Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp738585rdb; Tue, 23 Jan 2024 13:27:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+58KGtPJCeAogOVVYCyxKrNWThShljfW8wUcAycXX2eoVrZYGK1YWfJoDd9WoJcb9vYAw X-Received: by 2002:a05:6a20:144a:b0:19c:5cfc:44ce with SMTP id a10-20020a056a20144a00b0019c5cfc44cemr1398284pzi.100.1706045269441; Tue, 23 Jan 2024 13:27:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706045269; cv=pass; d=google.com; s=arc-20160816; b=DYpofDO/EPogOYWbl2LHQFcp84t0gpYTEIsZlolUgyaZVohvRl6NfmCUiZgxU2PEaL p1vlJ/47DHtsx1DpezmnB9cPefBn7b32JAN8mDT59ZLfpKiv5CxKQdb2B7MNXKYGuU7j 9xtlszgsQUv8OoiT7FtI758Zk43ogbVY6I6XsLB+UXXgPgrWxBEu5VZ7Ypqd/a0f9JbX ipP5YP8rvZuctrNs/WGnwR/GlRLwVg2cqnAD78BjTyX7lqLMw9Xg2gIPJY40953BXWm/ eYokpSFXA29SCuNq9UYOSezls1olqloQCGiEp+Rgw+BAcUvr46FHkrcNToZ+OdzU1EqH eQiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PepByJiWQ5z0YJAy3zsX5i+pG7M9t28NlsHRNrHyzFg=; fh=SUHg/+RDuMv598f0VNC8XNZDomJq+cjDOIHfr8cimXc=; b=yEVOhKBwoGScILDaRH1Oy+RohC5CFhibkISQtkk7E6UOfdBuFtR0wWyfkWOWGKU0Oq qVg+dIM+hHneHN9g8qjKWZj4k6JoY0KSTmitE8Vf9y9FywvzJdvJ+Gn/V4nlDAvo8rb5 9V7ySucKuJevmMi1RjdCSFmHrcf1PWgvd2qnkmzKNJmq8z/fJwBk+cI2Qrz1JsvdMQG5 UVcIfRcJwwdXLNFeQvVQRwte+49Jeszqq208OYAX9w25NFqqVHHS54lbVeYBe4LoXVTk j/J9NefmyfpT4MmxEq0ew234Pv6p5ZiIn3X+DpxsegMysxBfFPH3Sp62QCUifD0Q+MgQ 4kOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OZ4uDMvo; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-35490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35490-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l184-20020a6391c1000000b005d3faa6f7fbsi1052309pge.383.2024.01.23.13.27.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:27:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35490-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=@infradead.org header.s=casper.20170209 header.b=OZ4uDMvo; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-35490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35490-linux.lists.archive=gmail.com@vger.kernel.org" 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 0458328C984 for ; Tue, 23 Jan 2024 15:03:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AB7B5FDB0; Tue, 23 Jan 2024 15:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OZ4uDMvo" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 00383604A6; Tue, 23 Jan 2024 15:01:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706022103; cv=none; b=R99d7P7/ithGWzJYBzgi5YRAS08/XJPjG5tHdpUakAOZRc2nu01CrIrLJJ0Ppo6xi2GEhsC7oZpO82LMZP3nl/DeABA1Kw1kU77DtsbgSPKWgpGo9NqYF8DGRT8G81tlGSbUvPMYQRk72+BBjFjKpNX8hTLFkkZN5bZyybgBwFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706022103; c=relaxed/simple; bh=ShMrW1ADV7iv+pVf3ziJG/80/SbMo2RZcy8p0RkUoJY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G/IEDz2gDRSCHmxBK5XFWH1/zjXtlFjaJvCP5sBE7GVtDyByH2YMq/Ko7MB/tjOU013VaqIrCvP554ukGdgfSB2LvBZgzUY4CiNpuEjvT9MMfxY7SMCwbYfnGzbczzVKEysqNrUd4QT6b0sw9fQ08GS6g57gJG0DsR5Y1HibPkw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=OZ4uDMvo; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PepByJiWQ5z0YJAy3zsX5i+pG7M9t28NlsHRNrHyzFg=; b=OZ4uDMvo60iZ4l06WQT6UPpOyK 1Mzz1amI2B4lmc7SzQBo9/H5nZHwSc+ahhYWItLeLfbqvNQjOpLZ379CUtpyrKiJpaFB3y3qceoFn 2/09mBIgxlyPrDWwBI1N1vIcVhBAJ+ccP2Eft8qdX7sawkIRu0Y4eD33nl5AX1fWh4yZRXAHa0diJ xtf9jKwnR9O51wT9yPKs25kKmm0Ym9Nc1WnmkYd5euK/RIRwr1nWxHB5018vQ5PnPMYfUbcXkcguy WziupYXg/e8D0xyqPtbSRcqVXqNtY1gEyT+tocZwXdwgad56hM1QmUaMd0kzNvFae844ES7sQELU7 yz18rMEQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSIHS-00000003Un2-0lR2; Tue, 23 Jan 2024 15:01:38 +0000 Date: Tue, 23 Jan 2024 15:01:38 +0000 From: Matthew Wilcox To: Ryan Roberts Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Russell King , Catalin Marinas , Will Deacon , Dinh Nguyen , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , "David S. Miller" , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org Subject: Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64 Message-ID: References: <20240122194200.381241-1-david@redhat.com> <20240122194200.381241-2-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 23, 2024 at 10:34:21AM +0000, Ryan Roberts wrote: > > +#define PFN_PTE_SHIFT PAGE_SHIFT > > I think this is buggy. And so is the arm64 implementation of set_ptes(). It > works fine for 48-bit output address, but for 52-bit OAs, the high bits are not > kept contigously, so if you happen to be setting a mapping for which the > physical memory block straddles bit 48, this won't work. I'd like to see the folio allocation that can straddle bit 48 ... agreed, it's not workable _in general_, but specifically for a memory allocation from a power-of-two allocator, you'd have to do a 49-bit allocation (half a petabyte) to care.