diff options
author | Avi Kivity <avi@qumranet.com> | 2006-12-13 09:34:01 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 18:05:47 +0100 |
commit | 7725f0badd6682e5bcc06f38eedf0123712a3f60 (patch) | |
tree | bee0e576e61c4551658f3ae463964815baf41691 /drivers/kvm/vmx.c | |
parent | [PATCH] KVM: Make the GET_SREGS and SET_SREGS ioctls symmetric (diff) | |
download | linux-7725f0badd6682e5bcc06f38eedf0123712a3f60.tar.xz linux-7725f0badd6682e5bcc06f38eedf0123712a3f60.zip |
[PATCH] KVM: Move find_vmx_entry() to vmx.c
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/kvm/vmx.c | 12 |
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[] = { }; #define NR_VMX_MSR (sizeof(vmx_msr_index) / sizeof(*vmx_msr_index)) -struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr); - static inline int is_page_fault(u32 intr_info) { 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) == (INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK); } +static struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr) +{ + int i; + + for (i = 0; i < vcpu->nmsrs; ++i) + if (vcpu->guest_msrs[i].index == msr) + return &vcpu->guest_msrs[i]; + return 0; +} + static void vmcs_clear(struct vmcs *vmcs) { u64 phys_addr = __pa(vmcs); |