xen/arm: Add Cortex-A73 erratum 858921 workaround
authorPenny Zheng <penny.zheng@arm.com>
Mon, 9 Nov 2020 08:21:10 +0000 (16:21 +0800)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 19 Mar 2021 19:32:42 +0000 (12:32 -0700)
commit2c46385e5ac44276cdb5d17da3e8ede6cd1f50f1
treed6a33b74aebc118d91390cdd9b9eca4bfa506721
parentf43374f8c3af637f245d4ea2625bf98f1a7af84c
xen/arm: Add Cortex-A73 erratum 858921 workaround

CNTVCT_EL0 or CNTPCT_EL0 counter read in Cortex-A73 (all versions)
might return a wrong value when the counter crosses a 32bit boundary.

Until now, there is no case for Xen itself to access CNTVCT_EL0,
and it also should be the Guest OS's responsibility to deal with
this part.

But for CNTPCT, there exists several cases in Xen involving reading
CNTPCT, so a possible workaround is that performing the read twice,
and to return one or the other depending on whether a transition has
taken place.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Reviewed-by: Wei Chen <Wei.Chen@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit 5505f5f8e7e805365cfe70b6a4af6115940bb749)
docs/misc/arm/silicon-errata.txt
xen/arch/arm/Kconfig
xen/arch/arm/cpuerrata.c
xen/arch/arm/vtimer.c
xen/include/asm-arm/cpuerrata.h
xen/include/asm-arm/cpufeature.h
xen/include/asm-arm/time.h