arm64: assembler: Change order of macro arguments in phys_to_ttbr
authorWill Deacon <will.deacon@arm.com>
Mon, 29 Jan 2018 11:59:57 +0000 (11:59 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 6 Feb 2018 22:53:21 +0000 (22:53 +0000)
Since AArch64 assembly instructions take the destination register as
their first operand, do the same thing for the phys_to_ttbr macro.

Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/assembler.h
arch/arm64/kernel/head.S
arch/arm64/kernel/hibernate-asm.S
arch/arm64/kvm/hyp-init.S
arch/arm64/mm/proc.S

index 5aae7a6e8ab93c02ddb2d81e0d8b14b77e977d34..47555f632ffd9f36244bdc97c4a14aa5af016611 100644 (file)
@@ -514,7 +514,7 @@ alternative_endif
  *     phys:   physical address, preserved
  *     ttbr:   returns the TTBR value
  */
-       .macro  phys_to_ttbr, phys, ttbr
+       .macro  phys_to_ttbr, ttbr, phys
 #ifdef CONFIG_ARM64_PA_BITS_52
        orr     \ttbr, \phys, \phys, lsr #46
        and     \ttbr, \ttbr, #TTBR_BADDR_MASK_52
index ba3ab04788dc98952398f4bcf4bb549e241d1412..341649c08337d597686420cfd4c70ba171998ab9 100644 (file)
@@ -776,8 +776,8 @@ ENTRY(__enable_mmu)
        update_early_cpu_boot_status 0, x1, x2
        adrp    x1, idmap_pg_dir
        adrp    x2, swapper_pg_dir
-       phys_to_ttbr x1, x3
-       phys_to_ttbr x2, x4
+       phys_to_ttbr x3, x1
+       phys_to_ttbr x4, x2
        msr     ttbr0_el1, x3                   // load TTBR0
        msr     ttbr1_el1, x4                   // load TTBR1
        isb
index 84f5d52fdddac594567abf6fb15ece310a00c07c..dd14ab8c9f724fb923911b95a17c35d5ced6635c 100644 (file)
  * each stage of the walk.
  */
 .macro break_before_make_ttbr_switch zero_page, page_table, tmp
-       phys_to_ttbr \zero_page, \tmp
+       phys_to_ttbr \tmp, \zero_page
        msr     ttbr1_el1, \tmp
        isb
        tlbi    vmalle1
        dsb     nsh
-       phys_to_ttbr \page_table, \tmp
+       phys_to_ttbr \tmp, \page_table
        msr     ttbr1_el1, \tmp
        isb
 .endm
index e086c6eff8c6b380d1ed19b980f2e57d03133857..5aa9ccf6db99308d40ff903721f08091facd302d 100644 (file)
@@ -63,7 +63,7 @@ __do_hyp_init:
        cmp     x0, #HVC_STUB_HCALL_NR
        b.lo    __kvm_handle_stub_hvc
 
-       phys_to_ttbr x0, x4
+       phys_to_ttbr x4, x0
        msr     ttbr0_el2, x4
 
        mrs     x4, tcr_el1
index ab8660eb55cad67c8aabe945f0f5997e33d9bd35..cfd22ba9b510e299b776a796cd380fbf4bfea4f6 100644 (file)
@@ -153,7 +153,7 @@ ENDPROC(cpu_do_resume)
 ENTRY(cpu_do_switch_mm)
        mrs     x2, ttbr1_el1
        mmid    x1, x1                          // get mm->context.id
-       phys_to_ttbr x0, x3
+       phys_to_ttbr x3, x0
 #ifdef CONFIG_ARM64_SW_TTBR0_PAN
        bfi     x3, x1, #48, #16                // set the ASID field in TTBR0
 #endif
@@ -169,7 +169,7 @@ ENDPROC(cpu_do_switch_mm)
 
 .macro __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2
        adrp    \tmp1, empty_zero_page
-       phys_to_ttbr \tmp1, \tmp2
+       phys_to_ttbr \tmp2, \tmp1
        msr     ttbr1_el1, \tmp2
        isb
        tlbi    vmalle1
@@ -188,7 +188,7 @@ ENTRY(idmap_cpu_replace_ttbr1)
 
        __idmap_cpu_set_reserved_ttbr1 x1, x3
 
-       phys_to_ttbr x0, x3
+       phys_to_ttbr x3, x0
        msr     ttbr1_el1, x3
        isb