From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D59F827FB2A for ; Sat, 13 Jun 2026 00:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781309042; cv=none; b=ZzcE0g6sUwpBDqtQuydvQbyMdEbZJDXZzvj7jsvlE1k0eNsd6g6Kz7ZZafhDgr9+bKasbU1kNcqL798QzFkMdLuqJ5+Kswke70M2t4qAadC85CLhJwmA09DPJ5CVHDLqzflX/iq7K0BaTbOMGIqMGXjyakEs10sHr6QPexm9SMw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781309042; c=relaxed/simple; bh=+k8eAc2ynqCJOXA7Hou1UHoPM2wmYgGl88l+uTv4zhA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=j0Ie+D/PlfuUgYnkyH4uFBIAUzIbZh7jfTpjjhVbIO47Jzy7+YClNodrFQ9JXx0j9KhKS3V316Y0j24Yx9//eZXs3bJ9hRLdNk0FsJrkSCNgGUCYbsgv27iWpUs6DF0oC92xwXy4/dwusWLjT0l9+h3expUTVT5UUP6aY7nAtjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qPKwh3TI; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qPKwh3TI" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-36b7f696b40so1203895a91.1 for ; Fri, 12 Jun 2026 17:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781309040; x=1781913840; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=SYyJm6MD81P2mCuA1sw9aPrFrsPNQ7H8qIthy1i4Jvk=; b=qPKwh3TItllce3XN0yTt/QREydVGC/hMg9vttihSz+Su/OGVLf6E8zdRcBntpgdGo8 1cbxrVQUW2N49DXp6RQ/DroliZtIl1q17U3uzUBzX/jWQdKr4+DZdSwSoNf8urufqCqs ZYyrrVBag/UPaMTNkoQo00CUTKyxyDrkDvqajsmhuKxt2/1Pr8CcbRlU9nmd+WtFWJSk 1ihVHn8i5mZ+OZWbSN4vin+FH4J7UbiJ9bospIOda90bKL3HYa2vKXo4wS0EmBK7Ullw j+/zEbE1vzy3U2P8UqaOXg+falUkxGiXHBsjIMkcl50jFL62plrHz81rdEB6+IEfx390 RylQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781309040; x=1781913840; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SYyJm6MD81P2mCuA1sw9aPrFrsPNQ7H8qIthy1i4Jvk=; b=E6M5HqrIF8dVWzezwh9PyoRwVUB2lXuFzVVTlNxlPulg7PZLO4UpQj8ZfiB4KKRObT 2UtRzF6oEvwSI4ef2GH/LBfBg9XV7nRPKWFIkpe9nk/+tKk4WB9FezjFj83wo7cYb19T v7yqXBDr9QOwdFN6/RPZC6lD3QcwRsq8d+G/lwjVP8Ud1NczkxTQCRdNzh/78JkZpIs4 yfJuHzQr03o4DoYcjBAQH8qDnio62+6+/MBLknxRFCzArFwup9Xb3hq9STxypFkeMAlI GRSyw8f2DMsExidOV86x8E3oDKb/czoKS+LAwfOfFDVLTs41+e3U+tLp55n/BPTS9ijf grMA== X-Forwarded-Encrypted: i=1; AFNElJ8fEbTpboKEs7yU6WtR/CXBLVrglhqp3OGVekJCWswkWCcbDElF6cVR4xlJWsqjKLQ9vyEjIglrUmlvBgE=@vger.kernel.org X-Gm-Message-State: AOJu0YxuNe+JrsimEINNFSSoIJj3JP7Nj9EBlM1IMZNILk/K0Uvgq6oq Z2slBTEDi8Gt7sceH/TxQ0Rn9EcHKNOo1UUd8+HM6MaD4flYAIgNI3ICAb6ESCFRn3I2wfuAomp SmzwaBg== X-Received: from pjbmi16.prod.google.com ([2002:a17:90b:4b50:b0:374:e2b3:6e25]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2749:b0:369:932a:2b8a with SMTP id 98e67ed59e1d1-37a01e2e4d2mr4979035a91.1.1781309039973; Fri, 12 Jun 2026 17:03:59 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 12 Jun 2026 17:03:18 -0700 In-Reply-To: <20260613000329.732085-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260613000329.732085-1-seanjc@google.com> X-Mailer: git-send-email 2.54.0.1136.gdb2ca164c4-goog Message-ID: <20260613000329.732085-20-seanjc@google.com> Subject: [PATCH v4 19/30] KVM: x86/pmu: Move "struct kvm_x86_pmu_event_filter" definition to pmu.c From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Vitaly Kuznetsov Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed , Kai Huang Content-Type: text/plain; charset="UTF-8" Move the definition of "struct kvm_x86_pmu_event_filter" to pmu.c, as the as the details of the filters are very much implementation details that can and should be buried in pmu.c. While the _existence_ of filters is public knowledge, almost by definition, the contents don't need to be exposed outside of the PMU code as the filter data is provided by userspace, i.e. it pretty much has to be dynamically allocated, and thus never should be fully embedded in a globally visible structure. No functional change intended Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 13 +------------ arch/x86/kvm/pmu.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 4ff6304c02d0..211958914cc3 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -316,6 +316,7 @@ struct kvm_kernel_irqfd; struct kvm_kernel_irq_routing_entry; struct kvm_x86_msr_filter; +struct kvm_x86_pmu_event_filter; struct kvm_caps { /* control of guest tsc rate supported? */ @@ -1323,18 +1324,6 @@ enum kvm_suppress_eoi_broadcast_mode { KVM_SUPPRESS_EOI_BROADCAST_DISABLED /* Disable Suppress EOI broadcast */ }; -struct kvm_x86_pmu_event_filter { - __u32 action; - __u32 nevents; - __u32 fixed_counter_bitmap; - __u32 flags; - __u32 nr_includes; - __u32 nr_excludes; - __u64 *includes; - __u64 *excludes; - __u64 events[] __counted_by(nevents); -}; - enum kvm_apicv_inhibit { /********************************************************************/ diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index b92dd2e58335..62d0ed99ebe9 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -43,6 +43,18 @@ module_param(enable_pmu, bool, 0444); bool __read_mostly enable_mediated_pmu; EXPORT_SYMBOL_FOR_KVM_INTERNAL(enable_mediated_pmu); +struct kvm_x86_pmu_event_filter { + __u32 action; + __u32 nevents; + __u32 fixed_counter_bitmap; + __u32 flags; + __u32 nr_includes; + __u32 nr_excludes; + __u64 *includes; + __u64 *excludes; + __u64 events[] __counted_by(nevents); +}; + struct kvm_pmu_emulated_event_selectors { u64 INSTRUCTIONS_RETIRED; u64 BRANCH_INSTRUCTIONS_RETIRED; -- 2.54.0.1136.gdb2ca164c4-goog