KVM: i8254: remove unnecessary uses of PIT state lock
authorRadim Krčmář <rkrcmar@redhat.com>
Wed, 2 Mar 2016 21:56:44 +0000 (22:56 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 4 Mar 2016 08:29:58 +0000 (09:29 +0100)
commitb39c90b6560c4458d46cb243abea0dcb7bc126d1
tree0504d13b96b7006735826f3fbbfbb5ac21bd4dc0
parent09edea72b7f9fd8a8d26c1f7504d989b9773ee5e
KVM: i8254: remove unnecessary uses of PIT state lock

- kvm_create_pit had to lock only because it exposed kvm->arch.vpit very
  early, but initialization doesn't use kvm->arch.vpit since the last
  patch, so we can drop locking.
- kvm_free_pit is only run after there are no users of KVM and therefore
  is the sole actor.
- Locking in kvm_vm_ioctl_reinject doesn't do anything, because reinject
  is only protected at that place.
- kvm_pit_reset isn't used anywhere and its locking can be dropped if we
  hide it.

Removing useless locking allows to see what actually is being protected
by PIT state lock (values accessible from the guest).

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/i8254.c
arch/x86/kvm/i8254.h
arch/x86/kvm/x86.c