Skip to contentSkip to conversation

KVM: SVM: remove needless mmap_sem acquision from nested_svm_map

PATCH Applied Marcelo Tosatti 3 participants 3 messages Sep 8, 2009 – Sep 9, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

nested_svm_map unnecessarily takes mmap_sem around gfn_to_page, since gfn_to_page / get_user_pages are responsible for it.

arch/x86/kvm/svm.c +0 -3
Index: kvm/arch/x86/kvm/svm.c
===================================================================
@@ -1394,10 +1394,7 @@ static void *nested_svm_map(struct vcpu_
 {
 	struct page *page;
 
-	down_read(&current->mm->mmap_sem);
 	page = gfn_to_page(svm->vcpu.kvm, gpa >> PAGE_SHIFT);
-	up_read(&current->mm->mmap_sem);
-
 	if (is_error_page(page))
 		goto error;
 
#1 lore raw
Quoted 3 lines · Marcelo Tosatti

nested_svm_map unnecessarily takes mmap_sem around gfn_to_page, since gfn_to_page / get_user_pages are responsible for it.

Looks good. Sorry I didn't send it out yet.

(not tested, only looked at the code)

Applied
#2 lore raw
In reply to Marcelo Tosatti
Quoted 4 lines · Marcelo Tosatti

nested_svm_map unnecessarily takes mmap_sem around gfn_to_page, since gfn_to_page / get_user_pages are responsible for it.

Applied, thanks.

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