linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Christopher Covington <cov@codeaurora.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"marc.zyngier@arm.com" <marc.zyngier@arm.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"john.stultz@linaro.org" <john.stultz@linaro.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] [PATCH 1/3] arm_arch_timer: introduce arch_timer_stolen_ticks
Date: Wed, 8 May 2013 12:19:52 +0100	[thread overview]
Message-ID: <alpine.DEB.2.02.1305081217010.18865@kaball.uk.xensource.com> (raw)
In-Reply-To: <51892933.7090405@codeaurora.org>

On Tue, 7 May 2013, Christopher Covington wrote:
> Hi Konrad,
> 
> On 05/06/2013 10:35 AM, Konrad Rzeszutek Wilk wrote:
> >>> e.g. if a VCPU sets a timer for NOW+5, but 3 are stolen in the middle it
> >>> would not make sense (from the guests PoV) for NOW'==NOW+2 at the point
> >>> where the timer goes off. Nor does it make sense to require that the
> >>> guest actually be running for 5 before injecting the timer because that
> >>> would mean real time elapsed time for the timer would be 5+3 in the case
> >>> where 3 are stolen.
> >>
> >> This is a bit of an aside, but I think that hiding time spent at higher
> >> privilege levels can be a quite sensible approach to timekeeping in a
> >> virtualized environment, but I understand that it's not the approach taken
> >> with Xen, and as you pointed out above, adjusting the Virtual Offset Register
> >> by itself isn't enough to implement that approach.
> > 
> > This is the approach taken by Xen and KVM. Look in CONFIG_PARAVIRT_CLOCK for
> > implementation. In the user-space, the entry in 'top' of "stolen" (%st)
> > is for this exact value.
> 
> I may have been unclear with my terms, sorry. When I refer to time being
> "hidden", I mean that kernel level software (supervisor mode, EL1) cannot
> detect the passage of that time at all. I don't know whether this would really
> work, but I imagine one might be able to get close with the current
> virtualization facilities for ARM.
> 
> Am I correct in interpreting that what you're referring to is the deployment
> of paravirtualization code that ensures (observable) "stolen" time is factored
> into kernel decision-making?

Although it might be possible to hide the real time flow from the VM, it
is inadvisable: what would happen when the VM needs to deal with a real
hardware device? Or just send packets over the network?  This is why it
is much safer and more reliable to expose the stolen ticks to the VM.

  reply	other threads:[~2013-05-08 11:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 19:27 [PATCH 0/3] xen/arm: account for stolen ticks Stefano Stabellini
2013-05-01 19:27 ` [PATCH 1/3] arm_arch_timer: introduce arch_timer_stolen_ticks Stefano Stabellini
2013-05-01 20:36   ` Christopher Covington
2013-05-02  8:19     ` [Xen-devel] " Ian Campbell
2013-05-02 21:33       ` Christopher Covington
2013-05-03 10:43         ` Stefano Stabellini
2013-05-03 10:54           ` Marc Zyngier
2013-05-05 16:47             ` Stefano Stabellini
2013-05-06 14:55               ` Christopher Covington
2013-05-06 14:35         ` Konrad Rzeszutek Wilk
2013-05-07 16:17           ` Christopher Covington
2013-05-08 11:19             ` Stefano Stabellini [this message]
2013-05-08 11:48               ` Christopher Covington
2013-05-01 19:27 ` [PATCH 2/3] xen: move do_stolen_accounting to drivers/xen/time.c Stefano Stabellini
2013-05-02  8:19   ` [Xen-devel] " Ian Campbell
2013-05-02 18:49   ` Christopher Covington
2013-05-03  8:26     ` [Xen-devel] " Ian Campbell
2013-05-03 10:29       ` Stefano Stabellini
2013-05-01 19:27 ` [PATCH 3/3] xen/arm: account for stolen ticks Stefano Stabellini
2013-05-02  8:21   ` [Xen-devel] " Ian Campbell
2013-05-02 10:38     ` Stefano Stabellini
2013-05-02 10:48       ` Ian Campbell
2013-05-02 10:54         ` Stefano Stabellini
2013-05-02 11:02           ` Ian Campbell
2013-05-02 11:04             ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1305081217010.18865@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=catalin.marinas@arm.com \
    --cc=cov@codeaurora.org \
    --cc=john.stultz@linaro.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=will.deacon@arm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).