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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 DDFCBC433B4 for ; Mon, 17 May 2021 17:07:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 76CBC61221 for ; Mon, 17 May 2021 17:07:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76CBC61221 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7CF18E0001; Mon, 17 May 2021 13:07:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E06A76B007D; Mon, 17 May 2021 13:07:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C58928E0001; Mon, 17 May 2021 13:07:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 908AE6B007B for ; Mon, 17 May 2021 13:07:13 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3154D8249980 for ; Mon, 17 May 2021 17:07:13 +0000 (UTC) X-FDA: 78151353546.29.DF4C9A3 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by imf04.hostedemail.com (Postfix) with ESMTP id 98AC23F6 for ; Mon, 17 May 2021 17:07:11 +0000 (UTC) Received: by mail-qv1-f41.google.com with SMTP id z1so3471335qvo.4 for ; Mon, 17 May 2021 10:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iAVM06Z0b3X00uWZ/iOWO0Am27P94BoQacVHMIqOeTA=; b=Hi7Pzs6QbfTYK6VkC34Npoj70CXFPM+CGdoBXqdqgKx+d3k1CXMiyvi2NxJ9o+3Ps5 TUczTsSeJIYSDtqqvDKgZ6WhB1TB++5ox4YpvxJVaHH1xLROr3NUCcg4upKIy1xQgMGN Ev+9CRnJzuDT8U96AnUq/+CzcBXut28+0MFLmVe1zM8BLZNzk1iHzg8HiPZobysWXV2H 6SivE7N9E4vkYFIq9fIsn0B8UXwgxVu+CX08qBZs9j7rllsatUG1ywvTEZvVboY4C5gt ugBSSY1T1VgYMOi5OEi1l8AOzlbs2C6By2kupIg3G92xdpRjkqBAo3cTRWAESPoJILaa yCQQ== 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=iAVM06Z0b3X00uWZ/iOWO0Am27P94BoQacVHMIqOeTA=; b=E4dr1U2qR6sjyHR1FlwGPJJ80y0Dr7EBSk+AfoV3kk/higZqVDTX0ERMqhZuyBzQJf VTT7z0VjezMkHMK9nMQKeIE4+EBCaVpJ8x+HGDeUrAqU0lCpr3QV3VBBuCv2pvP4Gv62 Ncnzjvf6wHWIN++8a7x8nHUWvfkAgSKvD9dURLzC0Xno46sDG5Z5Plp3spaGgcKnwOOZ PKocpTdUIq/SezRUYZjU2gIxMzXnih1deJjvBB6lB3Z5NnPCQDqRdOBj0/LyRwv+oH3S QZdZA4WUl05OMCL1Y3FdCndy9Q0u0HXaqHRC7bhAi9vXrPfiZmOh//gTWQklm8ClIPOm XFvg== X-Gm-Message-State: AOAM531YbMei8X8sPi8k8qJer8t3TtMezkaYgqEgKb8HqiPF46ni8G2Z zNybZYf/nR97bdSsoOS7HPpzt3C/ZILuGHzvc1k= X-Google-Smtp-Source: ABdhPJzx7xfbVLxtJRcNnW6bLoi3veRw1dYSAINsnytiKfr6pa5SKgDCTSXmaY3v6JH/Q6kWZHSQFDo8ra71nMmy0Wo= X-Received: by 2002:ad4:4961:: with SMTP id p1mr611618qvy.43.1621271231753; Mon, 17 May 2021 10:07:11 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20210517131137.GA19451@lst.de> From: Matthew Auld Date: Mon, 17 May 2021 18:06:44 +0100 Message-ID: Subject: Re: [Intel-gfx] [PATCH 4/4] i915: fix remap_io_sg to verify the pgprot To: Christoph Hellwig Cc: Serge Belyshev , Peter Zijlstra , Daniel Vetter , Intel Graphics Development , Chris Wilson , linux-mm@kvack.org, ML dri-devel , Andrew Morton Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Hi7Pzs6Q; spf=pass (imf04.hostedemail.com: domain of matthewwilliamauld@gmail.com designates 209.85.219.41 as permitted sender) smtp.mailfrom=matthewwilliamauld@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 98AC23F6 X-Stat-Signature: 8uk8hy5yxi5por6xqi6putm1asjjkbm5 X-HE-Tag: 1621271231-480571 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, 17 May 2021 at 14:11, 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.. AFAIK there are two users of remap_io_sg, the first is our shmem objects(see i915_gem_shmem.c), and for these we support UC, WC, and WB mmap modes for userspace. The other user is device local-memory objects(VRAM), and for this one we have an actual io_mapping which is allocated as WC, and IIRC this should only be mapped as WC for the mmap mode, but normal userspace can't hit this path yet. What do we need to do here? It sounds like shmem backed objects are allocated as WB for the pages underneath, but i915 allows mapping them as UC/WC which trips up this track_pfn thing? > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx