* [PATCH] convert init_rmode_tss to slots_lock
@ 2008-03-18 20:42 Marcelo Tosatti
2008-03-19 5:37 ` Izik Eidus
2008-03-19 12:18 ` Avi Kivity
0 siblings, 2 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2008-03-18 20:42 UTC (permalink / raw)
To: Avi Kivity, Izik Eidus; +Cc: kvm-devel
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] convert init_rmode_tss to slots_lock
2008-03-18 20:42 [PATCH] convert init_rmode_tss to slots_lock Marcelo Tosatti
@ 2008-03-19 5:37 ` Izik Eidus
2008-03-19 12:18 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Izik Eidus @ 2008-03-19 5:37 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm-devel, Avi Kivity
Marcelo Tosatti wrote:
> init_rmode_tss was forgotten during the conversion from mmap_sem to
> slots_lock.
>
yup, good catch.
> 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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] convert init_rmode_tss to slots_lock
2008-03-18 20:42 [PATCH] convert init_rmode_tss to slots_lock Marcelo Tosatti
2008-03-19 5:37 ` Izik Eidus
@ 2008-03-19 12:18 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2008-03-19 12:18 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm-devel
Marcelo Tosatti wrote:
> init_rmode_tss was forgotten during the conversion from mmap_sem to
> slots_lock.
>
>
Applied, thanks.
> 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.
>
You'll need to acquire it for KVM_SET_MSRS (since that can trigger a
write, if writing to the clock base).
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-19 12:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18 20:42 [PATCH] convert init_rmode_tss to slots_lock Marcelo Tosatti
2008-03-19 5:37 ` Izik Eidus
2008-03-19 12:18 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox