All of lore.kernel.org
 help / color / mirror / Atom feed
From: john.stultz@linaro.org (John Stultz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] arm64: Fix the update_vsyscall() prototype
Date: Fri, 09 Nov 2012 14:47:54 -0800	[thread overview]
Message-ID: <509D881A.30908@linaro.org> (raw)
In-Reply-To: <1350406000-30882-3-git-send-email-catalin.marinas@arm.com>

On 10/16/2012 09:46 AM, Catalin Marinas wrote:
> With commit 576094b7 (time: Introduce new GENERIC_TIME_VSYSCALL) the old
> update_vsyscall() prototype is no longer available. This patch updates
> the arm64 port.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Acked-by: Will Deacon <will.deacon@arm.com>
> Cc: John Stultz <john.stultz@linaro.org>
> ---
>   arch/arm64/kernel/vdso.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
> index 17948fc..ba45794 100644
> --- a/arch/arm64/kernel/vdso.c
> +++ b/arch/arm64/kernel/vdso.c
> @@ -28,6 +28,7 @@
>   #include <linux/sched.h>
>   #include <linux/signal.h>
>   #include <linux/slab.h>
> +#include <linux/timekeeper_internal.h>
>   #include <linux/vmalloc.h>
>   
>   #include <asm/cacheflush.h>
> @@ -222,11 +223,10 @@ struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
>   /*
>    * Update the vDSO data page to keep in sync with kernel timekeeping.
>    */
> -void update_vsyscall(struct timespec *ts, struct timespec *wtm,
> -		     struct clocksource *clock, u32 mult)
> +void update_vsyscall(struct timekeeper *tk)
>   {
>   	struct timespec xtime_coarse;
> -	u32 use_syscall = strcmp(clock->name, "arch_sys_counter");
> +	u32 use_syscall = strcmp(tk->clock->name, "arch_sys_counter");
>   
>   	++vdso_data->tb_seq_count;
>   	smp_wmb();
> @@ -237,13 +237,13 @@ void update_vsyscall(struct timespec *ts, struct timespec *wtm,
>   	vdso_data->xtime_coarse_nsec		= xtime_coarse.tv_nsec;
>   
>   	if (!use_syscall) {
> -		vdso_data->cs_cycle_last	= clock->cycle_last;
> -		vdso_data->xtime_clock_sec	= ts->tv_sec;
> -		vdso_data->xtime_clock_nsec	= ts->tv_nsec;
> -		vdso_data->cs_mult		= mult;
> -		vdso_data->cs_shift		= clock->shift;
> -		vdso_data->wtm_clock_sec	= wtm->tv_sec;
> -		vdso_data->wtm_clock_nsec	= wtm->tv_nsec;
> +		vdso_data->cs_cycle_last	= tk->clock->cycle_last;
> +		vdso_data->xtime_clock_sec	= tk->xtime_sec;
> +		vdso_data->xtime_clock_nsec	= tk->xtime_nsec >> tk->shift;
Sorry for the collision here!

One word of warning:  Truncating the sub-ns base like this can cause 
small single ns inconsistencies from the vsyscalls.

So either use GENERIC_TIME_VSYSCALL_OLD to enable the 1ns generic 
rounding-up code, or rework the vsyscall code to use the sub-ns 
granularity as done in 650ea02475106e8d6bdf561896d2ffe0d1c0ebb4 for 
x86_64.  I hope to drop the _OLD config eventually, so this will need to 
be done at some point.

thanks
-john

  reply	other threads:[~2012-11-09 22:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 16:46 [PATCH 0/4] arm64: Random fixes for 3.7 Catalin Marinas
2012-10-16 16:46 ` [PATCH 1/4] arm64: Select MODULES_USE_ELF_RELA Catalin Marinas
2012-10-16 16:53   ` Will Deacon
2012-10-16 16:46 ` [PATCH 2/4] arm64: Fix the update_vsyscall() prototype Catalin Marinas
2012-11-09 22:47   ` John Stultz [this message]
2012-10-16 16:46 ` [PATCH 3/4] arm64: Ignore memory blocks below PHYS_OFFSET Catalin Marinas
2012-10-16 16:46 ` [PATCH 4/4] arm64: No need to set the x0-x2 registers in start_thread() Catalin Marinas

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=509D881A.30908@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.