ANDROID: KVM: arm64: use ring_buffer_page_data in hyp_trace_raw_read

In 6.12 kernel version the `struct buffer_data_read_page` changed and
now in order to access the data of the page one should call the newly
added `ring_buffer_read_page_data` function.

Bug: 428904926
Test: presubmit
Test: boot qemu & check reading trace_pipe_raw doesn't cause panic
Change-Id: Ia7d1b5fff35c0ed8f4aeb9ffc5a7c01efaacfac7
Signed-off-by: Nikita Ioffe <ioffe@google.com>
This commit is contained in:
Nikita Ioffe
2025-07-18 13:43:34 +00:00
parent d403a09405
commit ce2b062580
+4 -1
View File
@@ -758,6 +758,7 @@ hyp_trace_raw_read(struct file *file, char __user *ubuf,
struct ht_iterator *iter = (struct ht_iterator *)file->private_data;
size_t size;
int ret;
void *page_data;
if (iter->copy_leftover)
goto read;
@@ -786,7 +787,9 @@ read:
if (size > cnt)
size = cnt;
ret = copy_to_user(ubuf, iter->spare + PAGE_SIZE - size, size);
page_data = ring_buffer_read_page_data(
(struct buffer_data_read_page *)iter->spare);
ret = copy_to_user(ubuf, page_data + PAGE_SIZE - size, size);
if (ret == size)
return -EFAULT;