Received: by 2002:a05:7208:1509:b0:82:bbfa:f723 with SMTP id o9csp520278rbf; Wed, 24 Apr 2024 09:47:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWKLp8HKvPiE3CrbmhyDxO+M9oxMknG0GkBO77JuVcQEAqGpewdJrTIYULdk8mMDnt+UYvbQ+eZ6bK7SflTslf3eiqxFRmTyQc3BILnA== X-Google-Smtp-Source: AGHT+IE6NeIs+DCAtoug6PZ0DJE1rYAKSlIpt9+trVQVmW58zno71Sr9HOI97v+YP5umgG01ISwH X-Received: by 2002:a17:906:38a:b0:a51:9197:a2cf with SMTP id b10-20020a170906038a00b00a519197a2cfmr1915236eja.44.1713977242908; Wed, 24 Apr 2024 09:47:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713977242; cv=pass; d=google.com; s=arc-20160816; b=PYfECj03DUinVVHdRW2sTzZ7RUkyQ8/EdM0nvv+Qiua0HlMXPUTCgBvElfVEoEOIKX +Ga9c/7+k65zpOycc/3TFiZK4Q+Bm4wM5z+Qk2RrPYYkVV9bmEsmRL+E/ZjrX0AEjGmN pox+VgsyIkUAUcUG2x5EONURuukYCh6+W+5rWx2+Ci1ezWrDaq5W4iaqhqV7YbMsnz+R PYxt99fQfdsaaSxr87aIb6r5TCqm+wRVDU6Stt65zH/fIeWh2gyu+6SQob/muAXQOxH7 yUfPTHjOBlTy+EYkZRdbZiohPnmJhGKxq/JFxXFnoZK/hQfcljEAetCwYVvMJ+9BOIlF PDkw== 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=BpEOUGNb8RO9+Jt/xjuXfvEAh2gZiUMmc2qe3MUK5P4=; fh=UVtjsaBbn01ImDVX1mAZD+I0m+voPm2rqO7vX9VHL6s=; b=E7XEUrsZtjHna3eLXdG8PTqHfSy+exbEYf7TqJTvM2afQB/3Vf5GLYL9dOR/1oME0E 8CE0/MDfUPNI5zHHvCAvVFKMfis6VvncDJvmlj8IPKZceKALqbzOTIK4tP+93OtMev88 BUkVWMB/slxXQgcmEQJCOzIz8ajWRhIfW5uTQIkh8rr+Z38LwiSCPesKYqD3le+jTcYB Okx5X5XyoQ2oS60eyIrxcZ9HE1vR4jbBgpvXQZ+/HwLM37G+NeFwcc2aaxlT566IOxS9 6UYj+fo2oL4rdz2EQ5ets3WbZgXwpteEm0OkpsKc/PhL5Aj4e3Jx7HvrHJGsZ/CnGOje WLfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-157347-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qk42-20020a1709077faa00b00a54ca735287si9196344ejc.300.2024.04.24.09.47.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 09:47:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157347-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-157347-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157347-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1EC941F232D6 for ; Wed, 24 Apr 2024 16:46:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACB8316C6A6; Wed, 24 Apr 2024 16:46:53 +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 3409015EFA8 for ; Wed, 24 Apr 2024 16:46:53 +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=1713977213; cv=none; b=jPt9714d5Kg6aXmFayV0oJUWh7LEVn7iBt8jxDsxrg90zrcawzTCP9ZnRsWyP9j6C3PXKx8SLCot9xeW3wI3n8EcAXOrQWCPBBs8q2/hlFWpyCA+0UNYmHusLGSzhTeKpBJcfiY9cVqmzy/uieLLnZo9Vfjdwz9fCp1Eb4TQ6SY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713977213; c=relaxed/simple; bh=paXWtLd+vMIpou8828U+D/f8DV5lUFVZijN5DJyJATQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cmV1UrKSXFxeunQFoAVN9bTo+OeakNp7Wi9izQCByiStFjNU+zhw9LNCHT7wf2pyJ0u3RQewln4/GbpRm73XvPiU7mH/Lu4KCTr7BRMiWhlxVjb6kjY97afPsgWrFCDshv5J+I30/TPrwWMf+1FtMwiZpfju/OuvbG1VdMkXxfw= 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 9FFC1C113CD; Wed, 24 Apr 2024 16:46:50 +0000 (UTC) Date: Wed, 24 Apr 2024 17:46:48 +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 v1 2/2] arm64/mm: Add uffd write-protect support Message-ID: References: <20240424111017.3160195-1-ryan.roberts@arm.com> <20240424111017.3160195-3-ryan.roberts@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: <20240424111017.3160195-3-ryan.roberts@arm.com> On Wed, Apr 24, 2024 at 12:10:17PM +0100, Ryan Roberts wrote: > @@ -1248,6 +1302,7 @@ static inline pmd_t pmdp_establish(struct vm_area_struct *vma, > * Encode and decode a swap entry: > * bits 0-1: present (must be zero) > * bits 2: remember PG_anon_exclusive > + * bit 3: remember uffd-wp state > * bits 4-53: swap offset > * bit 54: PTE_PROT_NONE (overlays PTE_UXN) (must be zero) > * bits 55-59: swap type Ah, I did not realise we need to free up bit 3 from the swap pte as well. Though maybe patch 1 is fine as is but for the record, it would be good to justify the decision to go with PTE_UXN. For this patch: Reviewed-by: Catalin Marinas