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.5 required=3.0 tests=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 9DF00C43603 for ; Fri, 6 Dec 2019 10:30:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 66D3D2173E for ; Fri, 6 Dec 2019 10:30:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66D3D2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 027036B1551; Fri, 6 Dec 2019 05:30:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F18E16B1552; Fri, 6 Dec 2019 05:30:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2F7C6B1553; Fri, 6 Dec 2019 05:30:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0237.hostedemail.com [216.40.44.237]) by kanga.kvack.org (Postfix) with ESMTP id CA0A86B1551 for ; Fri, 6 Dec 2019 05:30:58 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 76B7D4DD7 for ; Fri, 6 Dec 2019 10:30:58 +0000 (UTC) X-FDA: 76234348596.29.honey21_258e38913a80a X-HE-Tag: honey21_258e38913a80a X-Filterd-Recvd-Size: 4144 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Dec 2019 10:30:57 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id c9so7173367wrw.8 for ; Fri, 06 Dec 2019 02:30:57 -0800 (PST) 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=mhXoMaU1UVBlyQ18j97xc9RF9JW9UYyQB2n+rphqqfo=; b=g+h/L0zBT+to2QhfupbSdBT15J6Z9Z/z5BrV+s0osUvd5/2hIuJ9sr+mtkrHZGA6Kk ACxIpi8tfkwVKgVHek3XISFTjREADFNFtlLOegg9AelfycF1S5HrLrNtTPwqBwg9pkWC mIqixeySnmYKcPS4CStBdqTh2PFU/wpgD4jPHwqTO3T30pbcVl1CwVl/VeoTzS35Hh2R Jl1vihsCS+F5S8S5THWOxK6yyPDFJaxlBDrXnvaYRulFSul0K4wk16juaLLotqLSnCoN usjG26oGX6XrjjZB+vI59jRYX1ksWDx0PEoyqSz8YONjsygpEFUKStXoGV4WAAEPySUq DPJw== X-Gm-Message-State: APjAAAVrNQ7ri5IEjuJsKJ1NzpJEZTWemWiDxLew8ehSc1YFnQLtC75d 5bnNrVKJXeTkSLqPd2kSEWw= X-Google-Smtp-Source: APXvYqzrDFccK7X9H1o6iY59fBFIiglCFoyDGEbEf2g1TDhd0HxoZ/ezkIG+sW98yOq/zRmldKE/BA== X-Received: by 2002:adf:83c7:: with SMTP id 65mr14202364wre.368.1575628256938; Fri, 06 Dec 2019 02:30:56 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id z13sm2983280wmi.18.2019.12.06.02.30.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 02:30:56 -0800 (PST) Date: Fri, 6 Dec 2019 11:30:55 +0100 From: Michal Hocko To: Thomas =?iso-8859-1?Q?Hellstr=F6m_=28VMware=29?= Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, pv-drivers@vmware.com, linux-graphics-maintainer@vmware.com, Thomas Hellstrom , Andrew Morton , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Ralph Campbell , =?iso-8859-1?B?Suly9G1l?= Glisse , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH v3 2/2] mm, drm/ttm: Fix vm page protection handling Message-ID: <20191206103055.GO28317@dhcp22.suse.cz> References: <20191206082426.2958-1-thomas_os@shipmail.org> <20191206082426.2958-3-thomas_os@shipmail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20191206082426.2958-3-thomas_os@shipmail.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Fri 06-12-19 09:24:26, Thomas Hellstr=F6m (VMware) wrote: [...] > @@ -283,11 +282,26 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fau= lt *vmf, > pfn =3D page_to_pfn(page); > } > =20 > + /* > + * Note that the value of @prot at this point may differ from > + * the value of @vma->vm_page_prot in the caching- and > + * encryption bits. This is because the exact location of the > + * data may not be known at mmap() time and may also change > + * at arbitrary times while the data is mmap'ed. > + * This is ok as long as @vma->vm_page_prot is not used by > + * the core vm to set caching- and encryption bits. > + * This is ensured by core vm using pte_modify() to modify > + * page table entry protection bits (that function preserves > + * old caching- and encryption bits), and the @fault > + * callback being the only function that creates new > + * page table entries. > + */ While this is a very valuable piece of information I believe we need to document this in the generic code where everybody will find it. vmf_insert_mixed_prot sounds like a good place to me. So being explicit about VM_MIXEDMAP. Also a reference from vm_page_prot to this function would be really helpeful. Thanks! --=20 Michal Hocko SUSE Labs