From 1195471b193fbc088f191169070ac7ab2768a883 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Fri, 18 Jul 2025 13:53:06 +0000 Subject: [PATCH] ANDROID: KVM: arm64: allow trace file to be open for read Userspace tools might want to open trace files for read (e.g. to check if they have access to the tracing interface), so instead of returning -EPERM we make this a no-op. Bug: 428904926 Test: presubmit Change-Id: I32b1b6db543f462dc986578cebd803d8312fe6bb Signed-off-by: Nikita Ioffe --- arch/arm64/kvm/hyp_trace.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kvm/hyp_trace.c b/arch/arm64/kvm/hyp_trace.c index 915bfdf57bca..9d6d77cd912a 100644 --- a/arch/arm64/kvm/hyp_trace.c +++ b/arch/arm64/kvm/hyp_trace.c @@ -858,13 +858,10 @@ static int hyp_trace_open(struct inode *inode, struct file *file) { int cpu = (s64)inode->i_private; - if (file->f_mode & FMODE_WRITE) { + if (file->f_mode & FMODE_WRITE) hyp_trace_reset(cpu); - return 0; - } - - return -EPERM; + return 0; } static ssize_t hyp_trace_write(struct file *filp, const char __user *ubuf,