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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 6FE57C432C0 for ; Tue, 3 Dec 2019 09:55:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3150220675 for ; Tue, 3 Dec 2019 09:55:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="SZCmKJP6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3150220675 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B627B6B0363; Tue, 3 Dec 2019 04:55:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF3C36B0364; Tue, 3 Dec 2019 04:55:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B3AD6B0366; Tue, 3 Dec 2019 04:55:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 7D4CA6B0363 for ; Tue, 3 Dec 2019 04:55:06 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 484CA181AEF1F for ; Tue, 3 Dec 2019 09:55:06 +0000 (UTC) X-FDA: 76223371812.23.wood68_83c9958208059 X-HE-Tag: wood68_83c9958208059 X-Filterd-Recvd-Size: 4395 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Dec 2019 09:55:05 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id e28so3006519ljo.9 for ; Tue, 03 Dec 2019 01:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Hv+Pds3vFXC3zGf7lcsSE/HZtqLjppCdeoWk5E8JtRk=; b=SZCmKJP6H4Orpk4pbjEoc8btCiRad6RxEpjVhsOAj+Ui27spoh+5SX7bPhzFtFm0Zu javlHUKAVkch6ScVcRxBdqC7VvR3gNQKXtKOF4nUnoqeUX1v9toaER2EVDchWVCDZ+87 nsL8wD6+LjyrgeSEi4QtJlYvKIkdtqkBEFBttWO8a9bZ8H0DCnDkrbDzz+gr68SnLGwT 6tT5ryOmVi8P7jWRGc8+poPLuQOWtX74Fm7jLctwlPoy4JUnEDhDObCC82jYLcQYH4bL r60N83z6VT8GScFOFpQTzKjmuN+qJSB9LzJ/N2l0OSKS9JAgKWiW9dDvFzE4C46WDoF9 sDOg== 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:content-transfer-encoding :in-reply-to:user-agent; bh=Hv+Pds3vFXC3zGf7lcsSE/HZtqLjppCdeoWk5E8JtRk=; b=nPkN47mGUcEPjMwy/N9NeIZz5d//ogGp65w+YhDiJG3zmleDNMBtB2K9/ow/jBf/eQ 4mYfHk1CtRYSG3aBlU0iuaZGIG40C6bT+T7pfHxbxe5yf2g2U5DH4ZZ4+iaqF2aaQ1jL lD6sDWR1SlXzb34PDVqI3r9uH4GCbYWKlFJNWIkzSPQFu42t9n0YXy2aYct9pISfWlSA v+6ZwQbgczAiwU/n5pdl1cl9QEkP5OoA08VF1ZDZjtKqtatK558QC07XSrhxGmk4uaqp VwZHe6pHEWn2zUAh9nKVjL0FxPvbTwb30gS2VOfZIHi7fAWkXjDxuHFdywWSCFtrvt25 h6HQ== X-Gm-Message-State: APjAAAVjyeaMH2fXQq/mXIHUURAy8QAAp0E2k14RO8uZZKKq+Hj2Tvtw /vJhP/fFES2Xvf0uyV5d75LXPw== X-Google-Smtp-Source: APXvYqxHj0JhbG9jjzg41QnjlnwGNECa6RkKnj/0qML2HC15ujiF8SjbpJzUDbrr+t4eOGwDt2QOYA== X-Received: by 2002:a05:651c:1067:: with SMTP id y7mr1888203ljm.123.1575366904017; Tue, 03 Dec 2019 01:55:04 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id y192sm1134240lfa.63.2019.12.03.01.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 01:55:03 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 55EAA100494; Tue, 3 Dec 2019 12:55:02 +0300 (+03) Date: Tue, 3 Dec 2019 12:55:02 +0300 From: "Kirill A. Shutemov" To: Thomas =?utf-8?Q?Hellstr=C3=B6m_=28VMware=29?= Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, dri-devel@vmware.com, pv-drivers@vmware.com, linux-graphics-maintainer@vmware.com, Thomas Hellstrom , Andrew Morton , Michal Hocko , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Ralph Campbell , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Christian =?utf-8?B?S8O2bmln?= Subject: Re: [PATCH 2/2] drm/ttm: Fix vm page protection handling Message-ID: <20191203095502.hw3r33ioax2x4kvt@box> References: <20191203075446.60197-1-thomas_os@shipmail.org> <20191203075446.60197-3-thomas_os@shipmail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20191203075446.60197-3-thomas_os@shipmail.org> User-Agent: NeoMutt/20180716 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 Tue, Dec 03, 2019 at 08:54:46AM +0100, Thomas Hellstr=F6m (VMware) wro= te: > From: Thomas Hellstrom >=20 > We were using an ugly hack to set the page protection correctly. > Fix that and instead use vmf_insert_mixed_prot() and / or > vmf_insert_pfn_prot(). > Also get the default page protection from > struct vm_area_struct::vm_page_prot rather than using vm_get_page_prot(= ). > This way we catch modifications done by the vm system for drivers that > want write-notification. Hm. Why doesn't your VMA have the right prot flags in the first place? Wh= y do you need to override them? More context, please. --=20 Kirill A. Shutemov