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.

powerpc/spufs: Fix hash faults for kernel regions

Commit ac29c64089b7 ("powerpc/mm: Replace _PAGE_USER with
_PAGE_PRIVILEGED") swapped _PAGE_USER for _PAGE_PRIVILEGED, and
introduced check_pte_access() which denied kernel access to
non-_PAGE_PRIVILEGED pages.

However, it didn't add _PAGE_PRIVILEGED to the hash fault handler
for spufs' kernel accesses, so the DMAs required to establish SPE
memory no longer work.

This change adds _PAGE_PRIVILEGED to the hash fault handler for
kernel accesses.

Fixes: ac29c64089b7 ("powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED")
Cc: stable@vger.kernel.org # v4.7+
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reported-by: Sombat Tragolgosol <sombat3960@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Jeremy Kerr and committed by
Michael Ellerman
d75e4919 d957fb4d

+3 -1
+3 -1
arch/powerpc/platforms/cell/spu_base.c
··· 197 (REGION_ID(ea) != USER_REGION_ID)) { 198 199 spin_unlock(&spu->register_lock); 200 - ret = hash_page(ea, _PAGE_PRESENT | _PAGE_READ, 0x300, dsisr); 201 spin_lock(&spu->register_lock); 202 203 if (!ret) {
··· 197 (REGION_ID(ea) != USER_REGION_ID)) { 198 199 spin_unlock(&spu->register_lock); 200 + ret = hash_page(ea, 201 + _PAGE_PRESENT | _PAGE_READ | _PAGE_PRIVILEGED, 202 + 0x300, dsisr); 203 spin_lock(&spu->register_lock); 204 205 if (!ret) {