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>
Wed, 11 Nov 2020 21:44:33 +0000 (13:44 -0800)
commit5505f5f8e7e805365cfe70b6a4af6115940bb749
tree956bc98d49b9244c9a6d42e646f3b6df5bcf5700
parent69634224afaf84474f04e1ab050f216d66bcda68
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>
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