[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.9] xen/arm: time: cycles_t should be an uint64_t and not unsigned long
commit bc8e5ecaed1b346767943fb3337040d3f5b7662f Author: Julien Grall <julien.grall@xxxxxxx> AuthorDate: Thu Jun 20 18:47:06 2019 +0100 Commit: Stefano Stabellini <sstabellini@xxxxxxxxxx> CommitDate: Thu Jun 20 17:05:25 2019 -0700 xen/arm: time: cycles_t should be an uint64_t and not unsigned long Since commit ca73ac8e7d "xen/arm: Add an isb() before reading CNTPCT_EL0 to prevent re-ordering", get_cycles() is now returning the number of cycles and used in more callers. While the counter registers is always 64-bit, get_cycles() will only reutrn a 32-bit on Arm32 and therefore truncate the value. This will result to weird behavior by both Xen and the Guest as the timer will not be setup correctly. This could be resolved by switch cycles_t from unsigned long to unsigned int. This change was originally introduced by da3d55ae67225798c2ad8f42af2f432f6f2b2214 "console: avoid printing no or null time stamps". Signed-off-by: Julien Grall <julien.grall@xxxxxxx> [Stefano: improve commit message] Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- xen/include/asm-arm/time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h index ca30406669..bd7dc86d78 100644 --- a/xen/include/asm-arm/time.h +++ b/xen/include/asm-arm/time.h @@ -7,7 +7,7 @@ DT_MATCH_COMPATIBLE("arm,armv7-timer"), \ DT_MATCH_COMPATIBLE("arm,armv8-timer") -typedef unsigned long cycles_t; +typedef uint64_t cycles_t; static inline cycles_t get_cycles (void) { -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.9 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |