From: Jeremy Fitzhardinge Subject: Re: Re: [PATCH 3/5] x86/pvclock: add vsyscall implementation Date: Tue, 13 Oct 2009 13:00:18 -0700 Message-ID: <4AD4DC52.8090508@goop.org> References: <1254790211-15416-1-git-send-email-jeremy.fitzhardinge@citrix.com> <1254790211-15416-4-git-send-email-jeremy.fitzhardinge@citrix.com> <4ACB0833.2050203@redhat.com> <4ACB9074.1000804@goop.org> <4ACC6C9C.7080707@redhat.com> <4ACFD43E.6000506@goop.org> <4AD0CDFB.9030704@redhat.com> <4AD3738B.6050200@goop.org> <4AD375A5.8050205@redhat.com> <4AD37FE3.1010002@goop.org> <4AD420A4.7050508@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4AD420A4.7050508@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Avi Kivity Cc: Dan Magenheimer , Jeremy Fitzhardinge , kurt.hackel@oracle.com, the arch/x86 maintainers , Linux Kernel Mailing List , Glauber de Oliveira Costa , Xen-devel , Keir Fraser , Zach Brown , Ingo Molnar , Chris Mason List-Id: xen-devel@lists.xenproject.org On 10/12/09 23:39, Avi Kivity wrote: > On 10/12/2009 09:13 PM, Jeremy Fitzhardinge wrote: >> On 10/12/09 11:29, Avi Kivity wrote: >> >>> Good catch. Doesn't that invalidate rdtscp based vgettimeofday on >>> non-virt as well (assuming p == cpu)? >>> >> The tsc clocksource assumes the tsc is (mostly?) synced; it doesn't use >> rdtscp or make any attempt at per-cpu corrections. >> > > So it's broken or disabled when that assumption is wrong? We could > easily fix that now. Might even reuse the pvclock structures. Well, the kernel internally makes more or less the same assumption; the vsyscall clocksource is the same as the kernel's internal one. I think idea is that it just drops back to something like hpet if the tsc doesn't have very simple SMP characteristics. If the kernel could characterize the per-cpu properties of the tsc more accurately, then it could use the pvclock mechanism on native. J