Commit 79c227a9 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Paul Mackerras

[PATCH] spufs: Fix endless protection fault on LS writes by SPE.

If an SPE attempts a DMA put to a local store after already doing
a get, the kernel must update the HW PTE to allow the write access.
This case was not being handled correctly.

From: Mike Kistler <mkistler@us.ibm.com>
Signed-off-by: default avatarMike Kistler <mkistler@us.ibm.com>
Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 47952d5e
...@@ -486,14 +486,13 @@ int spu_irq_class_1_bottom(struct spu *spu) ...@@ -486,14 +486,13 @@ int spu_irq_class_1_bottom(struct spu *spu)
ea = spu->dar; ea = spu->dar;
dsisr = spu->dsisr; dsisr = spu->dsisr;
if (dsisr & MFC_DSISR_PTE_NOT_FOUND) { if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)) {
access = (_PAGE_PRESENT | _PAGE_USER); access = (_PAGE_PRESENT | _PAGE_USER);
access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL; access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL;
if (hash_page(ea, access, 0x300) != 0) if (hash_page(ea, access, 0x300) != 0)
error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; error |= CLASS1_ENABLE_STORAGE_FAULT_INTR;
} }
if ((error & CLASS1_ENABLE_STORAGE_FAULT_INTR) || if (error & CLASS1_ENABLE_STORAGE_FAULT_INTR) {
(dsisr & MFC_DSISR_ACCESS_DENIED)) {
if ((ret = spu_handle_mm_fault(spu)) != 0) if ((ret = spu_handle_mm_fault(spu)) != 0)
error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; error |= CLASS1_ENABLE_STORAGE_FAULT_INTR;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment