~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/arm64/mte/mte_helper.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* Copyright (C) 2020 ARM Limited */
  3 
  4 #include "mte_def.h"
  5 
  6 .arch   armv8.5-a+memtag
  7 
  8 #define ENTRY(name) \
  9         .globl name ;\
 10         .p2align 2;\
 11         .type name, @function ;\
 12 name:
 13 
 14 #define ENDPROC(name) \
 15         .size name, .-name ;
 16 
 17         .text
 18 /*
 19  * mte_insert_random_tag: Insert random tag and might be same as the source tag if
 20  *                        the source pointer has it.
 21  * Input:
 22  *              x0 - source pointer with a tag/no-tag
 23  * Return:
 24  *              x0 - pointer with random tag
 25  */
 26 ENTRY(mte_insert_random_tag)
 27         irg     x0, x0, xzr
 28         ret
 29 ENDPROC(mte_insert_random_tag)
 30 
 31 /*
 32  * mte_insert_new_tag: Insert new tag and different from the source tag if
 33  *                     source pointer has it.
 34  * Input:
 35  *              x0 - source pointer with a tag/no-tag
 36  * Return:
 37  *              x0 - pointer with random tag
 38  */
 39 ENTRY(mte_insert_new_tag)
 40         gmi     x1, x0, xzr
 41         irg     x0, x0, x1
 42         ret
 43 ENDPROC(mte_insert_new_tag)
 44 
 45 /*
 46  * mte_get_tag_address: Get the tag from given address.
 47  * Input:
 48  *              x0 - source pointer
 49  * Return:
 50  *              x0 - pointer with appended tag
 51  */
 52 ENTRY(mte_get_tag_address)
 53         ldg     x0, [x0]
 54         ret
 55 ENDPROC(mte_get_tag_address)
 56 
 57 /*
 58  * mte_set_tag_address_range: Set the tag range from the given address
 59  * Input:
 60  *              x0 - source pointer with tag data
 61  *              x1 - range
 62  * Return:
 63  *              none
 64  */
 65 ENTRY(mte_set_tag_address_range)
 66         cbz     x1, 2f
 67 1:
 68         stg     x0, [x0, #0x0]
 69         add     x0, x0, #MT_GRANULE_SIZE
 70         sub     x1, x1, #MT_GRANULE_SIZE
 71         cbnz    x1, 1b
 72 2:
 73         ret
 74 ENDPROC(mte_set_tag_address_range)
 75 
 76 /*
 77  * mt_clear_tag_address_range: Clear the tag range from the given address
 78  * Input:
 79  *              x0 - source pointer with tag data
 80  *              x1 - range
 81  * Return:
 82  *              none
 83  */
 84 ENTRY(mte_clear_tag_address_range)
 85         cbz     x1, 2f
 86 1:
 87         stzg    x0, [x0, #0x0]
 88         add     x0, x0, #MT_GRANULE_SIZE
 89         sub     x1, x1, #MT_GRANULE_SIZE
 90         cbnz    x1, 1b
 91 2:
 92         ret
 93 ENDPROC(mte_clear_tag_address_range)
 94 
 95 /*
 96  * mte_enable_pstate_tco: Enable PSTATE.TCO (tag check override) field
 97  * Input:
 98  *              none
 99  * Return:
100  *              none
101  */
102 ENTRY(mte_enable_pstate_tco)
103         msr     tco, #MT_PSTATE_TCO_EN
104         ret
105 ENDPROC(mte_enable_pstate_tco)
106 
107 /*
108  * mte_disable_pstate_tco: Disable PSTATE.TCO (tag check override) field
109  * Input:
110  *              none
111  * Return:
112  *              none
113  */
114 ENTRY(mte_disable_pstate_tco)
115         msr     tco, #MT_PSTATE_TCO_DIS
116         ret
117 ENDPROC(mte_disable_pstate_tco)
118 
119 /*
120  * mte_get_pstate_tco: Get PSTATE.TCO (tag check override) field
121  * Input:
122  *              none
123  * Return:
124  *              x0
125  */
126 ENTRY(mte_get_pstate_tco)
127         mrs     x0, tco
128         ubfx    x0, x0, #MT_PSTATE_TCO_SHIFT, #1
129         ret
130 ENDPROC(mte_get_pstate_tco)

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php