From: Michal Hocko <mhocko@kernel.org>
To: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
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" <thellstrom@vmware.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
"Ralph Campbell" <rcampbell@nvidia.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH v3 2/2] mm, drm/ttm: Fix vm page protection handling
Date: Fri, 6 Dec 2019 11:30:55 +0100 [thread overview]
Message-ID: <20191206103055.GO28317@dhcp22.suse.cz> (raw)
In-Reply-To: <20191206082426.2958-3-thomas_os@shipmail.org>
On Fri 06-12-19 09:24:26, Thomas Hellström (VMware) wrote:
[...]
> @@ -283,11 +282,26 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
> pfn = page_to_pfn(page);
> }
>
> + /*
> + * 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!
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2019-12-06 10:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 8:24 [PATCH v3 0/2] mm, drm/ttm: Fix pte insertion with customized protection Thomas Hellström (VMware)
2019-12-06 8:24 ` [PATCH v3 1/2] mm: Add a vmf_insert_mixed_prot() function Thomas Hellström (VMware)
2019-12-06 8:24 ` [PATCH v3 2/2] mm, drm/ttm: Fix vm page protection handling Thomas Hellström (VMware)
2019-12-06 10:30 ` Michal Hocko [this message]
2019-12-06 14:16 ` Thomas Hellstrom
2019-12-06 14:24 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191206103055.GO28317@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jglisse@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pv-drivers@vmware.com \
--cc=rcampbell@nvidia.com \
--cc=thellstrom@vmware.com \
--cc=thomas_os@shipmail.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox