-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KVM: x86/vPMU: introduce pmu.h header
This will be used for private function used by AMD- and Intel-specific PMU implementations. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
- Loading branch information
Wei Huang
authored and
Paolo Bonzini
committed
Jun 19, 2015
1 parent
c6702c9
commit 474a5bb
Showing
5 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef __KVM_X86_PMU_H | ||
#define __KVM_X86_PMU_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) | ||
|
||
struct kvm_event_hw_type_mapping { | ||
u8 eventsel; | ||
u8 unit_mask; | ||
unsigned event_type; | ||
}; | ||
|
||
void kvm_pmu_deliver_pmi(struct kvm_vcpu *vcpu); | ||
void kvm_pmu_handle_event(struct kvm_vcpu *vcpu); | ||
int kvm_pmu_rdpmc(struct kvm_vcpu *vcpu, unsigned pmc, u64 *data); | ||
int kvm_pmu_is_valid_msr_idx(struct kvm_vcpu *vcpu, unsigned idx); | ||
bool kvm_pmu_is_valid_msr(struct kvm_vcpu *vcpu, u32 msr); | ||
int kvm_pmu_get_msr(struct kvm_vcpu *vcpu, u32 msr, u64 *data); | ||
int kvm_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info); | ||
void kvm_pmu_refresh(struct kvm_vcpu *vcpu); | ||
void kvm_pmu_reset(struct kvm_vcpu *vcpu); | ||
void kvm_pmu_init(struct kvm_vcpu *vcpu); | ||
void kvm_pmu_destroy(struct kvm_vcpu *vcpu); | ||
|
||
#endif /* __KVM_X86_PMU_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters