summaryrefslogtreecommitdiffstats
path: root/drivers/misc/cxl
diff options
context:
space:
mode:
authorMichael Ellerman2017-11-10 10:55:03 +0100
committerMichael Ellerman2017-11-10 10:55:03 +0100
commita54c61f46e25345e99eec06a402f746fe33febc6 (patch)
tree23f59fe8702aaf90802cef6f25e76c15211747e1 /drivers/misc/cxl
parentselftests/powerpc: Check FP/VEC on exception in TM (diff)
parentpowerpc/perf: Fix core-imc hotplug callback failure during imc initialization (diff)
downloadkernel-qcow2-linux-a54c61f46e25345e99eec06a402f746fe33febc6.tar.gz
kernel-qcow2-linux-a54c61f46e25345e99eec06a402f746fe33febc6.tar.xz
kernel-qcow2-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/cxl')
-rw-r--r--drivers/misc/cxl/cxllib.c13
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);