From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754265AbXKMM0X (ORCPT ); Tue, 13 Nov 2007 07:26:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751927AbXKMM0L (ORCPT ); Tue, 13 Nov 2007 07:26:11 -0500 Received: from mis011-1.exch011.intermedia.net ([64.78.21.128]:33863 "EHLO mis011-1.exch011.intermedia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbXKMM0J (ORCPT ); Tue, 13 Nov 2007 07:26:09 -0500 Message-ID: <473993B3.4060508@qumranet.com> Date: Tue, 13 Nov 2007 14:08:19 +0200 From: Izik Eidus User-Agent: Thunderbird 2.0.0.6 (X11/20070926) MIME-Version: 1.0 To: Glauber de Oliveira Costa CC: "Dong, Eddie" , kvm-devel@lists.sourceforge.net, jeremy@goop.org, linux-kernel@vger.kernel.org, hollisb@us.ibm.com, avi@qumranet.com Subject: Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part. References: <11945615632624-git-send-email-gcosta@redhat.com><11945615703593-git-send-email-gcosta@redhat.com> <11945615751747-git-send-email-gcosta@redhat.com> <10EA09EFD8728347A513008B6B0DA77A025DF8A2@pdsmsx411.ccr.corp.intel.com> <4739906B.2080103@redhat.com> In-Reply-To: <4739906B.2080103@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 13 Nov 2007 12:09:56.0590 (UTC) FILETIME=[1B0648E0:01C825EE] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Glauber de Oliveira Costa wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dong, Eddie escreveu: > >>> +static void kvm_write_guest_time(struct kvm_vcpu *vcpu) +{ >>> + struct timespec ts; >>> + int r; >>> + >>> + if (!vcpu->clock_gpa) >>> + return; >>> + >>> + /* Updates version to the next odd number, indicating >>> we're writing */ >>> + vcpu->hv_clock.version++; >>> + kvm_write_guest(vcpu->kvm, vcpu->clock_gpa, >>> &vcpu->hv_clock, PAGE_SIZE); >>> + >>> + kvm_get_msr(vcpu, MSR_IA32_TIME_STAMP_COUNTER, >>> + &vcpu->hv_clock.last_tsc); >>> + >>> + ktime_get_ts(&ts); >>> >> Do we need to disable preemption here? >> > After thinking for a little while, you are theoretically right. > In the current state, we could even be preempted between all operations > ;-) Maybe after avi's suggestion of moving the call to it it will end up > in a preempt safe region, but anyway, it's safer to add the preempt > markers here. > I'll put it in next version, thanks > note that you cant call to kvm_write_guest with preemption disabled (witch you do few lines below) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: Re: [PATCH 2/3] kvmclock - the host part. Date: Tue, 13 Nov 2007 14:08:19 +0200 Message-ID: <473993B3.4060508@qumranet.com> References: <11945615632624-git-send-email-gcosta@redhat.com><11945615703593-git-send-email-gcosta@redhat.com> <11945615751747-git-send-email-gcosta@redhat.com> <10EA09EFD8728347A513008B6B0DA77A025DF8A2@pdsmsx411.ccr.corp.intel.com> <4739906B.2080103@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: jeremy-TSDbQ3PG+2Y@public.gmane.org, hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org To: Glauber de Oliveira Costa Return-path: In-Reply-To: <4739906B.2080103-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Glauber de Oliveira Costa wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dong, Eddie escreveu: > >>> +static void kvm_write_guest_time(struct kvm_vcpu *vcpu) +{ >>> + struct timespec ts; >>> + int r; >>> + >>> + if (!vcpu->clock_gpa) >>> + return; >>> + >>> + /* Updates version to the next odd number, indicating >>> we're writing */ >>> + vcpu->hv_clock.version++; >>> + kvm_write_guest(vcpu->kvm, vcpu->clock_gpa, >>> &vcpu->hv_clock, PAGE_SIZE); >>> + >>> + kvm_get_msr(vcpu, MSR_IA32_TIME_STAMP_COUNTER, >>> + &vcpu->hv_clock.last_tsc); >>> + >>> + ktime_get_ts(&ts); >>> >> Do we need to disable preemption here? >> > After thinking for a little while, you are theoretically right. > In the current state, we could even be preempted between all operations > ;-) Maybe after avi's suggestion of moving the call to it it will end up > in a preempt safe region, but anyway, it's safer to add the preempt > markers here. > I'll put it in next version, thanks > note that you cant call to kvm_write_guest with preemption disabled (witch you do few lines below) ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/