mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
35 lines
729 B
ArmAsm
35 lines
729 B
ArmAsm
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||
|
/*
|
||
|
* Copyright (C) 2020 ARM Ltd.
|
||
|
*/
|
||
|
#include <linux/linkage.h>
|
||
|
|
||
|
#include <asm/assembler.h>
|
||
|
#include <asm/sysreg.h>
|
||
|
|
||
|
.arch armv8.5-a+memtag
|
||
|
|
||
|
/*
|
||
|
* multitag_transfer_size - set \reg to the block size that is accessed by the
|
||
|
* LDGM/STGM instructions.
|
||
|
*/
|
||
|
.macro multitag_transfer_size, reg, tmp
|
||
|
mrs_s \reg, SYS_GMID_EL1
|
||
|
ubfx \reg, \reg, #SYS_GMID_EL1_BS_SHIFT, #SYS_GMID_EL1_BS_SIZE
|
||
|
mov \tmp, #4
|
||
|
lsl \reg, \tmp, \reg
|
||
|
.endm
|
||
|
|
||
|
/*
|
||
|
* Clear the tags in a page
|
||
|
* x0 - address of the page to be cleared
|
||
|
*/
|
||
|
SYM_FUNC_START(mte_clear_page_tags)
|
||
|
multitag_transfer_size x1, x2
|
||
|
1: stgm xzr, [x0]
|
||
|
add x0, x0, x1
|
||
|
tst x0, #(PAGE_SIZE - 1)
|
||
|
b.ne 1b
|
||
|
ret
|
||
|
SYM_FUNC_END(mte_clear_page_tags)
|