Jason Gunthorpe
a11dda723c
iommufd: Require drivers to supply the cache_invalidate_user ops
If drivers don't do this then iommufd will oops invalidation ioctls with
something like:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
Mem abort info:
ESR = 0x0000000086000004
EC = 0x21: IABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
user pgtable: 4k pages, 48-bit VAs, pgdp=0000000101059000
[0000000000000000] pgd=0000000000000000, p4d=0000000000000000
Internal error: Oops: 0000000086000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 371 Comm: qemu-system-aar Not tainted 6.8.0-rc7-gde77230ac23a #9
Hardware name: linux,dummy-virt (DT)
pstate: 81400809 (Nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=-c)
pc : 0x0
lr : iommufd_hwpt_invalidate+0xa4/0x204
sp : ffff800080f3bcc0
x29: ffff800080f3bcf0 x28: ffff0000c369b300 x27: 0000000000000000
x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
x23: 0000000000000000 x22: 00000000c1e334a0 x21: ffff0000c1e334a0
x20: ffff800080f3bd38 x19: ffff800080f3bd58 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffff8240d6d8
x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
x8 : 0000001000000002 x7 : 0000fffeac1ec950 x6 : 0000000000000000
x5 : ffff800080f3bd78 x4 : 0000000000000003 x3 : 0000000000000002
x2 : 0000000000000000 x1 : ffff800080f3bcc8 x0 : ffff0000c6034d80
Call trace:
0x0
iommufd_fops_ioctl+0x154/0x274
__arm64_sys_ioctl+0xac/0xf0
invoke_syscall+0x48/0x110
el0_svc_common.constprop.0+0x40/0xe0
do_el0_svc+0x1c/0x28
el0_svc+0x34/0xb4
el0t_64_sync_handler+0x120/0x12c
el0t_64_sync+0x190/0x194
All existing drivers implement this op for nesting, this is mostly a
bisection aid.
Fixes: 8c6eabae38 ("iommufd: Add IOMMU_HWPT_INVALIDATE")
Link: https://lore.kernel.org/r/0-v1-e153859bd707+61-iommufd_check_ops_jgg@nvidia.com
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2024-07-10 10:50:30 -03:00
..
2024-05-19 09:21:03 -07:00
2024-05-24 08:43:25 -07:00
2024-06-21 12:55:12 +02:00
2024-05-04 18:59:47 +02:00
2024-06-19 13:19:38 +02:00
2024-05-06 18:26:47 -07:00
2024-05-22 10:45:12 -07:00
2024-06-04 18:14:51 +02:00
2024-06-14 06:21:25 -06:00
2024-05-23 12:04:36 -07:00
2024-05-22 20:14:47 -04:00
2024-05-15 12:59:55 -06:00
2024-06-05 04:55:04 +03:00
2024-06-12 16:58:05 -07:00
2024-05-22 09:56:00 -07:00
2024-06-12 14:11:50 +02:00
2024-05-16 08:50:32 -07:00
2024-05-23 12:04:36 -07:00
2024-05-28 16:09:17 -07:00
2024-05-19 09:21:03 -07:00
2024-05-09 00:30:37 +09:00
2024-07-09 13:55:05 -03:00
2024-05-28 22:21:34 +02:00
2024-05-13 16:53:53 -07:00
2024-06-04 11:29:52 +02:00
2024-05-03 22:09:50 +02:00
2024-05-09 01:03:39 +09:00
2024-06-15 14:59:26 +09:00
2024-06-22 07:58:21 -07:00
2024-05-22 12:26:46 -07:00
2024-06-07 10:05:21 +02:00
2024-06-23 07:16:13 -07:00
2024-05-04 18:59:41 +02:00
2024-06-08 10:48:11 -07:00
2024-06-06 06:03:29 +00:00
2024-05-30 09:05:19 -07:00
2024-05-22 12:26:46 -07:00
2024-06-21 01:17:43 +02:00
2024-05-23 00:29:19 +02:00
2024-06-03 20:29:31 +01:00
2024-06-21 10:19:36 -03:00
2024-06-03 11:10:08 +02:00
2024-05-22 20:14:47 -04:00
2024-07-10 10:50:30 -03:00
2024-06-03 18:20:00 +02:00
2024-06-16 09:33:28 -07:00
2024-05-17 09:05:46 -07:00
2024-05-31 12:39:15 -05:00
2024-04-29 10:53:31 +02:00
2024-05-28 06:55:59 -06:00
2024-06-12 09:28:04 -07:00
2024-05-17 08:53:47 -07:00
2024-05-14 18:25:53 -07:00
2024-06-14 08:43:39 +01:00
2024-06-04 18:08:39 +02:00
2024-05-16 08:56:49 -07:00
2024-05-21 09:51:42 -07:00
2024-04-29 08:20:07 -07:00
2024-06-20 07:15:17 -07:00
2024-05-29 13:08:31 +01:00
2024-05-23 12:04:36 -07:00
2024-06-13 14:19:57 -06:00
2024-05-03 07:26:39 +02:00
2024-05-30 19:43:47 -05:00
2024-05-17 13:01:24 +02:00
2024-06-04 18:08:31 +02:00
2024-06-04 12:10:05 -05:00
2024-05-23 12:09:22 -07:00
2024-06-03 19:30:47 +05:30
2024-05-22 10:41:14 -07:00
2024-06-03 11:57:28 +02:00
2024-05-27 08:18:31 -07:00
2024-05-28 21:53:51 +02:00
2024-05-20 08:55:18 -07:00
2024-04-30 21:10:37 +02:00
2024-04-29 08:20:06 -07:00
2024-06-18 13:26:44 -07:00
2024-06-22 16:13:19 +02:00
2024-05-14 23:36:19 +09:00
2024-06-16 11:22:57 +02:00
2024-06-12 21:30:43 +01:00
2024-05-06 13:34:12 -06:00
2024-05-18 12:48:37 -07:00
2024-05-23 12:04:36 -07:00
2024-05-07 23:40:46 +02:00
2024-05-21 12:09:36 -07:00
2024-06-21 14:28:28 -07:00
2024-05-08 19:21:51 +01:00
2024-06-06 08:55:20 -07:00
2024-06-03 17:35:24 +05:30
2024-06-19 14:07:13 +01:00
2024-05-08 19:46:11 +01:00
2024-06-04 13:36:44 +02:00
2024-05-21 13:11:44 -07:00
2024-04-29 22:29:44 +02:00
2024-06-21 11:16:56 -07:00
2024-05-31 13:13:39 +03:00
2024-06-04 14:10:43 +02:00
2024-06-13 21:00:25 -04:00
2024-06-21 14:28:28 -07:00
2024-05-22 08:32:48 -04:00
2024-06-12 15:40:39 -06:00
2024-05-23 12:04:36 -07:00
2024-05-22 10:45:12 -07:00
2024-05-19 09:21:03 -07:00
2024-05-23 12:04:36 -07:00
2024-05-11 11:32:06 +02:00
2024-05-24 10:24:49 -07:00
2024-04-29 16:45:53 +02:00
2024-05-10 04:34:52 +09:00