From: Julien Grall <julien@xen.org>
To: Jeff Kubascik <jeff.kubascik@dornerworks.com>,
xen-devel@lists.xenproject.org
Cc: Stewart Hildebrand <Stewart.Hildebrand@dornerworks.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [Xen-devel] [PATCH v3 2/2] xen/arm: sign extend writes to TimerValue
Date: Wed, 18 Dec 2019 14:24:49 +0000 [thread overview]
Message-ID: <1c90e15b-0f61-7b06-2291-795185ba5b48@xen.org> (raw)
In-Reply-To: <20191211211302.117395-3-jeff.kubascik@dornerworks.com>
Hi Jeff,
On 11/12/2019 21:13, Jeff Kubascik wrote:
> Per the ARMv8 Reference Manual (ARM DDI 0487E.a), section D11.2.4
> specifies that the values in the TimerValue view of the timers are
> signed in standard two's complement form. When writing to the TimerValue
Do you mean CompareValue register instead of TimerValue register?
> register, it should be signed extended as described by the equation
>
> CompareValue = (Counter[63:0] + SignExtend(TimerValue))[63:0]
This explains the signed part, but it does not explain why the 32-bit
case. So I would mention that TimerValue is a 32-bit signed integer.
Maybe saying "are 32-bit signed in standard ..."
>
> Signed-off-by: Jeff Kubascik <jeff.kubascik@dornerworks.com>
> ---
> xen/arch/arm/vtimer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
> index 21b98ec20a..872181d9b6 100644
> --- a/xen/arch/arm/vtimer.c
> +++ b/xen/arch/arm/vtimer.c
> @@ -211,7 +211,7 @@ static bool vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r,
> }
> else
> {
> - v->arch.phys_timer.cval = cntpct + *r;
> + v->arch.phys_timer.cval = cntpct + (uint64_t)(int32_t)*r;
> if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
> {
> v->arch.phys_timer.ctl &= ~CNTx_CTL_PENDING;
>
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-12-18 14:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 21:13 [Xen-devel] [PATCH v3 0/2] xen/arm: physical timer improvements Jeff Kubascik
2019-12-11 21:13 ` [Xen-devel] [PATCH v3 1/2] xen/arm: remove physical timer offset Jeff Kubascik
2019-12-18 14:20 ` Julien Grall
2020-01-17 21:24 ` Jeff Kubascik
2020-01-23 12:28 ` Julien Grall
2019-12-11 21:13 ` [Xen-devel] [PATCH v3 2/2] xen/arm: sign extend writes to TimerValue Jeff Kubascik
2019-12-18 14:24 ` Julien Grall [this message]
2020-01-17 21:29 ` Jeff Kubascik
2020-01-18 11:49 ` Julien Grall
2020-01-21 14:43 ` Jeff Kubascik
2020-01-16 21:25 ` [Xen-devel] [PATCH v3 0/2] xen/arm: physical timer improvements Julien Grall
2020-01-16 21:52 ` Jeff Kubascik
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=1c90e15b-0f61-7b06-2291-795185ba5b48@xen.org \
--to=julien@xen.org \
--cc=Stewart.Hildebrand@dornerworks.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=jeff.kubascik@dornerworks.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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.