From: Marcelo Tosatti <marcelo@kvack.org>
To: Avi Kivity <avi@qumranet.com>, Izik Eidus <izike@qumranet.com>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: [PATCH] convert init_rmode_tss to slots_lock
Date: Tue, 18 Mar 2008 17:42:34 -0300 [thread overview]
Message-ID: <20080318204234.GA18022@dmt> (raw)
init_rmode_tss was forgotten during the conversion from mmap_sem to
slots_lock.
There are several sites reading the slots data without taking
slots_lock, including tdp_page_fault. I'll be sending a patch
to move acquision to vcpu_run as suggested by Avi later today.
INFO: task qemu-system-x86:3748 blocked for more than 120 seconds.
Call Trace:
[<ffffffff8053d100>] __down_read+0x86/0x9e
[<ffffffff8053fb43>] do_page_fault+0x346/0x78e
[<ffffffff8053d235>] trace_hardirqs_on_thunk+0x35/0x3a
[<ffffffff8053dcad>] error_exit+0x0/0xa9
[<ffffffff8035a7a7>] copy_user_generic_string+0x17/0x40
[<ffffffff88099a8a>] :kvm:kvm_write_guest_page+0x3e/0x5f
[<ffffffff880b661a>] :kvm_intel:init_rmode_tss+0xa7/0xf9
[<ffffffff880b7d7e>] :kvm_intel:vmx_vcpu_reset+0x10/0x38a
[<ffffffff8809b9a5>] :kvm:kvm_arch_vcpu_setup+0x20/0x53
[<ffffffff8809a1e4>] :kvm:kvm_vm_ioctl+0xad/0x1cf
[<ffffffff80249dea>] __lock_acquire+0x4f7/0xc28
[<ffffffff8028fad9>] vfs_ioctl+0x21/0x6b
[<ffffffff8028fd75>] do_vfs_ioctl+0x252/0x26b
[<ffffffff8028fdca>] sys_ioctl+0x3c/0x5e
[<ffffffff8020b01b>] system_call_after_swapgs+0x7b/0x80
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: kvm/arch/x86/kvm/vmx.c
===================================================================
--- kvm.orig/arch/x86/kvm/vmx.c
+++ kvm/arch/x86/kvm/vmx.c
@@ -1480,7 +1480,7 @@ static int init_rmode_tss(struct kvm *kv
int ret = 0;
int r;
- down_read(¤t->mm->mmap_sem);
+ down_read(&kvm->slots_lock);
r = kvm_clear_guest_page(kvm, fn, 0, PAGE_SIZE);
if (r < 0)
goto out;
@@ -1503,7 +1503,7 @@ static int init_rmode_tss(struct kvm *kv
ret = 1;
out:
- up_read(¤t->mm->mmap_sem);
+ up_read(&kvm->slots_lock);
return ret;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next reply other threads:[~2008-03-18 20:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 20:42 Marcelo Tosatti [this message]
2008-03-19 5:37 ` [PATCH] convert init_rmode_tss to slots_lock Izik Eidus
2008-03-19 12:18 ` 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=20080318204234.GA18022@dmt \
--to=marcelo@kvack.org \
--cc=avi@qumranet.com \
--cc=izike@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox