From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CD96C4727E for ; Sat, 26 Sep 2020 04:15:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF6AF21527 for ; Sat, 26 Sep 2020 04:15:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=amacapital-net.20150623.gappssmtp.com header.i=@amacapital-net.20150623.gappssmtp.com header.b="BWnMfRXU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF6AF21527 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C49996B005C; Sat, 26 Sep 2020 00:15:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD40D6B0062; Sat, 26 Sep 2020 00:15:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9B3D6B0068; Sat, 26 Sep 2020 00:15:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id 925BD6B005C for ; Sat, 26 Sep 2020 00:15:24 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3FDBE180AD801 for ; Sat, 26 Sep 2020 04:15:24 +0000 (UTC) X-FDA: 77303898168.22.push42_34065632716d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 1072718038E60 for ; Sat, 26 Sep 2020 04:15:24 +0000 (UTC) X-HE-Tag: push42_34065632716d X-Filterd-Recvd-Size: 5726 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Sat, 26 Sep 2020 04:15:23 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id v14so477570pjd.4 for ; Fri, 25 Sep 2020 21:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=KUTsQ4cRgo7tcvKxTzbTra/DQ+skBopOu8YgTTZQp+o=; b=BWnMfRXUFKWpwia+E3QCxxaGzaHx+nORFT5Orpdeojhqss9dXtuYypFi6XTnsJ3WjW WEkjoK65wFyrvC73Uj4kbseBI6mjY8eI00R1vA7WhobCZE/0rP0GNtVPhFli7UV8Dl/h byjFxzHO9ScP+K55Ql6Rk8wrBGTASEGmQ12Kb9PNQ7J90+N7zvbXrlNrBQFcJJV8S2rn xUTWlqa18psooaWuTDDBTjmNpwjnO0T8EU6JYdLZpmN++wFoU6QFG7eeYK1CWTGKq17K RP1E8gLbK+aIf5TJRRCKDWGWep7Saozz5gdF6pyCSCrIAFp0gSKBE91tdnp4Y5Np7IuE b1rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=KUTsQ4cRgo7tcvKxTzbTra/DQ+skBopOu8YgTTZQp+o=; b=LBuAuo5e9+fgkeiG9Ja5/xd87kuI6EzcxjBnvefCHqODSwS4rYISahuwFI1ZcrYFSq 9joFE7A34EQLuoFA/71/QvzLutm+O4HHMenW8UQOFUV1Kly3zRIt/n5un2XaY8EGbR1c k5gcXngd57vFVvhVKrNJitsUIP1M3bXtzYlKoA2XuQQ2/hSR6XsnR1rToYQ5c8tr/yFq DV8bipS4hr4Tf1HvADfvg/suk6aunBTbSLtYwUNNS0r00HEuMUeRMUVFU3mIeApZHT1D p1pwDNIjNTcSL5lAlqBD/PeiCmCxr95RfQ98JN9ng7LXDlZ6sNgp2LmNGiimn6dUya5H wg0g== X-Gm-Message-State: AOAM530ieFDr6G9sJTZw7xonNr3qFRVXfz2VJYhFQXNcddZ3W9s9FVKX TXW0Mv7GnGTc4X/p8XhzAZ1QHA== X-Google-Smtp-Source: ABdhPJzsb5zohq/TAtZ5fioaotDPmq8e15jJlMaKFeemNTlWPQEVFAiwftJs/1T1diVswdmRcQu08g== X-Received: by 2002:a17:902:b18f:b029:d2:1ec0:4161 with SMTP id s15-20020a170902b18fb02900d21ec04161mr2444866plr.58.1601093722526; Fri, 25 Sep 2020 21:15:22 -0700 (PDT) Received: from localhost.localdomain ([2601:646:c200:1ef2:65a8:3322:5d17:ae5b]) by smtp.gmail.com with ESMTPSA id gg19sm505756pjb.49.2020.09.25.21.15.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Sep 2020 21:15:21 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v38 10/24] mm: Add vm_ops->mprotect() Date: Fri, 25 Sep 2020 21:15:19 -0700 Message-Id: <2321E653-F629-44D7-91C3-F42F42AF4EF6@amacapital.net> References: <230ce6da-7820-976f-f036-a261841d626f@intel.com> Cc: Sean Christopherson , Haitao Huang , Jarkko Sakkinen , Andy Lutomirski , X86 ML , linux-sgx@vger.kernel.org, LKML , Linux-MM , Andrew Morton , Matthew Wilcox , Jethro Beekman , Darren Kenny , Andy Shevchenko , asapek@google.com, Borislav Petkov , "Xing, Cedric" , chenalexchen@google.com, Conrad Parker , cyhanish@google.com, "Huang, Haitao" , Josh Triplett , "Huang, Kai" , "Svahn, Kai" , Keith Moyer , Christian Ludloff , Neil Horman , Nathaniel McCallum , Patrick Uiterwijk , David Rientjes , Thomas Gleixner , yaozhangx@google.com In-Reply-To: <230ce6da-7820-976f-f036-a261841d626f@intel.com> To: Dave Hansen X-Mailer: iPhone Mail (18A373) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > On Sep 25, 2020, at 12:53 PM, Dave Hansen wrote: >=20 > =EF=BB=BFOn 9/25/20 12:43 PM, Sean Christopherson wrote: >>> That means that the intent argument (SGX_PROT_*) is currently unused. >> No, the intent argument is used (eventually) by SGX's ->mprotect() >> implementation, i.e. sgx_mprotect() enforces that the actual protections a= re a >> subset of the declared/intended protections. >>=20 >> If ->mprotect() is not merged, then it yes, it will be unused. >=20 > OK, I think I've got it. >=20 > I think I'm OK with adding ->mprotect(). As long as folks buy into the > argument that intent needs to be checked at mmap() time, they obviously > need to be checked at mprotect() too. >=20 > Jarkko, if you want to try and rewrite the changelog, capturing the > discussion here and reply, I think I can ack the resulting patch. I > don't know if that will satisfy the request from Boris from an ack from > a "mm person", but we can at least start there. :) I think I agree. ->mprotect seems reasonable to me. FWIW, I don=E2=80=99t think I should ack this particular thing =E2=80=94 it w= as, to a decent extent, my suggestion in the first place, so I=E2=80=99m bia= sed. I think it turned into something reasonable, and the ->mprotect mechani= sm seems easily supportable and plausibly useful for other purposes down the= road. >=20 > Please be judicious in what you include in the changelog. There's been > a lot of detritus in them. Let's keep it as short, sweet, simple and on > topic as we can.