]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Add an isb() before reading CNTPCT_EL0 to prevent re-ordering
authorJulien Grall <julien.grall@arm.com>
Mon, 29 Apr 2019 14:05:16 +0000 (15:05 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 14 Jun 2019 13:38:40 +0000 (14:38 +0100)
commitca73ac8e7d36135c21bb9277e2da494a4bc980ab
treecadce553f79619f6335c2ba8e1a222c8c4f10015
parentb7ab29d448d58e75281046281689d2d1d71fa1d5
xen/arm: Add an isb() before reading CNTPCT_EL0 to prevent re-ordering

Per D8.2.1 in ARM DDI 0487C.a, "a read to CNTPCT_EL0 can occur
speculatively and out of order relative to other instructions executed
on the same PE."

Add an instruction barrier to get accurate number of cycles when
requested in get_cycles(). For the other users of CNPCT_EL0, replace by
a call to get_cycles().

This is part of XSA-295.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/time.c
xen/include/asm-arm/time.h