.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2012 ARM Ltd. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License version 2 as |
---|
6 | | - * published by the Free Software Foundation. |
---|
7 | | - * |
---|
8 | | - * This program is distributed in the hope that it will be useful, |
---|
9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
11 | | - * GNU General Public License for more details. |
---|
12 | | - * |
---|
13 | | - * You should have received a copy of the GNU General Public License |
---|
14 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | 4 | */ |
---|
16 | 5 | |
---|
17 | 6 | #include <linux/linkage.h> |
---|
.. | .. |
---|
25 | 14 | * Parameters: |
---|
26 | 15 | * x0 - dest |
---|
27 | 16 | */ |
---|
28 | | -ENTRY(clear_page) |
---|
| 17 | +SYM_FUNC_START_PI(clear_page) |
---|
29 | 18 | mrs x1, dczid_el0 |
---|
| 19 | + tbnz x1, #4, 2f /* Branch if DC ZVA is prohibited */ |
---|
30 | 20 | and w1, w1, #0xf |
---|
31 | 21 | mov x2, #4 |
---|
32 | 22 | lsl x1, x2, x1 |
---|
.. | .. |
---|
36 | 26 | tst x0, #(PAGE_SIZE - 1) |
---|
37 | 27 | b.ne 1b |
---|
38 | 28 | ret |
---|
39 | | -ENDPROC(clear_page) |
---|
| 29 | + |
---|
| 30 | +2: stnp xzr, xzr, [x0] |
---|
| 31 | + stnp xzr, xzr, [x0, #16] |
---|
| 32 | + stnp xzr, xzr, [x0, #32] |
---|
| 33 | + stnp xzr, xzr, [x0, #48] |
---|
| 34 | + add x0, x0, #64 |
---|
| 35 | + tst x0, #(PAGE_SIZE - 1) |
---|
| 36 | + b.ne 2b |
---|
| 37 | + ret |
---|
| 38 | +SYM_FUNC_END_PI(clear_page) |
---|
| 39 | +EXPORT_SYMBOL(clear_page) |
---|