Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-5.0-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"Just two fixes, both going to stable.

- Our support for split pmd page table lock had a bug which could
lead to a crash on mremap() when using the Radix MMU (Power9 only).

- A fix for the PAPR SCM driver (nvdimm) we added last release, which
had a bug where we might mis-handle a hypervisor response leading
to us failing to attach the memory region.

Thanks to: Aneesh Kumar K.V, Oliver O'Halloran"

* tag 'powerpc-5.0-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/papr_scm: Use the correct bind address
powerpc/radix: Fix kernel crash with mremap()

+33 -16
+7 -15
arch/powerpc/include/asm/book3s/64/pgtable.h
··· 1258 1258 1259 1259 #define pmd_move_must_withdraw pmd_move_must_withdraw 1260 1260 struct spinlock; 1261 - static inline int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl, 1262 - struct spinlock *old_pmd_ptl, 1263 - struct vm_area_struct *vma) 1264 - { 1265 - if (radix_enabled()) 1266 - return false; 1267 - /* 1268 - * Archs like ppc64 use pgtable to store per pmd 1269 - * specific information. So when we switch the pmd, 1270 - * we should also withdraw and deposit the pgtable 1271 - */ 1272 - return true; 1273 - } 1274 - 1275 - 1261 + extern int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl, 1262 + struct spinlock *old_pmd_ptl, 1263 + struct vm_area_struct *vma); 1264 + /* 1265 + * Hash translation mode use the deposited table to store hash pte 1266 + * slot information. 1267 + */ 1276 1268 #define arch_needs_pgtable_deposit arch_needs_pgtable_deposit 1277 1269 static inline bool arch_needs_pgtable_deposit(void) 1278 1270 {
+22
arch/powerpc/mm/pgtable-book3s64.c
··· 400 400 atomic_long_read(&direct_pages_count[MMU_PAGE_1G]) << 20); 401 401 } 402 402 #endif /* CONFIG_PROC_FS */ 403 + 404 + /* 405 + * For hash translation mode, we use the deposited table to store hash slot 406 + * information and they are stored at PTRS_PER_PMD offset from related pmd 407 + * location. Hence a pmd move requires deposit and withdraw. 408 + * 409 + * For radix translation with split pmd ptl, we store the deposited table in the 410 + * pmd page. Hence if we have different pmd page we need to withdraw during pmd 411 + * move. 412 + * 413 + * With hash we use deposited table always irrespective of anon or not. 414 + * With radix we use deposited table only for anonymous mapping. 415 + */ 416 + int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl, 417 + struct spinlock *old_pmd_ptl, 418 + struct vm_area_struct *vma) 419 + { 420 + if (radix_enabled()) 421 + return (new_pmd_ptl != old_pmd_ptl) && vma_is_anonymous(vma); 422 + 423 + return true; 424 + }
+4 -1
arch/powerpc/platforms/pseries/papr_scm.c
··· 43 43 { 44 44 unsigned long ret[PLPAR_HCALL_BUFSIZE]; 45 45 uint64_t rc, token; 46 + uint64_t saved = 0; 46 47 47 48 /* 48 49 * When the hypervisor cannot map all the requested memory in a single ··· 57 56 rc = plpar_hcall(H_SCM_BIND_MEM, ret, p->drc_index, 0, 58 57 p->blocks, BIND_ANY_ADDR, token); 59 58 token = ret[0]; 59 + if (!saved) 60 + saved = ret[1]; 60 61 cond_resched(); 61 62 } while (rc == H_BUSY); 62 63 ··· 67 64 return -ENXIO; 68 65 } 69 66 70 - p->bound_addr = ret[1]; 67 + p->bound_addr = saved; 71 68 72 69 dev_dbg(&p->pdev->dev, "bound drc %x to %pR\n", p->drc_index, &p->res); 73 70