Skip to contentSkip to conversation

preserve int status through call to kvm_insert_vmm_mapping

PATCH Applied Jes Sorensen 2 participants 2 messages Apr 16, 2009 – Apr 20, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 preserve int status through call to kvm_insert_vmm_mapping

Hi,

Here's another one, this one actually should be safe as it is, but with this change it's safe, even if the code is moved around later.

Cheers,
Jes

Preserve interrupt status around call to kvm_insert_vmm_mappin() in kvm_vcpu_pre_transition().

---
 arch/ia64/kvm/kvm-ia64.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/ia64/kvm/kvm-ia64.c +6 -1
Index: linux-2.6.git/arch/ia64/kvm/kvm-ia64.c
===================================================================
@@ -567,6 +567,8 @@
 
 static int kvm_vcpu_pre_transition(struct kvm_vcpu *vcpu)
 {
+	unsigned long psr;
+	int r;
 	int cpu = smp_processor_id();
 
 	if (vcpu->arch.last_run_cpu != cpu ||
@@ -578,7 +580,10 @@
 
 	vcpu->arch.host_rr6 = ia64_get_rr(RR6);
 	vti_set_rr6(vcpu->arch.vmm_rr);
-	return kvm_insert_vmm_mapping(vcpu);
+	local_irq_save(psr);
+	r = kvm_insert_vmm_mapping(vcpu);
+	local_irq_restore(psr);
+	return r;
 }
 
 static void kvm_vcpu_post_transition(struct kvm_vcpu *vcpu)
Applied
#1 lore raw
Quoted 4 lines · Jes Sorensen

Hi,

Here's another one, this one actually should be safe as it is, but with this change it's safe, even if the code is moved around later.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function