process.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. #include <linux/errno.h>
  2. #include <linux/kernel.h>
  3. #include <linux/mm.h>
  4. #include <linux/smp.h>
  5. #include <linux/prctl.h>
  6. #include <linux/slab.h>
  7. #include <linux/sched.h>
  8. #include <linux/module.h>
  9. #include <linux/pm.h>
  10. #include <linux/clockchips.h>
  11. #include <linux/random.h>
  12. #include <linux/user-return-notifier.h>
  13. #include <linux/dmi.h>
  14. #include <linux/utsname.h>
  15. #include <trace/events/power.h>
  16. #include <linux/hw_breakpoint.h>
  17. #include <asm/cpu.h>
  18. #include <asm/system.h>
  19. #include <asm/apic.h>
  20. #include <asm/syscalls.h>
  21. #include <asm/idle.h>
  22. #include <asm/uaccess.h>
  23. #include <asm/i387.h>
  24. #include <asm/fpu-internal.h>
  25. #include <asm/debugreg.h>
  26. struct kmem_cache *task_xstate_cachep;
  27. EXPORT_SYMBOL_GPL(task_xstate_cachep);
  28. int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
  29. {
  30. int ret;
  31. *dst = *src;
  32. if (fpu_allocated(&src->thread.fpu)) {
  33. memset(&dst->thread.fpu, 0, sizeof(dst->thread.fpu));
  34. ret = fpu_alloc(&dst->thread.fpu);
  35. if (ret)
  36. return ret;
  37. fpu_copy(&dst->thread.fpu, &src->thread.fpu);
  38. }
  39. return 0;
  40. }
  41. void free_thread_xstate(struct task_struct *tsk)
  42. {
  43. fpu_free(&tsk->thread.fpu);
  44. }
  45. void free_thread_info(struct thread_info *ti)
  46. {
  47. free_thread_xstate(ti->task);
  48. free_pages((unsigned long)ti, THREAD_ORDER);
  49. }
  50. void arch_task_cache_init(void)
  51. {
  52. task_xstate_cachep =
  53. kmem_cache_create("task_xstate", xstate_size,
  54. __alignof__(union thread_xstate),
  55. SLAB_PANIC | SLAB_NOTRACK, NULL);
  56. }
  57. /*
  58. * Free current thread data structures etc..
  59. */
  60. void exit_thread(void)
  61. {
  62. struct task_struct *me = current;
  63. struct thread_struct *t = &me->thread;
  64. unsigned long *bp = t->io_bitmap_ptr;
  65. if (bp) {
  66. struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
  67. t->io_bitmap_ptr = NULL;
  68. clear_thread_flag(TIF_IO_BITMAP);
  69. /*
  70. * Careful, clear this in the TSS too:
  71. */
  72. memset(tss->io_bitmap, 0xff, t->io_bitmap_max);
  73. t->io_bitmap_max = 0;
  74. put_cpu();
  75. kfree(bp);
  76. }
  77. }
  78. void show_regs(struct pt_regs *regs)
  79. {
  80. show_registers(regs);
  81. show_trace(NULL, regs, (unsigned long *)kernel_stack_pointer(regs), 0);
  82. }
  83. void show_regs_common(void)
  84. {
  85. const char *vendor, *product, *board;
  86. vendor = dmi_get_system_info(DMI_SYS_VENDOR);
  87. if (!vendor)
  88. vendor = "";
  89. product = dmi_get_system_info(DMI_PRODUCT_NAME);
  90. if (!product)
  91. product = "";
  92. /* Board Name is optional */
  93. board = dmi_get_system_info(DMI_BOARD_NAME);
  94. printk(KERN_CONT "\n");
  95. printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s",
  96. current->pid, current->comm, print_tainted(),
  97. init_utsname()->release,
  98. (int)strcspn(init_utsname()->version, " "),
  99. init_utsname()->version);
  100. printk(KERN_CONT " %s %s", vendor, product);
  101. if (board)
  102. printk(KERN_CONT "/%s", board);
  103. printk(KERN_CONT "\n");
  104. }
  105. void flush_thread(void)
  106. {
  107. struct task_struct *tsk = current;
  108. flush_ptrace_hw_breakpoint(tsk);
  109. memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
  110. /*
  111. * Forget coprocessor state..
  112. */
  113. tsk->fpu_counter = 0;
  114. clear_fpu(tsk);
  115. clear_used_math();
  116. }
  117. static void hard_disable_TSC(void)
  118. {
  119. write_cr4(read_cr4() | X86_CR4_TSD);
  120. }
  121. void disable_TSC(void)
  122. {
  123. preempt_disable();
  124. if (!test_and_set_thread_flag(TIF_NOTSC))
  125. /*
  126. * Must flip the CPU state synchronously with
  127. * TIF_NOTSC in the current running context.
  128. */
  129. hard_disable_TSC();
  130. preempt_enable();
  131. }
  132. static void hard_enable_TSC(void)
  133. {
  134. write_cr4(read_cr4() & ~X86_CR4_TSD);
  135. }
  136. static void enable_TSC(void)
  137. {
  138. preempt_disable();
  139. if (test_and_clear_thread_flag(TIF_NOTSC))
  140. /*
  141. * Must flip the CPU state synchronously with
  142. * TIF_NOTSC in the current running context.
  143. */
  144. hard_enable_TSC();
  145. preempt_enable();
  146. }
  147. int get_tsc_mode(unsigned long adr)
  148. {
  149. unsigned int val;
  150. if (test_thread_flag(TIF_NOTSC))
  151. val = PR_TSC_SIGSEGV;
  152. else
  153. val = PR_TSC_ENABLE;
  154. return put_user(val, (unsigned int __user *)adr);
  155. }
  156. int set_tsc_mode(unsigned int val)
  157. {
  158. if (val == PR_TSC_SIGSEGV)
  159. disable_TSC();
  160. else if (val == PR_TSC_ENABLE)
  161. enable_TSC();
  162. else
  163. return -EINVAL;
  164. return 0;
  165. }
  166. void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
  167. struct tss_struct *tss)
  168. {
  169. struct thread_struct *prev, *next;
  170. prev = &prev_p->thread;
  171. next = &next_p->thread;
  172. if (test_tsk_thread_flag(prev_p, TIF_BLOCKSTEP) ^
  173. test_tsk_thread_flag(next_p, TIF_BLOCKSTEP)) {
  174. unsigned long debugctl = get_debugctlmsr();
  175. debugctl &= ~DEBUGCTLMSR_BTF;
  176. if (test_tsk_thread_flag(next_p, TIF_BLOCKSTEP))
  177. debugctl |= DEBUGCTLMSR_BTF;
  178. update_debugctlmsr(debugctl);
  179. }
  180. if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
  181. test_tsk_thread_flag(next_p, TIF_NOTSC)) {
  182. /* prev and next are different */
  183. if (test_tsk_thread_flag(next_p, TIF_NOTSC))
  184. hard_disable_TSC();
  185. else
  186. hard_enable_TSC();
  187. }
  188. if (test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
  189. /*
  190. * Copy the relevant range of the IO bitmap.
  191. * Normally this is 128 bytes or less:
  192. */
  193. memcpy(tss->io_bitmap, next->io_bitmap_ptr,
  194. max(prev->io_bitmap_max, next->io_bitmap_max));
  195. } else if (test_tsk_thread_flag(prev_p, TIF_IO_BITMAP)) {
  196. /*
  197. * Clear any possible leftover bits:
  198. */
  199. memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
  200. }
  201. propagate_user_return_notify(prev_p, next_p);
  202. }
  203. int sys_fork(struct pt_regs *regs)
  204. {
  205. return do_fork(SIGCHLD, regs->sp, regs, 0, NULL, NULL);
  206. }
  207. /*
  208. * This is trivial, and on the face of it looks like it
  209. * could equally well be done in user mode.
  210. *
  211. * Not so, for quite unobvious reasons - register pressure.
  212. * In user mode vfork() cannot have a stack frame, and if
  213. * done by calling the "clone()" system call directly, you
  214. * do not have enough call-clobbered registers to hold all
  215. * the information you need.
  216. */
  217. int sys_vfork(struct pt_regs *regs)
  218. {
  219. return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->sp, regs, 0,
  220. NULL, NULL);
  221. }
  222. long
  223. sys_clone(unsigned long clone_flags, unsigned long newsp,
  224. void __user *parent_tid, void __user *child_tid, struct pt_regs *regs)
  225. {
  226. if (!newsp)
  227. newsp = regs->sp;
  228. return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
  229. }
  230. /*
  231. * This gets run with %si containing the
  232. * function to call, and %di containing
  233. * the "args".
  234. */
  235. extern void kernel_thread_helper(void);
  236. /*
  237. * Create a kernel thread
  238. */
  239. int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
  240. {
  241. struct pt_regs regs;
  242. memset(&regs, 0, sizeof(regs));
  243. regs.si = (unsigned long) fn;
  244. regs.di = (unsigned long) arg;
  245. #ifdef CONFIG_X86_32
  246. regs.ds = __USER_DS;
  247. regs.es = __USER_DS;
  248. regs.fs = __KERNEL_PERCPU;
  249. regs.gs = __KERNEL_STACK_CANARY;
  250. #else
  251. regs.ss = __KERNEL_DS;
  252. #endif
  253. regs.orig_ax = -1;
  254. regs.ip = (unsigned long) kernel_thread_helper;
  255. regs.cs = __KERNEL_CS | get_kernel_rpl();
  256. regs.flags = X86_EFLAGS_IF | X86_EFLAGS_BIT1;
  257. /* Ok, create the new process.. */
  258. return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
  259. }
  260. EXPORT_SYMBOL(kernel_thread);
  261. /*
  262. * sys_execve() executes a new program.
  263. */
  264. long sys_execve(const char __user *name,
  265. const char __user *const __user *argv,
  266. const char __user *const __user *envp, struct pt_regs *regs)
  267. {
  268. long error;
  269. char *filename;
  270. filename = getname(name);
  271. error = PTR_ERR(filename);
  272. if (IS_ERR(filename))
  273. return error;
  274. error = do_execve(filename, argv, envp, regs);
  275. #ifdef CONFIG_X86_32
  276. if (error == 0) {
  277. /* Make sure we don't return using sysenter.. */
  278. set_thread_flag(TIF_IRET);
  279. }
  280. #endif
  281. putname(filename);
  282. return error;
  283. }
  284. /*
  285. * Idle related variables and functions
  286. */
  287. unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
  288. EXPORT_SYMBOL(boot_option_idle_override);
  289. /*
  290. * Powermanagement idle function, if any..
  291. */
  292. void (*pm_idle)(void);
  293. #ifdef CONFIG_APM_MODULE
  294. EXPORT_SYMBOL(pm_idle);
  295. #endif
  296. #ifdef CONFIG_X86_32
  297. /*
  298. * This halt magic was a workaround for ancient floppy DMA
  299. * wreckage. It should be safe to remove.
  300. */
  301. static int hlt_counter;
  302. void disable_hlt(void)
  303. {
  304. hlt_counter++;
  305. }
  306. EXPORT_SYMBOL(disable_hlt);
  307. void enable_hlt(void)
  308. {
  309. hlt_counter--;
  310. }
  311. EXPORT_SYMBOL(enable_hlt);
  312. static inline int hlt_use_halt(void)
  313. {
  314. return (!hlt_counter && boot_cpu_data.hlt_works_ok);
  315. }
  316. #else
  317. static inline int hlt_use_halt(void)
  318. {
  319. return 1;
  320. }
  321. #endif
  322. /*
  323. * We use this if we don't have any better
  324. * idle routine..
  325. */
  326. void default_idle(void)
  327. {
  328. if (hlt_use_halt()) {
  329. trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
  330. trace_cpu_idle_rcuidle(1, smp_processor_id());
  331. current_thread_info()->status &= ~TS_POLLING;
  332. /*
  333. * TS_POLLING-cleared state must be visible before we
  334. * test NEED_RESCHED:
  335. */
  336. smp_mb();
  337. if (!need_resched())
  338. safe_halt(); /* enables interrupts racelessly */
  339. else
  340. local_irq_enable();
  341. current_thread_info()->status |= TS_POLLING;
  342. trace_power_end_rcuidle(smp_processor_id());
  343. trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
  344. } else {
  345. local_irq_enable();
  346. /* loop is done by the caller */
  347. cpu_relax();
  348. }
  349. }
  350. #ifdef CONFIG_APM_MODULE
  351. EXPORT_SYMBOL(default_idle);
  352. #endif
  353. bool set_pm_idle_to_default(void)
  354. {
  355. bool ret = !!pm_idle;
  356. pm_idle = default_idle;
  357. return ret;
  358. }
  359. void stop_this_cpu(void *dummy)
  360. {
  361. local_irq_disable();
  362. /*
  363. * Remove this CPU:
  364. */
  365. set_cpu_online(smp_processor_id(), false);
  366. disable_local_APIC();
  367. for (;;) {
  368. if (hlt_works(smp_processor_id()))
  369. halt();
  370. }
  371. }
  372. static void do_nothing(void *unused)
  373. {
  374. }
  375. /*
  376. * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
  377. * pm_idle and update to new pm_idle value. Required while changing pm_idle
  378. * handler on SMP systems.
  379. *
  380. * Caller must have changed pm_idle to the new value before the call. Old
  381. * pm_idle value will not be used by any CPU after the return of this function.
  382. */
  383. void cpu_idle_wait(void)
  384. {
  385. smp_mb();
  386. /* kick all the CPUs so that they exit out of pm_idle */
  387. smp_call_function(do_nothing, NULL, 1);
  388. }
  389. EXPORT_SYMBOL_GPL(cpu_idle_wait);
  390. /* Default MONITOR/MWAIT with no hints, used for default C1 state */
  391. static void mwait_idle(void)
  392. {
  393. if (!need_resched()) {
  394. trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
  395. trace_cpu_idle_rcuidle(1, smp_processor_id());
  396. if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
  397. clflush((void *)&current_thread_info()->flags);
  398. __monitor((void *)&current_thread_info()->flags, 0, 0);
  399. smp_mb();
  400. if (!need_resched())
  401. __sti_mwait(0, 0);
  402. else
  403. local_irq_enable();
  404. trace_power_end_rcuidle(smp_processor_id());
  405. trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
  406. } else
  407. local_irq_enable();
  408. }
  409. /*
  410. * On SMP it's slightly faster (but much more power-consuming!)
  411. * to poll the ->work.need_resched flag instead of waiting for the
  412. * cross-CPU IPI to arrive. Use this option with caution.
  413. */
  414. static void poll_idle(void)
  415. {
  416. trace_power_start_rcuidle(POWER_CSTATE, 0, smp_processor_id());
  417. trace_cpu_idle_rcuidle(0, smp_processor_id());
  418. local_irq_enable();
  419. while (!need_resched())
  420. cpu_relax();
  421. trace_power_end_rcuidle(smp_processor_id());
  422. trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
  423. }
  424. /*
  425. * mwait selection logic:
  426. *
  427. * It depends on the CPU. For AMD CPUs that support MWAIT this is
  428. * wrong. Family 0x10 and 0x11 CPUs will enter C1 on HLT. Powersavings
  429. * then depend on a clock divisor and current Pstate of the core. If
  430. * all cores of a processor are in halt state (C1) the processor can
  431. * enter the C1E (C1 enhanced) state. If mwait is used this will never
  432. * happen.
  433. *
  434. * idle=mwait overrides this decision and forces the usage of mwait.
  435. */
  436. #define MWAIT_INFO 0x05
  437. #define MWAIT_ECX_EXTENDED_INFO 0x01
  438. #define MWAIT_EDX_C1 0xf0
  439. int mwait_usable(const struct cpuinfo_x86 *c)
  440. {
  441. u32 eax, ebx, ecx, edx;
  442. if (boot_option_idle_override == IDLE_FORCE_MWAIT)
  443. return 1;
  444. if (c->cpuid_level < MWAIT_INFO)
  445. return 0;
  446. cpuid(MWAIT_INFO, &eax, &ebx, &ecx, &edx);
  447. /* Check, whether EDX has extended info about MWAIT */
  448. if (!(ecx & MWAIT_ECX_EXTENDED_INFO))
  449. return 1;
  450. /*
  451. * edx enumeratios MONITOR/MWAIT extensions. Check, whether
  452. * C1 supports MWAIT
  453. */
  454. return (edx & MWAIT_EDX_C1);
  455. }
  456. bool amd_e400_c1e_detected;
  457. EXPORT_SYMBOL(amd_e400_c1e_detected);
  458. static cpumask_var_t amd_e400_c1e_mask;
  459. void amd_e400_remove_cpu(int cpu)
  460. {
  461. if (amd_e400_c1e_mask != NULL)
  462. cpumask_clear_cpu(cpu, amd_e400_c1e_mask);
  463. }
  464. /*
  465. * AMD Erratum 400 aware idle routine. We check for C1E active in the interrupt
  466. * pending message MSR. If we detect C1E, then we handle it the same
  467. * way as C3 power states (local apic timer and TSC stop)
  468. */
  469. static void amd_e400_idle(void)
  470. {
  471. if (need_resched())
  472. return;
  473. if (!amd_e400_c1e_detected) {
  474. u32 lo, hi;
  475. rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
  476. if (lo & K8_INTP_C1E_ACTIVE_MASK) {
  477. amd_e400_c1e_detected = true;
  478. if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
  479. mark_tsc_unstable("TSC halt in AMD C1E");
  480. printk(KERN_INFO "System has AMD C1E enabled\n");
  481. }
  482. }
  483. if (amd_e400_c1e_detected) {
  484. int cpu = smp_processor_id();
  485. if (!cpumask_test_cpu(cpu, amd_e400_c1e_mask)) {
  486. cpumask_set_cpu(cpu, amd_e400_c1e_mask);
  487. /*
  488. * Force broadcast so ACPI can not interfere.
  489. */
  490. clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
  491. &cpu);
  492. printk(KERN_INFO "Switch to broadcast mode on CPU%d\n",
  493. cpu);
  494. }
  495. clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
  496. default_idle();
  497. /*
  498. * The switch back from broadcast mode needs to be
  499. * called with interrupts disabled.
  500. */
  501. local_irq_disable();
  502. clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
  503. local_irq_enable();
  504. } else
  505. default_idle();
  506. }
  507. void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
  508. {
  509. #ifdef CONFIG_SMP
  510. if (pm_idle == poll_idle && smp_num_siblings > 1) {
  511. printk_once(KERN_WARNING "WARNING: polling idle and HT enabled,"
  512. " performance may degrade.\n");
  513. }
  514. #endif
  515. if (pm_idle)
  516. return;
  517. if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
  518. /*
  519. * One CPU supports mwait => All CPUs supports mwait
  520. */
  521. printk(KERN_INFO "using mwait in idle threads.\n");
  522. pm_idle = mwait_idle;
  523. } else if (cpu_has_amd_erratum(amd_erratum_400)) {
  524. /* E400: APIC timer interrupt does not wake up CPU from C1e */
  525. printk(KERN_INFO "using AMD E400 aware idle routine\n");
  526. pm_idle = amd_e400_idle;
  527. } else
  528. pm_idle = default_idle;
  529. }
  530. void __init init_amd_e400_c1e_mask(void)
  531. {
  532. /* If we're using amd_e400_idle, we need to allocate amd_e400_c1e_mask. */
  533. if (pm_idle == amd_e400_idle)
  534. zalloc_cpumask_var(&amd_e400_c1e_mask, GFP_KERNEL);
  535. }
  536. static int __init idle_setup(char *str)
  537. {
  538. if (!str)
  539. return -EINVAL;
  540. if (!strcmp(str, "poll")) {
  541. printk("using polling idle threads.\n");
  542. pm_idle = poll_idle;
  543. boot_option_idle_override = IDLE_POLL;
  544. } else if (!strcmp(str, "mwait")) {
  545. boot_option_idle_override = IDLE_FORCE_MWAIT;
  546. WARN_ONCE(1, "\"idle=mwait\" will be removed in 2012\n");
  547. } else if (!strcmp(str, "halt")) {
  548. /*
  549. * When the boot option of idle=halt is added, halt is
  550. * forced to be used for CPU idle. In such case CPU C2/C3
  551. * won't be used again.
  552. * To continue to load the CPU idle driver, don't touch
  553. * the boot_option_idle_override.
  554. */
  555. pm_idle = default_idle;
  556. boot_option_idle_override = IDLE_HALT;
  557. } else if (!strcmp(str, "nomwait")) {
  558. /*
  559. * If the boot option of "idle=nomwait" is added,
  560. * it means that mwait will be disabled for CPU C2/C3
  561. * states. In such case it won't touch the variable
  562. * of boot_option_idle_override.
  563. */
  564. boot_option_idle_override = IDLE_NOMWAIT;
  565. } else
  566. return -1;
  567. return 0;
  568. }
  569. early_param("idle", idle_setup);
  570. unsigned long arch_align_stack(unsigned long sp)
  571. {
  572. if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
  573. sp -= get_random_int() % 8192;
  574. return sp & ~0xf;
  575. }
  576. unsigned long arch_randomize_brk(struct mm_struct *mm)
  577. {
  578. unsigned long range_end = mm->brk + 0x02000000;
  579. return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
  580. }