Max Erenberg
0bf355e6ca
edu: fix DMA range upper bound check
...
The edu_check_range function checks that start <= end1 < end2, where
end1 is the upper bound (exclusive) of the guest-supplied DMA range and
end2 is the upper bound (exclusive) of the device's allowed DMA range.
When the guest tries to transfer exactly DMA_SIZE (4096) bytes, end1
will be equal to end2, so the check fails and QEMU aborts with this
puzzling error message (newlines added for formatting):
qemu: hardware error: EDU: DMA range
0x0000000000040000-0x0000000000040fff out of bounds
(0x0000000000040000-0x0000000000040fff)!
By checking end1 <= end2 instead, guests will be allowed to transfer
exactly 4096 bytes. It is not necessary to explicitly check for
start <= end1 because the previous two checks (within(addr, start, end2)
and end1 > addr) imply start < end1.
Fixes: b30934cb52
("hw: misc, add educational driver", 2015-01-21)
Signed-off-by: Max Erenberg <merenber@uwaterloo.ca >
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru >
(cherry picked from commit 2c5107e1b4
)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru >
2024-01-08 19:26:21 +03:00
..
2023-06-20 10:01:30 +02:00
2020-09-14 14:23:19 +01:00
2023-01-12 16:50:19 +00:00
2023-01-12 16:50:19 +00:00
2023-06-06 10:19:31 +01:00
2023-10-19 23:13:28 +02:00
2020-12-18 15:20:17 -05:00
2023-07-06 13:26:43 +01:00
2023-02-14 09:11:27 +01:00
2021-02-11 11:50:14 +00:00
2020-09-18 14:12:32 -04:00
2023-09-29 10:07:18 +02:00
2021-03-08 17:20:02 +00:00
2021-03-08 11:54:16 +00:00
2021-03-08 11:54:16 +00:00
2021-09-01 11:08:18 +01:00
2023-06-15 18:35:57 +02:00
2023-09-29 10:07:19 +02:00
2021-03-09 12:01:28 +01:00
2022-06-30 09:21:14 +02:00
2022-07-14 16:24:38 +02:00
2022-06-30 09:21:13 +02:00
2023-02-07 09:02:05 +01:00
2021-05-01 10:03:52 +02:00
2023-01-18 11:14:34 +01:00
2020-07-11 11:02:05 +02:00
2023-06-06 10:19:32 +01:00
2021-03-08 17:20:01 +00:00
2022-02-21 13:30:20 +00:00
2022-02-21 13:30:20 +00:00
2023-10-19 13:01:52 +01:00
2022-02-21 13:30:20 +00:00
2022-10-22 23:15:40 +02:00
2020-09-18 14:12:32 -04:00
2023-10-06 10:33:43 +02:00
2020-09-18 14:12:32 -04:00
2024-01-08 19:26:21 +03:00
2020-09-18 14:12:32 -04:00
2020-09-18 14:12:32 -04:00
2020-09-18 14:12:32 -04:00
2023-07-25 17:13:53 +03:00
2022-08-08 23:43:11 +02:00
2023-10-12 14:11:44 +02:00
2023-11-02 13:36:45 +00:00
2022-12-15 17:37:47 +00:00
2023-01-05 15:02:08 +00:00
2023-09-21 11:31:16 +03:00
2023-11-02 13:36:45 +00:00
2023-08-31 09:45:17 +01:00
2020-12-10 11:44:55 +00:00
2020-12-10 11:44:55 +00:00
2021-05-02 17:24:50 +02:00
2023-04-28 11:31:54 +02:00
2023-10-06 10:33:43 +02:00
2022-08-01 11:58:02 +02:00
2022-12-15 17:37:47 +00:00
2021-03-08 17:20:01 +00:00
2023-10-20 08:51:41 +02:00
2023-11-02 14:42:03 +00:00
2023-04-20 11:17:35 +02:00
2023-10-27 12:51:17 +01:00
2023-10-06 10:33:43 +02:00
2021-05-02 17:24:50 +02:00
2023-01-06 10:42:55 +10:00
2023-01-06 10:42:55 +10:00
2023-11-02 14:42:03 +00:00
2023-03-08 00:37:48 +01:00
2020-11-03 16:51:13 +01:00
2023-10-19 23:13:27 +02:00
2023-02-06 11:41:39 +00:00
2021-03-08 17:20:03 +00:00
2023-11-27 15:27:42 +00:00
2023-01-18 11:14:34 +01:00
2022-03-18 10:55:15 +00:00
2021-01-12 21:19:02 +00:00
2021-03-12 12:48:56 +00:00
2021-03-12 12:48:56 +00:00
2021-01-12 21:19:02 +00:00
2023-01-12 17:15:09 +00:00
2023-01-12 17:15:09 +00:00
2023-01-12 17:15:09 +00:00
2023-01-12 17:15:09 +00:00
2020-09-18 14:12:32 -04:00
2021-09-20 08:50:59 +02:00
2023-10-25 17:35:15 +02:00
2022-06-09 19:32:49 -04:00
2023-01-08 01:54:22 -05:00
2022-03-06 05:08:23 -05:00
2023-01-12 17:15:09 +00:00
2023-07-10 22:29:14 +10:00
2021-05-02 17:24:50 +02:00
2023-10-12 12:34:30 +10:00
2023-01-26 13:25:07 +01:00
2020-09-09 15:54:19 -07:00
2020-09-18 14:12:32 -04:00
2023-09-21 11:31:16 +03:00
2023-11-02 13:36:45 +00:00
2020-08-21 06:18:24 -04:00
2020-12-08 13:48:57 -05:00
2021-02-08 15:15:32 +01:00
2020-08-28 10:02:46 +01:00
2021-11-09 10:11:27 +01:00
2023-09-08 16:41:34 +01:00
2023-09-08 16:41:35 +01:00
2023-09-08 16:41:35 +01:00
2022-04-21 11:37:03 +01:00
2022-01-28 14:29:46 +00:00
2023-11-02 14:42:03 +00:00
2021-03-12 12:40:09 +00:00
2023-02-23 13:56:14 +01:00
2022-03-18 11:31:20 +00:00
2023-09-21 11:31:16 +03:00