Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2023586lqa; Tue, 30 Apr 2024 06:29:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRwpuZvyi2N1KJUAhy3uw83n8nsL9eBJgeey7P1Ufci/4YO63x3zPn/iAg/bnvZ8C/RlUlilArSNce8amOz8tVy87DWfG9MLpVjnmx7g== X-Google-Smtp-Source: AGHT+IGQ53iVCAjHakJtcsxQWYlTsfD9pUIpMHyQI3J9uu5wf5UfZe6s7vnmMyYmSUBzyKkEa8Qu X-Received: by 2002:a17:902:6903:b0:1e2:be4b:dd9f with SMTP id j3-20020a170902690300b001e2be4bdd9fmr13116951plk.15.1714483790136; Tue, 30 Apr 2024 06:29:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714483790; cv=pass; d=google.com; s=arc-20160816; b=lIjolgbUi6J4llwhOoC3onCHzRi0W/xpIe9kmC/ImUENLCqCpKsaR/v3tpo/iksrxH Y914VMww1Bf+PjQQ5dcBdn19UQJmf4B9EQG+qTDcHy/spu/s0a9QN6e7yx/QjbXbhMHI RoIZ4C8ZLAjEF0Xxng7IgJeInzR5Yk+39db6kymriB0h1wOsRrOkrLys8SY1RrAFSFyC DpZrV2sELAJWMi22ke1WSeiq6P2ZxN73cafrIaPOn5KJ5zHfppd4KzgYZdEUIoIozN62 hfuVKH99UCKItSFgZk04ITaB9w9h+pVCKlhREa85kFor/Q9zgDnegMeCv/b3e9mRWPr5 hxwg== 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; bh=7o0348emY56Por7nYpBVJj2DKjHykHtwtA9cFCXKYrI=; fh=UVtjsaBbn01ImDVX1mAZD+I0m+voPm2rqO7vX9VHL6s=; b=YMVnrKpJKtZxN9P5yvAUssI+Mz8TAQxhaq7zZWmtzXZjfGsefNZxP4G21OHgpMuAPd nBVvxOR097nMRzyPdHjXp+FcOHdWAzYCqglAgXHH4mq0hBCq8QNyt2tCySZf+IysV6+J PTIgSqii+kM1ApDMVCAujU9aN8p9XzOWJ+r0Wi1I66PvQwzVekAvr2RzopEKoO89rb74 mGGqFh6VfZOEFphS1zTC7agiPHaoBOsfPOBZjoE9NVQjqHpCGolCM1QUAQC0takvmpez yDuT/amqusc3GHaVvPV6DTBg8+uItzAReu+Q8GeqV26fxL9/Q3Up1J5blb1jIqw+TTRT gI0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-164003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a3-20020a170902900300b001e27f807a8esi21332291plp.343.2024.04.30.06.29.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:29:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-164003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 BFA35282F1F for ; Tue, 30 Apr 2024 13:29:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33B08174EC5; Tue, 30 Apr 2024 13:28:49 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2B77D172BBF for ; Tue, 30 Apr 2024 13:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714483727; cv=none; b=aQAu31OAQKrgB+ihdNJv0yu4EU01Um6F9yBUpIxrdiqdgZKdWzteCSKmdES3ZEfmZ4TBZGe4qafBNQkq4F7xif1jQ08iKhzChYhGET/Ye8UUi7XgAVJYaDukjjo6ZL9LK0qsPqZJQmp4nHAjz5Gv2X91mXUC+KlQLLrTIusxVcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714483727; c=relaxed/simple; bh=fqVHp1k5t31Za+YyqmDbWnlbLfQ3U1zUqBIll69kroI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=patK0klC92fX5HW5aCWsR26O9GC0gOQLg2ux2H0JCWmhgC6FEngiBq1uFgielZVFvK4m7557jdAhclRKCNBzcX40VPltd3RAyERxempVWI9lojZzCX6fBJemq7XqPQ8XAzs2RiYK0tghx9y3K42VNc8gceMsXaoS+WJiZ50IMfE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70386C4AF1C; Tue, 30 Apr 2024 13:28:44 +0000 (UTC) Date: Tue, 30 Apr 2024 14:28:42 +0100 From: Catalin Marinas To: Ryan Roberts Cc: Will Deacon , Joey Gouly , Ard Biesheuvel , Mark Rutland , Anshuman Khandual , David Hildenbrand , Peter Xu , Mike Rapoport , Shivansh Vij , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] arm64/mm: Refactor PMD_PRESENT_INVALID and PTE_PROT_NONE bits Message-ID: References: <20240429140208.238056-1-ryan.roberts@arm.com> <20240429140208.238056-2-ryan.roberts@arm.com> <839d6975-ce12-4fc9-aa3b-8ec5787bf577@arm.com> <8cf74e5f-e6a5-465e-83b4-205233c78005@arm.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: <8cf74e5f-e6a5-465e-83b4-205233c78005@arm.com> On Tue, Apr 30, 2024 at 12:35:49PM +0100, Ryan Roberts wrote: > There is still one problem I need to resolve; During this work I discovered that > core-mm can call pmd_mkinvalid() for swap pmds. On arm64 this will turn the swap > pmd into a present pmd, and BadThings can happen in GUP-fast (and any other > lockless SW table walkers). My original fix modified core-mm to only call > pmd_mkinvalid() for present pmds. But discussion over there has shown that arm64 > is the only arch that cannot handle this. So I've been convinced that it's > probably more robust to make arm64 handle it gracefully and add tests to > debug_vm_pgtable.c to check for this. Patch incoming shortly, but it will cause > a conflict with this series. So I'll send a v2 of this once that fix is accepted. Sounds fine. I can queue the arm64 pmd_mkinvalid() fix for 6.9 and you can base this series on top. But I have a preference for this patchset to sit in -next for a bit anyway, so it might be 6.11 material. -- Catalin