xen/arm: Read the dcache line size from CTR register
authorStefano Stabellini <sstabellini@kernel.org>
Tue, 6 Mar 2018 19:27:54 +0000 (11:27 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 6 Mar 2018 19:32:51 +0000 (11:32 -0800)
commit797ef5091d341806a083e78f7d1e0dbe066c69dc
tree51b9d010fa04913adfe7ed84238cf7f7e3daf9f0
parent31bf55cb5fe3796cf6a4efbcfc0a9418bb1c783f
xen/arm: Read the dcache line size from CTR register

See the corresponding Linux commit as reference:

  commit f91e2c3bd427239c198351f44814dd39db91afe0
  Author: Catalin Marinas <catalin.marinas@arm.com>
  Date:   Tue Dec 7 16:52:04 2010 +0100

      ARM: 6527/1: Use CTR instead of CCSIDR for the D-cache line size on ARMv7

      The current implementation of the dcache_line_size macro reads the L1
      cache size from the CCSIDR register. This, however, is not guaranteed to
      be the smallest cache line in the cache hierarchy. The patch changes to
      the macro to use the more architecturally correct CTR register.

Reported-by: Kevin Sapp <ksapp@quicinc.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Also rename cacheline_bytes to dcache_line_bytes to clarify that it is
the minimum D-Cache line size.

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/arm32/head.S
xen/arch/arm/arm64/head.S
xen/arch/arm/setup.c
xen/include/asm-arm/cpregs.h
xen/include/asm-arm/page.h