2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-10 00:07:56 +02:00
|
|
|
|
2016-03-17 15:30:49 +11:00
|
|
|
|
2019-06-10 00:07:56 +02:00
|
|
|
|
2020-03-10 14:23:12 +01:00
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
2026-05-07 13:24:55 -04:00
|
|
|
|
2019-06-10 00:07:56 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2021-05-25 17:10:50 +02:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2020-11-03 10:30:11 +01:00
|
|
|
|
2022-05-09 21:13:35 +02:00
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
2019-06-10 00:07:56 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2018-05-22 15:31:23 -07:00
|
|
|
|
2020-09-23 12:21:38 +02:00
|
|
|
|
2022-11-09 12:28:46 +01:00
|
|
|
|
2019-03-26 14:47:57 -04:00
|
|
|
|
2024-12-19 10:14:11 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-09-25 18:10:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-23 19:09:52 +03:00
|
|
|
|
2024-09-25 18:10:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-19 14:47:11 +08:00
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-25 17:10:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-06 09:32:32 +08:00
|
|
|
|
|
|
|
|
|
2021-05-25 17:10:50 +02:00
|
|
|
|
2023-01-06 09:32:32 +08:00
|
|
|
|
2021-05-25 17:10:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-23 12:21:38 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-07-11 14:39:43 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-01-02 09:21:46 -05:00
|
|
|
|
2025-06-13 14:09:08 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2018-03-14 14:48:17 -05:00
|
|
|
|
2019-08-11 10:06:32 +02:00
|
|
|
|
2023-03-08 11:57:00 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2021-03-09 08:31:25 +01:00
|
|
|
|
2018-04-16 18:27:50 +08:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2018-04-16 18:27:50 +08:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-06-10 23:34:01 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2018-04-16 18:27:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-17 11:52:53 +08:00
|
|
|
|
2018-04-16 18:27:50 +08:00
|
|
|
|
2022-12-12 17:31:57 +01:00
|
|
|
|
2021-03-08 14:00:06 +01:00
|
|
|
|
2023-03-08 11:57:00 -05:00
|
|
|
|
2021-03-08 14:00:06 +01:00
|
|
|
|
2021-03-09 08:31:25 +01:00
|
|
|
|
2020-12-08 15:16:15 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2020-12-08 15:16:15 -05:00
|
|
|
|
2021-03-09 08:31:25 +01:00
|
|
|
|
2019-08-05 16:01:07 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-15 16:59:57 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2020-08-24 12:29:45 -04:00
|
|
|
|
2016-02-15 16:59:57 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-04-26 19:29:41 +02:00
|
|
|
|
2016-02-15 16:59:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2016-02-15 16:59:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-26 19:29:41 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-23 12:21:38 +02:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-09-15 15:06:50 +02:00
|
|
|
|
2016-09-15 14:58:48 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-29 16:07:31 +02:00
|
|
|
|
2026-01-20 12:57:21 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-08-29 16:07:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2024-05-06 17:59:55 +01:00
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
|
|
|
|
|
2026-01-20 12:57:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-12-19 10:14:11 -05:00
|
|
|
|
2016-09-15 15:06:50 +02:00
|
|
|
|
2026-01-28 16:07:03 +01:00
|
|
|
|
2016-09-15 15:06:50 +02:00
|
|
|
|
2026-01-28 16:07:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2026-01-28 16:07:03 +01:00
|
|
|
|
2024-08-27 15:44:43 +05:30
|
|
|
|
2026-01-20 12:57:21 +01:00
|
|
|
|
2024-01-03 18:13:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-15 10:26:22 +02:00
|
|
|
|
|
|
|
|
|
2024-01-03 18:13:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-18 20:15:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-17 09:49:48 -03:00
|
|
|
|
2024-01-18 20:15:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-03 18:13:22 -05:00
|
|
|
|
|
|
|
|
|
2026-01-20 12:57:21 +01:00
|
|
|
|
2024-01-03 18:13:22 -05:00
|
|
|
|
2026-01-20 12:57:21 +01:00
|
|
|
|
|
|
|
|
|
2024-01-03 18:13:22 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2020-09-23 12:21:38 +02:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-03-08 17:47:46 +01:00
|
|
|
|
2016-09-15 14:58:48 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2016-03-08 17:47:46 +01:00
|
|
|
|
2020-03-12 12:03:34 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2020-03-12 12:03:34 +01:00
|
|
|
|
2016-03-08 17:47:46 +01:00
|
|
|
|
2023-11-20 16:38:50 -08:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-08 17:47:46 +01:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2024-12-20 13:44:23 +01:00
|
|
|
|
2026-01-28 13:58:14 +01:00
|
|
|
|
2024-12-20 13:44:23 +01:00
|
|
|
|
2016-03-08 17:47:46 +01:00
|
|
|
|
2020-03-12 12:03:34 +01:00
|
|
|
|
|
|
|
|
|
2017-04-21 10:05:56 +02:00
|
|
|
|
2022-02-01 16:25:52 +01:00
|
|
|
|
2024-12-19 10:14:11 -05:00
|
|
|
|
2020-03-12 12:03:34 +01:00
|
|
|
|
|
|
|
|
|
2017-03-23 19:34:11 +01:00
|
|
|
|
2020-03-12 12:03:34 +01:00
|
|
|
|
2025-11-22 16:49:22 -06:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
|
|
|
|
|
2020-03-12 12:03:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-22 16:49:22 -06:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2021-05-25 17:10:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-15 15:05:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-19 11:49:45 +08:00
|
|
|
|
2023-01-26 11:37:49 -08:00
|
|
|
|
2021-07-15 15:05:37 -04:00
|
|
|
|
2021-05-25 17:10:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-11 14:39:43 +02:00
|
|
|
|
2020-09-23 12:21:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-03 10:30:11 +01:00
|
|
|
|
|
|
|
|
|
2021-05-25 17:10:50 +02:00
|
|
|
|
|
|
|
|
|
2020-09-23 12:21:38 +02:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-24 12:27:47 -04:00
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-08-23 20:11:25 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2019-08-11 10:06:32 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2020-12-08 15:16:15 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2017-03-08 17:40:17 -05:00
|
|
|
|
2025-08-12 14:19:18 -04:00
|
|
|
|
2017-05-08 15:14:54 +02:00
|
|
|
|
|
|
|
|
|
2017-03-08 17:40:17 -05:00
|
|
|
|
2018-04-17 18:34:40 +08:00
|
|
|
|
2017-05-08 15:14:54 +02:00
|
|
|
|
2017-03-08 17:40:17 -05:00
|
|
|
|
2020-02-18 13:07:42 +08:00
|
|
|
|
|
|
|
|
|
2019-08-07 22:32:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-26 11:28:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-30 11:12:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-23 20:11:25 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2021-06-15 17:23:11 -04:00
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-15 17:23:11 -04:00
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
|
|
|
|
|
2020-12-08 15:16:15 -05:00
|
|
|
|
2022-12-12 17:31:57 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2022-12-12 17:31:57 +01:00
|
|
|
|
2023-03-13 12:03:18 -04:00
|
|
|
|
2021-08-31 13:49:59 +08:00
|
|
|
|
2022-12-12 17:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-31 13:49:59 +08:00
|
|
|
|
|
|
|
|
|
2020-12-08 15:16:15 -05:00
|
|
|
|
|
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-15 17:23:11 -04:00
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2021-06-15 17:23:11 -04:00
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-05-08 15:14:54 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-05-08 15:14:54 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-12 14:24:39 +02:00
|
|
|
|
2020-08-24 12:27:47 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2023-03-13 12:03:18 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-10-10 18:09:57 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-25 16:48:47 -07:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-07 13:24:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-11 15:29:27 +01:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-03-11 15:29:27 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2023-03-13 12:03:18 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-05-08 15:14:54 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2017-08-08 07:58:01 -04:00
|
|
|
|
2015-12-18 22:13:12 +01:00
|
|
|
|
2020-08-06 14:44:07 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-09 12:28:46 +01:00
|
|
|
|
2022-11-09 12:14:44 +01:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2025-10-10 18:09:57 +05:30
|
|
|
|
2025-09-24 12:23:26 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-30 13:45:11 +05:30
|
|
|
|
2017-10-20 17:21:40 +08:00
|
|
|
|
2025-09-24 12:23:26 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-02-23 12:36:59 +01:00
|
|
|
|
drm/amdgpu: replace get_user_pages with HMM mirror helpers
Use HMM helper function hmm_vma_fault() to get physical pages backing
userptr and start CPU page table update track of those pages. Then use
hmm_vma_range_done() to check if those pages are updated before
amdgpu_cs_submit for gfx or before user queues are resumed for kfd.
If userptr pages are updated, for gfx, amdgpu_cs_ioctl will restart
from scratch, for kfd, restore worker is rescheduled to retry.
HMM simplify the CPU page table concurrent update check, so remove
guptasklock, mmu_invalidations, last_set_pages fields from
amdgpu_ttm_tt struct.
HMM does not pin the page (increase page ref count), so remove related
operations like release_pages(), put_page(), mark_page_dirty().
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-12-13 15:35:28 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-09-17 20:12:43 +05:30
|
|
|
|
|
|
|
|
|
2018-07-16 16:12:24 +02:00
|
|
|
|
2017-04-12 14:24:39 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
drm/amdgpu: replace get_user_pages with HMM mirror helpers
Use HMM helper function hmm_vma_fault() to get physical pages backing
userptr and start CPU page table update track of those pages. Then use
hmm_vma_range_done() to check if those pages are updated before
amdgpu_cs_submit for gfx or before user queues are resumed for kfd.
If userptr pages are updated, for gfx, amdgpu_cs_ioctl will restart
from scratch, for kfd, restore worker is rescheduled to retry.
HMM simplify the CPU page table concurrent update check, so remove
guptasklock, mmu_invalidations, last_set_pages fields from
amdgpu_ttm_tt struct.
HMM does not pin the page (increase page ref count), so remove related
operations like release_pages(), put_page(), mark_page_dirty().
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-12-13 15:35:28 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drm/amdgpu: replace get_user_pages with HMM mirror helpers
Use HMM helper function hmm_vma_fault() to get physical pages backing
userptr and start CPU page table update track of those pages. Then use
hmm_vma_range_done() to check if those pages are updated before
amdgpu_cs_submit for gfx or before user queues are resumed for kfd.
If userptr pages are updated, for gfx, amdgpu_cs_ioctl will restart
from scratch, for kfd, restore worker is rescheduled to retry.
HMM simplify the CPU page table concurrent update check, so remove
guptasklock, mmu_invalidations, last_set_pages fields from
amdgpu_ttm_tt struct.
HMM does not pin the page (increase page ref count), so remove related
operations like release_pages(), put_page(), mark_page_dirty().
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-12-13 15:35:28 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drm/amdgpu: replace get_user_pages with HMM mirror helpers
Use HMM helper function hmm_vma_fault() to get physical pages backing
userptr and start CPU page table update track of those pages. Then use
hmm_vma_range_done() to check if those pages are updated before
amdgpu_cs_submit for gfx or before user queues are resumed for kfd.
If userptr pages are updated, for gfx, amdgpu_cs_ioctl will restart
from scratch, for kfd, restore worker is rescheduled to retry.
HMM simplify the CPU page table concurrent update check, so remove
guptasklock, mmu_invalidations, last_set_pages fields from
amdgpu_ttm_tt struct.
HMM does not pin the page (increase page ref count), so remove related
operations like release_pages(), put_page(), mark_page_dirty().
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-12-13 15:35:28 -05:00
|
|
|
|
|
|
|
|
|
2025-09-30 13:45:11 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 11:04:54 +01:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-02-08 11:08:35 +01:00
|
|
|
|
2015-05-13 14:30:53 +02:00
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-08 16:58:48 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 11:04:54 +01:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2021-11-09 11:08:18 +01:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2016-05-09 11:04:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drm/amdgpu: Map/Unmap MMIO_REMAP as BAR register window; add TTM sg helpers; wire dma-buf
MMIO_REMAP (HDP flush page) exposes a hardware MMIO register window via
a PCI BAR; there are no struct pages backing it (not normal RAM). But
when one device shares memory with another through dma-buf, the receiver
still expects a delivery route—a list of DMA-able chunks—called an
sg_table. For the BAR window, we can’t (no pages!), so we instead create
a one-entry list that points directly to the BAR’s physical bus address
and tell DMA: “use this I/O span.” - A single, contiguous byte range on
the PCI bus (start DMA address + length)). That’s why we map it with
dma_map_resource() and set sg_set_page(..., NULL, ...). Perform DMA
reads/writes directly to that range so we build an sg_table from a BAR
physical span and map it with dma_map_resource().
This patch centralizes the BAR-I/O mapping in TTM and wires dma-buf to
it:
Add amdgpu_ttm_mmio_remap_alloc_sgt() /
amdgpu_ttm_mmio_remap_free_sgt(). They walk the TTM resource via
amdgpu_res_cursor, add the byte offset to adev->rmmio_remap.bus_addr,
build a one-entry sg_table with sg_set_page(NULL, …), and map/unmap it
with dma_map_resource().
In dma-buf map/unmap, if the BO is in AMDGPU_PL_MMIO_REMAP, call the new
helpers.
Single place for BAR-I/O handling: amdgpu_ttm.c in
amdgpu_ttm_mmio_remap_alloc_sgt() and ..._free_sgt().
No struct pages: sg_set_page(sg, NULL, cur.size, 0); inside
amdgpu_ttm_mmio_remap_alloc_sgt().
Minimal sg_table: sg_alloc_table(*sgt, 1, GFP_KERNEL); inside
amdgpu_ttm_mmio_remap_alloc_sgt().
Hooked into dma-buf: amdgpu_dma_buf_map()/unmap() in amdgpu_dma_buf.c
call these helpers for AMDGPU_PL_MMIO_REMAP.
v2: squash in fix for set/get tiling
Suggested-by: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2025-10-06 19:46:54 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-23 14:00:35 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-23 14:00:35 +03:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-13 10:13:38 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-03-13 10:13:38 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-01-27 15:58:43 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2026-01-09 18:01:23 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
2017-08-03 14:02:13 +02:00
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
|
|
|
|
|
2015-12-07 15:02:52 +08:00
|
|
|
|
2026-01-09 18:01:23 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-01-27 15:58:43 +01:00
|
|
|
|
2015-07-22 13:29:28 +08:00
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
2017-03-13 10:13:39 +01:00
|
|
|
|
2018-02-14 23:20:00 -06:00
|
|
|
|
2022-03-17 14:29:22 +01:00
|
|
|
|
2018-02-14 23:20:00 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
2019-03-14 09:10:01 +01:00
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-09 18:01:23 +05:30
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
2017-09-01 20:37:57 +02:00
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
|
|
|
|
|
2017-01-27 15:58:43 +01:00
|
|
|
|
2015-06-16 14:50:02 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
|
|
|
|
|
2022-05-06 13:11:41 +02:00
|
|
|
|
|
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-08 15:03:00 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2020-08-24 12:27:47 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-09-15 15:06:50 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
|
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2026-05-11 18:04:57 +08:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
2024-01-11 23:21:13 -08:00
|
|
|
|
2021-01-07 09:07:42 +01:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2024-01-11 23:21:13 -08:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-27 18:22:31 +02:00
|
|
|
|
|
|
|
|
|
2021-01-07 09:07:42 +01:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2018-08-27 18:22:31 +02:00
|
|
|
|
|
|
|
|
|
2017-11-06 15:37:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-27 18:22:31 +02:00
|
|
|
|
2017-11-06 15:37:01 +01:00
|
|
|
|
2020-10-16 18:03:07 +05:30
|
|
|
|
2024-01-11 23:21:13 -08:00
|
|
|
|
2026-05-11 18:04:57 +08:00
|
|
|
|
2021-01-07 09:07:42 +01:00
|
|
|
|
2020-10-16 18:03:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
2021-01-07 09:07:42 +01:00
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
2015-06-08 15:03:00 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2017-03-13 10:13:38 +01:00
|
|
|
|
2017-03-13 10:13:39 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2021-01-07 09:07:42 +01:00
|
|
|
|
2015-06-08 15:03:00 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-13 10:13:38 +01:00
|
|
|
|
|
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-13 14:18:38 +08:00
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
2024-09-25 18:10:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2023-11-20 16:38:50 -08:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-08 17:47:46 +01:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-08 15:03:00 +02:00
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
2017-03-13 10:13:38 +01:00
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
2017-03-13 10:13:38 +01:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-18 18:56:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-08 15:03:00 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2015-06-08 15:03:00 +02:00
|
|
|
|
|
|
|
|
|
2025-06-06 14:13:37 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2015-06-08 15:03:00 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2017-03-13 10:13:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-13 10:13:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-06 14:13:37 +02:00
|
|
|
|
2017-03-13 10:13:39 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
|
|
|
|
|
2026-02-03 17:30:57 +01:00
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-19 14:47:11 +08:00
|
|
|
|
2025-12-11 21:25:20 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-18 18:56:25 +05:30
|
|
|
|
2024-09-25 18:09:49 +02:00
|
|
|
|
2017-01-16 13:59:01 +08:00
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2026-03-19 14:47:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-19 14:33:39 +02:00
|
|
|
|
2024-09-25 18:10:41 +02:00
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-03-26 14:47:57 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 11:04:54 +01:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-26 17:02:52 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2019-08-05 16:01:07 +02:00
|
|
|
|
2021-02-05 16:17:07 +01:00
|
|
|
|
2017-08-08 07:58:01 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-27 14:30:38 +02:00
|
|
|
|
2025-06-25 10:42:17 +02:00
|
|
|
|
2021-06-09 13:51:36 +02:00
|
|
|
|
2017-04-03 13:31:22 +10:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
2017-04-03 13:31:22 +10:00
|
|
|
|
2016-02-08 11:08:35 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2019-03-26 14:47:57 -04:00
|
|
|
|
|
|
|
|
|
2021-06-15 17:23:11 -04:00
|
|
|
|
2019-03-26 14:47:57 -04:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
2019-03-26 14:47:57 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-08 07:58:01 -04:00
|
|
|
|
2015-12-18 22:13:12 +01:00
|
|
|
|
|
|
|
|
|
2017-08-08 07:58:01 -04:00
|
|
|
|
2015-12-18 22:13:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-25 09:14:43 +02:00
|
|
|
|
2024-12-19 10:14:10 -05:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-08 00:02:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
drm/amdgpu: fix lock leak on ENOMEM in AMDGPU_GEM_OP_GET_MAPPING_INFO
The AMDGPU_GEM_OP_GET_MAPPING_INFO branch of amdgpu_gem_op_ioctl()
holds three cleanup-tracked resources before calling kvcalloc():
the drm_gem_object reference from drm_gem_object_lookup(), the
drm_exec lock on the looked-up GEM via drm_exec_lock_obj(), and
the drm_exec lock on the per-process VM root page directory via
amdgpu_vm_lock_pd(). All three are released by the out_exec
label that every other error path in this function jumps to.
The kvcalloc() failure path returns -ENOMEM directly, skipping
out_exec and leaking all three.
The leaked per-process VM root PD dma_resv lock is the
load-bearing leak: any subsequent operation on the same VM
(further GEM ops, command-submission, eviction, TTM shrinker
callbacks) blocks on the held lock. DRM_IOCTL_AMDGPU_GEM_OP is
DRM_AUTH | DRM_RENDER_ALLOW, so this is an unprivileged-local
denial of service against the caller's GPU context, reachable
by any process with /dev/dri/renderD* access.
Route the failure through out_exec so drm_exec_fini() and
drm_gem_object_put() run.
Reproduced on stock 7.0.0-10, Ryzen 7 5700U / Radeon Vega
(Lucienne): the failing ioctl returns -ENOMEM and a second
GET_MAPPING_INFO on the same fd then blocks in
drm_exec_lock_obj() on the leaked dma_resv. SIGKILL on the
caller does not reap the task; the fd-release path during
process exit goes through amdgpu_gem_object_close() ->
drm_exec_prepare_obj() on the same lock, leaving the task in D
state until the box is rebooted. The patched kernel was not
rebuilt and re-tested on this hardware; the fix is mechanical.
Tested on a single Lucienne / Vega box only.
Ziyi Guo posted an independent INT_MAX-bound check for
args->num_entries in the same branch [1]; the two patches are
complementary and can land in either order.
Fixes: 4d82724f7f2b ("drm/amdgpu: Add mapping info option for GEM_OP ioctl")
Link: https://lore.kernel.org/all/20260208000255.4073363-1-n7l8m4@u.northwestern.edu/ # [1]
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Assisted-by: Claude:claude-opus-4-7
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b69d3256d79de15f54c322986ff4da68f1d65b0a)
Cc: stable@vger.kernel.org
2026-05-17 09:17:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-04 21:58:49 +03:00
|
|
|
|
|
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-16 09:49:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-16 09:47:42 -04:00
|
|
|
|
2025-08-31 15:16:04 +05:30
|
|
|
|
2025-06-16 09:47:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2025-06-16 09:47:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-04 21:58:49 +03:00
|
|
|
|
|
|
|
|
|
2025-06-16 09:47:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-19 17:26:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-24 12:27:47 -04:00
|
|
|
|
2023-03-13 12:03:18 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2019-07-15 18:04:08 -04:00
|
|
|
|
2021-11-12 15:51:25 +08:00
|
|
|
|
|
|
|
|
|
2018-05-25 17:12:29 -07:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2019-03-11 14:16:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-19 17:26:37 -04:00
|
|
|
|
|
|
|
|
|
2015-09-23 14:00:59 +03:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2021-08-25 17:05:09 +08:00
|
|
|
|
2019-07-26 09:24:35 -04:00
|
|
|
|
2019-03-11 14:16:29 -04:00
|
|
|
|
2023-03-13 12:03:18 -04:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 10:50:54 +01:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2023-07-21 14:03:53 +05:30
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-15 15:26:45 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2023-05-15 09:34:28 +08:00
|
|
|
|
2021-02-15 15:26:45 -05:00
|
|
|
|
2016-02-15 15:23:00 +01:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-04-26 19:29:41 +02:00
|
|
|
|
2016-02-15 15:23:00 +01:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-02-15 15:23:00 +01:00
|
|
|
|
|
|
|
|
|
2020-10-08 15:46:38 +05:30
|
|
|
|
drm: Update file owner during use
With the typical model where the display server opens the file descriptor
and then hands it over to the client(*), we were showing stale data in
debugfs.
Fix it by updating the drm_file->pid on ioctl access from a different
process.
The field is also made RCU protected to allow for lockless readers. Update
side is protected with dev->filelist_mutex.
Before:
$ cat /sys/kernel/debug/dri/0/clients
command pid dev master a uid magic
Xorg 2344 0 y y 0 0
Xorg 2344 0 n y 0 2
Xorg 2344 0 n y 0 3
Xorg 2344 0 n y 0 4
After:
$ cat /sys/kernel/debug/dri/0/clients
command tgid dev master a uid magic
Xorg 830 0 y y 0 0
xfce4-session 880 0 n y 0 1
xfwm4 943 0 n y 0 2
neverball 1095 0 n y 0 3
*)
More detailed and historically accurate description of various handover
implementation kindly provided by Emil Velikov:
"""
The traditional model, the server was the orchestrator managing the
primary device node. From the fd, to the master status and
authentication. But looking at the fd alone, this has varied across
the years.
IIRC in the DRI1 days, Xorg (libdrm really) would have a list of open
fd(s) and reuse those whenever needed, DRI2 the client was responsible
for open() themselves and with DRI3 the fd was passed to the client.
Around the inception of DRI3 and systemd-logind, the latter became
another possible orchestrator. Whereby Xorg and Wayland compositors
could ask it for the fd. For various reasons (hysterical and genuine
ones) Xorg has a fallback path going the open(), whereas Wayland
compositors are moving to solely relying on logind... some never had
fallback even.
Over the past few years, more projects have emerged which provide
functionality similar (be that on API level, Dbus, or otherwise) to
systemd-logind.
"""
v2:
* Fixed typo in commit text and added a fine historical explanation
from Emil.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230621094824.2348732-1-tvrtko.ursulin@linux.intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>
2023-06-21 10:48:24 +01:00
|
|
|
|
2020-10-08 15:46:38 +05:30
|
|
|
|
2016-02-15 12:41:37 +01:00
|
|
|
|
2016-02-15 15:23:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drm: Update file owner during use
With the typical model where the display server opens the file descriptor
and then hands it over to the client(*), we were showing stale data in
debugfs.
Fix it by updating the drm_file->pid on ioctl access from a different
process.
The field is also made RCU protected to allow for lockless readers. Update
side is protected with dev->filelist_mutex.
Before:
$ cat /sys/kernel/debug/dri/0/clients
command pid dev master a uid magic
Xorg 2344 0 y y 0 0
Xorg 2344 0 n y 0 2
Xorg 2344 0 n y 0 3
Xorg 2344 0 n y 0 4
After:
$ cat /sys/kernel/debug/dri/0/clients
command tgid dev master a uid magic
Xorg 830 0 y y 0 0
xfce4-session 880 0 n y 0 1
xfwm4 943 0 n y 0 2
neverball 1095 0 n y 0 3
*)
More detailed and historically accurate description of various handover
implementation kindly provided by Emil Velikov:
"""
The traditional model, the server was the orchestrator managing the
primary device node. From the fd, to the master status and
authentication. But looking at the fd alone, this has varied across
the years.
IIRC in the DRI1 days, Xorg (libdrm really) would have a list of open
fd(s) and reuse those whenever needed, DRI2 the client was responsible
for open() themselves and with DRI3 the fd was passed to the client.
Around the inception of DRI3 and systemd-logind, the latter became
another possible orchestrator. Whereby Xorg and Wayland compositors
could ask it for the fd. For various reasons (hysterical and genuine
ones) Xorg has a fallback path going the open(), whereas Wayland
compositors are moving to solely relying on logind... some never had
fallback even.
Over the past few years, more projects have emerged which provide
functionality similar (be that on API level, Dbus, or otherwise) to
systemd-logind.
"""
v2:
* Fixed typo in commit text and added a fine historical explanation
from Emil.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230621094824.2348732-1-tvrtko.ursulin@linux.intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>
2023-06-21 10:48:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-15 15:23:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-08 15:46:38 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-15 15:23:00 +01:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
2016-02-15 15:23:00 +01:00
|
|
|
|
2016-04-26 19:29:41 +02:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-15 15:26:45 -05:00
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2021-02-15 15:26:45 -05:00
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|
2021-02-15 15:26:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-20 16:55:21 -04:00
|
|
|
|
|
|
|
|
|