]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/misc/cxl/fault.c
powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED
[karo-tx-linux.git] / drivers / misc / cxl / fault.c
index 9a8650bcb042d4827eedc46d11edf7e9ddb4684e..377e650a2a1dc3464fa0eb3f6fdf99493a15f32c 100644 (file)
@@ -149,11 +149,13 @@ static void cxl_handle_page_fault(struct cxl_context *ctx,
         * update_mmu_cache() will not have loaded the hash since current->trap
         * is not a 0x400 or 0x300, so just call hash_page_mm() here.
         */
-       access = _PAGE_PRESENT;
+       access = _PAGE_PRESENT | _PAGE_READ;
        if (dsisr & CXL_PSL_DSISR_An_S)
-               access |= _PAGE_RW;
-       if ((!ctx->kernel) || ~(dar & (1ULL << 63)))
-               access |= _PAGE_USER;
+               access |= _PAGE_WRITE;
+
+       access |= _PAGE_PRIVILEGED;
+       if ((!ctx->kernel) || (REGION_ID(dar) == USER_REGION_ID))
+               access &= ~_PAGE_PRIVILEGED;
 
        if (dsisr & DSISR_NOHPTE)
                inv_flags |= HPTE_NOHPTE_UPDATE;