He Zhe
a3d83021fd
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>
2024-07-18 13:21:19 +02:00
..
2023-11-28 17:20:00 +00:00
2024-02-05 20:14:16 +00:00
2023-08-30 19:20:35 -07:00
2021-12-03 14:27:06 +01:00
2024-06-16 13:47:41 +02:00
2023-06-23 10:27:23 +02:00
2023-08-04 15:39:39 +02:00
2022-06-27 16:15:27 +02:00
2023-01-20 13:05:39 +01:00
2023-07-30 18:15:27 +02:00
2023-06-23 10:27:08 +02:00
2024-07-18 13:21:19 +02:00
2023-05-31 19:17:29 +01:00
2023-06-23 10:27:11 +02:00
2023-03-09 17:30:27 +01:00
2023-08-24 16:25:15 -07:00
2023-06-23 10:27:15 +02:00
2023-02-09 16:51:39 -08:00
2024-06-12 11:12:26 +02:00
2024-04-27 17:11:30 +02:00
2022-11-23 19:11:22 +01:00
2023-08-11 21:12:46 +02:00
2023-07-03 15:38:26 -07:00