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
2533 unsigned long pfn, pgprot_t pgprot);2533 unsigned long pfn, pgprot_t pgprot);
2534vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr,2534vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
2535 pfn_t pfn);2535 pfn_t pfn);
2536vm_fault_t vmf_insert_mixed_prot(struct vm_area_struct *vma, unsigned long addr,
2537 pfn_t pfn, pgprot_t pgprot);
2536vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma,2538vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma,
2537 unsigned long addr, pfn_t pfn);2539 unsigned long addr, pfn_t pfn);
2538int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);2540int 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
312 /* Second cache line starts here. */312 /* Second cache line starts here. */
313 313
314 struct mm_struct *vm_mm; /* The address space we belong to. */314 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;
316 unsigned long vm_flags; /* Flags, see mm.h. */321 unsigned long vm_flags; /* Flags, see mm.h. */
317 322
318 /*323 /*