xen/arm: disable CPUs with different dcache line sizes
authorStefano Stabellini <sstabellini@kernel.org>
Tue, 6 Mar 2018 19:29:23 +0000 (11:29 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 6 Mar 2018 19:32:51 +0000 (11:32 -0800)
commit457c86ff39f966aa040794d218e7e6d20436deef
treeb05f7f7ca462bae743142187526d6d12e6b8a085
parent9782e13b10f9129404317dbb1c84edd87d37e130
xen/arm: disable CPUs with different dcache line sizes

Even different cpus in big.LITTLE systems are expected to have the same
dcache line size. Unless the minimum of all dcache line sizes is used
across all cpu cores, cache coherency protocols can go wrong. Instead,
for now, just disable any cpu with a different dcache line size.

This check is not covered by the hmp-unsafe option, because even with
the correct scheduling and vcpu pinning in place, the system breaks if
dcache line sizes differ across cores. We don't believe it is a problem
for most big.LITTLE systems.

This patch moves the implementation of setup_cache to a static inline,
still setting dcache_line_bytes at the beginning of start_xen as
before.

In start_secondary we check that the dcache level 1 line sizes match,
otherwise we disable the cpu.

Suggested-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/setup.c
xen/arch/arm/smpboot.c
xen/include/asm-arm/page.h