From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796168631; b=3O63v/5KP3ef9omdcLtXbSb5RjEimojnEQaITfaBu0RdrvNnSWH56Zw9SoJ43J1/8VHB 3Q1ftkl1ez5/y5+1jfdUw9e70iyimp0+sSOPFEZkLc1UWiWLXyImYAEX4Ph7Fgemba1D/ TEDIWgw/LGyQHYi0QvdPlZOVKuyMjSJUaVrJ/OfHhgVgNYQmBIDeQzhK+dLXUX2aQT0lk ne032KZzveHlOe4uypFmeovEcsDj4eMoQ6Z7a6HVTIUvnbQTZLkBkMMPksKVex9Ko20hK ojY2rP57oiaNtRBV5HZaDasO+NtaBC7nmeLA0SBJDwDVVDSG48QzZJXQGzXwa7hBq2A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796168631; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=/JM4Hu60HnDz+1jEoW+iPyG452q2KfQMTpCrw8AYYFI=; b=EYU6jtBKPEXrSUxffP8Zn20QUOArRJwK5VUmGNXBiNR7qwbz4K3Sv4MdNiUP/yF90oF0 PTs5acDwFyRL8hCqJeFeW3M1lrRNcMEEySe2jbrLp021aD6CZjfp0HWIZyieH3M3dMkTC brk3D/uK9xQNlLjX6TLxbJWNxvYjMuHaTyX7vPaZ9zRsU+aihKZuEBuW7l3fP1jDE2C08 9aBRDxA+PXpqLXplqi+wdi8QnrfCC/VMwchWxlpPw0RXIF87r6uSV0b9Neq63KUBtsl1y F7kOLDUnbCjjFB5dkC0CubJ5OhV5qcen0k0Mpk/t3sN8SpCVJA+8HRvRQ9fRn8n5hqw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VYKoAESJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14B0D606A31A; Tue, 1 Dec 2026 23:43:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VYKoAESJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A2411F00893; Tue, 1 Dec 2026 23:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796168630; bh=/JM4Hu60HnDz+1jEoW+iPyG452q2KfQMTpCrw8AYYFI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=VYKoAESJRgj7nYXUQAOeeNqRxzjkTLCPZNVThK8pEaCwMb/ixjUiHihxl6qObcKz7 t/KJy5pXq5m4QX+DxD/k07yawuktkeFFt+AdwgsRS4T0nyWkOGQa9dp5WAhMsVx1XC BJdP8zTLfNalBZXoYwPUMSK7y/DTmz+gCpq7neezJudr419U2OWNgsdABfXKGKw+lm d3s73juPIp9pqxES0FmoBPQIIagbkE8t2+BDq5nH9UjJbibOHKpl94QHTj+ZFH4ziW v0oPFCCMgD1NdVDu2jvpTlbopWTaNV4REane1DNW203XqiOvDAoGW0+C6ZPMpntHI0 4qbTJFc8r3f6w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH 13/16] perf record: Filter runtime hypervisor data mmaps with BPF for --host-ip Reply-To: sashiko-reviews@lists.linux.dev To: "Ian Rogers" Cc: linux-perf-users@vger.kernel.org, kvm@vger.kernel.org, bpf@vger.kernel.org In-Reply-To: <20261201232116.1988791-14-irogers@google.com> References: <20261201232116.1988791-1-irogers@google.com> <20261201232116.1988791-14-irogers@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 23:43:50 +0000 X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] perf bpf: direct field access in perf_kvm_mmap_filter() breaks GEN_VMLINUX_H=3D1 -- commit ee1db873881f238429396b011d3810e0ce79e595 Author: Ian Rogers perf record: Filter runtime hypervisor data mmaps with BPF for --host-ip This commit adds the kvm_mmap_filter BPF skeleton and attaches it via attr.mmap_bpf to filter runtime non-executable file-backed hypervisor mappings during perf record --host-ip. > diff --git a/tools/perf/util/bpf_skel/kvm_mmap_filter.bpf.c b/tools/perf/= util/bpf_skel/kvm_mmap_filter.bpf.c > new file mode 100644 > index 0000000000000..3f089412fa594 > --- /dev/null > +++ b/tools/perf/util/bpf_skel/kvm_mmap_filter.bpf.c > @@ -0,0 +1,79 @@ [ ... ] > +SEC("perf_event") > +int perf_kvm_mmap_filter(void *ctx) > +{ > + struct bpf_perf_event_data_kern *kctx; > + struct vm_area_struct *vma; > + struct file *file; > + struct inode *inode; > + struct mm_struct *mm; > + unsigned int nlink; > + unsigned short mode; > + __u32 tgid; > + > + kctx =3D bpf_cast_to_kern_ctx(ctx); > + if (!bpf_core_field_exists(kctx->vma)) > + return 0; > + > + vma =3D kctx->vma; [ ... ] > + mm =3D BPF_CORE_READ(vma, vm_mm); > + if (mm && bpf_core_field_exists(mm->notifier_subscriptions) && > + BPF_CORE_READ(mm, notifier_subscriptions) !=3D NULL) { > + __u8 one =3D 1; > + > + bpf_map_update_elem(&hypervisor_pids, &tgid, &one, BPF_ANY); > + return 1; > + } [Severity: Low] Does referencing kctx->vma and mm->notifier_subscriptions directly on struct bpf_perf_event_data_kern and struct mm_struct break builds with GEN_VMLINUX_H=3D1? When GEN_VMLINUX_H=3D1 is set, tools/perf/bpf_skel.mak generates vmlinux.h from the host kernel BTF instead of using the bundled header. If that BTF comes from a kernel predating bpf_perf_event_data_kern::vma or built without CONFIG_MMU_NOTIFIER, the fields do not exist on the static struct types and clang fails at compile time despite the bpf_core_field_exists() guards. Defining local ___new CO-RE struct flavors (such as struct bpf_perf_event_data_kern___new and struct mm_struct___new) avoids relying on the generated vmlinux.h definitions. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201232116.1988= 791-1-irogers@google.com?part=3D13