aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/vmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r--drivers/kvm/vmx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index fc01c4b08fd5..43622061660b 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -78,8 +78,6 @@ static const u32 vmx_msr_index[] = {
78}; 78};
79#define NR_VMX_MSR (sizeof(vmx_msr_index) / sizeof(*vmx_msr_index)) 79#define NR_VMX_MSR (sizeof(vmx_msr_index) / sizeof(*vmx_msr_index))
80 80
81struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr);
82
83static inline int is_page_fault(u32 intr_info) 81static inline int is_page_fault(u32 intr_info)
84{ 82{
85 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK | 83 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
@@ -93,6 +91,16 @@ static inline int is_external_interrupt(u32 intr_info)
93 == (INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK); 91 == (INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK);
94} 92}
95 93
94static struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr)
95{
96 int i;
97
98 for (i = 0; i < vcpu->nmsrs; ++i)
99 if (vcpu->guest_msrs[i].index == msr)
100 return &vcpu->guest_msrs[i];
101 return 0;
102}
103
96static void vmcs_clear(struct vmcs *vmcs) 104static void vmcs_clear(struct vmcs *vmcs)
97{ 105{
98 u64 phys_addr = __pa(vmcs); 106 u64 phys_addr = __pa(vmcs);