]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: mte: DC {GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1
authorReiji Watanabe <reijiw@google.com>
Mon, 6 Dec 2021 00:47:36 +0000 (16:47 -0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 6 Dec 2021 17:02:10 +0000 (17:02 +0000)
commit629772e3f3bdfae3891808fcf90cc77ecdc2f68f
treef7409f8ee9f4ac811079d1f671cce80cf530d0e8
parent24b103571885c6f500b3825ca6bacb9c1c30251b
arm64: mte: DC {GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1

Currently, mte_set_mem_tag_range() and mte_zero_clear_page_tags() use
DC {GVA,GZVA} unconditionally.  But, they should make sure that
DCZID_EL0.DZP, which indicates whether or not use of those instructions
is prohibited, is zero when using those instructions.
Use ST{G,ZG,Z2G} instead when DCZID_EL0.DZP == 1.

Fixes: dcc1e78446d3 ("arm64: mte: handle tags zeroing at page allocation time")
Fixes: 786d4b9f7c91 ("kasan: speed up mte_set_mem_tag_range")
Signed-off-by: Reiji Watanabe <reijiw@google.com>
Link: https://lore.kernel.org/r/20211206004736.1520989-3-reijiw@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/mte-kasan.h
arch/arm64/lib/mte.S