From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [patch 09/18] KVM: x86: introduce facility to support vsyscall pvclock, via MSR Date: Tue, 30 Oct 2012 11:38:20 +0400 Message-ID: <508F83EC.4050007@parallels.com> References: <20121024131340.742340256@redhat.com> <20121024131621.707068244@redhat.com> <508E9697.2000003@parallels.com> <508EC089.5030409@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , , , , , , To: Jeremy Fitzhardinge Return-path: Received: from mx2.parallels.com ([64.131.90.16]:36793 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755312Ab2J3Hil (ORCPT ); Tue, 30 Oct 2012 03:38:41 -0400 In-Reply-To: <508EC089.5030409@goop.org> Sender: kvm-owner@vger.kernel.org List-ID: On 10/29/2012 09:44 PM, Jeremy Fitzhardinge wrote: > On 10/29/2012 07:45 AM, Glauber Costa wrote: >> On 10/24/2012 05:13 PM, Marcelo Tosatti wrote: >>> Allow a guest to register a second location for the VCPU time info >>> >>> structure for each vcpu (as described by MSR_KVM_SYSTEM_TIME_NEW). >>> This is intended to allow the guest kernel to map this information >>> into a usermode accessible page, so that usermode can efficiently >>> calculate system time from the TSC without having to make a syscall. >>> >>> Signed-off-by: Marcelo Tosatti >> Can you please be a bit more specific about why we need this? Why does >> the host need to provide us with two pages with the exact same data? Why >> can't just do it with mapping tricks in the guest? > > In Xen the pvclock structure is embedded within a pile of other stuff > that shouldn't be mapped into guest memory, so providing for a second > location allows it to be placed whereever is convenient for the guest. > That's a restriction of the Xen ABI, but I don't know if it affects KVM. > > J > In kvm the exported data seems to be exactly the same. So it makes sense to have a single page exported to the guest. The guest may have a facility that maps the vsyscall clock and the normal clock to a specific location given a page - that can be either a different page or the same page. Any reason why it wouldn't work?