[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 10/11] hvm/hpet: Prevent master clock equal to comparator while enabled



>>> On 17.04.14 at 19:43, <dslutz@xxxxxxxxxxx> wrote:
> Based on the software-developers-hpet-spec-1-0a.pdf, the comparator
> for a periodic timer will change to the new value when it matches
> the master clock.  The current code here uses a very standard
> rounding formula of "((x + y - 1) / y) * y".  This is wrong because
> in this case you need to go to the next comparator value when "x"
> equals "y". Not when "x + 1" equals "y".  In this case "y" is the
> period and "x" is the master clock.
> 
> The code lines:
> 
>     elapsed = hpet_read_maincounter(h, guest_time) +
>         period - 1 - comparator;
>     comparator += (elapsed / period) * period;
> 
> are what matter here.

So this is basically answering the question I raised on an earlier
patch, and I think it implies that this earlier patch is then pointless
(or should likely be folded with this one).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.