Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc: Fix objtool unannotated intra-function call warnings

Objtool throws unannotated intra-function call warnings in the following
assembly files:

arch/powerpc/kernel/vector.o: warning: objtool: .text+0x53c: unannotated intra-function call

arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0x60: unannotated intra-function call
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0x124: unannotated intra-function call
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0x5d4: unannotated intra-function call
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0x5dc: unannotated intra-function call
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xcb8: unannotated intra-function call
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xd0c: unannotated intra-function call
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0x1030: unannotated intra-function call

arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x358: unannotated intra-function call
arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x728: unannotated intra-function call
arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x4d94: unannotated intra-function call
arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x4ec4: unannotated intra-function call

arch/powerpc/kvm/book3s_hv_interrupts.o: warning: objtool: .text+0x6c: unannotated intra-function call
arch/powerpc/kernel/misc_64.o: warning: objtool: .text+0x64: unannotated intra-function call

Objtool does not add STT_NOTYPE symbols with size 0 to the rbtree, which
is why find_call_destination() function is not able to find the
destination symbol for 'bl' instruction. For such symbols, objtool is
throwing unannotated intra-function call warnings in assembly files. Fix
these warnings by annotating those symbols with SYM_FUNC_START_LOCAL and
SYM_FUNC_END macros, inorder to set symbol type to STT_FUNC and symbol
size accordingly.

Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221114175754.1131267-4-sv@linux.ibm.com

authored by

Sathvika Vasireddy and committed by
Michael Ellerman
29a011fc 01f2cf0b

+32 -13
+3 -1
arch/powerpc/kernel/exceptions-64s.S
··· 13 13 * 14 14 */ 15 15 16 + #include <linux/linkage.h> 16 17 #include <asm/hw_irq.h> 17 18 #include <asm/exception-64s.h> 18 19 #include <asm/ptrace.h> ··· 3113 3112 blr 3114 3113 3115 3114 /* MSR[RI] should be clear because this uses SRR[01] */ 3116 - disable_machine_check: 3115 + SYM_FUNC_START_LOCAL(disable_machine_check) 3117 3116 mflr r0 3118 3117 bcl 20,31,$+4 3119 3118 0: mflr r3 ··· 3126 3125 RFI_TO_KERNEL 3127 3126 1: mtlr r0 3128 3127 blr 3128 + SYM_FUNC_END(disable_machine_check)
+5 -2
arch/powerpc/kernel/head_64.S
··· 18 18 * variants. 19 19 */ 20 20 21 + #include <linux/linkage.h> 21 22 #include <linux/threads.h> 22 23 #include <linux/init.h> 23 24 #include <asm/reg.h> ··· 463 462 * Assumes we're mapped EA == RA if the MMU is on. 464 463 */ 465 464 #ifdef CONFIG_PPC_BOOK3S 466 - __mmu_off: 465 + SYM_FUNC_START_LOCAL(__mmu_off) 467 466 mfmsr r3 468 467 andi. r0,r3,MSR_IR|MSR_DR 469 468 beqlr ··· 474 473 sync 475 474 rfid 476 475 b . /* prevent speculative execution */ 476 + SYM_FUNC_END(__mmu_off) 477 477 #endif 478 478 479 479 ··· 871 869 /* 872 870 * This subroutine clobbers r11 and r12 873 871 */ 874 - enable_64b_mode: 872 + SYM_FUNC_START_LOCAL(enable_64b_mode) 875 873 mfmsr r11 /* grab the current MSR */ 876 874 #ifdef CONFIG_PPC_BOOK3E_64 877 875 oris r11,r11,0x8000 /* CM bit set, we'll set ICM later */ ··· 883 881 isync 884 882 #endif 885 883 blr 884 + SYM_FUNC_END(enable_64b_mode) 886 885 887 886 /* 888 887 * This puts the TOC pointer into r2, offset by 0x8000 (as expected
+3 -1
arch/powerpc/kernel/misc_64.S
··· 9 9 * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com) 10 10 */ 11 11 12 + #include <linux/linkage.h> 12 13 #include <linux/sys.h> 13 14 #include <asm/unistd.h> 14 15 #include <asm/errno.h> ··· 354 353 * 355 354 * don't overwrite r3 here, it is live for kexec_wait above. 356 355 */ 357 - real_mode: /* assume normal blr return */ 356 + SYM_FUNC_START_LOCAL(real_mode) /* assume normal blr return */ 358 357 #ifdef CONFIG_PPC_BOOK3E_64 359 358 /* Create an identity mapping. */ 360 359 b kexec_create_tlb ··· 371 370 mtspr SPRN_SRR0,r11 372 371 rfid 373 372 #endif 373 + SYM_FUNC_END(real_mode) 374 374 375 375 /* 376 376 * kexec_sequence(newstack, start, image, control, clear_all(),
+3 -1
arch/powerpc/kernel/vector.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #include <linux/linkage.h> 2 3 #include <asm/processor.h> 3 4 #include <asm/ppc_asm.h> 4 5 #include <asm/reg.h> ··· 186 185 * Internal routine to enable floating point and set FPSCR to 0. 187 186 * Don't call it from C; it doesn't use the normal calling convention. 188 187 */ 189 - fpenable: 188 + SYM_FUNC_START_LOCAL(fpenable) 190 189 #ifdef CONFIG_PPC32 191 190 stwu r1,-64(r1) 192 191 #else ··· 203 202 mffs fr31 204 203 MTFSF_L(fr1) 205 204 blr 205 + SYM_FUNC_END(fpenable) 206 206 207 207 fpdisable: 208 208 mtlr r12
+3 -1
arch/powerpc/kvm/book3s_hv_interrupts.S
··· 9 9 * Authors: Alexander Graf <agraf@suse.de> 10 10 */ 11 11 12 + #include <linux/linkage.h> 12 13 #include <asm/ppc_asm.h> 13 14 #include <asm/kvm_asm.h> 14 15 #include <asm/reg.h> ··· 108 107 /* 109 108 * void kvmhv_save_host_pmu(void) 110 109 */ 111 - kvmhv_save_host_pmu: 110 + SYM_FUNC_START_LOCAL(kvmhv_save_host_pmu) 112 111 BEGIN_FTR_SECTION 113 112 /* Work around P8 PMAE bug */ 114 113 li r3, -1 ··· 155 154 stw r8, HSTATE_PMC5(r13) 156 155 stw r9, HSTATE_PMC6(r13) 157 156 31: blr 157 + SYM_FUNC_END(kvmhv_save_host_pmu)
+15 -7
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 10 10 * Authors: Alexander Graf <agraf@suse.de> 11 11 */ 12 12 13 + #include <linux/linkage.h> 13 14 #include <asm/ppc_asm.h> 14 15 #include <asm/code-patching-asm.h> 15 16 #include <asm/kvm_asm.h> ··· 2359 2358 * This routine calls kvmppc_read_intr, a C function, if an external 2360 2359 * interrupt is pending. 2361 2360 */ 2362 - kvmppc_check_wake_reason: 2361 + SYM_FUNC_START_LOCAL(kvmppc_check_wake_reason) 2363 2362 mfspr r6, SPRN_SRR1 2364 2363 BEGIN_FTR_SECTION 2365 2364 rlwinm r6, r6, 45-31, 0xf /* extract wake reason field (P8) */ ··· 2428 2427 addi r1, r1, PPC_MIN_STKFRM 2429 2428 mtlr r0 2430 2429 blr 2430 + SYM_FUNC_END(kvmppc_check_wake_reason) 2431 2431 2432 2432 /* 2433 2433 * Save away FP, VMX and VSX registers. ··· 2436 2434 * N.B. r30 and r31 are volatile across this function, 2437 2435 * thus it is not callable from C. 2438 2436 */ 2439 - kvmppc_save_fp: 2437 + SYM_FUNC_START_LOCAL(kvmppc_save_fp) 2440 2438 mflr r30 2441 2439 mr r31,r3 2442 2440 mfmsr r5 ··· 2464 2462 stw r6,VCPU_VRSAVE(r31) 2465 2463 mtlr r30 2466 2464 blr 2465 + SYM_FUNC_END(kvmppc_save_fp) 2467 2466 2468 2467 /* 2469 2468 * Load up FP, VMX and VSX registers ··· 2472 2469 * N.B. r30 and r31 are volatile across this function, 2473 2470 * thus it is not callable from C. 2474 2471 */ 2475 - kvmppc_load_fp: 2472 + SYM_FUNC_START_LOCAL(kvmppc_load_fp) 2476 2473 mflr r30 2477 2474 mr r31,r4 2478 2475 mfmsr r9 ··· 2501 2498 mtlr r30 2502 2499 mr r4,r31 2503 2500 blr 2501 + SYM_FUNC_END(kvmppc_load_fp) 2504 2502 2505 2503 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 2506 2504 /* ··· 2750 2746 * r9 has a vcpu pointer (in) 2751 2747 * r0 is used as a scratch register 2752 2748 */ 2753 - kvmppc_msr_interrupt: 2749 + SYM_FUNC_START_LOCAL(kvmppc_msr_interrupt) 2754 2750 rldicl r0, r11, 64 - MSR_TS_S_LG, 62 2755 2751 cmpwi r0, 2 /* Check if we are in transactional state.. */ 2756 2752 ld r11, VCPU_INTR_MSR(r9) ··· 2759 2755 li r0, 1 2760 2756 1: rldimi r11, r0, MSR_TS_S_LG, 63 - MSR_TS_T_LG 2761 2757 blr 2758 + SYM_FUNC_END(kvmppc_msr_interrupt) 2762 2759 2763 2760 /* 2764 2761 * void kvmhv_load_guest_pmu(struct kvm_vcpu *vcpu) 2765 2762 * 2766 2763 * Load up guest PMU state. R3 points to the vcpu struct. 2767 2764 */ 2768 - kvmhv_load_guest_pmu: 2765 + SYM_FUNC_START_LOCAL(kvmhv_load_guest_pmu) 2769 2766 mr r4, r3 2770 2767 mflr r0 2771 2768 li r3, 1 ··· 2816 2811 isync 2817 2812 mtlr r0 2818 2813 blr 2814 + SYM_FUNC_END(kvmhv_load_guest_pmu) 2819 2815 2820 2816 /* 2821 2817 * void kvmhv_load_host_pmu(void) 2822 2818 * 2823 2819 * Reload host PMU state saved in the PACA by kvmhv_save_host_pmu. 2824 2820 */ 2825 - kvmhv_load_host_pmu: 2821 + SYM_FUNC_START_LOCAL(kvmhv_load_host_pmu) 2826 2822 mflr r0 2827 2823 lbz r4, PACA_PMCINUSE(r13) /* is the host using the PMU? */ 2828 2824 cmpwi r4, 0 ··· 2865 2859 isync 2866 2860 mtlr r0 2867 2861 23: blr 2862 + SYM_FUNC_END(kvmhv_load_host_pmu) 2868 2863 2869 2864 /* 2870 2865 * void kvmhv_save_guest_pmu(struct kvm_vcpu *vcpu, bool pmu_in_use) ··· 2873 2866 * Save guest PMU state into the vcpu struct. 2874 2867 * r3 = vcpu, r4 = full save flag (PMU in use flag set in VPA) 2875 2868 */ 2876 - kvmhv_save_guest_pmu: 2869 + SYM_FUNC_START_LOCAL(kvmhv_save_guest_pmu) 2877 2870 mr r9, r3 2878 2871 mr r8, r4 2879 2872 BEGIN_FTR_SECTION ··· 2949 2942 mtspr SPRN_MMCRS, r4 2950 2943 END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) 2951 2944 22: blr 2945 + SYM_FUNC_END(kvmhv_save_guest_pmu) 2952 2946 2953 2947 /* 2954 2948 * This works around a hardware bug on POWER8E processors, where