xen/arm: arm64: Annotate code symbols
v3 cover xen/arm: arm64: Annotate code symbols
From: "Edgar E. Iglesias" <[email protected]>
On the way towards Xen safety certification we're evaluating the use of tools to collect code-coverage/profiling information from execution traces. Some tools rely on ELF symbols for code being declared with type FUNC and having a symbol size.
We currently annotate some symbols but not all. Also, there seems to be different ways to do the annotation.
This series now converts all the .S files under xen/arm/arm64 to use the macros from xen/linkage.h and also adds missing code symbol annotations when appropriate.
Best regards,
Edgar
ChangeLog:
v2 -> v3:
* Convert and add annotations for all of xen/arm/arm64.
* Fix brain freeze in commit message for entry.S.
v1 -> v2:
* Drop RFC.
* Squash into a single patch to avoid confusion.
Edgar E. Iglesias (9):
xen/arm64: entry: Add missing code symbol annotations xen/arm64: smc: Add missing code symbol annotations xen/arm64: sve: Add missing code symbol annotations xen/arm64: head: Add missing code symbol annotations xen/arm64: debug: Add missing code symbol annotations xen/arm64: bpi: Add missing code symbol annotations xen/arm64: mmu/head: Add missing code symbol annotations xen/arm64: cache: Use the generic xen/linkage.h macros xen/arm64: lib: Use the generic xen/linkage.h macros
xen/arch/arm/arm64/bpi.S | 20 +++++---- xen/arch/arm/arm64/cache.S | 4 +- xen/arch/arm/arm64/debug.S | 6 ++- xen/arch/arm/arm64/entry.S | 72 +++++++++++++++++++++----------- xen/arch/arm/arm64/head.S | 50 +++++++++++----------- xen/arch/arm/arm64/lib/memchr.S | 4 +- xen/arch/arm/arm64/lib/memcmp.S | 4 +- xen/arch/arm/arm64/lib/memcpy.S | 4 +- xen/arch/arm/arm64/lib/memmove.S | 4 +- xen/arch/arm/arm64/lib/memset.S | 4 +- xen/arch/arm/arm64/lib/strchr.S | 4 +- xen/arch/arm/arm64/lib/strcmp.S | 4 +- xen/arch/arm/arm64/lib/strlen.S | 4 +- xen/arch/arm/arm64/lib/strncmp.S | 4 +- xen/arch/arm/arm64/lib/strnlen.S | 4 +- xen/arch/arm/arm64/lib/strrchr.S | 4 +- xen/arch/arm/arm64/mmu/head.S | 28 ++++++------- xen/arch/arm/arm64/smc.S | 6 ++- xen/arch/arm/arm64/sve-asm.S | 9 ++-- 19 files changed, 138 insertions(+), 101 deletions(-)
Signature · 1 line
2.40.1
PATCH v3 1/9 xen/arm64: entry: Add missing code symbol annotations
From: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols and add missing annotations.
--- xen/arch/arm/arm64/entry.S | 72 +++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 24 deletions(-)
xen/arch/arm/arm64/entry.S +48 -24
@@ -289,21 +289,25 @@ b do_bad_mode .endm -hyp_sync_invalid: +FUNC_LOCAL(hyp_sync_invalid) entry hyp=1 invalid BAD_SYNC +END(hyp_sync_invalid) -hyp_irq_invalid: +FUNC_LOCAL(hyp_irq_invalid) entry hyp=1 invalid BAD_IRQ +END(hyp_irq_invalid) -hyp_fiq_invalid: +FUNC_LOCAL(hyp_fiq_invalid) entry hyp=1 invalid BAD_FIQ +END(hyp_fiq_invalid) -hyp_error_invalid: +FUNC_LOCAL(hyp_error_invalid) entry hyp=1 invalid BAD_ERROR +END(hyp_error_invalid) /* * SError received while running in the hypervisor mode.
@@ -313,11 +317,12 @@ hyp_error_invalid: * simplicity, as SError should be rare and potentially fatal, * all interrupts are kept masked. */ -hyp_error: +FUNC_LOCAL(hyp_error) entry hyp=1 mov x0, sp bl do_trap_hyp_serror exit hyp=1 +END(hyp_error) /* * Synchronous exception received while running in the hypervisor mode.
@@ -327,7 +332,7 @@ hyp_error: * some of them. So we want to inherit the state from the interrupted * context. */ -hyp_sync: +FUNC_LOCAL(hyp_sync) entry hyp=1 /* Inherit interrupts */
@@ -338,6 +343,7 @@ hyp_sync: mov x0, sp bl do_trap_hyp_sync exit hyp=1 +END(hyp_sync) /* * IRQ received while running in the hypervisor mode.
@@ -352,7 +358,7 @@ hyp_sync: * would require some rework in some paths (e.g. panic, livepatch) to * ensure the ordering is enforced everywhere. */ -hyp_irq: +FUNC_LOCAL(hyp_irq) entry hyp=1 /* Inherit D, A, F interrupts and keep I masked */
@@ -365,8 +371,9 @@ hyp_irq: mov x0, sp bl do_trap_irq exit hyp=1 +END(hyp_irq) -guest_sync: +FUNC_LOCAL(guest_sync) /* * Save x0, x1 in advance */
@@ -413,8 +420,9 @@ fastpath_out_workaround: mov x1, xzr eret sb +END(guest_sync) -wa2_ssbd: +FUNC_LOCAL(wa2_ssbd) #ifdef CONFIG_ARM_SSBD alternative_cb arm_enable_wa2_handling b wa2_end
@@ -450,42 +458,55 @@ wa2_end: mov x0, xzr eret sb -guest_sync_slowpath: +END(wa2_ssbd) + +FUNC_LOCAL(guest_sync_slowpath) /* * x0/x1 may have been scratch by the fast path above, so avoid * to save them. */ guest_vector compat=0, iflags=IFLAGS__AI_, trap=guest_sync, save_x0_x1=0 +END(guest_sync_slowpath) -guest_irq: +FUNC_LOCAL(guest_irq) guest_vector compat=0, iflags=IFLAGS__A__, trap=irq +END(guest_irq) -guest_fiq_invalid: +FUNC_LOCAL(guest_fiq_invalid) entry hyp=0, compat=0 invalid BAD_FIQ +END(guest_fiq_invalid) -guest_error: +FUNC_LOCAL(guest_error) guest_vector compat=0, iflags=IFLAGS__AI_, trap=guest_serror +END(guest_error) -guest_sync_compat: +FUNC_LOCAL(guest_sync_compat) guest_vector compat=1, iflags=IFLAGS__AI_, trap=guest_sync +END(guest_sync_compat) -guest_irq_compat: +FUNC_LOCAL(guest_irq_compat) guest_vector compat=1, iflags=IFLAGS__A__, trap=irq +END(guest_irq_compat) -guest_fiq_invalid_compat: +FUNC_LOCAL(guest_fiq_invalid_compat) entry hyp=0, compat=1 invalid BAD_FIQ +END(guest_fiq_invalid_compat) -guest_error_compat: +FUNC_LOCAL(guest_error_compat) guest_vector compat=1, iflags=IFLAGS__AI_, trap=guest_serror +END(guest_error_compat) -ENTRY(return_to_new_vcpu32) +FUNC(return_to_new_vcpu32) exit hyp=0, compat=1 -ENTRY(return_to_new_vcpu64) +END(return_to_new_vcpu32) + +FUNC(return_to_new_vcpu64) exit hyp=0, compat=0 +END(return_to_new_vcpu64) -return_from_trap: +FUNC_LOCAL(return_from_trap) msr daifset, #IFLAGS___I_ /* Mask interrupts */ ldr x21, [sp, #UREGS_PC] /* load ELR */
@@ -524,6 +545,7 @@ return_from_trap: eret sb +END(return_from_trap) /* * Consume pending SError generated by the guest if any.
@@ -536,7 +558,7 @@ return_from_trap: * it. So the function will unmask SError exception for a small window and * then mask it again. */ -check_pending_guest_serror: +FUNC_LOCAL(check_pending_guest_serror) /* * Save elr_el2 to check whether the pending SError exception takes * place while we are doing this sync exception.
@@ -586,7 +608,7 @@ abort_guest_exit_end: cset x19, ne ret -ENDPROC(check_pending_guest_serror) +END(check_pending_guest_serror) /* * Exception vectors.
@@ -597,7 +619,7 @@ ENDPROC(check_pending_guest_serror) .endm .align 11 -ENTRY(hyp_traps_vector) +FUNC(hyp_traps_vector) ventry hyp_sync_invalid /* Synchronous EL2t */ ventry hyp_irq_invalid /* IRQ EL2t */ ventry hyp_fiq_invalid /* FIQ EL2t */
@@ -617,6 +639,7 @@ ENTRY(hyp_traps_vector) ventry guest_irq_compat /* IRQ 32-bit EL0/EL1 */ ventry guest_fiq_invalid_compat /* FIQ 32-bit EL0/EL1 */ ventry guest_error_compat /* Error 32-bit EL0/EL1 */ +END(hyp_traps_vector) /* * struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next)
@@ -626,7 +649,7 @@ ENTRY(hyp_traps_vector) * * Returns prev in x0 */ -ENTRY(__context_switch) +FUNC(__context_switch) add x8, x0, #VCPU_arch_saved_context mov x9, sp stp x19, x20, [x8], #16 /* store callee-saved registers */
@@ -647,6 +670,7 @@ ENTRY(__context_switch) ldr lr, [x8] mov sp, x9 ret +END(__context_switch) /* * Local variables:
Signature · 1 line
2.40.1
PATCH v3 2/9 xen/arm64: smc: Add missing code symbol annotations
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols and add missing annotations.
--- xen/arch/arm/arm64/smc.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
xen/arch/arm/arm64/smc.S +4 -2
@@ -19,7 +19,7 @@ * register_t a6, register_t a7, * struct arm_smccc_res *res) */ -ENTRY(__arm_smccc_1_0_smc) +FUNC(__arm_smccc_1_0_smc) smc #0 ldr x4, [sp] cbz x4, 1f /* No need to store the result */
@@ -27,12 +27,13 @@ ENTRY(__arm_smccc_1_0_smc) stp x2, x3, [x4, #SMCCC_RES_a2] 1: ret +END(__arm_smccc_1_0_smc) /* * void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args, * struct arm_smccc_1_2_regs *res) */ -ENTRY(arm_smccc_1_2_smc) +FUNC(arm_smccc_1_2_smc) /* Save `res` and free a GPR that won't be clobbered by SMC call */ stp x1, x19, [sp, #-16]!
@@ -69,3 +70,4 @@ ENTRY(arm_smccc_1_2_smc) /* Restore original x19 */ ldp xzr, x19, [sp], #16 ret +END(arm_smccc_1_2_smc)
Signature · 1 line
2.40.1
Re: [PATCH v3 2/9] xen/arm64: smc: Add missing code symbol annotations
Quoted 6 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>
Quoted 40 lines
--- xen/arch/arm/arm64/smc.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)xen/arch/arm/arm64/smc.S +4
-2@@ -19,7 +19,7 @@ * register_t a6, register_t a7, * struct arm_smccc_res *res) */ -ENTRY(__arm_smccc_1_0_smc) +FUNC(__arm_smccc_1_0_smc) smc #0 ldr x4, [sp] cbz x4, 1f /* No need to store the result */@@ -27,12 +27,13 @@ ENTRY(__arm_smccc_1_0_smc) stp x2, x3, [x4, #SMCCC_RES_a2] 1: ret +END(__arm_smccc_1_0_smc) /* * void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args, * struct arm_smccc_1_2_regs *res) */ -ENTRY(arm_smccc_1_2_smc) +FUNC(arm_smccc_1_2_smc) /* Save `res` and free a GPR that won't be clobbered by SMC call */ stp x1, x19, [sp, #-16]!@@ -69,3 +70,4 @@ ENTRY(arm_smccc_1_2_smc) /* Restore original x19 */ ldp xzr, x19, [sp], #16 ret +END(arm_smccc_1_2_smc)Signature · 1 line
2.40.1
PATCH v3 3/9 xen/arm64: sve: Add missing code symbol annotations
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols and add missing annotations.
--- xen/arch/arm/arm64/sve-asm.S | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
xen/arch/arm/arm64/sve-asm.S +6 -3
@@ -161,9 +161,10 @@ .endm /* Gets the current vector register size in bytes */ -GLOBAL(sve_get_hw_vl) +FUNC(sve_get_hw_vl) _sve_rdvl 0, 1 ret +END(sve_get_hw_vl) /* * Save the SVE context
@@ -172,9 +173,10 @@ GLOBAL(sve_get_hw_vl) * x1 - pointer to buffer for P0-15 * x2 - Save FFR if non-zero */ -GLOBAL(sve_save_ctx) +FUNC(sve_save_ctx) sve_save 0, 1, x2 ret +END(sve_save_ctx) /* * Load the SVE context
@@ -183,9 +185,10 @@ GLOBAL(sve_save_ctx) * x1 - pointer to buffer for P0-15 * x2 - Restore FFR if non-zero */ -GLOBAL(sve_load_ctx) +FUNC(sve_load_ctx) sve_load 0, 1, x2 ret +END(sve_load_ctx) /* * Local variables:
Signature · 1 line
2.40.1
Re: [PATCH v3 3/9] xen/arm64: sve: Add missing code symbol annotations
Quoted 6 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>
Quoted 47 lines
--- xen/arch/arm/arm64/sve-asm.S | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)xen/arch/arm/arm64/sve-asm.S +6
-3@@ -161,9 +161,10 @@ .endm /* Gets the current vector register size in bytes */ -GLOBAL(sve_get_hw_vl) +FUNC(sve_get_hw_vl) _sve_rdvl 0, 1 ret +END(sve_get_hw_vl) /* * Save the SVE context@@ -172,9 +173,10 @@ GLOBAL(sve_get_hw_vl) * x1 - pointer to buffer for P0-15 * x2 - Save FFR if non-zero */ -GLOBAL(sve_save_ctx) +FUNC(sve_save_ctx) sve_save 0, 1, x2 ret +END(sve_save_ctx) /* * Load the SVE context@@ -183,9 +185,10 @@ GLOBAL(sve_save_ctx) * x1 - pointer to buffer for P0-15 * x2 - Restore FFR if non-zero */ -GLOBAL(sve_load_ctx) +FUNC(sve_load_ctx) sve_load 0, 1, x2 ret +END(sve_load_ctx) /* * Local variables:Signature · 1 line
2.40.1
PATCH v3 4/9 xen/arm64: head: Add missing code symbol annotations
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols and add missing annotations.
--- xen/arch/arm/arm64/head.S | 50 ++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 24 deletions(-)
xen/arch/arm/arm64/head.S +26 -24
@@ -90,7 +90,7 @@ * 4K-aligned address. */ -GLOBAL(start) +FUNC(start) /* * DO NOT MODIFY. Image header expected by Linux boot-loaders. */
@@ -102,6 +102,7 @@ efi_head: */ add x13, x18, #0x16 b real_start /* branch to kernel start */ +END(start) .quad 0 /* Image load offset from start of RAM */ .quad _end - start /* Effective size of kernel image, little-endian */ .quad __HEAD_FLAGS /* Informative flags, little-endian */
@@ -223,7 +224,7 @@ section_table: .align 5 #endif /* CONFIG_ARM_EFI */ -real_start: +FUNC_LOCAL(real_start) /* BSS should be zeroed when booting without EFI */ mov x26, #0 /* x26 := skip_zero_bss */
@@ -263,9 +264,9 @@ primary_switched: mov x1, x21 /* x1 := paddr(FDT) */ ldr x2, =start_xen b launch -ENDPROC(real_start) +END(real_start) -GLOBAL(init_secondary) +FUNC(init_secondary) msr DAIFSet, 0xf /* Disable all interrupts */ /* Find out where we are */
@@ -304,7 +305,7 @@ secondary_switched: /* Jump to C world */ ldr x2, =start_secondary b launch -ENDPROC(init_secondary) +END(init_secondary) /* * Check if the CPU has been booted in Hypervisor mode.
@@ -313,7 +314,7 @@ ENDPROC(init_secondary) * * Clobbers x0 - x5 */ -check_cpu_mode: +FUNC_LOCAL(check_cpu_mode) PRINT_ID("- Current EL ") mrs x5, CurrentEL print_reg x5
@@ -329,7 +330,7 @@ check_cpu_mode: PRINT_ID("- Xen must be entered in NS EL2 mode -\r\n") PRINT_ID("- Please update the bootloader -\r\n") b fail -ENDPROC(check_cpu_mode) +END(check_cpu_mode) /* * Zero BSS
@@ -339,7 +340,7 @@ ENDPROC(check_cpu_mode) * * Clobbers x0 - x3 */ -zero_bss: +FUNC_LOCAL(zero_bss) /* Zero BSS only when requested */ cbnz x26, skip_bss
@@ -353,14 +354,14 @@ zero_bss: skip_bss: ret -ENDPROC(zero_bss) +END(zero_bss) /* * Initialize the processor for turning the MMU on. * * Clobbers x0 - x3 */ -cpu_init: +FUNC_LOCAL(cpu_init) PRINT_ID("- Initialize CPU -\r\n") /* Set up memory attribute type tables */
@@ -399,7 +400,7 @@ cpu_init: */ msr spsel, #1 ret -ENDPROC(cpu_init) +END(cpu_init) /* * Setup the initial stack and jump to the C world
@@ -411,7 +412,7 @@ ENDPROC(cpu_init) * * Clobbers x3 */ -launch: +FUNC_LOCAL(launch) ldr x3, =init_data add x3, x3, #INITINFO_stack /* Find the boot-time stack */ ldr x3, [x3]
@@ -421,13 +422,13 @@ launch: /* Jump to C world */ br x2 -ENDPROC(launch) +END(launch) /* Fail-stop */ -fail: PRINT_ID("- Boot failed -\r\n") +FUNC_LOCAL(fail) PRINT_ID("- Boot failed -\r\n") 1: wfe b 1b -ENDPROC(fail) +END(fail) #ifdef CONFIG_EARLY_PRINTK /*
@@ -438,14 +439,14 @@ ENDPROC(fail) * * Clobbers x0 - x1 */ -init_uart: +FUNC_LOCAL(init_uart) ldr x23, =CONFIG_EARLY_UART_BASE_ADDRESS #ifdef CONFIG_EARLY_UART_INIT early_uart_init x23, 0 #endif PRINT("- UART enabled -\r\n") ret -ENDPROC(init_uart) +END(init_uart) /* * Print early debug messages.
@@ -454,7 +455,7 @@ ENDPROC(init_uart) * x23: Early UART base address * Clobbers x0-x1 */ -ENTRY(asm_puts) +FUNC(asm_puts) early_uart_ready x23, 1 ldrb w1, [x0], #1 /* Load next char */ cbz w1, 1f /* Exit on nul */
@@ -462,7 +463,7 @@ ENTRY(asm_puts) b asm_puts 1: ret -ENDPROC(asm_puts) +END(asm_puts) /* * Print a 64-bit number in hex.
@@ -471,7 +472,7 @@ ENDPROC(asm_puts) * x23: Early UART base address * Clobbers x0-x3 */ -ENTRY(asm_putn) +FUNC(asm_putn) adr_l x1, hex mov x3, #16 1:
@@ -484,7 +485,7 @@ ENTRY(asm_putn) subs x3, x3, #1 b.ne 1b ret -ENDPROC(asm_putn) +END(asm_putn) RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef")
@@ -493,16 +494,17 @@ RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef") /* This provides a C-API version of __lookup_processor_type * TODO: For now, the implementation return NULL every time */ -ENTRY(lookup_processor_type) +FUNC(lookup_processor_type) mov x0, #0 ret +END(lookup_processor_type) #ifdef CONFIG_ARM_EFI /* * Function to transition from EFI loader in C, to Xen entry point. * void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size); */ -ENTRY(efi_xen_start) +FUNC(efi_xen_start) /* * Preserve x0 (fdt pointer) across call to __flush_dcache_area, * restore for entry into Xen.
@@ -554,7 +556,7 @@ ENTRY(efi_xen_start) mov x26, #1 /* x26 := skip_zero_bss */ b real_start_efi -ENDPROC(efi_xen_start) +END(efi_xen_start) #endif /* CONFIG_ARM_EFI */
Signature · 1 line
2.40.1
Re: [PATCH v3 4/9] xen/arm64: head: Add missing code symbol annotations
Quoted 124 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/arch/arm/arm64/head.S | 50 ++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 24 deletions(-)xen/arch/arm/arm64/head.S +13
-12@@ -90,7 +90,7 @@ * 4K-aligned address. */ -GLOBAL(start) +FUNC(start) /* * DO NOT MODIFY. Image header expected by Linux boot-loaders. */@@ -102,6 +102,7 @@ efi_head: */ add x13, x18, #0x16 b real_start /* branch to kernel start */ +END(start) .quad 0 /* Image load offset from start of RAM */ .quad _end - start /* Effective size of kernel image, little-endian */ .quad __HEAD_FLAGS /* Informative flags, little-endian */@@ -223,7 +224,7 @@ section_table: .align 5 #endif /* CONFIG_ARM_EFI */ -real_start: +FUNC_LOCAL(real_start) /* BSS should be zeroed when booting without EFI */ mov x26, #0 /* x26 := skip_zero_bss */@@ -263,9 +264,9 @@ primary_switched: mov x1, x21 /* x1 := paddr(FDT) */ ldr x2, =start_xen b launch -ENDPROC(real_start) +END(real_start) -GLOBAL(init_secondary) +FUNC(init_secondary) msr DAIFSet, 0xf /* Disable all interrupts */ /* Find out where we are */@@ -304,7 +305,7 @@ secondary_switched: /* Jump to C world */ ldr x2, =start_secondary b launch -ENDPROC(init_secondary) +END(init_secondary) /* * Check if the CPU has been booted in Hypervisor mode.@@ -313,7 +314,7 @@ ENDPROC(init_secondary) * * Clobbers x0 - x5 */ -check_cpu_mode: +FUNC_LOCAL(check_cpu_mode) PRINT_ID("- Current EL ") mrs x5, CurrentEL print_reg x5@@ -329,7 +330,7 @@ check_cpu_mode: PRINT_ID("- Xen must be entered in NS EL2 mode -\r\n") PRINT_ID("- Please update the bootloader -\r\n") b fail -ENDPROC(check_cpu_mode) +END(check_cpu_mode) /* * Zero BSS@@ -339,7 +340,7 @@ ENDPROC(check_cpu_mode) * * Clobbers x0 - x3 */ -zero_bss: +FUNC_LOCAL(zero_bss) /* Zero BSS only when requested */ cbnz x26, skip_bss@@ -353,14 +354,14 @@ zero_bss: skip_bss: ret -ENDPROC(zero_bss) +END(zero_bss) /* * Initialize the processor for turning the MMU on. * * Clobbers x0 - x3 */ -cpu_init: +FUNC_LOCAL(cpu_init) PRINT_ID("- Initialize CPU -\r\n") /* Set up memory attribute type tables */@@ -399,7 +400,7 @@ cpu_init: */ msr spsel, #1 ret -ENDPROC(cpu_init) +END(cpu_init) /* * Setup the initial stack and jump to the C world@@ -411,7 +412,7 @@ ENDPROC(cpu_init) * * Clobbers x3 */ -launch: +FUNC_LOCAL(launch) ldr x3, =init_data add x3, x3, #INITINFO_stack /* Find the boot-time stack */ ldr x3, [x3]
xen/arch/arm/arm64/head.S launch: · line 428
Quoted 9 lines
xen/arch/arm/arm64/head.S +2
-2@@ -421,13 +422,13 @@ launch: /* Jump to C world */ br x2 -ENDPROC(launch) +END(launch) /* Fail-stop */ -fail: PRINT_ID("- Boot failed -\r\n") +FUNC_LOCAL(fail) PRINT_ID("- Boot failed -\r\n")
Maybe we should move PRINT_ID to a newline?
I am not sure FUNC_LOCAL supports having a command on the same line.
Quoted 92 lines
xen/arch/arm/arm64/head.S +11
-101: wfe b 1b -ENDPROC(fail) +END(fail) #ifdef CONFIG_EARLY_PRINTK /*@@ -438,14 +439,14 @@ ENDPROC(fail) * * Clobbers x0 - x1 */ -init_uart: +FUNC_LOCAL(init_uart) ldr x23, =CONFIG_EARLY_UART_BASE_ADDRESS #ifdef CONFIG_EARLY_UART_INIT early_uart_init x23, 0 #endif PRINT("- UART enabled -\r\n") ret -ENDPROC(init_uart) +END(init_uart) /* * Print early debug messages.@@ -454,7 +455,7 @@ ENDPROC(init_uart) * x23: Early UART base address * Clobbers x0-x1 */ -ENTRY(asm_puts) +FUNC(asm_puts) early_uart_ready x23, 1 ldrb w1, [x0], #1 /* Load next char */ cbz w1, 1f /* Exit on nul */@@ -462,7 +463,7 @@ ENTRY(asm_puts) b asm_puts 1: ret -ENDPROC(asm_puts) +END(asm_puts) /* * Print a 64-bit number in hex.@@ -471,7 +472,7 @@ ENDPROC(asm_puts) * x23: Early UART base address * Clobbers x0-x3 */ -ENTRY(asm_putn) +FUNC(asm_putn) adr_l x1, hex mov x3, #16 1:@@ -484,7 +485,7 @@ ENTRY(asm_putn) subs x3, x3, #1 b.ne 1b ret -ENDPROC(asm_putn) +END(asm_putn) RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef")@@ -493,16 +494,17 @@ RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef") /* This provides a C-API version of __lookup_processor_type * TODO: For now, the implementation return NULL every time */ -ENTRY(lookup_processor_type) +FUNC(lookup_processor_type) mov x0, #0 ret +END(lookup_processor_type) #ifdef CONFIG_ARM_EFI /* * Function to transition from EFI loader in C, to Xen entry point. * void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size); */ -ENTRY(efi_xen_start) +FUNC(efi_xen_start) /* * Preserve x0 (fdt pointer) across call to __flush_dcache_area, * restore for entry into Xen.@@ -554,7 +556,7 @@ ENTRY(efi_xen_start) mov x26, #1 /* x26 := skip_zero_bss */ b real_start_efi -ENDPROC(efi_xen_start) +END(efi_xen_start) #endif /* CONFIG_ARM_EFI */Signature · 1 line
2.40.1
Re: [PATCH v3 4/9] xen/arm64: head: Add missing code symbol annotations
Quoted 132 lines · Stefano Stabellini
Quoted 130 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/arch/arm/arm64/head.S | 50 ++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 24 deletions(-)xen/arch/arm/arm64/head.S +14
-13@@ -90,7 +90,7 @@ * 4K-aligned address. */ -GLOBAL(start) +FUNC(start) /* * DO NOT MODIFY. Image header expected by Linux boot-loaders. */@@ -102,6 +102,7 @@ efi_head: */ add x13, x18, #0x16 b real_start /* branch to kernel start */ +END(start) .quad 0 /* Image load offset from start of RAM */ .quad _end - start /* Effective size of kernel image, little-endian */ .quad __HEAD_FLAGS /* Informative flags, little-endian */@@ -223,7 +224,7 @@ section_table: .align 5 #endif /* CONFIG_ARM_EFI */ -real_start: +FUNC_LOCAL(real_start) /* BSS should be zeroed when booting without EFI */ mov x26, #0 /* x26 := skip_zero_bss */@@ -263,9 +264,9 @@ primary_switched: mov x1, x21 /* x1 := paddr(FDT) */ ldr x2, =start_xen b launch -ENDPROC(real_start) +END(real_start) -GLOBAL(init_secondary) +FUNC(init_secondary) msr DAIFSet, 0xf /* Disable all interrupts */ /* Find out where we are */@@ -304,7 +305,7 @@ secondary_switched: /* Jump to C world */ ldr x2, =start_secondary b launch -ENDPROC(init_secondary) +END(init_secondary) /* * Check if the CPU has been booted in Hypervisor mode.@@ -313,7 +314,7 @@ ENDPROC(init_secondary) * * Clobbers x0 - x5 */ -check_cpu_mode: +FUNC_LOCAL(check_cpu_mode) PRINT_ID("- Current EL ") mrs x5, CurrentEL print_reg x5@@ -329,7 +330,7 @@ check_cpu_mode: PRINT_ID("- Xen must be entered in NS EL2 mode -\r\n") PRINT_ID("- Please update the bootloader -\r\n") b fail -ENDPROC(check_cpu_mode) +END(check_cpu_mode) /* * Zero BSS@@ -339,7 +340,7 @@ ENDPROC(check_cpu_mode) * * Clobbers x0 - x3 */ -zero_bss: +FUNC_LOCAL(zero_bss) /* Zero BSS only when requested */ cbnz x26, skip_bss@@ -353,14 +354,14 @@ zero_bss: skip_bss: ret -ENDPROC(zero_bss) +END(zero_bss) /* * Initialize the processor for turning the MMU on. * * Clobbers x0 - x3 */ -cpu_init: +FUNC_LOCAL(cpu_init) PRINT_ID("- Initialize CPU -\r\n") /* Set up memory attribute type tables */@@ -399,7 +400,7 @@ cpu_init: */ msr spsel, #1 ret -ENDPROC(cpu_init) +END(cpu_init) /* * Setup the initial stack and jump to the C world@@ -411,7 +412,7 @@ ENDPROC(cpu_init) * * Clobbers x3 */ -launch: +FUNC_LOCAL(launch) ldr x3, =init_data add x3, x3, #INITINFO_stack /* Find the boot-time stack */ ldr x3, [x3]@@ -421,13 +422,13 @@ launch: /* Jump to C world */ br x2 -ENDPROC(launch) +END(launch)
Quoted 6 lines
xen/arch/arm/arm64/head.S launch: · line 428
Quoted 3 lines
xen/arch/arm/arm64/head.S +1
-1/* Fail-stop */ -fail: PRINT_ID("- Boot failed -\r\n") +FUNC_LOCAL(fail) PRINT_ID("- Boot failed -\r\n")Maybe we should move
PRINT_IDto a newline?
I am not sureFUNC_LOCALsupports having a command on the same line.
Thanks, yes I checked that it works but it feels a little fragile so in v4 I'll move the print to a new line (here and in mmu/head.S).
Thanks,
Edgar
Quoted 95 lines
Quoted 95 lines
xen/arch/arm/arm64/head.S +11
-111: wfe b 1b -ENDPROC(fail) +END(fail) #ifdef CONFIG_EARLY_PRINTK /*@@ -438,14 +439,14 @@ ENDPROC(fail) * * Clobbers x0 - x1 */ -init_uart: +FUNC_LOCAL(init_uart) ldr x23, =CONFIG_EARLY_UART_BASE_ADDRESS #ifdef CONFIG_EARLY_UART_INIT early_uart_init x23, 0 #endif PRINT("- UART enabled -\r\n") ret -ENDPROC(init_uart) +END(init_uart) /* * Print early debug messages.@@ -454,7 +455,7 @@ ENDPROC(init_uart) * x23: Early UART base address * Clobbers x0-x1 */ -ENTRY(asm_puts) +FUNC(asm_puts) early_uart_ready x23, 1 ldrb w1, [x0], #1 /* Load next char */ cbz w1, 1f /* Exit on nul */@@ -462,7 +463,7 @@ ENTRY(asm_puts) b asm_puts 1: ret -ENDPROC(asm_puts) +END(asm_puts) /* * Print a 64-bit number in hex.@@ -471,7 +472,7 @@ ENDPROC(asm_puts) * x23: Early UART base address * Clobbers x0-x3 */ -ENTRY(asm_putn) +FUNC(asm_putn) adr_l x1, hex mov x3, #16 1:@@ -484,7 +485,7 @@ ENTRY(asm_putn) subs x3, x3, #1 b.ne 1b ret -ENDPROC(asm_putn) +END(asm_putn) RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef")@@ -493,16 +494,17 @@ RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef") /* This provides a C-API version of __lookup_processor_type * TODO: For now, the implementation return NULL every time */ -ENTRY(lookup_processor_type) +FUNC(lookup_processor_type) mov x0, #0 ret +END(lookup_processor_type) #ifdef CONFIG_ARM_EFI /* * Function to transition from EFI loader in C, to Xen entry point. * void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size); */ -ENTRY(efi_xen_start) +FUNC(efi_xen_start) /* * Preserve x0 (fdt pointer) across call to __flush_dcache_area, * restore for entry into Xen.@@ -554,7 +556,7 @@ ENTRY(efi_xen_start) mov x26, #1 /* x26 := skip_zero_bss */ b real_start_efi -ENDPROC(efi_xen_start) +END(efi_xen_start) #endif /* CONFIG_ARM_EFI */ --2.40.1
PATCH v3 5/9 xen/arm64: debug: Add missing code symbol annotations
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols and add missing annotations.
--- xen/arch/arm/arm64/debug.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
xen/arch/arm/arm64/debug.S +4 -2
@@ -27,17 +27,19 @@ * Print a character on the UART - this function is called by C * x0: character to print */ -GLOBAL(early_putch) +FUNC(early_putch) ldr x15, =EARLY_UART_VIRTUAL_ADDRESS early_uart_ready x15, 1 early_uart_transmit x15, w0 ret +END(early_putch) /* Flush the UART - this function is called by C */ -GLOBAL(early_flush) +FUNC(early_flush) ldr x15, =EARLY_UART_VIRTUAL_ADDRESS /* x15 := VA UART base address */ early_uart_ready x15, 1 ret +END(early_flush) /* * Local variables:
Signature · 1 line
2.40.1
Re: [PATCH v3 5/9] xen/arm64: debug: Add missing code symbol annotations
Quoted 6 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>
Quoted 33 lines
--- xen/arch/arm/arm64/debug.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)xen/arch/arm/arm64/debug.S +4
-2@@ -27,17 +27,19 @@ * Print a character on the UART - this function is called by C * x0: character to print */ -GLOBAL(early_putch) +FUNC(early_putch) ldr x15, =EARLY_UART_VIRTUAL_ADDRESS early_uart_ready x15, 1 early_uart_transmit x15, w0 ret +END(early_putch) /* Flush the UART - this function is called by C */ -GLOBAL(early_flush) +FUNC(early_flush) ldr x15, =EARLY_UART_VIRTUAL_ADDRESS /* x15 := VA UART base address */ early_uart_ready x15, 1 ret +END(early_flush) /* * Local variables:Signature · 1 line
2.40.1
PATCH v3 6/9 xen/arm64: bpi: Add missing code symbol annotations
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols and add missing annotations.
--- xen/arch/arm/arm64/bpi.S | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
xen/arch/arm/arm64/bpi.S +12 -8
@@ -52,14 +52,15 @@ * micro-architectures in a system. */ .align 11 -ENTRY(__bp_harden_hyp_vecs_start) +FUNC(__bp_harden_hyp_vecs_start) .rept 4 vectors hyp_traps_vector .endr -ENTRY(__bp_harden_hyp_vecs_end) +GLOBAL(__bp_harden_hyp_vecs_end) +END(__bp_harden_hyp_vecs_start) .macro mitigate_spectre_bhb_loop count -ENTRY(__mitigate_spectre_bhb_loop_start_\count) +FUNC(__mitigate_spectre_bhb_loop_start_\count) stp x0, x1, [sp, #-16]! mov x0, \count .Lspectre_bhb_loop\@:
@@ -68,11 +69,12 @@ ENTRY(__mitigate_spectre_bhb_loop_start_\count) b.ne .Lspectre_bhb_loop\@ sb ldp x0, x1, [sp], #16 -ENTRY(__mitigate_spectre_bhb_loop_end_\count) +GLOBAL(__mitigate_spectre_bhb_loop_end_\count) +END(__mitigate_spectre_bhb_loop_start_\count) .endm .macro smccc_workaround num smcc_id -ENTRY(__smccc_workaround_smc_start_\num) +FUNC(__smccc_workaround_smc_start_\num) sub sp, sp, #(8 * 4) stp x0, x1, [sp, #(8 * 2)] stp x2, x3, [sp, #(8 * 0)]
@@ -81,13 +83,15 @@ ENTRY(__smccc_workaround_smc_start_\num) ldp x2, x3, [sp, #(8 * 0)] ldp x0, x1, [sp, #(8 * 2)] add sp, sp, #(8 * 4) -ENTRY(__smccc_workaround_smc_end_\num) +GLOBAL(__smccc_workaround_smc_end_\num) +END(__smccc_workaround_smc_start_\num) .endm -ENTRY(__mitigate_spectre_bhb_clear_insn_start) +FUNC(__mitigate_spectre_bhb_clear_insn_start) clearbhb isb -ENTRY(__mitigate_spectre_bhb_clear_insn_end) +GLOBAL(__mitigate_spectre_bhb_clear_insn_end) +END(__mitigate_spectre_bhb_clear_insn_start) mitigate_spectre_bhb_loop 8 mitigate_spectre_bhb_loop 24
Signature · 1 line
2.40.1
Re: [PATCH v3 6/9] xen/arm64: bpi: Add missing code symbol annotations
Quoted 16 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/arch/arm/arm64/bpi.S | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)xen/arch/arm/arm64/bpi.S +0
-0@@ -52,14 +52,15 @@ * micro-architectures in a system.
xen/arch/arm/arm64/bpi.S line 60
Quoted 10 lines
xen/arch/arm/arm64/bpi.S +3
-2*/ .align 11 -ENTRY(__bp_harden_hyp_vecs_start) +FUNC(__bp_harden_hyp_vecs_start) .rept 4 vectors hyp_traps_vector .endr -ENTRY(__bp_harden_hyp_vecs_end) +GLOBAL(__bp_harden_hyp_vecs_end) +END(__bp_harden_hyp_vecs_start)
Shouldn't GLOBAL be changed to FUNC as well?
xen/arch/arm/arm64/bpi.S ENTRY(__mitigate_spectre_bhb_loop_start_\count) · line 72
Quoted 12 lines
xen/arch/arm/arm64/bpi.S +2
-2.macro mitigate_spectre_bhb_loop count -ENTRY(__mitigate_spectre_bhb_loop_start_\count) +FUNC(__mitigate_spectre_bhb_loop_start_\count) stp x0, x1, [sp, #-16]! mov x0, \count .Lspectre_bhb_loop\@:@@ -68,11 +69,12 @@ ENTRY(__mitigate_spectre_bhb_loop_start_\count) b.ne .Lspectre_bhb_loop\@ sb ldp x0, x1, [sp], #16 -ENTRY(__mitigate_spectre_bhb_loop_end_\count) +GLOBAL(__mitigate_spectre_bhb_loop_end_\count)
Also here?
Quoted 10 lines
xen/arch/arm/arm64/bpi.S +2
-1+END(__mitigate_spectre_bhb_loop_start_\count) .endm .macro smccc_workaround num smcc_id -ENTRY(__smccc_workaround_smc_start_\num) +FUNC(__smccc_workaround_smc_start_\num) sub sp, sp, #(8 * 4) stp x0, x1, [sp, #(8 * 2)] stp x2, x3, [sp, #(8 * 0)]
xen/arch/arm/arm64/bpi.S ENTRY(__smccc_workaround_smc_start_\num) · line 86
Quoted 5 lines
xen/arch/arm/arm64/bpi.S +1
-1@@ -81,13 +83,15 @@ ENTRY(__smccc_workaround_smc_start_\num) ldp x2, x3, [sp, #(8 * 0)] ldp x0, x1, [sp, #(8 * 2)] add sp, sp, #(8 * 4) -ENTRY(__smccc_workaround_smc_end_\num) +GLOBAL(__smccc_workaround_smc_end_\num)
And here?
xen/arch/arm/arm64/bpi.S ENTRY(__smccc_workaround_smc_start_\num) · line 93
Quoted 9 lines
xen/arch/arm/arm64/bpi.S +3
-2+END(__smccc_workaround_smc_start_\num) .endm -ENTRY(__mitigate_spectre_bhb_clear_insn_start) +FUNC(__mitigate_spectre_bhb_clear_insn_start) clearbhb isb -ENTRY(__mitigate_spectre_bhb_clear_insn_end) +GLOBAL(__mitigate_spectre_bhb_clear_insn_end)
and here?
Quoted 7 lines
xen/arch/arm/arm64/bpi.S +1
-0+END(__mitigate_spectre_bhb_clear_insn_start) mitigate_spectre_bhb_loop 8 mitigate_spectre_bhb_loop 24Signature · 1 line
2.40.1
Re: [PATCH v3 6/9] xen/arm64: bpi: Add missing code symbol annotations
Quoted 22 lines · Stefano Stabellini
Quoted 20 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/arch/arm/arm64/bpi.S | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)xen/arch/arm/arm64/bpi.S +1
-1@@ -52,14 +52,15 @@ * micro-architectures in a system. */ .align 11 -ENTRY(__bp_harden_hyp_vecs_start) +FUNC(__bp_harden_hyp_vecs_start)
Quoted 9 lines
xen/arch/arm/arm64/bpi.S line 60
Quoted 6 lines
xen/arch/arm/arm64/bpi.S +2
-1.rept 4 vectors hyp_traps_vector .endr -ENTRY(__bp_harden_hyp_vecs_end) +GLOBAL(__bp_harden_hyp_vecs_end) +END(__bp_harden_hyp_vecs_start)Shouldn't GLOBAL be changed to FUNC as well?
I was a bit unsure but went for GLOBAL since the _end labels point to addresses after and outside of the code sequence.
But I don't have a strong opinion and am happy to change them to FUNC if you feel that's better.
Cheers,
Edgar
Quoted 56 lines
xen/arch/arm/arm64/bpi.S ENTRY(__mitigate_spectre_bhb_loop_start_\count) · line 72
Quoted 13 lines
xen/arch/arm/arm64/bpi.S +2
-2.macro mitigate_spectre_bhb_loop count -ENTRY(__mitigate_spectre_bhb_loop_start_\count) +FUNC(__mitigate_spectre_bhb_loop_start_\count) stp x0, x1, [sp, #-16]! mov x0, \count .Lspectre_bhb_loop\@:@@ -68,11 +69,12 @@ ENTRY(__mitigate_spectre_bhb_loop_start_\count) b.ne .Lspectre_bhb_loop\@ sb ldp x0, x1, [sp], #16 -ENTRY(__mitigate_spectre_bhb_loop_end_\count) +GLOBAL(__mitigate_spectre_bhb_loop_end_\count)Also here?
Quoted 10 lines
xen/arch/arm/arm64/bpi.S +2
-1+END(__mitigate_spectre_bhb_loop_start_\count) .endm .macro smccc_workaround num smcc_id -ENTRY(__smccc_workaround_smc_start_\num) +FUNC(__smccc_workaround_smc_start_\num) sub sp, sp, #(8 * 4) stp x0, x1, [sp, #(8 * 2)] stp x2, x3, [sp, #(8 * 0)]xen/arch/arm/arm64/bpi.S ENTRY(__smccc_workaround_smc_start_\num) · line 86
Quoted 5 lines
xen/arch/arm/arm64/bpi.S +1
-1@@ -81,13 +83,15 @@ ENTRY(__smccc_workaround_smc_start_\num) ldp x2, x3, [sp, #(8 * 0)] ldp x0, x1, [sp, #(8 * 2)] add sp, sp, #(8 * 4) -ENTRY(__smccc_workaround_smc_end_\num) +GLOBAL(__smccc_workaround_smc_end_\num)And here?
xen/arch/arm/arm64/bpi.S ENTRY(__smccc_workaround_smc_start_\num) · line 93
Quoted 9 lines
xen/arch/arm/arm64/bpi.S +3
-2+END(__smccc_workaround_smc_start_\num) .endm -ENTRY(__mitigate_spectre_bhb_clear_insn_start) +FUNC(__mitigate_spectre_bhb_clear_insn_start) clearbhb isb -ENTRY(__mitigate_spectre_bhb_clear_insn_end) +GLOBAL(__mitigate_spectre_bhb_clear_insn_end)and here?
Quoted 7 lines
xen/arch/arm/arm64/bpi.S +1
-1+END(__mitigate_spectre_bhb_clear_insn_start) mitigate_spectre_bhb_loop 8 mitigate_spectre_bhb_loop 24 --2.40.1
Re: [PATCH v3 6/9] xen/arm64: bpi: Add missing code symbol annotations
Hi,
Quoted 34 lines · Edgar E. Iglesias
Quoted 22 lines · Stefano Stabellini
Quoted 20 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/arch/arm/arm64/bpi.S | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)xen/arch/arm/arm64/bpi.S +1
-1@@ -52,14 +52,15 @@ * micro-architectures in a system. */ .align 11 -ENTRY(__bp_harden_hyp_vecs_start) +FUNC(__bp_harden_hyp_vecs_start)Quoted 9 lines
xen/arch/arm/arm64/bpi.S line 60
Quoted 6 lines
xen/arch/arm/arm64/bpi.S +2
-1.rept 4 vectors hyp_traps_vector .endr -ENTRY(__bp_harden_hyp_vecs_end) +GLOBAL(__bp_harden_hyp_vecs_end) +END(__bp_harden_hyp_vecs_start)Shouldn't GLOBAL be changed to FUNC as well?
Quoted 4 lines
I was a bit unsure but went for GLOBAL since the
_endlabels point to addresses after and outside of the code sequence.
But I don't have a strong opinion and am happy to change them to FUNC if you feel that's better.
I don't think it should be FUNC as this is not meant to be called directly. I am also under the impression, we were planning to get rid of GLOBAL() as well.
Furthermore, __bp_harden_hyp_vec_start is not a function per say. It is a pointer to the vector table.
From the brief look, the same remarks would apply to the rest of bpi.S. So I think we want to switch all the ENTRY() to LABEL().
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH v3 6/9] xen/arm64: bpi: Add missing code symbol annotations
Quoted 47 lines · Julien Grall
Hi,
Quoted 34 lines · Edgar E. Iglesias
Quoted 22 lines · Stefano Stabellini
Quoted 20 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/arch/arm/arm64/bpi.S | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)xen/arch/arm/arm64/bpi.S +1
-1@@ -52,14 +52,15 @@ * micro-architectures in a system. */ .align 11 -ENTRY(__bp_harden_hyp_vecs_start) +FUNC(__bp_harden_hyp_vecs_start)Quoted 9 lines
xen/arch/arm/arm64/bpi.S line 60
Quoted 6 lines
xen/arch/arm/arm64/bpi.S +2
-1.rept 4 vectors hyp_traps_vector .endr -ENTRY(__bp_harden_hyp_vecs_end) +GLOBAL(__bp_harden_hyp_vecs_end) +END(__bp_harden_hyp_vecs_start)Shouldn't GLOBAL be changed to FUNC as well?
Quoted 4 lines
I was a bit unsure but went for GLOBAL since the
_endlabels point to addresses after and outside of the code sequence.
But I don't have a strong opinion and am happy to change them to FUNC if you feel that's better.I don't think it should be FUNC as this is not meant to be called directly. I am also under the impression, we were planning to get rid of
GLOBAL()as well.
Quoted 5 lines
Furthermore,
__bp_harden_hyp_vec_startis not a function per say. It is a pointer to the vector table.From the brief look, the same remarks would apply to the rest of
bpi.S.
So I think we want to switch all theENTRY()toLABEL().
Hi Julien,
The reason I choose FUNC for the start of the symbol is because these symbols contain
executable code (not only a table of pointers to code somewhere else) and the ELF spec
says that STT_FUNC means the symbol contains functions or other executable code (not only callable functions IIUC):
"STT_FUNC The symbol is associated with a function or other executable code."
https://refspecs.linuxbase.org/elf/elf.pdf
(Symbol Table 1-20).
I think using LABEL instead of GLOBAL for the _end labels of these code sequences makes sense.
I'm happy to change the _start labels to LABEL too if you guys feel that's better.
Cheers,
Edgar
Re: [PATCH v3 6/9] xen/arm64: bpi: Add missing code symbol annotations
Quoted 2 lines · Edgar E. Iglesias
On Tue, May 7, 2024 at 11:57 AM Julien Grall <[email protected]> wrote:
Hi Julien,
Hi Edgar,
Quoted 11 lines
The reason I choose FUNC for the start of the symbol is because these symbols contain
executable code (not only a table of pointers to code somewhere else) and the ELF spec
says thatSTT_FUNCmeans the symbol contains functions or other executable code (not only callable functions IIUC):"
STT_FUNCThe symbol is associated with a function or other executable code."
https://refspecs.linuxbase.org/elf/elf.pdf
(Symbol Table 1-20).
Thanks for the pointer. I originally did intend to suggest the change, but then I saw the use of LABEL in x86 (such as svm_stgi_label). There are a few others example with LABEL_LOCAL.
AFAICT, this is also executable code which the only difference that it is not meant to be called by someone else. Furthermore, LABEL is using DO_CODE_ALIGN(...) for the alignment which imply that it is intended to be used by executable code. So I thought the only difference was whether the label was intended to be used as a function.
Quoted 5 lines
I think using LABEL instead of GLOBAL for the
_endlabels of these code sequences makes sense.
I'm happy to change the_startlabels to LABEL too if you guys feel that's better.
I have to admit I am little confused with the difference between LABEL vs FUNC. I think I will need some guidance from Jan (he introduced linkage.h).
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH v3 6/9] xen/arm64: bpi: Add missing code symbol annotations
Quoted 25 lines · Julien Grall
Quoted 2 lines · Edgar E. Iglesias
On Tue, May 7, 2024 at 11:57 AM Julien Grall <[email protected]> wrote:
Hi Julien,Hi Edgar,
Quoted 11 lines
The reason I choose FUNC for the start of the symbol is because these symbols contain
executable code (not only a table of pointers to code somewhere else) and the ELF spec
says thatSTT_FUNCmeans the symbol contains functions or other executable code (not only callable functions IIUC):"
STT_FUNCThe symbol is associated with a function or other executable code."
https://refspecs.linuxbase.org/elf/elf.pdf
(Symbol Table 1-20).Thanks for the pointer. I originally did intend to suggest the change, but then I saw the use of LABEL in x86 (such as
svm_stgi_label). There are a few others example withLABEL_LOCAL.
Quoted 6 lines
AFAICT, this is also executable code which the only difference that it is not meant to be called by someone else. Furthermore, LABEL is using
DO_CODE_ALIGN(...)for the alignment which imply that it is intended to be used by executable code. So I thought the only difference was whether the label was intended to be used as a function.
Thanks Julien, yes, good points.
Quoted 10 lines
Quoted 5 lines
I think using LABEL instead of GLOBAL for the
_endlabels of these code sequences makes sense.
I'm happy to change the_startlabels to LABEL too if you guys feel that's better.I have to admit I am little confused with the difference between LABEL vs FUNC. I think I will need some guidance from Jan (he introduced
linkage.h).
Jan, do you have any guidance on this specific case using FUNC , LABEL (or something else)?
Cheers,
Edgar
Re: [PATCH v3 6/9] xen/arm64: bpi: Add missing code symbol annotations
In reply to Julien GrallQuoted 24 lines · Julien Grall
Quoted 2 lines · Edgar E. Iglesias
On Tue, May 7, 2024 at 11:57 AM Julien Grall <[email protected]> wrote:
Hi Julien,Hi Edgar,
Quoted 11 lines
The reason I choose FUNC for the start of the symbol is because these symbols contain
executable code (not only a table of pointers to code somewhere else) and the ELF spec
says thatSTT_FUNCmeans the symbol contains functions or other executable code (not only callable functions IIUC):"
STT_FUNCThe symbol is associated with a function or other executable code."
https://refspecs.linuxbase.org/elf/elf.pdf
(Symbol Table 1-20).Thanks for the pointer. I originally did intend to suggest the change, but then I saw the use of LABEL in x86 (such as
svm_stgi_label). There are a few others example withLABEL_LOCAL.
Quoted 5 lines
AFAICT, this is also executable code which the only difference that it is not meant to be called by someone else. Furthermore, LABEL is using
DO_CODE_ALIGN(...)for the alignment which imply that it is intended to be used by executable code. So I thought the only difference was whether the label was intended to be used as a function.
No. See below.
Quoted 8 lines
Quoted 4 lines
I think using LABEL instead of GLOBAL for the
_endlabels of these code sequences makes sense.
I'm happy to change the_startlabels to LABEL too if you guys feel that's better.I have to admit I am little confused with the difference between LABEL vs FUNC. I think I will need some guidance from Jan (he introduced
linkage.h).
For annotations the question is what is a "unit" of code. That wants to be enclosed in FUNC() / END(). Any "inner" entry points or markers would use LABEL(). On x86 I think it's mainly markers (i.e. addresses pointing into code which we need e.g. for comparison operations on what Arm would call PC) where we use LABEL().
Jan
PATCH v3 7/9 xen/arm64: mmu/head: Add missing code symbol annotations
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols and add missing annotations.
--- xen/arch/arm/arm64/mmu/head.S | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
xen/arch/arm/arm64/mmu/head.S +14 -14
@@ -138,7 +138,7 @@ * * Clobbers x0 - x4 */ -create_page_tables: +FUNC_LOCAL(create_page_tables) /* Prepare the page-tables for mapping Xen */ ldr x0, =XEN_VIRT_START create_table_entry boot_pgtable, boot_first, x0, 0, x1, x2, x3
@@ -260,7 +260,7 @@ virtphys_clash: /* Identity map clashes with boot_third, which we cannot handle yet */ PRINT("- Unable to build boot page tables - virt and phys addresses clash. -\r\n") b fail -ENDPROC(create_page_tables) +END(create_page_tables) /* * Turn on the Data Cache and the MMU. The function will return on the 1:1
@@ -273,7 +273,7 @@ ENDPROC(create_page_tables) * * Clobbers x0 - x5 */ -enable_mmu: +FUNC_LOCAL(enable_mmu) mov x4, x0 mov x5, x1 PRINT_ID("- Turning on paging -\r\n")
@@ -304,7 +304,7 @@ enable_mmu: PRINT_ID("- Paging turned on -\r\n") ret -ENDPROC(enable_mmu) +END(enable_mmu) /* * Enable mm (turn on the data cache and the MMU) for secondary CPUs.
@@ -316,7 +316,7 @@ ENDPROC(enable_mmu) * * Clobbers x0 - x6 */ -ENTRY(enable_secondary_cpu_mm) +FUNC(enable_secondary_cpu_mm) mov x6, lr load_paddr x0, init_ttbr
@@ -328,7 +328,7 @@ ENTRY(enable_secondary_cpu_mm) /* Return to the virtual address requested by the caller. */ ret -ENDPROC(enable_secondary_cpu_mm) +END(enable_secondary_cpu_mm) /* * Enable mm (turn on the data cache and the MMU) for the boot CPU.
@@ -340,7 +340,7 @@ ENDPROC(enable_secondary_cpu_mm) * * Clobbers x0 - x6 */ -ENTRY(enable_boot_cpu_mm) +FUNC(enable_boot_cpu_mm) mov x6, lr bl create_page_tables
@@ -365,7 +365,7 @@ ENTRY(enable_boot_cpu_mm) * by the caller. */ b remove_identity_mapping -ENDPROC(enable_boot_cpu_mm) +END(enable_boot_cpu_mm) /* * Remove the 1:1 map from the page-tables. It is not easy to keep track
@@ -377,7 +377,7 @@ ENDPROC(enable_boot_cpu_mm) * * Clobbers x0 - x1 */ -remove_identity_mapping: +FUNC_LOCAL(remove_identity_mapping) /* * Find the zeroeth slot used. Remove the entry from zeroeth * table if the slot is not XEN_ZEROETH_SLOT.
@@ -419,20 +419,20 @@ identity_mapping_removed: flush_xen_tlb_local ret -ENDPROC(remove_identity_mapping) +END(remove_identity_mapping) /* Fail-stop */ -fail: PRINT("- Boot failed -\r\n") +FUNC_LOCAL(fail) PRINT("- Boot failed -\r\n") 1: wfe b 1b -ENDPROC(fail) +END(fail) /* * Switch TTBR * * x0 ttbr */ -ENTRY(switch_ttbr_id) +FUNC(switch_ttbr_id) /* 1) Ensure any previous read/write have completed */ dsb ish isb
@@ -464,7 +464,7 @@ ENTRY(switch_ttbr_id) isb ret -ENDPROC(switch_ttbr_id) +END(switch_ttbr_id) /* * Local variables:
Signature · 1 line
2.40.1
Re: [PATCH v3 7/9] xen/arm64: mmu/head: Add missing code symbol annotations
Quoted 96 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols and add missing annotations.Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/arch/arm/arm64/mmu/head.S | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)xen/arch/arm/arm64/mmu/head.S +9
-9@@ -138,7 +138,7 @@ * * Clobbers x0 - x4 */ -create_page_tables: +FUNC_LOCAL(create_page_tables) /* Prepare the page-tables for mapping Xen */ ldr x0, =XEN_VIRT_START create_table_entry boot_pgtable, boot_first, x0, 0, x1, x2, x3@@ -260,7 +260,7 @@ virtphys_clash: /* Identity map clashes with boot_third, which we cannot handle yet */ PRINT("- Unable to build boot page tables - virt and phys addresses clash. -\r\n") b fail -ENDPROC(create_page_tables) +END(create_page_tables) /* * Turn on the Data Cache and the MMU. The function will return on the 1:1@@ -273,7 +273,7 @@ ENDPROC(create_page_tables) * * Clobbers x0 - x5 */ -enable_mmu: +FUNC_LOCAL(enable_mmu) mov x4, x0 mov x5, x1 PRINT_ID("- Turning on paging -\r\n")@@ -304,7 +304,7 @@ enable_mmu: PRINT_ID("- Paging turned on -\r\n") ret -ENDPROC(enable_mmu) +END(enable_mmu) /* * Enable mm (turn on the data cache and the MMU) for secondary CPUs.@@ -316,7 +316,7 @@ ENDPROC(enable_mmu) * * Clobbers x0 - x6 */ -ENTRY(enable_secondary_cpu_mm) +FUNC(enable_secondary_cpu_mm) mov x6, lr load_paddr x0, init_ttbr@@ -328,7 +328,7 @@ ENTRY(enable_secondary_cpu_mm) /* Return to the virtual address requested by the caller. */ ret -ENDPROC(enable_secondary_cpu_mm) +END(enable_secondary_cpu_mm) /* * Enable mm (turn on the data cache and the MMU) for the boot CPU.@@ -340,7 +340,7 @@ ENDPROC(enable_secondary_cpu_mm) * * Clobbers x0 - x6 */ -ENTRY(enable_boot_cpu_mm) +FUNC(enable_boot_cpu_mm) mov x6, lr bl create_page_tables@@ -365,7 +365,7 @@ ENTRY(enable_boot_cpu_mm) * by the caller. */ b remove_identity_mapping -ENDPROC(enable_boot_cpu_mm) +END(enable_boot_cpu_mm) /* * Remove the 1:1 map from the page-tables. It is not easy to keep track@@ -377,7 +377,7 @@ ENDPROC(enable_boot_cpu_mm) * * Clobbers x0 - x1 */ -remove_identity_mapping: +FUNC_LOCAL(remove_identity_mapping) /* * Find the zeroeth slot used. Remove the entry from zeroeth * table if the slot is not XEN_ZEROETH_SLOT.
xen/arch/arm/arm64/mmu/head.S identity_mapping_removed: · line 425
Quoted 9 lines
xen/arch/arm/arm64/mmu/head.S +2
-2@@ -419,20 +419,20 @@ identity_mapping_removed: flush_xen_tlb_local ret -ENDPROC(remove_identity_mapping) +END(remove_identity_mapping) /* Fail-stop */ -fail: PRINT("- Boot failed -\r\n") +FUNC_LOCAL(fail) PRINT("- Boot failed -\r\n")
move PRINT to newline
Quoted 27 lines
xen/arch/arm/arm64/mmu/head.S +3
-31: wfe b 1b -ENDPROC(fail) +END(fail) /* * Switch TTBR * * x0 ttbr */ -ENTRY(switch_ttbr_id) +FUNC(switch_ttbr_id) /* 1) Ensure any previous read/write have completed */ dsb ish isb@@ -464,7 +464,7 @@ ENTRY(switch_ttbr_id) isb ret -ENDPROC(switch_ttbr_id) +END(switch_ttbr_id) /* * Local variables:Signature · 1 line
2.40.1
PATCH v3 8/9 xen/arm64: cache: Use the generic xen/linkage.h macros
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols.
--- xen/arch/arm/arm64/cache.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/arm/arm64/cache.S +2 -2
@@ -40,7 +40,7 @@ * - kaddr - kernel address * - size - size in question */ -ENTRY(__flush_dcache_area) +FUNC(__flush_dcache_area) dcache_line_size x2, x3 add x1, x0, x1 sub x3, x2, #1
@@ -51,4 +51,4 @@ ENTRY(__flush_dcache_area) b.lo 1b dsb sy ret -ENDPROC(__flush_dcache_area) +END(__flush_dcache_area)
Signature · 1 line
2.40.1
Re: [PATCH v3 8/9] xen/arm64: cache: Use the generic xen/linkage.h macros
Quoted 5 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols.Signed-off-by Edgar E. Iglesias <[email protected]>
Quoted 26 lines
--- xen/arch/arm/arm64/cache.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)xen/arch/arm/arm64/cache.S +2
-2@@ -40,7 +40,7 @@ * - kaddr - kernel address * - size - size in question */ -ENTRY(__flush_dcache_area) +FUNC(__flush_dcache_area) dcache_line_size x2, x3 add x1, x0, x1 sub x3, x2, #1@@ -51,4 +51,4 @@ ENTRY(__flush_dcache_area) b.lo 1b dsb sy ret -ENDPROC(__flush_dcache_area) +END(__flush_dcache_area)Signature · 1 line
2.40.1
PATCH v3 9/9 xen/arm64: lib: Use the generic xen/linkage.h macros
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Use the generic xen/linkage.h macros to annotate code symbols.
--- xen/arch/arm/arm64/lib/memchr.S | 4 ++-- xen/arch/arm/arm64/lib/memcmp.S | 4 ++-- xen/arch/arm/arm64/lib/memcpy.S | 4 ++-- xen/arch/arm/arm64/lib/memmove.S | 4 ++-- xen/arch/arm/arm64/lib/memset.S | 4 ++-- xen/arch/arm/arm64/lib/strchr.S | 4 ++-- xen/arch/arm/arm64/lib/strcmp.S | 4 ++-- xen/arch/arm/arm64/lib/strlen.S | 4 ++-- xen/arch/arm/arm64/lib/strncmp.S | 4 ++-- xen/arch/arm/arm64/lib/strnlen.S | 4 ++-- xen/arch/arm/arm64/lib/strrchr.S | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-)
xen/arch/arm/arm64/lib/memchr.S +2 -2
@@ -29,7 +29,7 @@ * Returns: * x0 - address of first occurrence of 'c' or 0 */ -ENTRY(memchr) +FUNC(memchr) and w1, w1, #0xff 1: subs x2, x2, #1 b.mi 2f
@@ -40,4 +40,4 @@ ENTRY(memchr) ret 2: mov x0, #0 ret -ENDPROC(memchr) +END(memchr)
xen/arch/arm/arm64/lib/memcmp.S +2 -2
@@ -57,7 +57,7 @@ pos .req x11 limit_wd .req x12 mask .req x13 -ENTRY(memcmp) +FUNC(memcmp) cbz limit, .Lret0 eor tmp1, src1, src2 tst tmp1, #7
@@ -254,4 +254,4 @@ CPU_LE( rev data2, data2 ) .Lret0: mov result, #0 ret -ENDPROC(memcmp) +END(memcmp)
xen/arch/arm/arm64/lib/memcpy.S +2 -2
@@ -55,7 +55,7 @@ C_h .req x12 D_l .req x13 D_h .req x14 -ENTRY(memcpy) +FUNC(memcpy) mov dst, dstin cmp count, #16 /*When memory length is less than 16, the accessed are not aligned.*/
@@ -197,4 +197,4 @@ ENTRY(memcpy) tst count, #0x3f b.ne .Ltail63 ret -ENDPROC(memcpy) +END(memcpy)
xen/arch/arm/arm64/lib/memmove.S +2 -2
@@ -56,7 +56,7 @@ C_h .req x12 D_l .req x13 D_h .req x14 -ENTRY(memmove) +FUNC(memmove) cmp dstin, src b.lo memcpy add tmp1, src, count
@@ -193,4 +193,4 @@ ENTRY(memmove) tst count, #0x3f b.ne .Ltail63 ret -ENDPROC(memmove) +END(memmove)
xen/arch/arm/arm64/lib/memset.S +2 -2
@@ -53,7 +53,7 @@ dst .req x8 tmp3w .req w9 tmp3 .req x9 -ENTRY(memset) +FUNC(memset) mov dst, dstin /* Preserve return value. */ and A_lw, val, #255 orr A_lw, A_lw, A_lw, lsl #8
@@ -212,4 +212,4 @@ ENTRY(memset) ands count, count, zva_bits_x b.ne .Ltail_maybe_long ret -ENDPROC(memset) +END(memset)
xen/arch/arm/arm64/lib/strchr.S +2 -2
@@ -27,7 +27,7 @@ * Returns: * x0 - address of first occurrence of 'c' or 0 */ -ENTRY(strchr) +FUNC(strchr) and w1, w1, #0xff 1: ldrb w2, [x0], #1 cmp w2, w1
@@ -37,4 +37,4 @@ ENTRY(strchr) cmp w2, w1 csel x0, x0, xzr, eq ret -ENDPROC(strchr) +END(strchr)
xen/arch/arm/arm64/lib/strcmp.S +2 -2
@@ -59,7 +59,7 @@ tmp3 .req x9 zeroones .req x10 pos .req x11 -ENTRY(strcmp) +FUNC(strcmp) eor tmp1, src1, src2 mov zeroones, #REP8_01 tst tmp1, #7
@@ -230,4 +230,4 @@ CPU_BE( orr syndrome, diff, has_nul ) lsr data1, data1, #56 sub result, data1, data2, lsr #56 ret -ENDPROC(strcmp) +END(strcmp)
xen/arch/arm/arm64/lib/strlen.S +2 -2
@@ -56,7 +56,7 @@ pos .req x12 #define REP8_7f 0x7f7f7f7f7f7f7f7f #define REP8_80 0x8080808080808080 -ENTRY(strlen) +FUNC(strlen) mov zeroones, #REP8_01 bic src, srcin, #15 ands tmp1, srcin, #15
@@ -123,4 +123,4 @@ CPU_LE( lsr tmp2, tmp2, tmp1 ) /* Shift (tmp1 & 63). */ csinv data1, data1, xzr, le csel data2, data2, data2a, le b .Lrealigned -ENDPROC(strlen) +END(strlen)
xen/arch/arm/arm64/lib/strncmp.S +2 -2
@@ -64,7 +64,7 @@ limit_wd .req x13 mask .req x14 endloop .req x15 -ENTRY(strncmp) +FUNC(strncmp) cbz limit, .Lret0 eor tmp1, src1, src2 mov zeroones, #REP8_01
@@ -307,4 +307,4 @@ CPU_BE( orr syndrome, diff, has_nul ) .Lret0: mov result, #0 ret -ENDPROC(strncmp) +END(strncmp)
xen/arch/arm/arm64/lib/strnlen.S +2 -2
@@ -59,7 +59,7 @@ limit_wd .req x14 #define REP8_7f 0x7f7f7f7f7f7f7f7f #define REP8_80 0x8080808080808080 -ENTRY(strnlen) +FUNC(strnlen) cbz limit, .Lhit_limit mov zeroones, #REP8_01 bic src, srcin, #15
@@ -168,4 +168,4 @@ CPU_LE( lsr tmp2, tmp2, tmp4 ) /* Shift (tmp1 & 63). */ .Lhit_limit: mov len, limit ret -ENDPROC(strnlen) +END(strnlen)
xen/arch/arm/arm64/lib/strrchr.S +2 -2
@@ -26,7 +26,7 @@ * Returns: * x0 - address of last occurrence of 'c' or 0 */ -ENTRY(strrchr) +FUNC(strrchr) mov x3, #0 and w1, w1, #0xff 1: ldrb w2, [x0], #1
@@ -37,4 +37,4 @@ ENTRY(strrchr) b 1b 2: mov x0, x3 ret -ENDPROC(strrchr) +END(strrchr)
Signature · 1 line
2.40.1
Re: [PATCH v3 9/9] xen/arm64: lib: Use the generic xen/linkage.h macros
Quoted 5 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Use the generic
xen/linkage.hmacros to annotate code symbols.Signed-off-by Edgar E. Iglesias <[email protected]>
Quoted 226 lines
--- xen/arch/arm/arm64/lib/memchr.S | 4 ++-- xen/arch/arm/arm64/lib/memcmp.S | 4 ++-- xen/arch/arm/arm64/lib/memcpy.S | 4 ++-- xen/arch/arm/arm64/lib/memmove.S | 4 ++-- xen/arch/arm/arm64/lib/memset.S | 4 ++-- xen/arch/arm/arm64/lib/strchr.S | 4 ++-- xen/arch/arm/arm64/lib/strcmp.S | 4 ++-- xen/arch/arm/arm64/lib/strlen.S | 4 ++-- xen/arch/arm/arm64/lib/strncmp.S | 4 ++-- xen/arch/arm/arm64/lib/strnlen.S | 4 ++-- xen/arch/arm/arm64/lib/strrchr.S | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-)xen/arch/arm/arm64/lib/memchr.S +2
-2@@ -29,7 +29,7 @@ * Returns: * x0 - address of first occurrence of 'c' or 0 */ -ENTRY(memchr) +FUNC(memchr) and w1, w1, #0xff 1: subs x2, x2, #1 b.mi 2f@@ -40,4 +40,4 @@ ENTRY(memchr) ret 2: mov x0, #0 ret -ENDPROC(memchr) +END(memchr)xen/arch/arm/arm64/lib/memcmp.S +2
-2@@ -57,7 +57,7 @@ pos .req x11 limit_wd .req x12 mask .req x13 -ENTRY(memcmp) +FUNC(memcmp) cbz limit, .Lret0 eor tmp1, src1, src2 tst tmp1, #7@@ -254,4 +254,4 @@ CPU_LE( rev data2, data2 ) .Lret0: mov result, #0 ret -ENDPROC(memcmp) +END(memcmp)xen/arch/arm/arm64/lib/memcpy.S +2
-2@@ -55,7 +55,7 @@ C_h .req x12 D_l .req x13 D_h .req x14 -ENTRY(memcpy) +FUNC(memcpy) mov dst, dstin cmp count, #16 /*When memory length is less than 16, the accessed are not aligned.*/@@ -197,4 +197,4 @@ ENTRY(memcpy) tst count, #0x3f b.ne .Ltail63 ret -ENDPROC(memcpy) +END(memcpy)xen/arch/arm/arm64/lib/memmove.S +2
-2@@ -56,7 +56,7 @@ C_h .req x12 D_l .req x13 D_h .req x14 -ENTRY(memmove) +FUNC(memmove) cmp dstin, src b.lo memcpy add tmp1, src, count@@ -193,4 +193,4 @@ ENTRY(memmove) tst count, #0x3f b.ne .Ltail63 ret -ENDPROC(memmove) +END(memmove)xen/arch/arm/arm64/lib/memset.S +2
-2@@ -53,7 +53,7 @@ dst .req x8 tmp3w .req w9 tmp3 .req x9 -ENTRY(memset) +FUNC(memset) mov dst, dstin /* Preserve return value. */ and A_lw, val, #255 orr A_lw, A_lw, A_lw, lsl #8@@ -212,4 +212,4 @@ ENTRY(memset) ands count, count, zva_bits_x b.ne .Ltail_maybe_long ret -ENDPROC(memset) +END(memset)xen/arch/arm/arm64/lib/strchr.S +2
-2@@ -27,7 +27,7 @@ * Returns: * x0 - address of first occurrence of 'c' or 0 */ -ENTRY(strchr) +FUNC(strchr) and w1, w1, #0xff 1: ldrb w2, [x0], #1 cmp w2, w1@@ -37,4 +37,4 @@ ENTRY(strchr) cmp w2, w1 csel x0, x0, xzr, eq ret -ENDPROC(strchr) +END(strchr)xen/arch/arm/arm64/lib/strcmp.S +2
-2@@ -59,7 +59,7 @@ tmp3 .req x9 zeroones .req x10 pos .req x11 -ENTRY(strcmp) +FUNC(strcmp) eor tmp1, src1, src2 mov zeroones, #REP8_01 tst tmp1, #7@@ -230,4 +230,4 @@ CPU_BE( orr syndrome, diff, has_nul ) lsr data1, data1, #56 sub result, data1, data2, lsr #56 ret -ENDPROC(strcmp) +END(strcmp)xen/arch/arm/arm64/lib/strlen.S +2
-2@@ -56,7 +56,7 @@ pos .req x12 #define REP8_7f 0x7f7f7f7f7f7f7f7f #define REP8_80 0x8080808080808080 -ENTRY(strlen) +FUNC(strlen) mov zeroones, #REP8_01 bic src, srcin, #15 ands tmp1, srcin, #15@@ -123,4 +123,4 @@ CPU_LE( lsr tmp2, tmp2, tmp1 ) /* Shift (tmp1 & 63). */ csinv data1, data1, xzr, le csel data2, data2, data2a, le b .Lrealigned -ENDPROC(strlen) +END(strlen)xen/arch/arm/arm64/lib/strncmp.S +2
-2@@ -64,7 +64,7 @@ limit_wd .req x13 mask .req x14 endloop .req x15 -ENTRY(strncmp) +FUNC(strncmp) cbz limit, .Lret0 eor tmp1, src1, src2 mov zeroones, #REP8_01@@ -307,4 +307,4 @@ CPU_BE( orr syndrome, diff, has_nul ) .Lret0: mov result, #0 ret -ENDPROC(strncmp) +END(strncmp)xen/arch/arm/arm64/lib/strnlen.S +2
-2@@ -59,7 +59,7 @@ limit_wd .req x14 #define REP8_7f 0x7f7f7f7f7f7f7f7f #define REP8_80 0x8080808080808080 -ENTRY(strnlen) +FUNC(strnlen) cbz limit, .Lhit_limit mov zeroones, #REP8_01 bic src, srcin, #15@@ -168,4 +168,4 @@ CPU_LE( lsr tmp2, tmp2, tmp4 ) /* Shift (tmp1 & 63). */ .Lhit_limit: mov len, limit ret -ENDPROC(strnlen) +END(strnlen)xen/arch/arm/arm64/lib/strrchr.S +2
-2@@ -26,7 +26,7 @@ * Returns: * x0 - address of last occurrence of 'c' or 0 */ -ENTRY(strrchr) +FUNC(strrchr) mov x3, #0 and w1, w1, #0xff 1: ldrb w2, [x0], #1@@ -37,4 +37,4 @@ ENTRY(strrchr) b 1b 2: mov x0, x3 ret -ENDPROC(strrchr) +END(strrchr)Signature · 1 line
2.40.1