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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 1D22EC433ED for ; Tue, 18 May 2021 13:23:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 91235610CD for ; Tue, 18 May 2021 13:23:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91235610CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2984F8E0024; Tue, 18 May 2021 09:23:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 24B0D8E0023; Tue, 18 May 2021 09:23:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EB1C8E0024; Tue, 18 May 2021 09:23:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id CE4338E0023 for ; Tue, 18 May 2021 09:23:36 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6FB2A181AEF1E for ; Tue, 18 May 2021 13:23:36 +0000 (UTC) X-FDA: 78154418832.01.A9CC207 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf23.hostedemail.com (Postfix) with ESMTP id 04EBCA000182 for ; Tue, 18 May 2021 13:23:33 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 2D56267373; Tue, 18 May 2021 15:23:34 +0200 (CEST) Date: Tue, 18 May 2021 15:23:33 +0200 From: Christoph Hellwig To: Thomas =?iso-8859-1?Q?Hellstr=F6m?= Cc: Christoph Hellwig , Serge Belyshev , Peter Zijlstra , Daniel Vetter , intel-gfx@lists.freedesktop.org, Chris Wilson , linux-mm@kvack.org, dri-devel@lists.freedesktop.org, Andrew Morton Subject: Re: [Intel-gfx] [PATCH 4/4] i915: fix remap_io_sg to verify the pgprot Message-ID: <20210518132333.GC2617@lst.de> References: <20210326055505.1424432-1-hch@lst.de> <20210326055505.1424432-5-hch@lst.de> <87pmxqiry6.fsf@depni.sinp.msu.ru> <20210517123716.GD15150@lst.de> <87lf8dik15.fsf@depni.sinp.msu.ru> <20210517131137.GA19451@lst.de> <976fb38a-7780-6ca6-d602-a5f02c0938c9@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <976fb38a-7780-6ca6-d602-a5f02c0938c9@linux.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=none; spf=none (imf23.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 04EBCA000182 X-Stat-Signature: 4wt14gh4aaodh5bsmua9it4pfu4ybtbx X-HE-Tag: 1621344213-97698 Content-Transfer-Encoding: quoted-printable 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 Mon, May 17, 2021 at 11:46:35PM +0200, Thomas Hellstr=F6m wrote: > Apart from the caching aliasing Mattew brought up, doesn't the=20 > remap_pfn_range_xxx() family require the mmap_sem held in write mode si= nce=20 > it modifies the vma structure? remap_io_sg() is called from the fault=20 > handler with the mmap_sem held in read mode only. Only for vma->vm_flags, and remap_sg already asserts all the interesting flags are set, although it does not assert VM_IO. We could move the assignment out of remap_pfn_range_notrack and into remap_pfn_range and just assert that the proper flags are set, though. 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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 C5E12C433B4 for ; Tue, 18 May 2021 13:23:38 +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 837B8610CD for ; Tue, 18 May 2021 13:23:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 837B8610CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FB136EB71; Tue, 18 May 2021 13:23:38 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7748D6EB71; Tue, 18 May 2021 13:23:36 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 2D56267373; Tue, 18 May 2021 15:23:34 +0200 (CEST) Date: Tue, 18 May 2021 15:23:33 +0200 From: Christoph Hellwig To: Thomas =?iso-8859-1?Q?Hellstr=F6m?= Message-ID: <20210518132333.GC2617@lst.de> References: <20210326055505.1424432-1-hch@lst.de> <20210326055505.1424432-5-hch@lst.de> <87pmxqiry6.fsf@depni.sinp.msu.ru> <20210517123716.GD15150@lst.de> <87lf8dik15.fsf@depni.sinp.msu.ru> <20210517131137.GA19451@lst.de> <976fb38a-7780-6ca6-d602-a5f02c0938c9@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <976fb38a-7780-6ca6-d602-a5f02c0938c9@linux.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: [Intel-gfx] [PATCH 4/4] i915: fix remap_io_sg to verify the pgprot X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Serge Belyshev , Peter Zijlstra , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , linux-mm@kvack.org, Andrew Morton , Christoph Hellwig Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, May 17, 2021 at 11:46:35PM +0200, Thomas Hellstr=F6m wrote: > Apart from the caching aliasing Mattew brought up, doesn't the = > remap_pfn_range_xxx() family require the mmap_sem held in write mode sinc= e = > it modifies the vma structure? remap_io_sg() is called from the fault = > handler with the mmap_sem held in read mode only. Only for vma->vm_flags, and remap_sg already asserts all the interesting flags are set, although it does not assert VM_IO. We could move the assignment out of remap_pfn_range_notrack and into remap_pfn_range and just assert that the proper flags are set, though. _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx