From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de, Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [PATCH v6] s390: Fix vDSO clock_getres()
Date: Tue, 9 Jun 2020 16:46:08 +0200 [thread overview]
Message-ID: <20200609144608.GB4575@osiris> (raw)
In-Reply-To: <20200324121027.21665-1-vincenzo.frascino@arm.com>
Hello Vincenzo,
sorry it took such a long time to answer!
> clock_getres in the vDSO library has to preserve the same behaviour
> of posix_get_hrtimer_res().
>
> In particular, posix_get_hrtimer_res() does:
> sec = 0;
> ns = hrtimer_resolution;
> and hrtimer_resolution depends on the enablement of the high
> resolution timers that can happen either at compile or at run time.
>
> Fix the s390 vdso implementation of clock_getres keeping a copy of
> hrtimer_resolution in vdso data and using that directly.
>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> ---
> arch/s390/include/asm/vdso.h | 1 +
> arch/s390/kernel/asm-offsets.c | 2 +-
> arch/s390/kernel/time.c | 1 +
> arch/s390/kernel/vdso64/clock_getres.S | 10 +++++-----
> 4 files changed, 8 insertions(+), 6 deletions(-)
...
> diff --git a/arch/s390/kernel/vdso64/clock_getres.S b/arch/s390/kernel/vdso64/clock_getres.S
> index 081435398e0a..022b58c980db 100644
> --- a/arch/s390/kernel/vdso64/clock_getres.S
> +++ b/arch/s390/kernel/vdso64/clock_getres.S
> @@ -17,12 +17,14 @@
> .type __kernel_clock_getres,@function
> __kernel_clock_getres:
> CFI_STARTPROC
> - larl %r1,4f
> + larl %r1,3f
> + lg %r0,0(%r1)
> cghi %r2,__CLOCK_REALTIME_COARSE
> je 0f
> cghi %r2,__CLOCK_MONOTONIC_COARSE
> je 0f
> - larl %r1,3f
> + larl %r1,_vdso_data
> + l %r0,__VDSO_CLOCK_REALTIME_RES(%r1)
This should be llgf for proper zero extension. The code works anyway,
since the upper lg would clear the high order bits, however this looks
like it works more or less by accident ;)
I changed it and applied your patch. Thanks a lot!
next prev parent reply other threads:[~2020-06-09 14:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-24 12:10 [PATCH v6] s390: Fix vDSO clock_getres() Vincenzo Frascino
2020-06-09 14:46 ` Heiko Carstens [this message]
2020-06-09 15:12 ` Vincenzo Frascino
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=20200609144608.GB4575@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.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