tsb.S 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* tsb.S: Sparc64 TSB table handling.
  3. *
  4. * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
  5. */
  6. #include <asm/tsb.h>
  7. #include <asm/hypervisor.h>
  8. #include <asm/page.h>
  9. #include <asm/cpudata.h>
  10. #include <asm/mmu.h>
  11. .text
  12. .align 32
  13. /* Invoked from TLB miss handler, we are in the
  14. * MMU global registers and they are setup like
  15. * this:
  16. *
  17. * %g1: TSB entry pointer
  18. * %g2: available temporary
  19. * %g3: FAULT_CODE_{D,I}TLB
  20. * %g4: available temporary
  21. * %g5: available temporary
  22. * %g6: TAG TARGET
  23. * %g7: available temporary, will be loaded by us with
  24. * the physical address base of the linux page
  25. * tables for the current address space
  26. */
  27. tsb_miss_dtlb:
  28. mov TLB_TAG_ACCESS, %g4
  29. ldxa [%g4] ASI_DMMU, %g4
  30. srlx %g4, PAGE_SHIFT, %g4
  31. ba,pt %xcc, tsb_miss_page_table_walk
  32. sllx %g4, PAGE_SHIFT, %g4
  33. tsb_miss_itlb:
  34. mov TLB_TAG_ACCESS, %g4
  35. ldxa [%g4] ASI_IMMU, %g4
  36. srlx %g4, PAGE_SHIFT, %g4
  37. ba,pt %xcc, tsb_miss_page_table_walk
  38. sllx %g4, PAGE_SHIFT, %g4
  39. /* At this point we have:
  40. * %g1 -- PAGE_SIZE TSB entry address
  41. * %g3 -- FAULT_CODE_{D,I}TLB
  42. * %g4 -- missing virtual address
  43. * %g6 -- TAG TARGET (vaddr >> 22)
  44. */
  45. tsb_miss_page_table_walk:
  46. TRAP_LOAD_TRAP_BLOCK(%g7, %g5)
  47. /* Before committing to a full page table walk,
  48. * check the huge page TSB.
  49. */
  50. #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
  51. 661: ldx [%g7 + TRAP_PER_CPU_TSB_HUGE], %g5
  52. nop
  53. .section .sun4v_2insn_patch, "ax"
  54. .word 661b
  55. mov SCRATCHPAD_UTSBREG2, %g5
  56. ldxa [%g5] ASI_SCRATCHPAD, %g5
  57. .previous
  58. cmp %g5, -1
  59. be,pt %xcc, 80f
  60. nop
  61. /* We need an aligned pair of registers containing 2 values
  62. * which can be easily rematerialized. %g6 and %g7 foot the
  63. * bill just nicely. We'll save %g6 away into %g2 for the
  64. * huge page TSB TAG comparison.
  65. *
  66. * Perform a huge page TSB lookup.
  67. */
  68. mov %g6, %g2
  69. and %g5, 0x7, %g6
  70. mov 512, %g7
  71. andn %g5, 0x7, %g5
  72. sllx %g7, %g6, %g7
  73. srlx %g4, REAL_HPAGE_SHIFT, %g6
  74. sub %g7, 1, %g7
  75. and %g6, %g7, %g6
  76. sllx %g6, 4, %g6
  77. add %g5, %g6, %g5
  78. TSB_LOAD_QUAD(%g5, %g6)
  79. cmp %g6, %g2
  80. be,a,pt %xcc, tsb_tlb_reload
  81. mov %g7, %g5
  82. /* No match, remember the huge page TSB entry address,
  83. * and restore %g6 and %g7.
  84. */
  85. TRAP_LOAD_TRAP_BLOCK(%g7, %g6)
  86. srlx %g4, 22, %g6
  87. 80: stx %g5, [%g7 + TRAP_PER_CPU_TSB_HUGE_TEMP]
  88. #endif
  89. ldx [%g7 + TRAP_PER_CPU_PGD_PADDR], %g7
  90. /* At this point we have:
  91. * %g1 -- TSB entry address
  92. * %g3 -- FAULT_CODE_{D,I}TLB
  93. * %g4 -- missing virtual address
  94. * %g6 -- TAG TARGET (vaddr >> 22)
  95. * %g7 -- page table physical address
  96. *
  97. * We know that both the base PAGE_SIZE TSB and the HPAGE_SIZE
  98. * TSB both lack a matching entry.
  99. */
  100. tsb_miss_page_table_walk_sun4v_fastpath:
  101. USER_PGTABLE_WALK_TL1(%g4, %g7, %g5, %g2, tsb_do_fault)
  102. /* Valid PTE is now in %g5. */
  103. #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
  104. sethi %uhi(_PAGE_PMD_HUGE | _PAGE_PUD_HUGE), %g7
  105. sllx %g7, 32, %g7
  106. andcc %g5, %g7, %g0
  107. be,pt %xcc, 60f
  108. nop
  109. /* It is a huge page, use huge page TSB entry address we
  110. * calculated above. If the huge page TSB has not been
  111. * allocated, setup a trap stack and call hugetlb_setup()
  112. * to do so, then return from the trap to replay the TLB
  113. * miss.
  114. *
  115. * This is necessary to handle the case of transparent huge
  116. * pages where we don't really have a non-atomic context
  117. * in which to allocate the hugepage TSB hash table. When
  118. * the 'mm' faults in the hugepage for the first time, we
  119. * thus handle it here. This also makes sure that we can
  120. * allocate the TSB hash table on the correct NUMA node.
  121. */
  122. TRAP_LOAD_TRAP_BLOCK(%g7, %g2)
  123. ldx [%g7 + TRAP_PER_CPU_TSB_HUGE_TEMP], %g1
  124. cmp %g1, -1
  125. bne,pt %xcc, 60f
  126. nop
  127. 661: rdpr %pstate, %g5
  128. wrpr %g5, PSTATE_AG | PSTATE_MG, %pstate
  129. .section .sun4v_2insn_patch, "ax"
  130. .word 661b
  131. SET_GL(1)
  132. nop
  133. .previous
  134. rdpr %tl, %g7
  135. cmp %g7, 1
  136. bne,pn %xcc, winfix_trampoline
  137. mov %g3, %g4
  138. ba,pt %xcc, etrap
  139. rd %pc, %g7
  140. call hugetlb_setup
  141. add %sp, PTREGS_OFF, %o0
  142. ba,pt %xcc, rtrap
  143. nop
  144. 60:
  145. #endif
  146. /* At this point we have:
  147. * %g1 -- TSB entry address
  148. * %g3 -- FAULT_CODE_{D,I}TLB
  149. * %g5 -- valid PTE
  150. * %g6 -- TAG TARGET (vaddr >> 22)
  151. */
  152. tsb_reload:
  153. TSB_LOCK_TAG(%g1, %g2, %g7)
  154. TSB_WRITE(%g1, %g5, %g6)
  155. /* Finally, load TLB and return from trap. */
  156. tsb_tlb_reload:
  157. cmp %g3, FAULT_CODE_DTLB
  158. bne,pn %xcc, tsb_itlb_load
  159. nop
  160. tsb_dtlb_load:
  161. 661: stxa %g5, [%g0] ASI_DTLB_DATA_IN
  162. retry
  163. .section .sun4v_2insn_patch, "ax"
  164. .word 661b
  165. nop
  166. nop
  167. .previous
  168. /* For sun4v the ASI_DTLB_DATA_IN store and the retry
  169. * instruction get nop'd out and we get here to branch
  170. * to the sun4v tlb load code. The registers are setup
  171. * as follows:
  172. *
  173. * %g4: vaddr
  174. * %g5: PTE
  175. * %g6: TAG
  176. *
  177. * The sun4v TLB load wants the PTE in %g3 so we fix that
  178. * up here.
  179. */
  180. ba,pt %xcc, sun4v_dtlb_load
  181. mov %g5, %g3
  182. tsb_itlb_load:
  183. /* Executable bit must be set. */
  184. 661: sethi %hi(_PAGE_EXEC_4U), %g4
  185. andcc %g5, %g4, %g0
  186. .section .sun4v_2insn_patch, "ax"
  187. .word 661b
  188. andcc %g5, _PAGE_EXEC_4V, %g0
  189. nop
  190. .previous
  191. be,pn %xcc, tsb_do_fault
  192. nop
  193. 661: stxa %g5, [%g0] ASI_ITLB_DATA_IN
  194. retry
  195. .section .sun4v_2insn_patch, "ax"
  196. .word 661b
  197. nop
  198. nop
  199. .previous
  200. /* For sun4v the ASI_ITLB_DATA_IN store and the retry
  201. * instruction get nop'd out and we get here to branch
  202. * to the sun4v tlb load code. The registers are setup
  203. * as follows:
  204. *
  205. * %g4: vaddr
  206. * %g5: PTE
  207. * %g6: TAG
  208. *
  209. * The sun4v TLB load wants the PTE in %g3 so we fix that
  210. * up here.
  211. */
  212. ba,pt %xcc, sun4v_itlb_load
  213. mov %g5, %g3
  214. /* No valid entry in the page tables, do full fault
  215. * processing.
  216. */
  217. .globl tsb_do_fault
  218. tsb_do_fault:
  219. cmp %g3, FAULT_CODE_DTLB
  220. 661: rdpr %pstate, %g5
  221. wrpr %g5, PSTATE_AG | PSTATE_MG, %pstate
  222. .section .sun4v_2insn_patch, "ax"
  223. .word 661b
  224. SET_GL(1)
  225. ldxa [%g0] ASI_SCRATCHPAD, %g4
  226. .previous
  227. bne,pn %xcc, tsb_do_itlb_fault
  228. nop
  229. tsb_do_dtlb_fault:
  230. rdpr %tl, %g3
  231. cmp %g3, 1
  232. 661: mov TLB_TAG_ACCESS, %g4
  233. ldxa [%g4] ASI_DMMU, %g5
  234. .section .sun4v_2insn_patch, "ax"
  235. .word 661b
  236. ldx [%g4 + HV_FAULT_D_ADDR_OFFSET], %g5
  237. nop
  238. .previous
  239. /* Clear context ID bits. */
  240. srlx %g5, PAGE_SHIFT, %g5
  241. sllx %g5, PAGE_SHIFT, %g5
  242. be,pt %xcc, sparc64_realfault_common
  243. mov FAULT_CODE_DTLB, %g4
  244. ba,pt %xcc, winfix_trampoline
  245. nop
  246. tsb_do_itlb_fault:
  247. rdpr %tpc, %g5
  248. ba,pt %xcc, sparc64_realfault_common
  249. mov FAULT_CODE_ITLB, %g4
  250. .globl sparc64_realfault_common
  251. sparc64_realfault_common:
  252. /* fault code in %g4, fault address in %g5, etrap will
  253. * preserve these two values in %l4 and %l5 respectively
  254. */
  255. ba,pt %xcc, etrap ! Save trap state
  256. 1: rd %pc, %g7 ! ...
  257. stb %l4, [%g6 + TI_FAULT_CODE] ! Save fault code
  258. stx %l5, [%g6 + TI_FAULT_ADDR] ! Save fault address
  259. call do_sparc64_fault ! Call fault handler
  260. add %sp, PTREGS_OFF, %o0 ! Compute pt_regs arg
  261. ba,pt %xcc, rtrap ! Restore cpu state
  262. nop ! Delay slot (fill me)
  263. winfix_trampoline:
  264. rdpr %tpc, %g3 ! Prepare winfixup TNPC
  265. or %g3, 0x7c, %g3 ! Compute branch offset
  266. wrpr %g3, %tnpc ! Write it into TNPC
  267. done ! Trap return
  268. /* Insert an entry into the TSB.
  269. *
  270. * %o0: TSB entry pointer (virt or phys address)
  271. * %o1: tag
  272. * %o2: pte
  273. */
  274. .align 32
  275. .globl __tsb_insert
  276. __tsb_insert:
  277. rdpr %pstate, %o5
  278. wrpr %o5, PSTATE_IE, %pstate
  279. TSB_LOCK_TAG(%o0, %g2, %g3)
  280. TSB_WRITE(%o0, %o2, %o1)
  281. wrpr %o5, %pstate
  282. retl
  283. nop
  284. .size __tsb_insert, .-__tsb_insert
  285. /* Flush the given TSB entry if it has the matching
  286. * tag.
  287. *
  288. * %o0: TSB entry pointer (virt or phys address)
  289. * %o1: tag
  290. */
  291. .align 32
  292. .globl tsb_flush
  293. .type tsb_flush,#function
  294. tsb_flush:
  295. sethi %hi(TSB_TAG_LOCK_HIGH), %g2
  296. 1: TSB_LOAD_TAG(%o0, %g1)
  297. srlx %g1, 32, %o3
  298. andcc %o3, %g2, %g0
  299. bne,pn %icc, 1b
  300. nop
  301. cmp %g1, %o1
  302. mov 1, %o3
  303. bne,pt %xcc, 2f
  304. sllx %o3, TSB_TAG_INVALID_BIT, %o3
  305. TSB_CAS_TAG(%o0, %g1, %o3)
  306. cmp %g1, %o3
  307. bne,pn %xcc, 1b
  308. nop
  309. 2: retl
  310. nop
  311. .size tsb_flush, .-tsb_flush
  312. /* Reload MMU related context switch state at
  313. * schedule() time.
  314. *
  315. * %o0: page table physical address
  316. * %o1: TSB base config pointer
  317. * %o2: TSB huge config pointer, or NULL if none
  318. * %o3: Hypervisor TSB descriptor physical address
  319. * %o4: Secondary context to load, if non-zero
  320. *
  321. * We have to run this whole thing with interrupts
  322. * disabled so that the current cpu doesn't change
  323. * due to preemption.
  324. */
  325. .align 32
  326. .globl __tsb_context_switch
  327. .type __tsb_context_switch,#function
  328. __tsb_context_switch:
  329. rdpr %pstate, %g1
  330. wrpr %g1, PSTATE_IE, %pstate
  331. brz,pn %o4, 1f
  332. mov SECONDARY_CONTEXT, %o5
  333. 661: stxa %o4, [%o5] ASI_DMMU
  334. .section .sun4v_1insn_patch, "ax"
  335. .word 661b
  336. stxa %o4, [%o5] ASI_MMU
  337. .previous
  338. flush %g6
  339. 1:
  340. TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
  341. stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR]
  342. ldx [%o1 + TSB_CONFIG_REG_VAL], %o0
  343. brz,pt %o2, 1f
  344. mov -1, %g3
  345. ldx [%o2 + TSB_CONFIG_REG_VAL], %g3
  346. 1: stx %g3, [%g2 + TRAP_PER_CPU_TSB_HUGE]
  347. sethi %hi(tlb_type), %g2
  348. lduw [%g2 + %lo(tlb_type)], %g2
  349. cmp %g2, 3
  350. bne,pt %icc, 50f
  351. nop
  352. /* Hypervisor TSB switch. */
  353. mov SCRATCHPAD_UTSBREG1, %o5
  354. stxa %o0, [%o5] ASI_SCRATCHPAD
  355. mov SCRATCHPAD_UTSBREG2, %o5
  356. stxa %g3, [%o5] ASI_SCRATCHPAD
  357. mov 2, %o0
  358. cmp %g3, -1
  359. move %xcc, 1, %o0
  360. mov HV_FAST_MMU_TSB_CTXNON0, %o5
  361. mov %o3, %o1
  362. ta HV_FAST_TRAP
  363. /* Finish up. */
  364. ba,pt %xcc, 9f
  365. nop
  366. /* SUN4U TSB switch. */
  367. 50: mov TSB_REG, %o5
  368. stxa %o0, [%o5] ASI_DMMU
  369. membar #Sync
  370. stxa %o0, [%o5] ASI_IMMU
  371. membar #Sync
  372. 2: ldx [%o1 + TSB_CONFIG_MAP_VADDR], %o4
  373. brz %o4, 9f
  374. ldx [%o1 + TSB_CONFIG_MAP_PTE], %o5
  375. sethi %hi(sparc64_highest_unlocked_tlb_ent), %g2
  376. mov TLB_TAG_ACCESS, %g3
  377. lduw [%g2 + %lo(sparc64_highest_unlocked_tlb_ent)], %g2
  378. stxa %o4, [%g3] ASI_DMMU
  379. membar #Sync
  380. sllx %g2, 3, %g2
  381. stxa %o5, [%g2] ASI_DTLB_DATA_ACCESS
  382. membar #Sync
  383. brz,pt %o2, 9f
  384. nop
  385. ldx [%o2 + TSB_CONFIG_MAP_VADDR], %o4
  386. ldx [%o2 + TSB_CONFIG_MAP_PTE], %o5
  387. mov TLB_TAG_ACCESS, %g3
  388. stxa %o4, [%g3] ASI_DMMU
  389. membar #Sync
  390. sub %g2, (1 << 3), %g2
  391. stxa %o5, [%g2] ASI_DTLB_DATA_ACCESS
  392. membar #Sync
  393. 9:
  394. wrpr %g1, %pstate
  395. retl
  396. nop
  397. .size __tsb_context_switch, .-__tsb_context_switch
  398. #define TSB_PASS_BITS ((1 << TSB_TAG_LOCK_BIT) | \
  399. (1 << TSB_TAG_INVALID_BIT))
  400. .align 32
  401. .globl copy_tsb
  402. .type copy_tsb,#function
  403. copy_tsb: /* %o0=old_tsb_base, %o1=old_tsb_size
  404. * %o2=new_tsb_base, %o3=new_tsb_size
  405. * %o4=page_size_shift
  406. */
  407. sethi %uhi(TSB_PASS_BITS), %g7
  408. srlx %o3, 4, %o3
  409. add %o0, %o1, %o1 /* end of old tsb */
  410. sllx %g7, 32, %g7
  411. sub %o3, 1, %o3 /* %o3 == new tsb hash mask */
  412. mov %o4, %g1 /* page_size_shift */
  413. 661: prefetcha [%o0] ASI_N, #one_read
  414. .section .tsb_phys_patch, "ax"
  415. .word 661b
  416. prefetcha [%o0] ASI_PHYS_USE_EC, #one_read
  417. .previous
  418. 90: andcc %o0, (64 - 1), %g0
  419. bne 1f
  420. add %o0, 64, %o5
  421. 661: prefetcha [%o5] ASI_N, #one_read
  422. .section .tsb_phys_patch, "ax"
  423. .word 661b
  424. prefetcha [%o5] ASI_PHYS_USE_EC, #one_read
  425. .previous
  426. 1: TSB_LOAD_QUAD(%o0, %g2) /* %g2/%g3 == TSB entry */
  427. andcc %g2, %g7, %g0 /* LOCK or INVALID set? */
  428. bne,pn %xcc, 80f /* Skip it */
  429. sllx %g2, 22, %o4 /* TAG --> VADDR */
  430. /* This can definitely be computed faster... */
  431. srlx %o0, 4, %o5 /* Build index */
  432. and %o5, 511, %o5 /* Mask index */
  433. sllx %o5, %g1, %o5 /* Put into vaddr position */
  434. or %o4, %o5, %o4 /* Full VADDR. */
  435. srlx %o4, %g1, %o4 /* Shift down to create index */
  436. and %o4, %o3, %o4 /* Mask with new_tsb_nents-1 */
  437. sllx %o4, 4, %o4 /* Shift back up into tsb ent offset */
  438. TSB_STORE(%o2 + %o4, %g2) /* Store TAG */
  439. add %o4, 0x8, %o4 /* Advance to TTE */
  440. TSB_STORE(%o2 + %o4, %g3) /* Store TTE */
  441. 80: add %o0, 16, %o0
  442. cmp %o0, %o1
  443. bne,pt %xcc, 90b
  444. nop
  445. retl
  446. nop
  447. .size copy_tsb, .-copy_tsb
  448. /* Set the invalid bit in all TSB entries. */
  449. .align 32
  450. .globl tsb_init
  451. .type tsb_init,#function
  452. tsb_init: /* %o0 = TSB vaddr, %o1 = size in bytes */
  453. prefetch [%o0 + 0x000], #n_writes
  454. mov 1, %g1
  455. prefetch [%o0 + 0x040], #n_writes
  456. sllx %g1, TSB_TAG_INVALID_BIT, %g1
  457. prefetch [%o0 + 0x080], #n_writes
  458. 1: prefetch [%o0 + 0x0c0], #n_writes
  459. stx %g1, [%o0 + 0x00]
  460. stx %g1, [%o0 + 0x10]
  461. stx %g1, [%o0 + 0x20]
  462. stx %g1, [%o0 + 0x30]
  463. prefetch [%o0 + 0x100], #n_writes
  464. stx %g1, [%o0 + 0x40]
  465. stx %g1, [%o0 + 0x50]
  466. stx %g1, [%o0 + 0x60]
  467. stx %g1, [%o0 + 0x70]
  468. prefetch [%o0 + 0x140], #n_writes
  469. stx %g1, [%o0 + 0x80]
  470. stx %g1, [%o0 + 0x90]
  471. stx %g1, [%o0 + 0xa0]
  472. stx %g1, [%o0 + 0xb0]
  473. prefetch [%o0 + 0x180], #n_writes
  474. stx %g1, [%o0 + 0xc0]
  475. stx %g1, [%o0 + 0xd0]
  476. stx %g1, [%o0 + 0xe0]
  477. stx %g1, [%o0 + 0xf0]
  478. subcc %o1, 0x100, %o1
  479. bne,pt %xcc, 1b
  480. add %o0, 0x100, %o0
  481. retl
  482. nop
  483. nop
  484. nop
  485. .size tsb_init, .-tsb_init
  486. .globl NGtsb_init
  487. .type NGtsb_init,#function
  488. NGtsb_init:
  489. rd %asi, %g2
  490. mov 1, %g1
  491. wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
  492. sllx %g1, TSB_TAG_INVALID_BIT, %g1
  493. 1: stxa %g1, [%o0 + 0x00] %asi
  494. stxa %g1, [%o0 + 0x10] %asi
  495. stxa %g1, [%o0 + 0x20] %asi
  496. stxa %g1, [%o0 + 0x30] %asi
  497. stxa %g1, [%o0 + 0x40] %asi
  498. stxa %g1, [%o0 + 0x50] %asi
  499. stxa %g1, [%o0 + 0x60] %asi
  500. stxa %g1, [%o0 + 0x70] %asi
  501. stxa %g1, [%o0 + 0x80] %asi
  502. stxa %g1, [%o0 + 0x90] %asi
  503. stxa %g1, [%o0 + 0xa0] %asi
  504. stxa %g1, [%o0 + 0xb0] %asi
  505. stxa %g1, [%o0 + 0xc0] %asi
  506. stxa %g1, [%o0 + 0xd0] %asi
  507. stxa %g1, [%o0 + 0xe0] %asi
  508. stxa %g1, [%o0 + 0xf0] %asi
  509. subcc %o1, 0x100, %o1
  510. bne,pt %xcc, 1b
  511. add %o0, 0x100, %o0
  512. membar #Sync
  513. retl
  514. wr %g2, 0x0, %asi
  515. .size NGtsb_init, .-NGtsb_init