All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org
Subject: [PATCH 07/45] KVM: Fix userspace IRQ chip migration
Date: Sun, 24 May 2009 18:49:52 +0300	[thread overview]
Message-ID: <1243180230-2480-8-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1243180230-2480-1-git-send-email-avi@redhat.com>

From: Gleb Natapov <gleb@redhat.com>

Re-put pending IRQ vector into interrupt_bitmap before migration.
Otherwise it will be lost if migration happens in the wrong time.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/kvm/x86.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b3ecaf8..cf315e8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3562,17 +3562,17 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
 	sregs->efer = vcpu->arch.shadow_efer;
 	sregs->apic_base = kvm_get_apic_base(vcpu);
 
-	if (irqchip_in_kernel(vcpu->kvm)) {
+	if (irqchip_in_kernel(vcpu->kvm))
 		memset(sregs->interrupt_bitmap, 0,
 		       sizeof sregs->interrupt_bitmap);
-		pending_vec = kvm_x86_ops->get_irq(vcpu);
-		if (pending_vec >= 0)
-			set_bit(pending_vec,
-				(unsigned long *)sregs->interrupt_bitmap);
-	} else
+	else
 		memcpy(sregs->interrupt_bitmap, vcpu->arch.irq_pending,
 		       sizeof sregs->interrupt_bitmap);
 
+	pending_vec = kvm_x86_ops->get_irq(vcpu);
+	if (pending_vec >= 0)
+		set_bit(pending_vec, (unsigned long *)sregs->interrupt_bitmap);
+
 	vcpu_put(vcpu);
 
 	return 0;
-- 
1.6.0.6


  parent reply	other threads:[~2009-05-24 15:51 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24 15:49 [PATCH 00/45] KVM updates for the 2.6.31 merge window (batch 3/3) Avi Kivity
2009-05-24 15:49 ` [PATCH 01/45] KVM: Remove inject_pending_vectors() callback Avi Kivity
2009-05-24 15:49 ` [PATCH 02/45] KVM: Remove kvm_push_irq() Avi Kivity
2009-05-24 15:49 ` [PATCH 03/45] KVM: sync_lapic_to_cr8() should always sync cr8 to V_TPR Avi Kivity
2009-05-24 15:49 ` [PATCH 04/45] KVM: Do not report TPR write to userspace if new value bigger or equal to a previous one Avi Kivity
2009-05-24 15:49 ` [PATCH 05/45] KVM: Get rid of arch.interrupt_window_open & arch.nmi_window_open Avi Kivity
2009-05-24 15:49 ` [PATCH 06/45] KVM: SVM: Add NMI injection support Avi Kivity
2009-05-24 15:49 ` Avi Kivity [this message]
2009-05-24 15:49 ` [PATCH 08/45] KVM: Get rid of get_irq() callback Avi Kivity
2009-05-24 15:49 ` [PATCH 09/45] KVM: Wake up waitqueue before calling get_cpu() Avi Kivity
2009-05-24 15:49 ` [PATCH 10/45] KVM: Replace get_mt_mask_shift with get_mt_mask Avi Kivity
2009-05-24 15:49 ` [PATCH 11/45] KVM: Enable snooping control for supported hardware Avi Kivity
2009-05-24 15:49 ` [PATCH 12/45] KVM: VMX: Disable VMX when system shutdown Avi Kivity
2009-05-24 15:49 ` [PATCH 13/45] KVM: Trivial format fix in setup_routing_entry() Avi Kivity
2009-05-24 15:49 ` [PATCH 14/45] KVM: fix apic_debug instances Avi Kivity
2009-05-24 15:50 ` [PATCH 15/45] KVM: SVM: Fix cross vendor migration issue in segment segment descriptor Avi Kivity
2009-05-24 15:50 ` [PATCH 16/45] KVM: SVM: Don't reinject event that caused a task switch Avi Kivity
2009-05-24 15:50 ` [PATCH 17/45] KVM: Drop request_nmi from stats Avi Kivity
2009-05-24 15:50 ` [PATCH 18/45] KVM: Fix cpuid feature misreporting Avi Kivity
2009-05-24 15:50 ` [PATCH 19/45] KVM: Add AMD cpuid bit: cr8_legacy, abm, misaligned sse, sse4, 3dnow prefetch Avi Kivity
2009-05-24 15:50 ` [PATCH 20/45] x86: Add cpu features MOVBE and POPCNT Avi Kivity
2009-05-24 15:50 ` [PATCH 21/45] KVM: Update cpuid 1.ecx reporting Avi Kivity
2009-05-24 15:50 ` [PATCH 22/45] KVM: use smp_send_reschedule in kvm_vcpu_kick Avi Kivity
2009-05-24 15:50 ` [PATCH 23/45] KVM: protect assigned dev workqueue, int handler and irq acker Avi Kivity
2009-05-24 15:50 ` [PATCH 24/45] KVM: Replace ->drop_interrupt_shadow() by ->set_interrupt_shadow() Avi Kivity
2009-05-24 15:50 ` [PATCH 25/45] KVM: Deal with interrupt shadow state for emulated instructions Avi Kivity
2009-05-24 15:50 ` [PATCH 26/45] KVM: MMU: protect kvm_mmu_change_mmu_pages with mmu_lock Avi Kivity
2009-05-24 15:50 ` [PATCH 27/45] KVM: take mmu_lock when updating a deleted slot Avi Kivity
2009-05-24 15:50 ` [PATCH 28/45] KVM: x86: check for cr3 validity in mmu_alloc_roots Avi Kivity
2009-05-24 15:50 ` [PATCH 29/45] KVM: Expand on "help" info to specify kvm intel and amd module names Avi Kivity
2009-05-24 15:50 ` [PATCH 30/45] KVM: s390: Fix memory slot versus run - v3 Avi Kivity
2009-05-24 15:50 ` [PATCH 31/45] KVM: s390: use hrtimer for clock wakeup from idle - v2 Avi Kivity
2009-05-24 15:50 ` [PATCH 32/45] KVM: s390: optimize float int lock: spin_lock_bh --> spin_lock Avi Kivity
2009-05-24 15:50 ` [PATCH 33/45] KVM: s390: Unlink vcpu on destroy - v2 Avi Kivity
2009-05-24 15:50 ` [PATCH 34/45] KVM: s390: Sanity check on validity intercept Avi Kivity
2009-05-24 15:50 ` [PATCH 35/45] KVM: s390: Verify memory in kvm run Avi Kivity
2009-05-24 15:50 ` [PATCH 36/45] KVM: Unprotect a page if #PF happens during NMI injection Avi Kivity
2009-05-24 15:50 ` [PATCH 37/45] KVM: Do not allow interrupt injection from userspace if there is a pending event Avi Kivity
2009-05-24 15:50 ` [PATCH 38/45] KVM: Remove irq_pending bitmap Avi Kivity
2009-05-24 15:50 ` [PATCH 39/45] KVM: skip_emulated_instruction() decode instruction if size is not known Avi Kivity
2009-05-24 15:50 ` [PATCH 40/45] KVM: Do not re-execute INTn instruction Avi Kivity
2009-05-24 15:50 ` [PATCH 41/45] KVM: Always request IRQ/NMI window if an interrupt is pending Avi Kivity
2009-05-24 15:50 ` [PATCH 42/45] KVM: inject NMI after IRET from a previous NMI, not before Avi Kivity
2009-05-24 15:50 ` [PATCH 43/45] KVM: Do not migrate pending software interrupts Avi Kivity
2009-05-24 15:50 ` [PATCH 44/45] KVM: Disable CR8 intercept if tpr patching is active Avi Kivity
2009-05-24 15:50 ` [PATCH 45/45] KVM: Move "exit due to NMI" handling into vmx_complete_interrupts() Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243180230-2480-8-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.