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,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 C2893C433B4 for ; Mon, 17 May 2021 21:46:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 616ED610A1 for ; Mon, 17 May 2021 21:46:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 616ED610A1 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 9E73C8E0005; Mon, 17 May 2021 17:46:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 997C78E0002; Mon, 17 May 2021 17:46:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 811618E0005; Mon, 17 May 2021 17:46:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 4F4938E0002 for ; Mon, 17 May 2021 17:46:44 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D97F28248D7C for ; Mon, 17 May 2021 21:46:43 +0000 (UTC) X-FDA: 78152057886.22.AE6C5F8 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf08.hostedemail.com (Postfix) with ESMTP id 04C3B80192E5 for ; Mon, 17 May 2021 21:46:39 +0000 (UTC) IronPort-SDR: SUs/FpDLbjb7+uZPGtRXx9uoColFz3W5esaI3ITuzjC2saGwu8bqB9ngNG1YyurM1BxwdqdBOp vf0wxj70SvZg== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="187695762" X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="187695762" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 14:46:40 -0700 IronPort-SDR: s5l9ImYLcSiB/VyGPVX9aB8wj3/TqQL2Gvtn9SvHg+KEAQri3lwvx4FhqH3+3zM3KjxvlykP5/ YFPogSmBzmJA== X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="393695671" Received: from mkosciow-mobl.igk.intel.com (HELO [10.249.254.186]) ([10.249.254.186]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 14:46:37 -0700 Subject: Re: [Intel-gfx] [PATCH 4/4] i915: fix remap_io_sg to verify the pgprot To: Christoph Hellwig , Serge Belyshev Cc: Peter Zijlstra , Daniel Vetter , intel-gfx@lists.freedesktop.org, Chris Wilson , linux-mm@kvack.org, dri-devel@lists.freedesktop.org, Andrew Morton 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> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= Message-ID: <976fb38a-7780-6ca6-d602-a5f02c0938c9@linux.intel.com> Date: Mon, 17 May 2021 23:46:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210517131137.GA19451@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none); spf=none (imf08.hostedemail.com: domain of thomas.hellstrom@linux.intel.com has no SPF policy when checking 134.134.136.20) smtp.mailfrom=thomas.hellstrom@linux.intel.com X-Stat-Signature: 8j7b6bqnhi4m4kgsf4taj5padqu788wn X-Rspamd-Queue-Id: 04C3B80192E5 X-Rspamd-Server: rspam02 X-HE-Tag: 1621287999-330413 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 5/17/21 3:11 PM, Christoph Hellwig wrote: > On Mon, May 17, 2021 at 04:09:42PM +0300, Serge Belyshev wrote: >> Christoph Hellwig writes: >> >>> As an ad-hoc experiment: can you replace the call to remap_pfn_range >>> with remap_pfn_range_notrack (and export it if you build i915 modular) >>> in remap_io_sg and see if that makes any difference? >> That worked, thanks -- no artifacts seen. > Looks like it is caused by the validation failure then. Which means the > existing code is doing something wrong in its choice of the page > protection bit. I really need help from the i915 maintainers here.. Hmm, Apart from the caching aliasing Mattew brought up, doesn't the remap_pfn_range_xxx() family require the mmap_sem held in write mode since it modifies the vma structure? remap_io_sg() is called from the fault handler with the mmap_sem held in read mode only. /Thomas > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx 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,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 34B8FC433ED for ; Mon, 17 May 2021 21:46:44 +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 E91CC6109E for ; Mon, 17 May 2021 21:46:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E91CC6109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 BC6F96E4C1; Mon, 17 May 2021 21:46:42 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 564576E48E; Mon, 17 May 2021 21:46:41 +0000 (UTC) IronPort-SDR: jedau+5vNUxmyr3/Y75oc0/ZG6Dw3/FnGMdhhyBRwTYHvhl0I9M4473HbbE9XgnmwKPLxisbaD ZzOWi/OlCAbA== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="198624735" X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="198624735" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 14:46:40 -0700 IronPort-SDR: s5l9ImYLcSiB/VyGPVX9aB8wj3/TqQL2Gvtn9SvHg+KEAQri3lwvx4FhqH3+3zM3KjxvlykP5/ YFPogSmBzmJA== X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="393695671" Received: from mkosciow-mobl.igk.intel.com (HELO [10.249.254.186]) ([10.249.254.186]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 14:46:37 -0700 Subject: Re: [Intel-gfx] [PATCH 4/4] i915: fix remap_io_sg to verify the pgprot To: Christoph Hellwig , Serge Belyshev 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> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= Message-ID: <976fb38a-7780-6ca6-d602-a5f02c0938c9@linux.intel.com> Date: Mon, 17 May 2021 23:46:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210517131137.GA19451@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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: Peter Zijlstra , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , linux-mm@kvack.org, Andrew Morton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 5/17/21 3:11 PM, Christoph Hellwig wrote: > On Mon, May 17, 2021 at 04:09:42PM +0300, Serge Belyshev wrote: >> Christoph Hellwig writes: >> >>> As an ad-hoc experiment: can you replace the call to remap_pfn_range >>> with remap_pfn_range_notrack (and export it if you build i915 modular) >>> in remap_io_sg and see if that makes any difference? >> That worked, thanks -- no artifacts seen. > Looks like it is caused by the validation failure then. Which means the > existing code is doing something wrong in its choice of the page > protection bit. I really need help from the i915 maintainers here.. Hmm, Apart from the caching aliasing Mattew brought up, doesn't the remap_pfn_range_xxx() family require the mmap_sem held in write mode since it modifies the vma structure? remap_io_sg() is called from the fault handler with the mmap_sem held in read mode only. /Thomas > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx 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,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 1B46DC433B4 for ; Mon, 17 May 2021 21:46:43 +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 D1B9C6109E for ; Mon, 17 May 2021 21:46:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1B9C6109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 49D766E48E; Mon, 17 May 2021 21:46:42 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 564576E48E; Mon, 17 May 2021 21:46:41 +0000 (UTC) IronPort-SDR: jedau+5vNUxmyr3/Y75oc0/ZG6Dw3/FnGMdhhyBRwTYHvhl0I9M4473HbbE9XgnmwKPLxisbaD ZzOWi/OlCAbA== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="198624735" X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="198624735" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 14:46:40 -0700 IronPort-SDR: s5l9ImYLcSiB/VyGPVX9aB8wj3/TqQL2Gvtn9SvHg+KEAQri3lwvx4FhqH3+3zM3KjxvlykP5/ YFPogSmBzmJA== X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="393695671" Received: from mkosciow-mobl.igk.intel.com (HELO [10.249.254.186]) ([10.249.254.186]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 14:46:37 -0700 To: Christoph Hellwig , Serge Belyshev 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> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= Message-ID: <976fb38a-7780-6ca6-d602-a5f02c0938c9@linux.intel.com> Date: Mon, 17 May 2021 23:46:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210517131137.GA19451@lst.de> Content-Language: en-US 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: Peter Zijlstra , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , linux-mm@kvack.org, Andrew Morton Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 5/17/21 3:11 PM, Christoph Hellwig wrote: > On Mon, May 17, 2021 at 04:09:42PM +0300, Serge Belyshev wrote: >> Christoph Hellwig writes: >> >>> As an ad-hoc experiment: can you replace the call to remap_pfn_range >>> with remap_pfn_range_notrack (and export it if you build i915 modular) >>> in remap_io_sg and see if that makes any difference? >> That worked, thanks -- no artifacts seen. > Looks like it is caused by the validation failure then. Which means the > existing code is doing something wrong in its choice of the page > protection bit. I really need help from the i915 maintainers here.. Hmm, Apart from the caching aliasing Mattew brought up, doesn't the remap_pfn_range_xxx() family require the mmap_sem held in write mode since it modifies the vma structure? remap_io_sg() is called from the fault handler with the mmap_sem held in read mode only. /Thomas > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx