From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [RFC PATCH v2 1/2] add support for Hyper-V reference time counter Date: Wed, 22 May 2013 00:32:57 -0300 Message-ID: <20130522033257.GA16087@amt.cnet> References: <1368947197-9033-1-git-send-email-vrozenfe@redhat.com> <1368947197-9033-2-git-send-email-vrozenfe@redhat.com> <20130522004614.GA7322@amt.cnet> <20130522032847.GI14287@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Vadim Rozenfeld , kvm@vger.kernel.org, pl@dlh.net To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29088 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753708Ab3EVDdQ (ORCPT ); Tue, 21 May 2013 23:33:16 -0400 Content-Disposition: inline In-Reply-To: <20130522032847.GI14287@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, May 22, 2013 at 06:28:47AM +0300, Gleb Natapov wrote > > > + case HV_X64_MSR_TIME_REF_COUNT: > > > r = true; > > > break; > > > } > > > @@ -1827,6 +1829,29 @@ static int set_msr_hyperv_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data) > > > if (__copy_to_user((void __user *)addr, instructions, 4)) > > > return 1; > > > kvm->arch.hv_hypercall = data; > > > + local_irq_disable(); > > > + kvm->arch.hv_ref_count = get_kernel_ns(); > > > + local_irq_enable(); > > > + break; > > > > local_irq_disable/local_irq_enable not needed. > > > get_kernel_ns has WARN_ON(preemptible()) so at least preempt_disable() > is needed, but all callers of the function disable interrupts. OK. Its not necessary to disable interrupts (this is a left over of kvm_guest_update_time).