[PATCH] powerpc/spufs: Fix hash faults for kernel regions

Subsystems: cell broadband engine architecture, linux for powerpc (32-bit and 64-bit), the rest

STALE3417d

3 messages, 3 authors, 2017-05-25 · open the first message on its own page

[PATCH] powerpc/spufs: Fix hash faults for kernel regions

From: Jeremy Kerr <jk@ozlabs.org>
Date: 2017-05-24 06:50:22

Change ac29c64089b7 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.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reported-by: Sombat Tragolgosol <redacted>
CC: Aneesh Kumar K.V <redacted>
---
 arch/powerpc/platforms/cell/spu_base.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 96c2b8a..0c45cdb 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -197,7 +197,9 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
 	    (REGION_ID(ea) != USER_REGION_ID)) {
 
 		spin_unlock(&spu->register_lock);
-		ret = hash_page(ea, _PAGE_PRESENT | _PAGE_READ, 0x300, dsisr);
+		ret = hash_page(ea,
+				_PAGE_PRESENT | _PAGE_READ | _PAGE_PRIVILEGED,
+				0x300, dsisr);
 		spin_lock(&spu->register_lock);
 
 		if (!ret) {
-- 
2.7.4

Re: [PATCH] powerpc/spufs: Fix hash faults for kernel regions

From: Aneesh Kumar K.V <hidden>
Date: 2017-05-24 09:01:34

Jeremy Kerr [off-list ref] writes:
Change ac29c64089b7 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.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reported-by: Sombat Tragolgosol <redacted>
CC: Aneesh Kumar K.V <redacted>
Reviewed-by: Aneesh Kumar K.V <redacted>
quoted hunk
---
 arch/powerpc/platforms/cell/spu_base.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 96c2b8a..0c45cdb 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -197,7 +197,9 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
 	    (REGION_ID(ea) != USER_REGION_ID)) {

 		spin_unlock(&spu->register_lock);
-		ret = hash_page(ea, _PAGE_PRESENT | _PAGE_READ, 0x300, dsisr);
+		ret = hash_page(ea,
+				_PAGE_PRESENT | _PAGE_READ | _PAGE_PRIVILEGED,
+				0x300, dsisr);
 		spin_lock(&spu->register_lock);

 		if (!ret) {
-- 
2.7.4

Re: powerpc/spufs: Fix hash faults for kernel regions

From: Michael Ellerman <hidden>
Date: 2017-05-25 13:22:32

On Wed, 2017-05-24 at 06:49:59 UTC, Jeremy Kerr wrote:
Change ac29c64089b7 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.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reported-by: Sombat Tragolgosol <redacted>
CC: Aneesh Kumar K.V <redacted>
Reviewed-by: Aneesh Kumar K.V <redacted>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/d75e4919cc0b6fbcbc8d6654ef66d8

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help