File tree Expand file tree Collapse file tree 5 files changed +30
-18
lines changed Expand file tree Collapse file tree 5 files changed +30
-18
lines changed Original file line number Diff line number Diff line change @@ -1195,18 +1195,6 @@ void kvm_complete_insn_gp(struct kvm_vcpu *vcpu, int err);
1195
1195
1196
1196
int kvm_is_in_guest (void );
1197
1197
1198
- void kvm_pmu_init (struct kvm_vcpu * vcpu );
1199
- void kvm_pmu_destroy (struct kvm_vcpu * vcpu );
1200
- void kvm_pmu_reset (struct kvm_vcpu * vcpu );
1201
- void kvm_pmu_refresh (struct kvm_vcpu * vcpu );
1202
- bool kvm_pmu_is_valid_msr (struct kvm_vcpu * vcpu , u32 msr );
1203
- int kvm_pmu_get_msr (struct kvm_vcpu * vcpu , u32 msr , u64 * data );
1204
- int kvm_pmu_set_msr (struct kvm_vcpu * vcpu , struct msr_data * msr_info );
1205
- int kvm_pmu_is_valid_msr_idx (struct kvm_vcpu * vcpu , unsigned pmc );
1206
- int kvm_pmu_rdpmc (struct kvm_vcpu * vcpu , unsigned pmc , u64 * data );
1207
- void kvm_pmu_handle_event (struct kvm_vcpu * vcpu );
1208
- void kvm_pmu_deliver_pmi (struct kvm_vcpu * vcpu );
1209
-
1210
1198
int __x86_set_memory_region (struct kvm * kvm ,
1211
1199
const struct kvm_userspace_memory_region * mem );
1212
1200
int x86_set_memory_region (struct kvm * kvm ,
Original file line number Diff line number Diff line change 24
24
#include "lapic.h"
25
25
#include "mmu.h"
26
26
#include "trace.h"
27
+ #include "pmu.h"
27
28
28
29
static u32 xstate_required_size (u64 xstate_bv , bool compacted )
29
30
{
Original file line number Diff line number Diff line change 19
19
#include "x86.h"
20
20
#include "cpuid.h"
21
21
#include "lapic.h"
22
+ #include "pmu.h"
22
23
23
- static struct kvm_arch_event_perf_mapping {
24
- u8 eventsel ;
25
- u8 unit_mask ;
26
- unsigned event_type ;
27
- bool inexact ;
28
- } arch_events [] = {
24
+ static struct kvm_event_hw_type_mapping arch_events [] = {
29
25
/* Index must match CPUID 0x0A.EBX bit vector */
30
26
[0 ] = { 0x3c , 0x00 , PERF_COUNT_HW_CPU_CYCLES },
31
27
[1 ] = { 0xc0 , 0x00 , PERF_COUNT_HW_INSTRUCTIONS },
Original file line number Diff line number Diff line change
1
+ #ifndef __KVM_X86_PMU_H
2
+ #define __KVM_X86_PMU_H
3
+
4
+ #define vcpu_to_pmu (vcpu ) (&(vcpu)->arch.pmu)
5
+ #define pmu_to_vcpu (pmu ) (container_of((pmu), struct kvm_vcpu, arch.pmu))
6
+ #define pmc_to_pmu (pmc ) (&(pmc)->vcpu->arch.pmu)
7
+
8
+ struct kvm_event_hw_type_mapping {
9
+ u8 eventsel ;
10
+ u8 unit_mask ;
11
+ unsigned event_type ;
12
+ };
13
+
14
+ void kvm_pmu_deliver_pmi (struct kvm_vcpu * vcpu );
15
+ void kvm_pmu_handle_event (struct kvm_vcpu * vcpu );
16
+ int kvm_pmu_rdpmc (struct kvm_vcpu * vcpu , unsigned pmc , u64 * data );
17
+ int kvm_pmu_is_valid_msr_idx (struct kvm_vcpu * vcpu , unsigned idx );
18
+ bool kvm_pmu_is_valid_msr (struct kvm_vcpu * vcpu , u32 msr );
19
+ int kvm_pmu_get_msr (struct kvm_vcpu * vcpu , u32 msr , u64 * data );
20
+ int kvm_pmu_set_msr (struct kvm_vcpu * vcpu , struct msr_data * msr_info );
21
+ void kvm_pmu_refresh (struct kvm_vcpu * vcpu );
22
+ void kvm_pmu_reset (struct kvm_vcpu * vcpu );
23
+ void kvm_pmu_init (struct kvm_vcpu * vcpu );
24
+ void kvm_pmu_destroy (struct kvm_vcpu * vcpu );
25
+
26
+ #endif /* __KVM_X86_PMU_H */
Original file line number Diff line number Diff line change 28
28
#include "x86.h"
29
29
#include "cpuid.h"
30
30
#include "assigned-dev.h"
31
+ #include "pmu.h"
31
32
32
33
#include <linux/clocksource.h>
33
34
#include <linux/interrupt.h>
You can’t perform that action at this time.
0 commit comments