Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53910146 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc: Fix address masking bug in hpte_need_flush()
parents 5551638a 77058e1a
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -63,15 +63,21 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
	if (huge) {
	if (huge) {
#ifdef CONFIG_HUGETLB_PAGE
#ifdef CONFIG_HUGETLB_PAGE
		psize = get_slice_psize(mm, addr);
		psize = get_slice_psize(mm, addr);
		/* Mask the address for the correct page size */
		addr &= ~((1UL << mmu_psize_defs[psize].shift) - 1);
#else
#else
		BUG();
		BUG();
		psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */
		psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */
#endif
#endif
	} else
	} else {
		psize = pte_pagesize_index(mm, addr, pte);
		psize = pte_pagesize_index(mm, addr, pte);
		/* Mask the address for the standard page size.  If we
		 * have a 64k page kernel, but the hardware does not
		 * support 64k pages, this might be different from the
		 * hardware page size encoded in the slice table. */
		addr &= PAGE_MASK;
	}


	/* Mask the address for the correct page size */
	addr &= ~((1UL << mmu_psize_defs[psize].shift) - 1);


	/* Build full vaddr */
	/* Build full vaddr */
	if (!is_kernel_addr(addr)) {
	if (!is_kernel_addr(addr)) {