|
@@ -16,9 +16,10 @@
|
|
|
#include <linux/mmu_notifier.h>
|
|
|
#include <linux/page_idle.h>
|
|
|
#include <linux/shmem_fs.h>
|
|
|
+#include <linux/uaccess.h>
|
|
|
|
|
|
#include <asm/elf.h>
|
|
|
-#include <linux/uaccess.h>
|
|
|
+#include <asm/tlb.h>
|
|
|
#include <asm/tlbflush.h>
|
|
|
#include "internal.h"
|
|
|
|
|
@@ -1008,6 +1009,7 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
|
|
|
struct mm_struct *mm;
|
|
|
struct vm_area_struct *vma;
|
|
|
enum clear_refs_types type;
|
|
|
+ struct mmu_gather tlb;
|
|
|
int itype;
|
|
|
int rv;
|
|
|
|
|
@@ -1054,6 +1056,7 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
|
|
|
}
|
|
|
|
|
|
down_read(&mm->mmap_sem);
|
|
|
+ tlb_gather_mmu(&tlb, mm, 0, -1);
|
|
|
if (type == CLEAR_REFS_SOFT_DIRTY) {
|
|
|
for (vma = mm->mmap; vma; vma = vma->vm_next) {
|
|
|
if (!(vma->vm_flags & VM_SOFTDIRTY))
|
|
@@ -1075,7 +1078,7 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
|
|
|
walk_page_range(0, mm->highest_vm_end, &clear_refs_walk);
|
|
|
if (type == CLEAR_REFS_SOFT_DIRTY)
|
|
|
mmu_notifier_invalidate_range_end(mm, 0, -1);
|
|
|
- flush_tlb_mm(mm);
|
|
|
+ tlb_finish_mmu(&tlb, 0, -1);
|
|
|
up_read(&mm->mmap_sem);
|
|
|
out_mm:
|
|
|
mmput(mm);
|