Skip to content

Commit 2da3776

Browse files
chleroympe
authored andcommitted
powerpc/32: Fix objtool unannotated intra-function call warnings
Fix several annotations in assembly files on PPC32. [Sathvika Vasireddy: Changed subject line and removed Kconfig change to enable objtool, as it is a part of "objtool/powerpc: Enable objtool to be built on ppc" patch in this series.] Tested-by: Naveen N. Rao <[email protected]> Reviewed-by: Naveen N. Rao <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Sathvika Vasireddy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1c13732 commit 2da3776

File tree

10 files changed

+89
-35
lines changed

10 files changed

+89
-35
lines changed

arch/powerpc/kernel/cpu_setup_6xx.S

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright (C) 2003 Benjamin Herrenschmidt ([email protected])
55
*/
66

7+
#include <linux/linkage.h>
8+
79
#include <asm/processor.h>
810
#include <asm/page.h>
911
#include <asm/cputable.h>
@@ -81,7 +83,7 @@ _GLOBAL(__setup_cpu_745x)
8183
blr
8284

8385
/* Enable caches for 603's, 604, 750 & 7400 */
84-
setup_common_caches:
86+
SYM_FUNC_START_LOCAL(setup_common_caches)
8587
mfspr r11,SPRN_HID0
8688
andi. r0,r11,HID0_DCE
8789
ori r11,r11,HID0_ICE|HID0_DCE
@@ -95,11 +97,12 @@ setup_common_caches:
9597
sync
9698
isync
9799
blr
100+
SYM_FUNC_END(setup_common_caches)
98101

99102
/* 604, 604e, 604ev, ...
100103
* Enable superscalar execution & branch history table
101104
*/
102-
setup_604_hid0:
105+
SYM_FUNC_START_LOCAL(setup_604_hid0)
103106
mfspr r11,SPRN_HID0
104107
ori r11,r11,HID0_SIED|HID0_BHTE
105108
ori r8,r11,HID0_BTCD
@@ -110,6 +113,7 @@ setup_604_hid0:
110113
sync
111114
isync
112115
blr
116+
SYM_FUNC_END(setup_604_hid0)
113117

114118
/* 7400 <= rev 2.7 and 7410 rev = 1.0 suffer from some
115119
* erratas we work around here.
@@ -125,13 +129,14 @@ setup_604_hid0:
125129
* needed once we have applied workaround #5 (though it's
126130
* not set by Apple's firmware at least).
127131
*/
128-
setup_7400_workarounds:
132+
SYM_FUNC_START_LOCAL(setup_7400_workarounds)
129133
mfpvr r3
130134
rlwinm r3,r3,0,20,31
131135
cmpwi 0,r3,0x0207
132136
ble 1f
133137
blr
134-
setup_7410_workarounds:
138+
SYM_FUNC_END(setup_7400_workarounds)
139+
SYM_FUNC_START_LOCAL(setup_7410_workarounds)
135140
mfpvr r3
136141
rlwinm r3,r3,0,20,31
137142
cmpwi 0,r3,0x0100
@@ -151,14 +156,15 @@ setup_7410_workarounds:
151156
sync
152157
isync
153158
blr
159+
SYM_FUNC_END(setup_7410_workarounds)
154160

155161
/* 740/750/7400/7410
156162
* Enable Store Gathering (SGE), Address Broadcast (ABE),
157163
* Branch History Table (BHTE), Branch Target ICache (BTIC)
158164
* Dynamic Power Management (DPM), Speculative (SPD)
159165
* Clear Instruction cache throttling (ICTC)
160166
*/
161-
setup_750_7400_hid0:
167+
SYM_FUNC_START_LOCAL(setup_750_7400_hid0)
162168
mfspr r11,SPRN_HID0
163169
ori r11,r11,HID0_SGE | HID0_ABE | HID0_BHTE | HID0_BTIC
164170
oris r11,r11,HID0_DPM@h
@@ -177,12 +183,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_NO_DPM)
177183
sync
178184
isync
179185
blr
186+
SYM_FUNC_END(setup_750_7400_hid0)
180187

181188
/* 750cx specific
182189
* Looks like we have to disable NAP feature for some PLL settings...
183190
* (waiting for confirmation)
184191
*/
185-
setup_750cx:
192+
SYM_FUNC_START_LOCAL(setup_750cx)
186193
mfspr r10, SPRN_HID1
187194
rlwinm r10,r10,4,28,31
188195
cmpwi cr0,r10,7
@@ -196,11 +203,13 @@ setup_750cx:
196203
andc r6,r6,r7
197204
stw r6,CPU_SPEC_FEATURES(r4)
198205
blr
206+
SYM_FUNC_END(setup_750cx)
199207

200208
/* 750fx specific
201209
*/
202-
setup_750fx:
210+
SYM_FUNC_START_LOCAL(setup_750fx)
203211
blr
212+
SYM_FUNC_END(setup_750fx)
204213

205214
/* MPC 745x
206215
* Enable Store Gathering (SGE), Branch Folding (FOLD)
@@ -212,7 +221,7 @@ setup_750fx:
212221
* Clear Instruction cache throttling (ICTC)
213222
* Enable L2 HW prefetch
214223
*/
215-
setup_745x_specifics:
224+
SYM_FUNC_START_LOCAL(setup_745x_specifics)
216225
/* We check for the presence of an L3 cache setup by
217226
* the firmware. If any, we disable NAP capability as
218227
* it's known to be bogus on rev 2.1 and earlier
@@ -270,6 +279,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_NO_DPM)
270279
sync
271280
isync
272281
blr
282+
SYM_FUNC_END(setup_745x_specifics)
273283

274284
/*
275285
* Initialize the FPU registers. This is needed to work around an errata

arch/powerpc/kernel/cpu_setup_e500.S

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Benjamin Herrenschmidt <[email protected]>
99
*/
1010

11+
#include <linux/linkage.h>
12+
1113
#include <asm/page.h>
1214
#include <asm/processor.h>
1315
#include <asm/cputable.h>
@@ -274,7 +276,7 @@ _GLOBAL(flush_dcache_L1)
274276

275277
blr
276278

277-
has_L2_cache:
279+
SYM_FUNC_START_LOCAL(has_L2_cache)
278280
/* skip L2 cache on P2040/P2040E as they have no L2 cache */
279281
mfspr r3, SPRN_SVR
280282
/* shift right by 8 bits and clear E bit of SVR */
@@ -290,9 +292,10 @@ has_L2_cache:
290292
1:
291293
li r3, 0
292294
blr
295+
SYM_FUNC_END(has_L2_cache)
293296

294297
/* flush backside L2 cache */
295-
flush_backside_L2_cache:
298+
SYM_FUNC_START_LOCAL(flush_backside_L2_cache)
296299
mflr r10
297300
bl has_L2_cache
298301
mtlr r10
@@ -313,6 +316,7 @@ flush_backside_L2_cache:
313316
bne 1b
314317
2:
315318
blr
319+
SYM_FUNC_END(flush_backside_L2_cache)
316320

317321
_GLOBAL(cpu_down_flush_e500v2)
318322
mflr r0

arch/powerpc/kernel/entry_32.S

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <linux/err.h>
1919
#include <linux/sys.h>
2020
#include <linux/threads.h>
21+
#include <linux/linkage.h>
22+
2123
#include <asm/reg.h>
2224
#include <asm/page.h>
2325
#include <asm/mmu.h>
@@ -74,17 +76,18 @@ _ASM_NOKPROBE_SYMBOL(prepare_transfer_to_handler)
7476
#endif /* CONFIG_PPC_BOOK3S_32 || CONFIG_PPC_E500 */
7577

7678
#if defined(CONFIG_PPC_KUEP) && defined(CONFIG_PPC_BOOK3S_32)
77-
.globl __kuep_lock
78-
__kuep_lock:
79+
SYM_FUNC_START(__kuep_lock)
7980
lwz r9, THREAD+THSR0(r2)
8081
update_user_segments_by_4 r9, r10, r11, r12
8182
blr
83+
SYM_FUNC_END(__kuep_lock)
8284

83-
__kuep_unlock:
85+
SYM_FUNC_START_LOCAL(__kuep_unlock)
8486
lwz r9, THREAD+THSR0(r2)
8587
rlwinm r9,r9,0,~SR_NX
8688
update_user_segments_by_4 r9, r10, r11, r12
8789
blr
90+
SYM_FUNC_END(__kuep_unlock)
8891

8992
.macro kuep_lock
9093
bl __kuep_lock

arch/powerpc/kernel/head_40x.S

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <linux/init.h>
2929
#include <linux/pgtable.h>
3030
#include <linux/sizes.h>
31+
#include <linux/linkage.h>
32+
3133
#include <asm/processor.h>
3234
#include <asm/page.h>
3335
#include <asm/mmu.h>
@@ -662,7 +664,7 @@ start_here:
662664
* kernel initialization. This maps the first 32 MBytes of memory 1:1
663665
* virtual to physical and more importantly sets the cache mode.
664666
*/
665-
initial_mmu:
667+
SYM_FUNC_START_LOCAL(initial_mmu)
666668
tlbia /* Invalidate all TLB entries */
667669
isync
668670

@@ -711,6 +713,7 @@ initial_mmu:
711713
mtspr SPRN_EVPR,r0
712714

713715
blr
716+
SYM_FUNC_END(initial_mmu)
714717

715718
_GLOBAL(abort)
716719
mfspr r13,SPRN_DBCR0

arch/powerpc/kernel/head_85xx.S

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include <linux/init.h>
3030
#include <linux/threads.h>
3131
#include <linux/pgtable.h>
32+
#include <linux/linkage.h>
33+
3234
#include <asm/processor.h>
3335
#include <asm/page.h>
3436
#include <asm/mmu.h>
@@ -885,7 +887,7 @@ KernelSPE:
885887
* Translate the effec addr in r3 to phys addr. The phys addr will be put
886888
* into r3(higher 32bit) and r4(lower 32bit)
887889
*/
888-
get_phys_addr:
890+
SYM_FUNC_START_LOCAL(get_phys_addr)
889891
mfmsr r8
890892
mfspr r9,SPRN_PID
891893
rlwinm r9,r9,16,0x3fff0000 /* turn PID into MAS6[SPID] */
@@ -907,6 +909,7 @@ get_phys_addr:
907909
mfspr r3,SPRN_MAS7
908910
#endif
909911
blr
912+
SYM_FUNC_END(get_phys_addr)
910913

911914
/*
912915
* Global functions

arch/powerpc/kernel/head_8xx.S

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <linux/magic.h>
1919
#include <linux/pgtable.h>
2020
#include <linux/sizes.h>
21+
#include <linux/linkage.h>
22+
2123
#include <asm/processor.h>
2224
#include <asm/page.h>
2325
#include <asm/mmu.h>
@@ -625,7 +627,7 @@ start_here:
625627
* 24 Mbytes of data, and the 512k IMMR space. Anything not covered by
626628
* these mappings is mapped by page tables.
627629
*/
628-
initial_mmu:
630+
SYM_FUNC_START_LOCAL(initial_mmu)
629631
li r8, 0
630632
mtspr SPRN_MI_CTR, r8 /* remove PINNED ITLB entries */
631633
lis r10, MD_TWAM@h
@@ -686,6 +688,7 @@ initial_mmu:
686688
#endif
687689
mtspr SPRN_DER, r8
688690
blr
691+
SYM_FUNC_END(initial_mmu)
689692

690693
_GLOBAL(mmu_pin_tlb)
691694
lis r9, (1f - PAGE_OFFSET)@h

arch/powerpc/kernel/head_book3s_32.S

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#include <linux/init.h>
2020
#include <linux/pgtable.h>
21+
#include <linux/linkage.h>
22+
2123
#include <asm/reg.h>
2224
#include <asm/page.h>
2325
#include <asm/mmu.h>
@@ -877,7 +879,7 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_HPTE_TABLE)
877879
* Load stuff into the MMU. Intended to be called with
878880
* IR=0 and DR=0.
879881
*/
880-
early_hash_table:
882+
SYM_FUNC_START_LOCAL(early_hash_table)
881883
sync /* Force all PTE updates to finish */
882884
isync
883885
tlbia /* Clear all TLB entries */
@@ -888,8 +890,9 @@ early_hash_table:
888890
ori r6, r6, 3 /* 256kB table */
889891
mtspr SPRN_SDR1, r6
890892
blr
893+
SYM_FUNC_END(early_hash_table)
891894

892-
load_up_mmu:
895+
SYM_FUNC_START_LOCAL(load_up_mmu)
893896
sync /* Force all PTE updates to finish */
894897
isync
895898
tlbia /* Clear all TLB entries */
@@ -918,6 +921,7 @@ BEGIN_MMU_FTR_SECTION
918921
LOAD_BAT(7,r3,r4,r5)
919922
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
920923
blr
924+
SYM_FUNC_END(load_up_mmu)
921925

922926
_GLOBAL(load_segment_registers)
923927
li r0, NUM_USER_SEGMENTS /* load up user segment register values */
@@ -1028,7 +1032,7 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_HPTE_TABLE)
10281032
* this makes sure it's done.
10291033
* -- Cort
10301034
*/
1031-
clear_bats:
1035+
SYM_FUNC_START_LOCAL(clear_bats)
10321036
li r10,0
10331037

10341038
mtspr SPRN_DBAT0U,r10
@@ -1072,6 +1076,7 @@ BEGIN_MMU_FTR_SECTION
10721076
mtspr SPRN_IBAT7L,r10
10731077
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
10741078
blr
1079+
SYM_FUNC_END(clear_bats)
10751080

10761081
_GLOBAL(update_bats)
10771082
lis r4, 1f@h
@@ -1108,15 +1113,16 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
11081113
mtspr SPRN_SRR1, r6
11091114
rfi
11101115

1111-
flush_tlbs:
1116+
SYM_FUNC_START_LOCAL(flush_tlbs)
11121117
lis r10, 0x40
11131118
1: addic. r10, r10, -0x1000
11141119
tlbie r10
11151120
bgt 1b
11161121
sync
11171122
blr
1123+
SYM_FUNC_END(flush_tlbs)
11181124

1119-
mmu_off:
1125+
SYM_FUNC_START_LOCAL(mmu_off)
11201126
addi r4, r3, __after_mmu_off - _start
11211127
mfmsr r3
11221128
andi. r0,r3,MSR_DR|MSR_IR /* MMU enabled? */
@@ -1128,9 +1134,10 @@ mmu_off:
11281134
mtspr SPRN_SRR1,r3
11291135
sync
11301136
rfi
1137+
SYM_FUNC_END(mmu_off)
11311138

11321139
/* We use one BAT to map up to 256M of RAM at _PAGE_OFFSET */
1133-
initial_bats:
1140+
SYM_FUNC_START_LOCAL(initial_bats)
11341141
lis r11,PAGE_OFFSET@h
11351142
tophys(r8,r11)
11361143
#ifdef CONFIG_SMP
@@ -1146,9 +1153,10 @@ initial_bats:
11461153
mtspr SPRN_IBAT0U,r11
11471154
isync
11481155
blr
1156+
SYM_FUNC_END(initial_bats)
11491157

11501158
#ifdef CONFIG_BOOTX_TEXT
1151-
setup_disp_bat:
1159+
SYM_FUNC_START_LOCAL(setup_disp_bat)
11521160
/*
11531161
* setup the display bat prepared for us in prom.c
11541162
*/
@@ -1164,10 +1172,11 @@ setup_disp_bat:
11641172
mtspr SPRN_DBAT3L,r8
11651173
mtspr SPRN_DBAT3U,r11
11661174
blr
1175+
SYM_FUNC_END(setup_disp_bat)
11671176
#endif /* CONFIG_BOOTX_TEXT */
11681177

11691178
#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
1170-
setup_cpm_bat:
1179+
SYM_FUNC_START_LOCAL(setup_cpm_bat)
11711180
lis r8, 0xf000
11721181
ori r8, r8, 0x002a
11731182
mtspr SPRN_DBAT1L, r8
@@ -1177,10 +1186,11 @@ setup_cpm_bat:
11771186
mtspr SPRN_DBAT1U, r11
11781187

11791188
blr
1189+
SYM_FUNC_END(setup_cpm_bat)
11801190
#endif
11811191

11821192
#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
1183-
setup_usbgecko_bat:
1193+
SYM_FUNC_START_LOCAL(setup_usbgecko_bat)
11841194
/* prepare a BAT for early io */
11851195
#if defined(CONFIG_GAMECUBE)
11861196
lis r8, 0x0c00
@@ -1199,6 +1209,7 @@ setup_usbgecko_bat:
11991209
mtspr SPRN_DBAT1L, r8
12001210
mtspr SPRN_DBAT1U, r11
12011211
blr
1212+
SYM_FUNC_END(setup_usbgecko_bat)
12021213
#endif
12031214

12041215
.data

0 commit comments

Comments
 (0)