linux/drivers/gpu/drm/xe/regs
Brian Nguyen 0b5ed2756d drm/xe: Add compact-PT and addr mask handling for page reclaim
Current implementation of generate_reclaim_entry() overlooks some
differences between the different page implementations: address masking
and compact 64K page handling.

Address masking of each leaf varies depending on the leaf entry size.
generate_reclaim_entry() is using XE_PTE_ADDR_MASK [51:12] for all leaf
entries. For 2MB PTEs, bit 12 (PAT) is part of the flags so the old mask
corrupts the physical address extraction.

64K pages can be represented as PS64 and a compact PT, which the latter
was not handled. Compact pages aren't walked by the unbind walker, so we
separately walk through the compact PT to ensure none of the leaf 64K
PTEs are dropped. Previously, compact PT were causing an abort since it
was considered covered and not descended into.

v2:
 - Update 64K entry/unbind walker for 64K compact PT handling. (Matthew)
 - Rework calculations of reclamation and address mask size.
 - Add new func abstracting the error handling before generating the
   reclaim entry.

v3:
 - Report finer addr granularity in abort debug print for compact.
   (Zongyao)
 - Add comments for ADDR_MASK usage. (Zongyao)
 - Drop existing phys_addr asserts, the new XE_PAGE_ADDR_MASK clears
   bits checked, so redundant asserts. (Sashiko)
 - WARN_ON to verify compact pt and edge pt won't be possible.

Fixes: b912138df2 ("drm/xe: Create page reclaim list on unbind")
Assisted-by: Sashiko-Review:gemini-3.1-pro-preview
Cc: stable@vger.kernel.org
Cc: Matthew Auld <matthew.auld@intel.com>
Suggested-by: Zongyao Bai <zongyao.bai@intel.com>
Signed-off-by: Brian Nguyen <brian3.nguyen@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Zongyao Bai <zongyao.bai@intel.com>
Link: https://patch.msgid.link/20260605224257.2194194-2-brian3.nguyen@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 669252801a)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
2026-06-16 10:18:52 -07:00
..
xe_bars.h drm/xe/pf: Set VF LMEM BAR size 2025-08-12 05:59:31 -07:00
xe_engine_regs.h drm/xe/multi_queue: Capture queue run times for active queues 2026-05-08 13:48:46 -07:00
xe_eu_stall_regs.h drm/xe/eustall: Add support to init, enable and disable EU stall sampling 2025-02-26 11:30:59 -08:00
xe_gsc_regs.h drm/xe/xe_hw_error: Handle CSC Firmware reported Hardware errors 2025-08-26 10:11:34 -04:00
xe_gt_regs.h drm/xe: Define and use MCR version of COMMON_SLICE_CHICKEN4 2026-05-15 18:05:12 -03:00
xe_gtt_defs.h drm/xe: Add compact-PT and addr mask handling for page reclaim 2026-06-16 10:18:52 -07:00
xe_guc_regs.h drm/xe/guc: Add Wa_14025883347 for GuC DMA failure on reset 2026-02-09 12:00:16 -08:00
xe_hw_error_regs.h drm/xe/xe_hw_error: Add support for PVC SoC errors 2026-03-05 19:38:56 -05:00
xe_i2c_regs.h drm/xe/i2c: Wire up reset/postinstall for I2C IRQ 2025-10-13 07:24:25 -07:00
xe_irq_regs.h drm/xe/sysctrl: Add system controller interrupt handler 2026-04-30 11:31:45 +05:30
xe_lrc_layout.h drm/xe/multi_queue: Add helpers to access CS QUEUE TIMESTAMP from lrc 2026-05-08 13:48:44 -07:00
xe_mchbar_regs.h drm/xe/hwmon: Fix xe_hwmon_power_max_write 2025-06-18 12:26:27 -04:00
xe_mert_regs.h drm/xe/mert: Improve handling of MERT CAT errors 2026-01-14 16:02:50 +01:00
xe_oa_regs.h drm/xe/oa: MERTOA Wa_14026779378 2026-05-12 14:34:48 -07:00
xe_pcode_regs.h drm/xe/hwmon: Enable energy attributes for CRI 2026-04-17 14:27:19 -04:00
xe_pmt.h drm/xe/soc_remapper: Use SoC remapper helper from VSEC code 2025-12-23 11:43:49 -08:00
xe_pxp_regs.h drm/xe/pxp: Handle the PXP termination interrupt 2025-02-03 11:51:13 -08:00
xe_reg_defs.h drm/intel: add pick.h for the various "picker" helpers 2026-03-04 13:04:29 +02:00
xe_regs.h drm/xe: Use SG_TILE_ADDR_RANGE instead of TILE_ADDR_RANGE 2025-11-10 09:09:27 -08:00
xe_soc_remapper_regs.h drm/xe/soc_remapper: Add system controller config for SoC remapper 2025-12-23 11:43:51 -08:00
xe_sysctrl_regs.h drm/xe/xe_sysctrl: Add System Controller mailbox register definitions 2026-03-30 10:06:55 -07:00