| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * kexec for arm64 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) Linaro. |
|---|
| 5 | 6 | * Copyright (C) Huawei Futurewei Technologies. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/kexec.h> |
|---|
| .. | .. |
|---|
| 29 | 26 | * control_code_page, a special page which has been set up to be preserved |
|---|
| 30 | 27 | * during the copy operation. |
|---|
| 31 | 28 | */ |
|---|
| 32 | | -ENTRY(arm64_relocate_new_kernel) |
|---|
| 29 | +SYM_CODE_START(arm64_relocate_new_kernel) |
|---|
| 33 | 30 | |
|---|
| 34 | 31 | /* Setup the list loop variables. */ |
|---|
| 32 | + mov x18, x2 /* x18 = dtb address */ |
|---|
| 35 | 33 | mov x17, x1 /* x17 = kimage_start */ |
|---|
| 36 | 34 | mov x16, x0 /* x16 = kimage_head */ |
|---|
| 37 | 35 | raw_dcache_line_size x15, x0 /* x15 = dcache line size */ |
|---|
| 38 | 36 | mov x14, xzr /* x14 = entry ptr */ |
|---|
| 39 | 37 | mov x13, xzr /* x13 = copy dest */ |
|---|
| 40 | | - |
|---|
| 41 | | - /* Clear the sctlr_el2 flags. */ |
|---|
| 42 | | - mrs x0, CurrentEL |
|---|
| 43 | | - cmp x0, #CurrentEL_EL2 |
|---|
| 44 | | - b.ne 1f |
|---|
| 45 | | - mrs x0, sctlr_el2 |
|---|
| 46 | | - ldr x1, =SCTLR_ELx_FLAGS |
|---|
| 47 | | - bic x0, x0, x1 |
|---|
| 48 | | - pre_disable_mmu_workaround |
|---|
| 49 | | - msr sctlr_el2, x0 |
|---|
| 50 | | - isb |
|---|
| 51 | | -1: |
|---|
| 52 | 38 | |
|---|
| 53 | 39 | /* Check if the new image needs relocation. */ |
|---|
| 54 | 40 | tbnz x16, IND_DONE_BIT, .Ldone |
|---|
| .. | .. |
|---|
| 107 | 93 | isb |
|---|
| 108 | 94 | |
|---|
| 109 | 95 | /* Start new image. */ |
|---|
| 110 | | - mov x0, xzr |
|---|
| 96 | + mov x0, x18 |
|---|
| 111 | 97 | mov x1, xzr |
|---|
| 112 | 98 | mov x2, xzr |
|---|
| 113 | 99 | mov x3, xzr |
|---|
| 114 | 100 | br x17 |
|---|
| 115 | 101 | |
|---|
| 116 | | -ENDPROC(arm64_relocate_new_kernel) |
|---|
| 117 | | - |
|---|
| 118 | | -.ltorg |
|---|
| 102 | +SYM_CODE_END(arm64_relocate_new_kernel) |
|---|
| 119 | 103 | |
|---|
| 120 | 104 | .align 3 /* To keep the 64-bit values below naturally aligned. */ |
|---|
| 121 | 105 | |
|---|