From: Keir Fraser <keir.xen@gmail.com>
To: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
"stefano.stabellini@eu.citrix.com"
<stefano.stabellini@eu.citrix.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
Tim Deegan <Tim.Deegan@citrix.com>
Subject: Re: [PATCH RFC 04/25] Replace "/" operand with div64
Date: Wed, 07 Dec 2011 09:16:48 +0000 [thread overview]
Message-ID: <CB04DF80.26A1E%keir.xen@gmail.com> (raw)
In-Reply-To: <CB04DE84.26A14%keir.xen@gmail.com>
On 07/12/2011 09:12, "Keir Fraser" <keir.xen@gmail.com> wrote:
> Also, I assume the gcc arm target can at least do 64-bit arithmetic via
> library calls, which you could then implement in arch/arm. __divdi3 etc.
> Perhaps you intend to do this anyway and do_div() here is a bandaid.
Of course we already implement __divdi3/__udivdi3 in common/lib.c. That
should already have been sufficient so not sure why this timer.c change
would be needed at all?
> -- Keir
>
> On 07/12/2011 07:00, "Zhang, Xiantao" <xiantao.zhang@intel.com> wrote:
>
>> Hi, Stefano
>> Great work from you guys! One quick comment: Just found the below logic's
>> change maybe wrong and probably break current things.
>> Original logic is A+B -(C%D), but it is changed to (A+B-C)%D, so if it is
>> not an intended fix, it should be an issue.
>> Thanks!
>> Xiantao
>>
>>> diff --git a/xen/common/timer.c b/xen/common/timer.c index 0547ea3..043250e
>>> 100644
>>> --- a/xen/common/timer.c
>>> +++ b/xen/common/timer.c
>>> @@ -23,6 +23,7 @@
>>> #include <xen/symbols.h>
>>> #include <asm/system.h>
>>> #include <asm/desc.h>
>>> +#include <asm/div64.h>
>>> #include <asm/atomic.h>
>>>
>>> /* We program the time hardware this far behind the closest deadline. */ @@
>>> -503,16 +504,18 @@ static void timer_softirq_action(void)
>>>
>>> s_time_t align_timer(s_time_t firsttick, uint64_t period) {
>>> + uint64_t n;
>>> if ( !period )
>>> return firsttick;
>>
>>> - return firsttick + (period - 1) - ((firsttick - 1) % period);
>>> + n = firsttick + (period - 1) - (firsttick - 1);
>>> + return do_div(n, period);
>>> }
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>
next prev parent reply other threads:[~2011-12-07 9:16 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-06 18:19 [PATCH RFC 00/25] xen: ARMv7 with virtualization extensions Stefano Stabellini
2011-12-06 18:19 ` [PATCH RFC 01/25] Include some header files that are not automatically included on all archs stefano.stabellini
2011-12-07 8:52 ` Jan Beulich
2011-12-07 11:20 ` Stefano Stabellini
2011-12-06 18:19 ` [PATCH RFC 02/25] A collection of fixes to Xen common files stefano.stabellini
2011-12-07 9:00 ` Jan Beulich
2011-12-07 11:14 ` George Dunlap
2011-12-07 11:20 ` Stefano Stabellini
2011-12-07 11:38 ` Ian Campbell
2011-12-07 12:39 ` Stefano Stabellini
2011-12-07 12:47 ` Jan Beulich
2011-12-07 12:43 ` Tim Deegan
2011-12-07 12:49 ` Jan Beulich
2011-12-07 12:53 ` David Vrabel
2011-12-07 12:58 ` Stefano Stabellini
2011-12-06 18:19 ` [PATCH RFC 03/25] Move cpufreq option parsing to cpufreq.c stefano.stabellini
2011-12-07 9:01 ` Jan Beulich
2011-12-07 11:22 ` Stefano Stabellini
2011-12-06 18:19 ` [PATCH RFC 04/25] Replace "/" operand with div64 stefano.stabellini
2011-12-07 7:00 ` Zhang, Xiantao
2011-12-07 9:12 ` Keir Fraser
2011-12-07 9:16 ` Keir Fraser [this message]
2011-12-07 12:23 ` Stefano Stabellini
2011-12-07 15:04 ` Keir Fraser
2011-12-07 20:27 ` Stefano Stabellini
2011-12-07 9:24 ` Jan Beulich
2011-12-07 11:35 ` Keir Fraser
2011-12-06 18:19 ` [PATCH RFC 05/25] Introduce clear_user stefano.stabellini
2011-12-07 9:43 ` Jan Beulich
2011-12-07 11:23 ` Stefano Stabellini
2011-12-06 18:19 ` [PATCH RFC 06/25] libelf-loader: introduce elf_load_image and CONFIG_KERNEL_NO_RELOC stefano.stabellini
2011-12-07 9:56 ` Jan Beulich
2011-12-09 12:02 ` Stefano Stabellini
2011-12-06 18:19 ` [PATCH RFC 07/25] xen/common/Makefile: introduce HAS_CPUFREQ, HAS_PCI, HAS_PASSTHROUGH, HAS_NS16550 stefano.stabellini
2011-12-07 10:00 ` Jan Beulich
2011-12-07 11:24 ` Stefano Stabellini
2011-12-07 12:57 ` Jan Beulich
2011-12-09 12:05 ` Stefano Stabellini
2011-12-09 12:38 ` Ian Campbell
2011-12-06 18:19 ` [PATCH RFC 08/25] arm: makefiles stefano.stabellini
2011-12-07 12:59 ` David Vrabel
2011-12-07 13:04 ` Ian Campbell
2011-12-06 18:19 ` [PATCH RFC 09/25] arm: compile tmem stefano.stabellini
2011-12-06 18:19 ` [PATCH RFC 10/25] arm: header files stefano.stabellini
2011-12-06 18:19 ` [PATCH RFC 11/25] arm: bit manipulation, copy and division libraries stefano.stabellini
2011-12-06 18:19 ` [PATCH RFC 12/25] arm: entry.S and head.S stefano.stabellini
2011-12-06 18:19 ` [PATCH RFC 13/25] arm: domain stefano.stabellini
2011-12-06 18:19 ` [PATCH RFC 14/25] arm: domain_build stefano.stabellini
2011-12-06 18:19 ` [PATCH RFC 15/25] arm: driver for CoreLink GIC-400 Generic Interrupt Controller stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 16/25] arm: mmio handlers stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 17/25] arm: irq stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 18/25] arm: mm and p2m stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 20/25] arm: early setup code stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 21/25] arm: shutdown, smp and smpboot stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 22/25] arm: driver for the generic timer for ARMv7 stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 23/25] arm: trap handlers stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 24/25] arm: vgic emulation stefano.stabellini
2011-12-06 18:20 ` [PATCH RFC 25/25] arm: vtimer 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=CB04DF80.26A1E%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=Tim.Deegan@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
--cc=xiantao.zhang@intel.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 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.