[patch] ia64 vcpu_reset() do not call kmalloc() with irqs disabled

Jes Sorensen <[email protected]>
Newsgroups org.kernel.vger.kvm-ia64
Message-ID <[email protected]>
Hi,

Here we go again, another case where we were calling kmalloc() through
vcpu_reset() while local interrupts were disabled.

Cheers,
Jes
0006-kvm-ia64-vcpu-reset-sleep.patch (text/x-patch, 695 B)
Restore local irq enabled state before calling kvm_arch_vcpu_init(),
which calls kmalloc(GFP_KERNEL).

Signed-off-by: Jes Sorensen <[email protected]>

---
 arch/ia64/kvm/kvm-ia64.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.git/arch/ia64/kvm/kvm-ia64.c
===================================================================
--- linux-2.6.git.orig/arch/ia64/kvm/kvm-ia64.c
+++ linux-2.6.git/arch/ia64/kvm/kvm-ia64.c
@@ -1919,6 +1919,7 @@
 	long psr;
 	local_irq_save(psr);
 	r = kvm_insert_vmm_mapping(vcpu);
+	local_irq_restore(psr);
 	if (r)
 		goto fail;
 
@@ -1931,7 +1932,6 @@
 	kvm_purge_vmm_mapping(vcpu);
 	r = 0;
 fail:
-	local_irq_restore(psr);
 	return r;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.