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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E1044C433E1 for ; Tue, 7 Jul 2020 04:02:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF67D206C3 for ; Tue, 7 Jul 2020 04:02:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF67D206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 469AC6B0026; Tue, 7 Jul 2020 00:02:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 41B156B0027; Tue, 7 Jul 2020 00:02:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32FD46B0028; Tue, 7 Jul 2020 00:02:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id 1EC736B0026 for ; Tue, 7 Jul 2020 00:02:08 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A556D824805A for ; Tue, 7 Jul 2020 04:02:07 +0000 (UTC) X-FDA: 77009931894.20.steel67_10070b226eb1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 7EFF4180C07AF for ; Tue, 7 Jul 2020 04:02:07 +0000 (UTC) X-HE-Tag: steel67_10070b226eb1 X-Filterd-Recvd-Size: 3802 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 04:02:06 +0000 (UTC) IronPort-SDR: BdVhqHVjQoIbBRK3s0Rlb4yjjvo1q69jcc4o+P4VYdBtyjfbDacXKdrsfCI3BULNq2Gp7eg7zj UbxJhiG2St4Q== X-IronPort-AV: E=McAfee;i="6000,8403,9674"; a="232396251" X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="232396251" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2020 21:02:05 -0700 IronPort-SDR: lnrqym7HRjdzFxj0amzMyaJ/xjzHqd8+7SCyrMcOvpmFi4Rr/tRdxKxSS2CPxX64LXT8FvbQwP aOv2gWsmV1Ew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="483361427" Received: from apiccion-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.45.178]) by fmsmga005.fm.intel.com with ESMTP; 06 Jul 2020 21:01:52 -0700 Date: Tue, 7 Jul 2020 07:01:51 +0300 From: Jarkko Sakkinen To: Matthew Wilcox Cc: Sean Christopherson , x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Jethro Beekman , andriy.shevchenko@linux.intel.com, asapek@google.com, bp@alien8.de, cedric.xing@intel.com, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, josh@joshtriplett.org, kai.huang@intel.com, kai.svahn@intel.com, kmoy@google.com, ludloff@google.com, luto@kernel.org, nhorman@redhat.com, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v34 10/24] mm: Add vm_ops->mprotect() Message-ID: <20200707040151.GA143804@linux.intel.com> References: <20200707030204.126021-1-jarkko.sakkinen@linux.intel.com> <20200707030204.126021-11-jarkko.sakkinen@linux.intel.com> <20200707031424.GD25523@casper.infradead.org> <20200707032254.GB5208@linux.intel.com> <20200707032408.GE25523@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707032408.GE25523@casper.infradead.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Rspamd-Queue-Id: 7EFF4180C07AF X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Tue, Jul 07, 2020 at 04:24:08AM +0100, Matthew Wilcox wrote: > On Mon, Jul 06, 2020 at 08:22:54PM -0700, Sean Christopherson wrote: > > On Tue, Jul 07, 2020 at 04:14:24AM +0100, Matthew Wilcox wrote: > > > > + if (vma->vm_ops && vma->vm_ops->mprotect) { > > > > + error = vma->vm_ops->mprotect(vma, nstart, tmp, prot); > > > > + if (error) > > > > + goto out; > > > > + } > > > > Based on "... and then the vma owner can do whatever it needs to before > > calling mprotect_fixup(), which is already not static", my interpretation > > is that Matthew's intent was to do: > > > > if (vma->vm_ops && vma->vm_ops->mprotect) > > error = = vma->vm_ops->mprotect(vma, nstart, tmp, prot); > > else > > error = mprotect_fixup(vma, &prev, nstart, tmp, newflags); > > if (error) > > goto out; > > > > i.e. make .mprotect() a full replacement as opposed to a prereq hook. > > Yes, it was. I was just looking at the next patch to be sure this was > how I'd been misunderstood. I'm don't get this part. If mprotect_fixup is called in the tail of the callback, why it has to be called inside the callback and not be called after the callback? The reason I only part did what you requested was to do only the part of the change that I get. Not to oppose it. /Jarkko