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.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 352A4C4727E for ; Wed, 7 Oct 2020 16:53:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D23152087D for ; Wed, 7 Oct 2020 16:53:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ThVHp0Bf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728044AbgJGQxV (ORCPT ); Wed, 7 Oct 2020 12:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726129AbgJGQxU (ORCPT ); Wed, 7 Oct 2020 12:53:20 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87EDFC0613D5 for ; Wed, 7 Oct 2020 09:53:19 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id 140so1839736qko.2 for ; Wed, 07 Oct 2020 09:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aA5/IKqeJTcjHMODAliv+D9oxsXiJBjU0Q/RoQOchc4=; b=ThVHp0Bf6+g4+R33mQIvIX8CheiSQQTMUuTCia9X1IqJrBuFaGelh/l39LBTeYKkvK NaMOGfKlUrf0z4iE8OxQVYLuzZ/JlM7sUpAQwKcFn4cRIEuVLL6aIerNL35v1pmwUkj+ wDrYDlD+5FNGiiz175SjQIUqXASz3MvdF3eYJh+ukkwcF83qjZnM9uioklIntUHKaRya Zg9rg6+eKKInIDWli/ZJm1h6yck77cdzU9Fs3bEWsRArMtEGioYwK8tfNazOHk/B4xtt Mf7AVxNkG0ee/JcnZSnMywZa9C4+2enXUIhuG1wGpzdJZvOcjJkPsfCeezTM2uT5xq7S MUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aA5/IKqeJTcjHMODAliv+D9oxsXiJBjU0Q/RoQOchc4=; b=sE2ufgHjhAGvNdxZkiiRDRCraUb8xM68aPKqsOzccsGI2Qz/rjgm0fleJyhKsBEodx l+NW6pvFQSRGJPwfRLVkrwWAWvWF/zeVrvKhccpS4ccZrfKuSvCUfryvKsKKHtLEegnq 8pP67t8SbEgGp3B4O0cqrllVWSI66mmewfI3hzjFHwYdhbWW2BzY4ftlCd1sJFuezCb4 IGZlHNKW+qYwOdEsrUpzcSXcEP5rb4jVxXcmWjnwGxEcAM4epiqcwyH0TxVagNr5L3wS keTT3pH+iObp4U5uqP/BM5j4q3rMN6X94ZuEuPHkdtahC5F5LT0oL9MjbIgY2y6vruwT 4UzQ== X-Gm-Message-State: AOAM531n7OcW+rz9XMzv5fHlO3gMFkwVT8D+gSuSjzR4lpf4fepricpU zfFUQiAvi7RfXZ5zMEHTqFEwGg== X-Google-Smtp-Source: ABdhPJxixhkZJXYtJ75yqJVriDbZSDlnfap0MWWWiSIn4wzaboeX7oTS66SiExjVo2w4rTtFpjs6Eg== X-Received: by 2002:a37:aec2:: with SMTP id x185mr3746059qke.73.1602089598574; Wed, 07 Oct 2020 09:53:18 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id x75sm232893qka.59.2020.10.07.09.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 09:53:17 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQCgm-0010EB-Tr; Wed, 07 Oct 2020 13:53:16 -0300 Date: Wed, 7 Oct 2020 13:53:16 -0300 From: Jason Gunthorpe To: Daniel Vetter Cc: DRI Development , LKML , kvm@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, linux-s390@vger.kernel.org, Daniel Vetter , Pawel Osciak , Marek Szyprowski , Kyungmin Park , Tomasz Figa , Mauro Carvalho Chehab , Andrew Morton , John Hubbard , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Jan Kara , Dan Williams Subject: Re: [PATCH 05/13] mm/frame-vector: Use FOLL_LONGTERM Message-ID: <20201007165316.GT5177@ziepe.ca> References: <20201007164426.1812530-1-daniel.vetter@ffwll.ch> <20201007164426.1812530-6-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007164426.1812530-6-daniel.vetter@ffwll.ch> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 06:44:18PM +0200, Daniel Vetter wrote: > > - /* > - * While get_vaddr_frames() could be used for transient (kernel > - * controlled lifetime) pinning of memory pages all current > - * users establish long term (userspace controlled lifetime) > - * page pinning. Treat get_vaddr_frames() like > - * get_user_pages_longterm() and disallow it for filesystem-dax > - * mappings. > - */ > - if (vma_is_fsdax(vma)) { > - ret = -EOPNOTSUPP; > - goto out; > - } > - > - if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { > - vec->got_ref = true; > - vec->is_pfns = false; > - ret = pin_user_pages_locked(start, nr_frames, > - gup_flags, (struct page **)(vec->ptrs), &locked); > - goto out; > - } The vm_flags still need to be checked before going into the while loop. If the break is taken then nothing would check vm_flags Jason 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=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 21D89C41604 for ; Wed, 7 Oct 2020 16:54:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D4F42087D for ; Wed, 7 Oct 2020 16:54:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IFzpkVBi"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ThVHp0Bf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D4F42087D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7uQNrBcYRu98RcRddB7PBnAJjq6w+E1/+BZ2RgCk1eY=; b=IFzpkVBiIg4ZTUK0qmBbP+2rT fJb125jaZE0l3IQUCzrQF1gdq/GlrhKsMXjFCwmG6JP+gYaiq7BsKNCYcVzrTo+LP3HGjq+Bvej4+ 8w/67Bkxyg6+uu+YXxjgViQag9G3wr31rWIK9HqtEVU1iHCtGnRiB6OKakToCuQLhIanBZgV2LzrB q+8/gOOT+JDAoy1p9SafmeJ3ZeDWWbVULSj35ABN6ubOwsgnwQybN3PC39kiiJA+39HmhCSoYiVTS lzTxeblDmpLUWVP6ROXAMzcp/7sM5lg5eJEqcvK4Ruk/kBB8500uVwVH7Apkt3R/G9uianeoBMl/p HkYFuW4Pw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQCgu-000469-O1; Wed, 07 Oct 2020 16:53:24 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQCgq-00044w-Tr for linux-arm-kernel@lists.infradead.org; Wed, 07 Oct 2020 16:53:22 +0000 Received: by mail-qk1-x741.google.com with SMTP id w12so3567558qki.6 for ; Wed, 07 Oct 2020 09:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aA5/IKqeJTcjHMODAliv+D9oxsXiJBjU0Q/RoQOchc4=; b=ThVHp0Bf6+g4+R33mQIvIX8CheiSQQTMUuTCia9X1IqJrBuFaGelh/l39LBTeYKkvK NaMOGfKlUrf0z4iE8OxQVYLuzZ/JlM7sUpAQwKcFn4cRIEuVLL6aIerNL35v1pmwUkj+ wDrYDlD+5FNGiiz175SjQIUqXASz3MvdF3eYJh+ukkwcF83qjZnM9uioklIntUHKaRya Zg9rg6+eKKInIDWli/ZJm1h6yck77cdzU9Fs3bEWsRArMtEGioYwK8tfNazOHk/B4xtt Mf7AVxNkG0ee/JcnZSnMywZa9C4+2enXUIhuG1wGpzdJZvOcjJkPsfCeezTM2uT5xq7S MUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aA5/IKqeJTcjHMODAliv+D9oxsXiJBjU0Q/RoQOchc4=; b=Z08DV3FkdMLwAcf3iVIcE23HKR4XeBAmrQzAuO9XBnrcT7ZlYWtbo4RvrJ1BgckjFG O+98BwwaeupGNYv1Nie+Yt9mQA2wsfWtrb3PpCIu62nsRPP9iKc5Ys9FvOrlhaXJxZ/V lyqH58zU+OpbNA0hgGH08k+2kgYQdaHJKdfFpIRZH4zdTTUsbczdTOQNUPikgaguP01x LjF5miM682Yt88B6MPyaaBd7yiYYvNwi/ZLr1EDTMOHKOHeJa6HhD/KI8HNiwVVQb3Gl FPdiL99uqsJxMPp6p4uq26e/s5g6gN8yPbpNXOCkHuADDYoUyItgsPd6VnfYcUtA8qAN +5jg== X-Gm-Message-State: AOAM5300nOtVfZj3Vc2kxpG57ZK8vXXe7BJorC1dQ2rrdtg/iDAbNX+I oHzOBPvzlCxKz+tZy1wb70yKXw== X-Google-Smtp-Source: ABdhPJxixhkZJXYtJ75yqJVriDbZSDlnfap0MWWWiSIn4wzaboeX7oTS66SiExjVo2w4rTtFpjs6Eg== X-Received: by 2002:a37:aec2:: with SMTP id x185mr3746059qke.73.1602089598574; Wed, 07 Oct 2020 09:53:18 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id x75sm232893qka.59.2020.10.07.09.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 09:53:17 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQCgm-0010EB-Tr; Wed, 07 Oct 2020 13:53:16 -0300 Date: Wed, 7 Oct 2020 13:53:16 -0300 From: Jason Gunthorpe To: Daniel Vetter Subject: Re: [PATCH 05/13] mm/frame-vector: Use FOLL_LONGTERM Message-ID: <20201007165316.GT5177@ziepe.ca> References: <20201007164426.1812530-1-daniel.vetter@ffwll.ch> <20201007164426.1812530-6-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201007164426.1812530-6-daniel.vetter@ffwll.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201007_125321_371630_23F7B35A X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?B?SsOpcsO0bWU=?= Glisse , linux-s390@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Jan Kara , Pawel Osciak , kvm@vger.kernel.org, John Hubbard , Mauro Carvalho Chehab , LKML , DRI Development , Tomasz Figa , linux-mm@kvack.org, Kyungmin Park , Daniel Vetter , Andrew Morton , Marek Szyprowski , Dan Williams , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 07, 2020 at 06:44:18PM +0200, Daniel Vetter wrote: > > - /* > - * While get_vaddr_frames() could be used for transient (kernel > - * controlled lifetime) pinning of memory pages all current > - * users establish long term (userspace controlled lifetime) > - * page pinning. Treat get_vaddr_frames() like > - * get_user_pages_longterm() and disallow it for filesystem-dax > - * mappings. > - */ > - if (vma_is_fsdax(vma)) { > - ret = -EOPNOTSUPP; > - goto out; > - } > - > - if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { > - vec->got_ref = true; > - vec->is_pfns = false; > - ret = pin_user_pages_locked(start, nr_frames, > - gup_flags, (struct page **)(vec->ptrs), &locked); > - goto out; > - } The vm_flags still need to be checked before going into the while loop. If the break is taken then nothing would check vm_flags Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 062ABC433E7 for ; Thu, 8 Oct 2020 07:21:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A69420739 for ; Thu, 8 Oct 2020 07:21:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ThVHp0Bf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A69420739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE3EE6E0B8; Thu, 8 Oct 2020 07:20:57 +0000 (UTC) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by gabe.freedesktop.org (Postfix) with ESMTPS id A9EC66E073 for ; Wed, 7 Oct 2020 16:53:19 +0000 (UTC) Received: by mail-qk1-x741.google.com with SMTP id 188so3506817qkk.12 for ; Wed, 07 Oct 2020 09:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aA5/IKqeJTcjHMODAliv+D9oxsXiJBjU0Q/RoQOchc4=; b=ThVHp0Bf6+g4+R33mQIvIX8CheiSQQTMUuTCia9X1IqJrBuFaGelh/l39LBTeYKkvK NaMOGfKlUrf0z4iE8OxQVYLuzZ/JlM7sUpAQwKcFn4cRIEuVLL6aIerNL35v1pmwUkj+ wDrYDlD+5FNGiiz175SjQIUqXASz3MvdF3eYJh+ukkwcF83qjZnM9uioklIntUHKaRya Zg9rg6+eKKInIDWli/ZJm1h6yck77cdzU9Fs3bEWsRArMtEGioYwK8tfNazOHk/B4xtt Mf7AVxNkG0ee/JcnZSnMywZa9C4+2enXUIhuG1wGpzdJZvOcjJkPsfCeezTM2uT5xq7S MUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aA5/IKqeJTcjHMODAliv+D9oxsXiJBjU0Q/RoQOchc4=; b=f+BgJ/JLNlh4l3tfa0CVETxvFYIA3Ign3s3DrCj8YrApVo5ygF9wuFQdcPXNlu+teB Z2tdjAvOGFuhDy2psYvjDFKlLhkeBDDhMHyhbmtTNxBpzPMXgh8OZPy2W6nVL+kWsb20 7s6dOOMAe6Oagv5mR5ramTe3Y3wZhKlaitD2NaVJH84G5NJ+Lea+GcdhFiLHER3kDDiC cWuahokjWdoHkanhwrElbymj/XeOvXuXcZ58Mpc8AwNnPOHY4apxROIhw1usk4WBYruf gPyEpdIpB+RloVwBJswnHbMxzfE4wdbbEFZO+QUvdDmRjPPOT+g0R59lPcEH180h1QpY sQ3g== X-Gm-Message-State: AOAM531QbWpwJo6yeqEy/DGOtsXDB4j9KL5oUrbIWJnZ5EbPO1ME+P28 gsPG9HgiiEU5XTLSKYRF7hQxTg== X-Google-Smtp-Source: ABdhPJxixhkZJXYtJ75yqJVriDbZSDlnfap0MWWWiSIn4wzaboeX7oTS66SiExjVo2w4rTtFpjs6Eg== X-Received: by 2002:a37:aec2:: with SMTP id x185mr3746059qke.73.1602089598574; Wed, 07 Oct 2020 09:53:18 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id x75sm232893qka.59.2020.10.07.09.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 09:53:17 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQCgm-0010EB-Tr; Wed, 07 Oct 2020 13:53:16 -0300 Date: Wed, 7 Oct 2020 13:53:16 -0300 From: Jason Gunthorpe To: Daniel Vetter Subject: Re: [PATCH 05/13] mm/frame-vector: Use FOLL_LONGTERM Message-ID: <20201007165316.GT5177@ziepe.ca> References: <20201007164426.1812530-1-daniel.vetter@ffwll.ch> <20201007164426.1812530-6-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201007164426.1812530-6-daniel.vetter@ffwll.ch> X-Mailman-Approved-At: Thu, 08 Oct 2020 07:20:54 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?B?SsOpcsO0bWU=?= Glisse , linux-s390@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Jan Kara , Pawel Osciak , kvm@vger.kernel.org, John Hubbard , Mauro Carvalho Chehab , LKML , DRI Development , Tomasz Figa , linux-mm@kvack.org, Kyungmin Park , Daniel Vetter , Andrew Morton , Marek Szyprowski , Dan Williams , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Oct 07, 2020 at 06:44:18PM +0200, Daniel Vetter wrote: > > - /* > - * While get_vaddr_frames() could be used for transient (kernel > - * controlled lifetime) pinning of memory pages all current > - * users establish long term (userspace controlled lifetime) > - * page pinning. Treat get_vaddr_frames() like > - * get_user_pages_longterm() and disallow it for filesystem-dax > - * mappings. > - */ > - if (vma_is_fsdax(vma)) { > - ret = -EOPNOTSUPP; > - goto out; > - } > - > - if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { > - vec->got_ref = true; > - vec->is_pfns = false; > - ret = pin_user_pages_locked(start, nr_frames, > - gup_flags, (struct page **)(vec->ptrs), &locked); > - goto out; > - } The vm_flags still need to be checked before going into the while loop. If the break is taken then nothing would check vm_flags Jason _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel