[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3] xen/arm: avoid overflow when setting vtimer in context switch
On 30/06/2022 06:20, Jiamei Xie wrote: Hi, Hi Jiamei, -----Original Message----- From: Jiamei Xie <jiamei.xie@xxxxxxx> Sent: 2022年6月30日 9:54 To: xen-devel@xxxxxxxxxxxxxxxxxxxx Cc: Jiamei Xie <Jiamei.Xie@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>; Wei Chen <Wei.Chen@xxxxxxx> Subject: [PATCH v3] xen/arm: avoid overflow when setting vtimer in context switch virt_vtimer_save is calculating the new time for the vtimer in: "v->arch.virt_timer.cval + v->domain->arch.virt_timer_base.offset - boot_count". In this formula, "cval + offset" might cause uint64_t overflow. Changing it to "ticks_to_ns(v->domain->arch.virt_timer_base.offset - boot_count) + ticks_to_ns(v->arch.virt_timer.cval)" can avoid overflow, and "ticks_to_ns(arch.virt_timer_base.offset - boot_count)" will be always the same, which has been caculated in domain_vtimer_init. Introduce a new field virt_timer_base.nanoseconds to store this value for arm in struct arch_domain, so we can use it directly. Signed-off-by: Jiamei Xie <jiamei.xie@xxxxxxx> Change-Id: Ib80cee51eaf844661e6f92154a0339ad2a652f9bI am sorry I forget to remove the Change-Id. No worries. This can be dropped on commit (if no other changes are requested). Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |