[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ab59943e-4a92-41ff-fed7-c0e7f916fa82@gmail.com>
Date: Fri, 13 May 2022 16:57:41 +0800
From: Like Xu <like.xu.linux@...il.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Joerg Roedel <joro@...tes.org>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, Jim Mattson <jmattson@...gle.com>
Subject: Re: [PATCH RESEND v12 09/17] KVM: x86/pmu: Adjust precise_ip to
emulate Ice Lake guest PDIR counter
On 11/4/2022 6:19 pm, Like Xu wrote:
> +++ b/arch/x86/kvm/pmu.h
> @@ -4,6 +4,8 @@
>
> #include <linux/nospec.h>
>
> +#include <asm/cpu_device_id.h>
> +
> #define vcpu_to_pmu(vcpu) (&(vcpu)->arch.pmu)
> #define pmu_to_vcpu(pmu) (container_of((pmu), struct kvm_vcpu, arch.pmu))
> #define pmc_to_pmu(pmc) (&(pmc)->vcpu->arch.pmu)
> @@ -15,6 +17,12 @@
> #define VMWARE_BACKDOOR_PMC_REAL_TIME 0x10001
> #define VMWARE_BACKDOOR_PMC_APPARENT_TIME 0x10002
>
> +static const struct x86_cpu_id vmx_icl_pebs_cpu[] = {
> + X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, NULL),
> + X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, NULL),
> + {}
> +};
The gcc [-Wunused-const-variable] flag would complain about
not moving vmx_icl_pebs_cpu[] from pmu.h to pmu.c:
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
index b5d0c36b869b..17c9bfc2527d 100644
--- a/arch/x86/kvm/pmu.c
+++ b/arch/x86/kvm/pmu.c
@@ -27,6 +27,12 @@
struct x86_pmu_capability __read_mostly kvm_pmu_cap;
EXPORT_SYMBOL_GPL(kvm_pmu_cap);
+static const struct x86_cpu_id vmx_icl_pebs_cpu[] = {
+ X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, NULL),
+ X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, NULL),
+ {}
+};
+
/* NOTE:
* - Each perf counter is defined as "struct kvm_pmc";
* - There are two types of perf counters: general purpose (gp) and fixed.
diff --git a/arch/x86/kvm/pmu.h b/arch/x86/kvm/pmu.h
index dbf4c83519a4..8064d074f3be 100644
--- a/arch/x86/kvm/pmu.h
+++ b/arch/x86/kvm/pmu.h
@@ -17,12 +17,6 @@
#define VMWARE_BACKDOOR_PMC_REAL_TIME 0x10001
#define VMWARE_BACKDOOR_PMC_APPARENT_TIME 0x10002
-static const struct x86_cpu_id vmx_icl_pebs_cpu[] = {
- X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, NULL),
- X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, NULL),
- {}
-};
-
struct kvm_event_hw_type_mapping {
u8 eventsel;
u8 unit_mask;
Powered by blists - more mailing lists