From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/xe/xe_pagefault: Disallow writes to read-only VMAs Date: Sun, 22 Mar 2026 03:27:29 +1000 Message-ID: In-Reply-To: <20260320183547.61017-7-jonathan.cavitt@intel.com> References: <20260320183547.61017-6-jonathan.cavitt@intel.com> <20260320183547.61017-7-jonathan.cavitt@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Bug: Prefetch bit not masked in access_type comparison** The new check at line 190-193: ```c if (xe_vma_read_only(vma) && pf->consumer.access_type != XE_PAGEFAULT_ACCESS_TYPE_READ) { ``` does a direct comparison of `pf->consumer.access_type` against `XE_PAGEFAULT_ACCESS_TYPE_READ` (0). However, `access_type` can have `XE_PAGEFAULT_ACCESS_PREFETCH` (BIT(7)) ORed in (see `xe_guc_pagefault.c:83`). A prefetch read would have `access_type == 0x80`, which would fail this `!= 0` check and incorrectly return `-EPERM`. The existing `xe_pagefault_access_is_atomic()` at line 139 correctly masks with `XE_PAGEFAULT_ACCESS_TYPE_MASK` before comparing. This check should do the same: ```c if (xe_vma_read_only(vma) && (pf->consumer.access_type & XE_PAGEFAULT_ACCESS_TYPE_MASK) != XE_PAGEFAULT_ACCESS_TYPE_READ) { ``` Otherwise this is a straightforward and well-motivated fix. --- --- Generated by Claude Code Patch Reviewer