[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10EA09EFD8728347A513008B6B0DA77A025DF8A2@pdsmsx411.ccr.corp.intel.com>
Date: Tue, 13 Nov 2007 13:00:10 +0800
From: "Dong, Eddie" <eddie.dong@...el.com>
To: "Glauber de Oliveira Costa" <gcosta@...hat.com>,
<linux-kernel@...r.kernel.org>
Cc: <jeremy@...p.org>, <hollisb@...ibm.com>,
<kvm-devel@...ts.sourceforge.net>, <avi@...ranet.com>
Subject: RE: [kvm-devel] [PATCH 2/3] kvmclock - the host part.
> +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?
> + vcpu->hv_clock.now_ns = ts.tv_nsec + (NSEC_PER_SEC *
> (u64)ts.tv_sec); + vcpu->hv_clock.wc_sec = get_seconds();
> + vcpu->hv_clock.version++;
> + kvm_write_guest(vcpu->kvm, vcpu->clock_gpa,
> &vcpu->hv_clock, PAGE_SIZE);
> +}
> +
thx,eddie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists