diff --git a/drivers/gpu/drm/asahi/g17/mod.rs b/drivers/gpu/drm/asahi/g17/mod.rs index b2c0aa5e0c4b2..434a97b486fd0 100644 --- a/drivers/gpu/drm/asahi/g17/mod.rs +++ b/drivers/gpu/drm/asahi/g17/mod.rs @@ -2561,13 +2561,16 @@ impl gpu::Gpu for Gpu { true } - /// The G17 runtime never programs fault_control into the firmware, so unmapped reads are not - /// guaranteed to return zero. Advertising soft faults made Mesa point out-of-bounds vec3/vec4 - /// vertex fetches at address 0 and skip bounds checks on bounded loads; on T6040 those reads - /// returned non-zero data (2026-10-19: every robustness2 rgba32 vertex_attribute_fetch case - /// failed; all pass with soft faults off). + /// The G17 firmware takes no fault_control. Its own fault mode gives soft faults: a shader + /// load of an unmapped client address returns zero and a store or atomic to one is dropped, + /// with no fault reported (measured on the M4 Pro, firmware 25G83). The driver gives every + /// queue of the family the same fault setting, 1 in `QueueConfig::unk_66`, the word the M5 + /// firmware names soft_fault_enabled, so this is not a per-SoC property. Advertise it unless + /// fault_control asks for anything else. The first 0x74000 bytes of a client VM are mapped, + /// not unmapped memory: they hold the execution context's views (`CONTEXT_VIEWS`, the null + /// view at address 0). fn supports_soft_faults(&self) -> bool { - false + crate::module_parameters::fault_control.value() == 0xb } fn queue_limits(&self) -> Option { diff --git a/include/uapi/drm/asahi_drm.h b/include/uapi/drm/asahi_drm.h index fc3b32a63b470..f963089017c40 100644 --- a/include/uapi/drm/asahi_drm.h +++ b/include/uapi/drm/asahi_drm.h @@ -291,6 +291,10 @@ enum drm_asahi_feature { * toggled. Therefore, it is exposed as a feature bit and not a * userspace-settable flag on the VM. When soft fault is enabled, * userspace can speculate memory accesses more aggressively. + * + * On G17 GPUs the first 0x74000 bytes of a VM are not unmapped memory: + * they hold the views of the execution context, which the kernel and + * userspace map there. Loads from them return the context's data. */ DRM_ASAHI_FEATURE_SOFT_FAULTS = (1UL) << 0,