From: Thomas Hellstrom <thellstrom@vmware.com>
To: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Cc: Pv-drivers <Pv-drivers@vmware.com>,
Linux-graphics-maintainer <Linux-graphics-maintainer@vmware.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Michal Hocko" <mhocko@suse.com>,
"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 v4 1/2] mm: Add a vmf_insert_mixed_prot() function
Date: Thu, 12 Dec 2019 08:51:29 +0000 [thread overview]
Message-ID: <MN2PR05MB6141C9205BBA112F43309D2FA1550@MN2PR05MB6141.namprd05.prod.outlook.com> (raw)
In-Reply-To: <20191212084741.9251-2-thomas_os@shipmail.org>
On 12/12/19 9:48 AM, Thomas Hellström (VMware) wrote:
> From: Thomas Hellstrom <thellstrom@vmware.com>
>
> The TTM module today uses a hack to be able to set a different page
> protection than struct vm_area_struct::vm_page_prot. To be able to do
> this properly, add the needed vm functionality as vmf_insert_mixed_prot().
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Cc: Ralph Campbell <rcampbell@nvidia.com>
> Cc: "Jérôme Glisse" <jglisse@redhat.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
> Acked-by: Christian König <christian.koenig@amd.com>
> ---
> include/linux/mm.h | 2 ++
> include/linux/mm_types.h | 7 ++++++-
> mm/memory.c | 43 ++++++++++++++++++++++++++++++++++++----
> 3 files changed, 47 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index cc292273e6ba..29575d3c1e47 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2548,6 +2548,8 @@ vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr,
> unsigned long pfn, pgprot_t pgprot);
> vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
> pfn_t pfn);
> +vm_fault_t vmf_insert_mixed_prot(struct vm_area_struct *vma, unsigned long addr,
> + pfn_t pfn, pgprot_t pgprot);
> vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma,
> unsigned long addr, pfn_t pfn);
> int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 2222fa795284..ac96afdbb4bc 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -307,7 +307,12 @@ struct vm_area_struct {
> /* Second cache line starts here. */
>
> struct mm_struct *vm_mm; /* The address space we belong to. */
> - pgprot_t vm_page_prot; /* Access permissions of this VMA. */
> +
> + /*
> + * Access permissions of this VMA.
> + * See vmf_insert_mixed() for discussion.
Typo. will of course be vmf_insert_mixed_prot() in the final version.
next prev parent reply other threads:[~2019-12-12 8:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 8:47 [PATCH v4 0/2] mm, drm/ttm: Fix pte insertion with customized protection Thomas Hellström (VMware)
2019-12-12 8:47 ` [PATCH v4 1/2] mm: Add a vmf_insert_mixed_prot() function Thomas Hellström (VMware)
2019-12-12 8:51 ` Thomas Hellstrom [this message]
2019-12-20 8:23 ` Michal Hocko
2019-12-12 8:47 ` [PATCH v4 2/2] mm, drm/ttm: Fix vm page protection handling Thomas Hellström (VMware)
2019-12-20 8:06 ` Ack to merge through DRM tree? WAS [PATCH v4 0/2] mm, drm/ttm: Fix pte insertion with customized protection Thomas Hellström (VMware)
2019-12-23 22:34 ` Andrew Morton
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=MN2PR05MB6141C9205BBA112F43309D2FA1550@MN2PR05MB6141.namprd05.prod.outlook.com \
--to=thellstrom@vmware.com \
--cc=Linux-graphics-maintainer@vmware.com \
--cc=Pv-drivers@vmware.com \
--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-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rcampbell@nvidia.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