diff options
author | Will Auld <will.auld.intel@gmail.com> | 2012-11-29 15:42:12 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-30 15:26:12 -0500 |
commit | 8fe8ab46be06fcd9abfe6fe9928fd95b54ab079a (patch) | |
tree | 38c355d8451076da9259f45db598763f91aaf941 /arch/x86/include/asm/kvm_host.h | |
parent | 5419369ed6bd4cf711fdda5e52a5999b940413f5 (diff) |
KVM: x86: Add code to track call origin for msr assignment
In order to track who initiated the call (host or guest) to modify an msr
value I have changed function call parameters along the call path. The
specific change is to add a struct pointer parameter that points to (index,
data, caller) information rather than having this information passed as
individual parameters.
The initial use for this capability is for updating the IA32_TSC_ADJUST msr
while setting the tsc value. It is anticipated that this capability is
useful for other tasks.
Signed-off-by: Will Auld <will.auld@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_host.h')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 9fb6d8da7a43..56c5dca9d78d 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -620,6 +620,12 @@ struct kvm_vcpu_stat { | |||
620 | 620 | ||
621 | struct x86_instruction_info; | 621 | struct x86_instruction_info; |
622 | 622 | ||
623 | struct msr_data { | ||
624 | bool host_initiated; | ||
625 | u32 index; | ||
626 | u64 data; | ||
627 | }; | ||
628 | |||
623 | struct kvm_x86_ops { | 629 | struct kvm_x86_ops { |
624 | int (*cpu_has_kvm_support)(void); /* __init */ | 630 | int (*cpu_has_kvm_support)(void); /* __init */ |
625 | int (*disabled_by_bios)(void); /* __init */ | 631 | int (*disabled_by_bios)(void); /* __init */ |
@@ -642,7 +648,7 @@ struct kvm_x86_ops { | |||
642 | 648 | ||
643 | void (*update_db_bp_intercept)(struct kvm_vcpu *vcpu); | 649 | void (*update_db_bp_intercept)(struct kvm_vcpu *vcpu); |
644 | int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata); | 650 | int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata); |
645 | int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); | 651 | int (*set_msr)(struct kvm_vcpu *vcpu, struct msr_data *msr); |
646 | u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg); | 652 | u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg); |
647 | void (*get_segment)(struct kvm_vcpu *vcpu, | 653 | void (*get_segment)(struct kvm_vcpu *vcpu, |
648 | struct kvm_segment *var, int seg); | 654 | struct kvm_segment *var, int seg); |
@@ -793,7 +799,7 @@ static inline int emulate_instruction(struct kvm_vcpu *vcpu, | |||
793 | 799 | ||
794 | void kvm_enable_efer_bits(u64); | 800 | void kvm_enable_efer_bits(u64); |
795 | int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data); | 801 | int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *data); |
796 | int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); | 802 | int kvm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr); |
797 | 803 | ||
798 | struct x86_emulate_ctxt; | 804 | struct x86_emulate_ctxt; |
799 | 805 | ||
@@ -820,7 +826,7 @@ void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l); | |||
820 | int kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr); | 826 | int kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr); |
821 | 827 | ||
822 | int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); | 828 | int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); |
823 | int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data); | 829 | int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr); |
824 | 830 | ||
825 | unsigned long kvm_get_rflags(struct kvm_vcpu *vcpu); | 831 | unsigned long kvm_get_rflags(struct kvm_vcpu *vcpu); |
826 | void kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags); | 832 | void kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags); |