Skip to content

Commit 72f7e16

Browse files
akacprowjlawryno
authored andcommitted
accel/ivpu: Fix NOC firewall interrupt handling
The NOC firewall interrupt means that the HW prevented unauthorized access to a protected resource, so there is no need to trigger device reset in such case. To facilitate security testing add firewall_irq_counter debugfs file that tracks firewall interrupts. Fixes: 8a27ad8 ("accel/ivpu: Split IP and buttress code") Cc: [email protected] # v6.11+ Signed-off-by: Andrzej Kacprowski <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 746ae46 commit 72f7e16

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

drivers/accel/ivpu/ivpu_debugfs.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ static int reset_pending_show(struct seq_file *s, void *v)
108108
return 0;
109109
}
110110

111+
static int firewall_irq_counter_show(struct seq_file *s, void *v)
112+
{
113+
struct ivpu_device *vdev = seq_to_ivpu(s);
114+
115+
seq_printf(s, "%d\n", atomic_read(&vdev->hw->firewall_irq_counter));
116+
return 0;
117+
}
118+
111119
static const struct drm_debugfs_info vdev_debugfs_list[] = {
112120
{"bo_list", bo_list_show, 0},
113121
{"fw_name", fw_name_show, 0},
@@ -116,6 +124,7 @@ static const struct drm_debugfs_info vdev_debugfs_list[] = {
116124
{"last_bootmode", last_bootmode_show, 0},
117125
{"reset_counter", reset_counter_show, 0},
118126
{"reset_pending", reset_pending_show, 0},
127+
{"firewall_irq_counter", firewall_irq_counter_show, 0},
119128
};
120129

121130
static ssize_t

drivers/accel/ivpu/ivpu_hw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ int ivpu_hw_init(struct ivpu_device *vdev)
249249
platform_init(vdev);
250250
wa_init(vdev);
251251
timeouts_init(vdev);
252+
atomic_set(&vdev->hw->firewall_irq_counter, 0);
252253

253254
return 0;
254255
}

drivers/accel/ivpu/ivpu_hw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct ivpu_hw_info {
5252
int dma_bits;
5353
ktime_t d0i3_entry_host_ts;
5454
u64 d0i3_entry_vpu_ts;
55+
atomic_t firewall_irq_counter;
5556
};
5657

5758
int ivpu_hw_init(struct ivpu_device *vdev);

drivers/accel/ivpu/ivpu_hw_ip.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,10 @@ static void irq_wdt_mss_handler(struct ivpu_device *vdev)
10621062

10631063
static void irq_noc_firewall_handler(struct ivpu_device *vdev)
10641064
{
1065-
ivpu_pm_trigger_recovery(vdev, "NOC Firewall IRQ");
1065+
atomic_inc(&vdev->hw->firewall_irq_counter);
1066+
1067+
ivpu_dbg(vdev, IRQ, "NOC Firewall interrupt detected, counter %d\n",
1068+
atomic_read(&vdev->hw->firewall_irq_counter));
10661069
}
10671070

10681071
/* Handler for IRQs from NPU core */

0 commit comments

Comments
 (0)