diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2017-11-10 10:55:03 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-11-10 10:55:03 +0100 |
commit | a54c61f46e25345e99eec06a402f746fe33febc6 (patch) | |
tree | 23f59fe8702aaf90802cef6f25e76c15211747e1 /drivers/misc | |
parent | selftests/powerpc: Check FP/VEC on exception in TM (diff) | |
parent | powerpc/perf: Fix core-imc hotplug callback failure during imc initialization (diff) | |
download | linux-a54c61f46e25345e99eec06a402f746fe33febc6.tar.xz linux-a54c61f46e25345e99eec06a402f746fe33febc6.zip |
Merge branch 'fixes' into next
We have some dependencies & conflicts between patches in fixes and
things to go in next, both in the radix TLB flush code and the IMC PMU
driver. So merge fixes into next.
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/cxl/cxllib.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/misc/cxl/cxllib.c b/drivers/misc/cxl/cxllib.c index 5dba23ca2e5f..dc9bc1807fdf 100644 --- a/drivers/misc/cxl/cxllib.c +++ b/drivers/misc/cxl/cxllib.c @@ -219,8 +219,17 @@ int cxllib_handle_fault(struct mm_struct *mm, u64 addr, u64 size, u64 flags) down_read(&mm->mmap_sem); - for (dar = addr; dar < addr + size; dar += page_size) { - if (!vma || dar < vma->vm_start || dar > vma->vm_end) { + vma = find_vma(mm, addr); + if (!vma) { + pr_err("Can't find vma for addr %016llx\n", addr); + rc = -EFAULT; + goto out; + } + /* get the size of the pages allocated */ + page_size = vma_kernel_pagesize(vma); + + for (dar = (addr & ~(page_size - 1)); dar < (addr + size); dar += page_size) { + if (dar < vma->vm_start || dar >= vma->vm_end) { vma = find_vma(mm, addr); if (!vma) { pr_err("Can't find vma for addr %016llx\n", addr); |