summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-10-04 12:55:49 +0200
committerAvi Kivity <avi@redhat.com>2010-10-24 10:53:14 +0200
commit395c6b0a9d56fe7fdb7aeda12795d0eb02475d24 (patch)
tree86922dc53a722cca079e7ce911c47a566e05fc11 /arch/x86/kvm/x86.c
parent7ebaf15eefe7b019def72bd9d4420c7bc51ed69e (diff)
downloadlwn-395c6b0a9d56fe7fdb7aeda12795d0eb02475d24.tar.gz
lwn-395c6b0a9d56fe7fdb7aeda12795d0eb02475d24.zip
KVM: Disable interrupts around get_kernel_ns()
get_kernel_ns() wants preemption disabled. It doesn't make a lot of sense during the get/set ioctls (no way to make them non-racy) but the callee wants it. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ffcb90669ec5..e96038e1bc3a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3469,8 +3469,10 @@ long kvm_arch_vm_ioctl(struct file *filp,
goto out;
r = 0;
+ local_irq_disable();
now_ns = get_kernel_ns();
delta = user_ns.clock - now_ns;
+ local_irq_enable();
kvm->arch.kvmclock_offset = delta;
break;
}
@@ -3478,8 +3480,10 @@ long kvm_arch_vm_ioctl(struct file *filp,
struct kvm_clock_data user_ns;
u64 now_ns;
+ local_irq_disable();
now_ns = get_kernel_ns();
user_ns.clock = kvm->arch.kvmclock_offset + now_ns;
+ local_irq_enable();
user_ns.flags = 0;
r = -EFAULT;