diff options
author | Avi Kivity <avi@redhat.com> | 2010-07-22 06:09:54 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:52:54 -0400 |
commit | 625831a3f40d330c611fe37cf501d80d611921f9 (patch) | |
tree | caa9d6b9a04929fc68082778ef2d1935e16bda2a /arch/x86/kvm | |
parent | b463a6f744a263fccd7da14db1afdc880371a280 (diff) |
KVM: VMX: Move fixup_rmode_irq() to avoid forward declaration
No code changes.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/vmx.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 70af3db372d7..32315935201a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -182,7 +182,6 @@ static int init_rmode(struct kvm *kvm); | |||
182 | static u64 construct_eptp(unsigned long root_hpa); | 182 | static u64 construct_eptp(unsigned long root_hpa); |
183 | static void kvm_cpu_vmxon(u64 addr); | 183 | static void kvm_cpu_vmxon(u64 addr); |
184 | static void kvm_cpu_vmxoff(void); | 184 | static void kvm_cpu_vmxoff(void); |
185 | static void fixup_rmode_irq(struct vcpu_vmx *vmx, u32 *idt_vectoring_info); | ||
186 | 185 | ||
187 | static DEFINE_PER_CPU(struct vmcs *, vmxarea); | 186 | static DEFINE_PER_CPU(struct vmcs *, vmxarea); |
188 | static DEFINE_PER_CPU(struct vmcs *, current_vmcs); | 187 | static DEFINE_PER_CPU(struct vmcs *, current_vmcs); |
@@ -3827,6 +3826,29 @@ static void vmx_recover_nmi_blocking(struct vcpu_vmx *vmx) | |||
3827 | ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time)); | 3826 | ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time)); |
3828 | } | 3827 | } |
3829 | 3828 | ||
3829 | /* | ||
3830 | * Failure to inject an interrupt should give us the information | ||
3831 | * in IDT_VECTORING_INFO_FIELD. However, if the failure occurs | ||
3832 | * when fetching the interrupt redirection bitmap in the real-mode | ||
3833 | * tss, this doesn't happen. So we do it ourselves. | ||
3834 | */ | ||
3835 | static void fixup_rmode_irq(struct vcpu_vmx *vmx, u32 *idt_vectoring_info) | ||
3836 | { | ||
3837 | vmx->rmode.irq.pending = 0; | ||
3838 | if (kvm_rip_read(&vmx->vcpu) + 1 != vmx->rmode.irq.rip) | ||
3839 | return; | ||
3840 | kvm_rip_write(&vmx->vcpu, vmx->rmode.irq.rip); | ||
3841 | if (*idt_vectoring_info & VECTORING_INFO_VALID_MASK) { | ||
3842 | *idt_vectoring_info &= ~VECTORING_INFO_TYPE_MASK; | ||
3843 | *idt_vectoring_info |= INTR_TYPE_EXT_INTR; | ||
3844 | return; | ||
3845 | } | ||
3846 | *idt_vectoring_info = | ||
3847 | VECTORING_INFO_VALID_MASK | ||
3848 | | INTR_TYPE_EXT_INTR | ||
3849 | | vmx->rmode.irq.vector; | ||
3850 | } | ||
3851 | |||
3830 | static void __vmx_complete_interrupts(struct vcpu_vmx *vmx, | 3852 | static void __vmx_complete_interrupts(struct vcpu_vmx *vmx, |
3831 | u32 idt_vectoring_info, | 3853 | u32 idt_vectoring_info, |
3832 | int instr_len_field, | 3854 | int instr_len_field, |
@@ -3905,29 +3927,6 @@ static void vmx_cancel_injection(struct kvm_vcpu *vcpu) | |||
3905 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); | 3927 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); |
3906 | } | 3928 | } |
3907 | 3929 | ||
3908 | /* | ||
3909 | * Failure to inject an interrupt should give us the information | ||
3910 | * in IDT_VECTORING_INFO_FIELD. However, if the failure occurs | ||
3911 | * when fetching the interrupt redirection bitmap in the real-mode | ||
3912 | * tss, this doesn't happen. So we do it ourselves. | ||
3913 | */ | ||
3914 | static void fixup_rmode_irq(struct vcpu_vmx *vmx, u32 *idt_vectoring_info) | ||
3915 | { | ||
3916 | vmx->rmode.irq.pending = 0; | ||
3917 | if (kvm_rip_read(&vmx->vcpu) + 1 != vmx->rmode.irq.rip) | ||
3918 | return; | ||
3919 | kvm_rip_write(&vmx->vcpu, vmx->rmode.irq.rip); | ||
3920 | if (*idt_vectoring_info & VECTORING_INFO_VALID_MASK) { | ||
3921 | *idt_vectoring_info &= ~VECTORING_INFO_TYPE_MASK; | ||
3922 | *idt_vectoring_info |= INTR_TYPE_EXT_INTR; | ||
3923 | return; | ||
3924 | } | ||
3925 | *idt_vectoring_info = | ||
3926 | VECTORING_INFO_VALID_MASK | ||
3927 | | INTR_TYPE_EXT_INTR | ||
3928 | | vmx->rmode.irq.vector; | ||
3929 | } | ||
3930 | |||
3931 | #ifdef CONFIG_X86_64 | 3930 | #ifdef CONFIG_X86_64 |
3932 | #define R "r" | 3931 | #define R "r" |
3933 | #define Q "q" | 3932 | #define Q "q" |