linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <konrad.wilk@oracle.com>,
	<marc.zyngier@arm.com>, <will.deacon@arm.com>,
	<Stefano.Stabellini@eu.citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	<linux@arm.linux.org.uk>, <john.stultz@linaro.org>,
	<catalin.marinas@arm.com>
Subject: [PATCH 1/3] arm_arch_timer: introduce arch_timer_stolen_ticks
Date: Wed, 1 May 2013 20:27:38 +0100	[thread overview]
Message-ID: <1367436460-10183-1-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1305011939180.5398@kaball.uk.xensource.com>

Introduce a function, called arch_timer_stolen_ticks, called from the
arch_timer interrupt handler to account for stolen ticks.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: linux@arm.linux.org.uk
CC: john.stultz@linaro.org
CC: catalin.marinas@arm.com
CC: marc.zyngier@arm.com
---
 arch/arm/include/asm/arch_timer.h    |    5 +++++
 drivers/clocksource/arm_arch_timer.c |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h
index 7ade91d..30db413 100644
--- a/arch/arm/include/asm/arch_timer.h
+++ b/arch/arm/include/asm/arch_timer.h
@@ -13,6 +13,11 @@
 int arch_timer_of_register(void);
 int arch_timer_sched_clock_init(void);
 
+/* per-platform function to calculate stolen ticks (clock cycles stolen
+ * to the vcpu by the hypervisor).
+ */
+extern void (*arch_timer_stolen_ticks)(void);
+
 /*
  * These register accessors are marked inline so the compiler can
  * nicely work out which register we want, and chuck away the rest of
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index d7ad425..d1ddf0b 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -37,6 +37,8 @@ static int arch_timer_ppi[MAX_TIMER_PPI];
 
 static struct clock_event_device __percpu *arch_timer_evt;
 
+void (*arch_timer_stolen_ticks)(void);
+
 static bool arch_timer_use_virtual = true;
 
 /*
@@ -52,6 +54,10 @@ static inline irqreturn_t timer_handler(const int access,
 		ctrl |= ARCH_TIMER_CTRL_IT_MASK;
 		arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl);
 		evt->event_handler(evt);
+
+		if ( arch_timer_stolen_ticks != NULL )
+			arch_timer_stolen_ticks();
+
 		return IRQ_HANDLED;
 	}
 
-- 
1.7.2.5


  reply	other threads:[~2013-05-01 19:27 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 ` Stefano Stabellini [this message]
2013-05-01 20:36   ` [PATCH 1/3] arm_arch_timer: introduce arch_timer_stolen_ticks 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
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=1367436460-10183-1-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=catalin.marinas@arm.com \
    --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).