History

mm: Add a vmf_insert_mixed_prot() function

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().

Thomas Hellstrom committed 6 years ago

Commit 574c5b31 parent 71e72743 files · +47 −5Browse files

Showing the changes to include/linux (2 of 3 files). Show all

Unified · Split

2 files
  1. include/linux/mm.h +2 −0
  2. include/linux/mm_types.h +6 −1
include/linux/mm.h+2−0
@@ -2533,6 +2533,8 @@ vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, · 2532 unmodified lines
25332533 unsigned long pfn, pgprot_t pgprot);
25342534 vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
25352535 pfn_t pfn);
2536+vm_fault_t vmf_insert_mixed_prot(struct vm_area_struct *vma, unsigned long addr,
2537+ pfn_t pfn, pgprot_t pgprot);
25362538 vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma,
25372539 unsigned long addr, pfn_t pfn);
25382540 int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
include/linux/mm_types.h+6−1
@@ -312,7 +312,12 @@ struct vm_area_struct { · 311 unmodified lines
312312 /* Second cache line starts here. */
313313
314314 struct mm_struct *vm_mm; /* The address space we belong to. */
315− pgprot_t vm_page_prot; /* Access permissions of this VMA. */
315+
316+ /*
317+ * Access permissions of this VMA.
318+ * See vmf_insert_mixed_prot() for discussion.
319+ */
320+ pgprot_t vm_page_prot;
316321 unsigned long vm_flags; /* Flags, see mm.h. */
317322
318323 /*