aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-07-22 06:09:54 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:52:54 -0400
commit625831a3f40d330c611fe37cf501d80d611921f9 (patch)
treecaa9d6b9a04929fc68082778ef2d1935e16bda2a /arch/x86
parentb463a6f744a263fccd7da14db1afdc880371a280 (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')
-rw-r--r--arch/x86/kvm/vmx.c47
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);
182static u64 construct_eptp(unsigned long root_hpa); 182static u64 construct_eptp(unsigned long root_hpa);
183static void kvm_cpu_vmxon(u64 addr); 183static void kvm_cpu_vmxon(u64 addr);
184static void kvm_cpu_vmxoff(void); 184static void kvm_cpu_vmxoff(void);
185static void fixup_rmode_irq(struct vcpu_vmx *vmx, u32 *idt_vectoring_info);
186 185
187static DEFINE_PER_CPU(struct vmcs *, vmxarea); 186static DEFINE_PER_CPU(struct vmcs *, vmxarea);
188static DEFINE_PER_CPU(struct vmcs *, current_vmcs); 187static 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 */
3835static 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
3830static void __vmx_complete_interrupts(struct vcpu_vmx *vmx, 3852static 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 */
3914static 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"