Commit 353b8f48 authored by Karol Wachowski's avatar Karol Wachowski Committed by Jacek Lawrynowicz
Browse files

accel/ivpu: Fix missing MMU events from reserved SSID



Generate recovery when fault from reserved context is detected.
Add Abort (A) bit to reserved (1) SSID to ensure NPU also receives a fault.

There is no way to create a file_priv with reserved SSID
but it is still possible to receive MMU faults from that SSID
as it is a default NPU HW setting. Such situation will occur if
FW freed context related resources but still performed access to DRAM.

Signed-off-by: default avatarKarol Wachowski <karol.wachowski@intel.com>
Signed-off-by: default avatarMaciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250107173238.381120-9-maciej.falkowski@linux.intel.com
parent 4480912f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -725,8 +725,8 @@ static int ivpu_mmu_cdtab_entry_set(struct ivpu_device *vdev, u32 ssid, u64 cd_d
	cd[2] = 0;
	cd[3] = 0x0000000000007444;

	/* For global context generate memory fault on VPU */
	if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID)
	/* For global and reserved contexts generate memory fault on VPU */
	if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID || ssid == IVPU_RESERVED_CONTEXT_MMU_SSID)
		cd[0] |= IVPU_MMU_CD_0_A;

	if (valid)
@@ -945,7 +945,8 @@ void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev)

	while ((event = ivpu_mmu_get_event(vdev))) {
		ssid = FIELD_GET(IVPU_MMU_EVT_SSID_MASK, *event);
		if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID) {
		if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID ||
		    ssid == IVPU_RESERVED_CONTEXT_MMU_SSID) {
			ivpu_mmu_dump_event(vdev, event);
			ivpu_pm_trigger_recovery(vdev, "MMU event");
			return;