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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 C62B4C47420 for ; Fri, 2 Oct 2020 02:07:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86FEE20719 for ; Fri, 2 Oct 2020 02:07:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SyWPxJQj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387575AbgJBCHC (ORCPT ); Thu, 1 Oct 2020 22:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387496AbgJBCHC (ORCPT ); Thu, 1 Oct 2020 22:07:02 -0400 Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2040C0613E3 for ; Thu, 1 Oct 2020 19:07:00 -0700 (PDT) Received: by mail-vs1-xe41.google.com with SMTP id x1so370176vsf.1 for ; Thu, 01 Oct 2020 19:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vT94c58c5RJpPi7b9HKxloC1mNQH0vp26xTTILK9X5s=; b=SyWPxJQjF1pyN0tV9nljtIiQi7IAU4ykxGKYZ+Ngd0KIBmRApBv8Lys4YpoYU593S3 R/81CTJRQli3fwWhMot/+N4MW2z9TutEevFLsPxdQT04VEDJf3EcDb7TxTqPw16raYmL O185M4iVi+3hsx1y5CvCknDPjkmzzw/9oxohxNKfqhyfWVgIu2chMpy4PROp5XBAYtfw FhfullWI5DsudxJwmWVhfm3K5WnYqpDGnYdwOeDSZPIpIYNezYXrtPq++798LoUDLvAf jsLd/mLSMkpNOeJC2ZXc4XqQD5T+2H2J74a1Im5Bjz83C+9BqVudzCgo4FUKJFYPsFIw L07w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vT94c58c5RJpPi7b9HKxloC1mNQH0vp26xTTILK9X5s=; b=Q7BJN9yLoDoU5wjQp1N+6tzfKiyKBLi6HvLd5Hoc8qOJDrguyxTKEPv3ckmBlgOm/3 ojFYR4Tw15g+jw1CA3TnHlmuddvA7bcTnLSJsZ0AF9gZ7uyZW2GvKzwyCszUL1yVuJ6C kYjMNV6FJVvi8mERI9ZAyKuphuS8BPeKcpsxhtl+Ke2OQE0IkRXe74PPJXcAivaeFGjQ WjewwBVPPg2Kbg77SoVHnELwTsP6zZnQzu3AgOMIkVCdA6MddfazJSBwPxBQ0z4F/5Td 5kjD9m/2H1BrzHwow2nbv4yqxf4cIe8YNDkEzQx5vefm4oJvJYTWKw39W3adnUnv7yuQ pDRw== X-Gm-Message-State: AOAM533wcObvuUGVY8DyeIy1v2Lzdo0GQXGsXdNo4oBH4jLTelE0yGfx EHIOWT55ThTrW3M2kK8L7uPIPEvqW+fgNbL8PM7R1g== X-Google-Smtp-Source: ABdhPJxoSqWOWqkgye3JYdbsMetKDhjeqdmku/0TOcCNaVVCZlRIiJXTsWsPQC2qA8YecqG4ck2fb88Uv71SNqE97IM= X-Received: by 2002:a67:e83:: with SMTP id 125mr124303vso.22.1601604419476; Thu, 01 Oct 2020 19:06:59 -0700 (PDT) MIME-Version: 1.0 References: <20200925145649.5438-1-yu-cheng.yu@intel.com> <20200925145649.5438-20-yu-cheng.yu@intel.com> In-Reply-To: <20200925145649.5438-20-yu-cheng.yu@intel.com> From: Peter Collingbourne Date: Thu, 1 Oct 2020 19:06:48 -0700 Message-ID: Subject: Re: [PATCH v13 19/26] mm: Re-introduce do_mmap_pgoff() To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Linux Kernel Mailing List , linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Andrew Morton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 7:57 AM Yu-cheng Yu wrote: > > There was no more caller passing vm_flags to do_mmap(), and vm_flags was > removed from the function's input by: > > commit 45e55300f114 ("mm: remove unnecessary wrapper function do_mmap_pgoff()"). > > There is a new user now. Shadow stack allocation passes VM_SHSTK to > do_mmap(). Re-introduce the vm_flags and do_mmap_pgoff(). I would prefer to change the callers to pass the additional 0 argument instead of bringing the wrapper function back, but if we're going to bring it back then we should fix the naming (both functions take a pgoff argument, so the previous name do_mmap_pgoff() was just plain confusing). Peter 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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 513DAC47426 for ; Fri, 2 Oct 2020 02:07:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B7FFA20708 for ; Fri, 2 Oct 2020 02:07:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SyWPxJQj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7FFA20708 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DFE208E0001; Thu, 1 Oct 2020 22:07:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D88806B0078; Thu, 1 Oct 2020 22:07:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C50AF8E0001; Thu, 1 Oct 2020 22:07:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 9861C6B0071 for ; Thu, 1 Oct 2020 22:07:01 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 36D493630 for ; Fri, 2 Oct 2020 02:07:01 +0000 (UTC) X-FDA: 77325347442.22.test23_5f09672271a0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 0C35218038E60 for ; Fri, 2 Oct 2020 02:07:01 +0000 (UTC) X-HE-Tag: test23_5f09672271a0 X-Filterd-Recvd-Size: 4471 Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Fri, 2 Oct 2020 02:07:00 +0000 (UTC) Received: by mail-vs1-f65.google.com with SMTP id y194so364651vsc.4 for ; Thu, 01 Oct 2020 19:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vT94c58c5RJpPi7b9HKxloC1mNQH0vp26xTTILK9X5s=; b=SyWPxJQjF1pyN0tV9nljtIiQi7IAU4ykxGKYZ+Ngd0KIBmRApBv8Lys4YpoYU593S3 R/81CTJRQli3fwWhMot/+N4MW2z9TutEevFLsPxdQT04VEDJf3EcDb7TxTqPw16raYmL O185M4iVi+3hsx1y5CvCknDPjkmzzw/9oxohxNKfqhyfWVgIu2chMpy4PROp5XBAYtfw FhfullWI5DsudxJwmWVhfm3K5WnYqpDGnYdwOeDSZPIpIYNezYXrtPq++798LoUDLvAf jsLd/mLSMkpNOeJC2ZXc4XqQD5T+2H2J74a1Im5Bjz83C+9BqVudzCgo4FUKJFYPsFIw L07w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vT94c58c5RJpPi7b9HKxloC1mNQH0vp26xTTILK9X5s=; b=QUjUSnh6UeVbHhAh9xa+P4ZYvzdrgnV7R9fFlVxoVTj9nKWzURCM34gVN4xMObETFL L0A/4WWdZBm/n3Knv7Yo/EJP3bzza8+w1cBjyyLnW40yxyrY1A5wHKAj/McoCXNCAMZH MLAxElGQnkYvFwkoVjvNr/kh5osD4hcbxyJym5gD9/GLIzu52bCifitchHqNpu6t83nS WEgAP63+ZPEabDRgp3iW+7s589LITvE+uOn3/tTxE6x+dd69r9k6tv/dwNQUMkKTACXL Cd/GAPJx+Ja8PYJdjxjTOPN4wu4XM2EDotCH1dnAw93ecyqeGYnGtKr18uSOJIso8ilV wvDg== X-Gm-Message-State: AOAM5336iyzMpefZTSOBSL+2+I+SVn9LAZ8rKEdzNdDtdixGVWwFVeHI V9fn8b0BRId4CbKt6Yq8Cr206uPDy9iw+88iwmzKjQ== X-Google-Smtp-Source: ABdhPJxoSqWOWqkgye3JYdbsMetKDhjeqdmku/0TOcCNaVVCZlRIiJXTsWsPQC2qA8YecqG4ck2fb88Uv71SNqE97IM= X-Received: by 2002:a67:e83:: with SMTP id 125mr124303vso.22.1601604419476; Thu, 01 Oct 2020 19:06:59 -0700 (PDT) MIME-Version: 1.0 References: <20200925145649.5438-1-yu-cheng.yu@intel.com> <20200925145649.5438-20-yu-cheng.yu@intel.com> In-Reply-To: <20200925145649.5438-20-yu-cheng.yu@intel.com> From: Peter Collingbourne Date: Thu, 1 Oct 2020 19:06:48 -0700 Message-ID: Subject: Re: [PATCH v13 19/26] mm: Re-introduce do_mmap_pgoff() To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Linux Kernel Mailing List , linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Andrew Morton Content-Type: text/plain; charset="UTF-8" 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 Fri, Sep 25, 2020 at 7:57 AM Yu-cheng Yu wrote: > > There was no more caller passing vm_flags to do_mmap(), and vm_flags was > removed from the function's input by: > > commit 45e55300f114 ("mm: remove unnecessary wrapper function do_mmap_pgoff()"). > > There is a new user now. Shadow stack allocation passes VM_SHSTK to > do_mmap(). Re-introduce the vm_flags and do_mmap_pgoff(). I would prefer to change the callers to pass the additional 0 argument instead of bringing the wrapper function back, but if we're going to bring it back then we should fix the naming (both functions take a pgoff argument, so the previous name do_mmap_pgoff() was just plain confusing). Peter