Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1420320rda; Mon, 23 Oct 2023 12:01:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUuQUOCLYwQYQmsgJxkTJl60BL6PfR1EdndJ418s+OtGQGUhsh0sgKqwYJqxS2LzMMfPWT X-Received: by 2002:a17:903:11d0:b0:1c9:e072:33a8 with SMTP id q16-20020a17090311d000b001c9e07233a8mr12105960plh.61.1698087687437; Mon, 23 Oct 2023 12:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698087687; cv=none; d=google.com; s=arc-20160816; b=GPKh5YTqxjeRGu2+XVbbOkYB24v3wImHsyR/A/mOjhfs/llrQVdIohfz5K55Xu8jJw C6pRx1bLHrQ8CoXsHGdG4YkJve1AUKeSikZP19m2qRY9Lik/AW3BnF5Gqyjf5T7CeQH+ ua9KogwGW/MF0yFqLcQFMb9qu29/NvZPSW6/2FxhkmN17Exu4l3cCS6cmUG9H5E+Jhc+ Wh4RWjxkh7T9cgOnu6ZXwassiyvytSNfk3ysv4Btn3zLYVO1/P4cdGLRz0fnNgfuyRoQ 2CwokDlWEKu5LG6alBl4FdGejdl4zkFYuWOQDCITRSTvdxrNXICRVml4chVcHQ9Gwn32 T5EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dtdA9ub/ANr7ejS62Fd8050vwxz1kSazOAjElqLmkxM=; fh=a2cvMOZ5X6w2qF2UEJIjTbWs+epmi2diFTXo5EHEsmo=; b=iOWtfap1wDxo9+Np+PrM/J2JfdulSBcKaNUIhwvi3bJjdxZPs2fM7fEzTKS+I45kAP CPae4REA5T3HTJ+Q7vUGZLmJ4L8PfKdIpTX4/El05xWacoJIICBF7Yg9M7F6sdSWjTEX 3sPRBIKQAxXq0jTr7vo8ucPT4HAHoseojmR4GJDtZYzBRS83xMEpHESxJJ9+HvgqNF/7 PStbSwNjjUFEznqWks4wVRuj5p9dIPFRaMZiF1WDfFvn3lM+AutdGuC8fCwpnZg3yMwh L8tIoTAjaaHUQPKXN/CHCq9VFILC8Zzd0jZxK3AeOkVy5r0RcjRcE327SnMi8Map+OhB CQuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PMoDV5oP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l17-20020a170902eb1100b001b69ede5b79si6438461plb.470.2023.10.23.12.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:01:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PMoDV5oP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2E84280755EA; Mon, 23 Oct 2023 12:00:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231998AbjJWTAo (ORCPT + 99 others); Mon, 23 Oct 2023 15:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbjJWTAd (ORCPT ); Mon, 23 Oct 2023 15:00:33 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9CEE10E3 for ; Mon, 23 Oct 2023 12:00:21 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-d9a3d737d66so2811345276.2 for ; Mon, 23 Oct 2023 12:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698087621; x=1698692421; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dtdA9ub/ANr7ejS62Fd8050vwxz1kSazOAjElqLmkxM=; b=PMoDV5oPWWZLd9mFQbXBvL+JlLndRu926JSGLEhJMxss3Lp8WoBDWKdmp+xRF0Lf7E GkLPVBkUCV3ME9LzUyD+VC283keAsJ+wwhGBV3N/tgEZXRGXnJtTj12tteov5HxVufgm b67/0BZddh+lo0ekqlQnsY42r4/wrmeMXmSA60x1Tq4L5SaBijYBr8w3Hn6Hntsv6w8V PoTJY8RclYmTmh2JWK/rYqkD58NVAK/WffOkhzICBJE4/FjvdRRd1fPHCH09StKc5/6b pGc6SRBHBCOq6QCdQdDcB/x1zCG1BmlluAhrbtZq9KyZ8AL+F8AhBPdLXebKQiOunsOS KtJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698087621; x=1698692421; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dtdA9ub/ANr7ejS62Fd8050vwxz1kSazOAjElqLmkxM=; b=sFSP+AlPl1w69IZlvIIsdBbYVknXHAsHb6A4GmYONeyXZjxYqe7hPsYwGe/3MhmNxH rctMsmLoBhDYmO4nPYQg9uq+GkqIXf5lI4vBZdjwVofmADdvcYriryQbkNs4yCfVnt3o fGCaDnkAi+gJz0JUJG1WR3XzsKl41XOlaGManTzyLjV711tZ8azeWYD+s5MUr6pyPJjG ctgC3YjVvzxWYhBwhPfhGIMa52f+kyRZ/SPj8jdAedkNLpMr+7mbX62Vsffu1na6+88I k6R1u/GRo60gYX9nmA1Pt4/dF0uvvqRsBULwLgjHPR+Lr0XRxCv0yTZ6CPpF7NxVIKq3 J/vw== X-Gm-Message-State: AOJu0YyNt61CJSjPQZNFsbaaMvwyLifr9CVfVSmJ1wL+/DRpdArgTq+X ctP2ArZCJk+caow0eDjh1BRqr48nS4LYYGOm4wYSsw== X-Received: by 2002:a25:86c1:0:b0:d9a:b522:6870 with SMTP id y1-20020a2586c1000000b00d9ab5226870mr8756763ybm.0.1698087620747; Mon, 23 Oct 2023 12:00:20 -0700 (PDT) MIME-Version: 1.0 References: <20231009064230.2952396-1-surenb@google.com> <20231009064230.2952396-3-surenb@google.com> <721366d0-7909-45c9-ae49-f652c8369b9d@redhat.com> <045c35ba-7872-40a7-bd86-e37771076b88@redhat.com> In-Reply-To: <045c35ba-7872-40a7-bd86-e37771076b88@redhat.com> From: Suren Baghdasaryan Date: Mon, 23 Oct 2023 12:00:09 -0700 Message-ID: Subject: Re: [PATCH v3 2/3] userfaultfd: UFFDIO_MOVE uABI To: David Hildenbrand Cc: akpm@linux-foundation.org, viro@zeniv.linux.org.uk, brauner@kernel.org, shuah@kernel.org, aarcange@redhat.com, lokeshgidra@google.com, peterx@redhat.com, hughd@google.com, mhocko@suse.com, axelrasmussen@google.com, rppt@kernel.org, willy@infradead.org, Liam.Howlett@oracle.com, jannh@google.com, zhangpeng362@huawei.com, bgeffon@google.com, kaleshsingh@google.com, ngeoffray@google.com, jdduke@google.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:00:55 -0700 (PDT) On Mon, Oct 23, 2023 at 8:53=E2=80=AFAM David Hildenbrand wrote: > > On 23.10.23 14:29, David Hildenbrand wrote: > >> + > >> + /* Only allow remapping if both are mlocked or both aren't */ > >> + if ((src_vma->vm_flags & VM_LOCKED) !=3D (dst_vma->vm_flags & VM_= LOCKED)) > >> + return -EINVAL; > >> + > >> + if (!(src_vma->vm_flags & VM_WRITE) || !(dst_vma->vm_flags & VM_W= RITE)) > >> + return -EINVAL; > > > > Why does one of both need VM_WRITE? If one really needs it, then the > > destination (where we're moving stuff to). > > Just realized that we want both to be writable. > > If you have this in place, there is no need to use maybe*_mkwrite(), you > can use the non-maybe variants. Ack. > > I recall that for UFFDIO_COPY we even support PROT_NONE VMAs, is there > any reason why we want to have different semantics here? I don't think so. At least not for the single-mm case. > > -- > Cheers, > > David / dhildenb > > -- > To unsubscribe from this group and stop receiving emails from it, send an= email to kernel-team+unsubscribe@android.com. >