He Zhe
a43cf7b341
hpet: Support 32-bit userspace
commit 4e60131d0d36af65ab9c9144f4f163fe97ae36e8 upstream.
hpet_compat_ioctl and read file operations failed to handle parameters from
32-bit userspace and thus samples/timers/hpet_example.c fails as below.
root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2
-hpet: executing poll
hpet_poll: HPET_IRQFREQ failed
This patch fixes cmd and arg handling in hpet_compat_ioctl and adds compat
handling for 32-bit userspace in hpet_read.
hpet_example now shows that it works for both 64-bit and 32-bit.
root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2
-hpet: executing poll
hpet_poll: info.hi_flags 0x0
hpet_poll: expired time = 0xf4298
hpet_poll: revents = 0x1
hpet_poll: data 0x1
hpet_poll: expired time = 0xf4235
hpet_poll: revents = 0x1
hpet_poll: data 0x1
root@intel-x86-64:~# ./hpet_example-64.out poll /dev/hpet 1 2
-hpet: executing poll
hpet_poll: info.hi_flags 0x0
hpet_poll: expired time = 0xf42a1
hpet_poll: revents = 0x1
hpet_poll: data 0x1
hpet_poll: expired time = 0xf4232
hpet_poll: revents = 0x1
hpet_poll: data 0x1
Cc: stable@vger.kernel.org
Signed-off-by: He Zhe <zhe.he@windriver.com>
Fixes: 54066a57c584 ("hpet: kill BKL, add compat_ioctl")
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240606123908.738733-1-zhe.he@windriver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e2cb94465de92f6a840bc7eface420b30cc64aa0)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-08-23 16:50:07 +00:00
..
2024-08-08 15:52:18 +00:00
2023-09-23 10:46:59 +02:00
2024-07-15 17:44:32 +00:00
2024-07-15 17:44:33 +00:00
2024-03-08 08:21:36 +00:00
2024-08-08 15:52:16 +00:00
2024-07-15 17:44:30 +00:00
2024-05-30 09:00:45 +00:00
2024-04-16 10:30:28 +00:00
2024-08-23 16:50:07 +00:00
2024-05-30 08:58:50 +00:00
2023-11-28 16:45:42 +00:00
2023-09-23 10:46:54 +02:00
2024-07-15 18:30:23 +00:00
2023-09-23 10:46:59 +02:00
2024-08-08 15:52:18 +00:00
2024-07-15 17:44:31 +00:00
2024-02-02 11:33:37 +00:00
2024-07-15 17:44:29 +00:00
2024-06-03 12:47:30 +00:00
2024-08-23 16:43:23 +00:00
2024-06-03 12:29:52 +00:00
2024-08-23 16:50:05 +00:00
2024-08-08 15:52:15 +00:00
2024-08-08 15:52:17 +00:00
2024-05-30 09:00:38 +00:00
2024-08-08 15:52:17 +00:00
2024-08-23 16:50:05 +00:00
2023-08-11 11:33:32 +02:00
2024-08-08 15:52:21 +00:00
2024-08-09 08:25:32 +00:00
2024-08-23 16:43:23 +00:00
2024-08-08 15:52:15 +00:00
2024-07-08 08:14:52 +00:00
2023-01-18 09:26:28 +01:00
2024-05-06 14:36:41 +00:00
2024-07-08 08:14:55 +00:00
2023-08-11 11:33:40 +02:00
2023-11-28 16:45:45 +00:00
2024-07-15 17:44:33 +00:00
2024-08-23 16:50:05 +00:00
2023-08-11 11:33:34 +02:00
2023-05-30 12:38:35 +01:00
2024-04-16 10:30:33 +00:00
2024-08-08 15:52:16 +00:00
2024-08-08 15:52:21 +00:00
2024-07-08 08:15:03 +00:00
2024-08-23 16:50:06 +00:00
2024-05-31 12:30:41 +00:00
2023-09-23 10:47:00 +02:00
2024-07-15 17:44:31 +00:00
2023-09-23 10:46:56 +02:00
2023-10-10 21:43:39 +02:00
2023-12-13 16:46:17 +01:00
2024-05-30 09:00:38 +00:00
2023-11-20 10:27:35 +01:00
2024-03-08 08:21:36 +00:00
2024-08-08 15:52:20 +00:00
2023-12-20 15:32:36 +01:00
2024-03-08 08:21:30 +00:00
2024-06-03 12:29:50 +00:00
2024-08-08 15:52:13 +00:00
2024-08-08 15:52:22 +00:00
2024-08-08 15:52:18 +00:00
2024-05-06 14:36:34 +00:00
2024-03-06 11:04:05 +00:00
2024-04-16 10:30:35 +00:00
2024-08-23 16:43:24 +00:00
2024-08-08 15:52:19 +00:00
2024-08-08 15:52:20 +00:00
2024-07-15 17:44:31 +00:00
2023-05-17 11:11:44 +02:00
2023-08-11 11:33:32 +02:00
2024-07-15 17:44:31 +00:00
2024-08-08 15:07:35 +00:00
2023-11-20 10:27:33 +01:00
2023-04-05 11:14:16 +02:00
2024-08-08 15:52:21 +00:00
2024-02-02 11:33:37 +00:00
2024-08-23 16:50:07 +00:00
2024-05-30 09:00:38 +00:00
2024-05-31 12:30:39 +00:00
2024-07-15 17:44:33 +00:00
2024-07-15 17:44:31 +00:00
2023-08-11 11:33:38 +02:00
2024-02-02 11:33:44 +00:00
2024-05-06 14:36:32 +00:00