From ce2b0625808657adedd177fc008f9d4ebaf471a4 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Fri, 18 Jul 2025 13:43:34 +0000 Subject: [PATCH] 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 --- arch/arm64/kvm/hyp_trace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp_trace.c b/arch/arm64/kvm/hyp_trace.c index 100927f9a3a5..d41c2a8ef312 100644 --- a/arch/arm64/kvm/hyp_trace.c +++ b/arch/arm64/kvm/hyp_trace.c @@ -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;