smp.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. /*
  2. * linux/arch/arm/kernel/smp.c
  3. *
  4. * Copyright (C) 2002 ARM Limited, All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/module.h>
  11. #include <linux/delay.h>
  12. #include <linux/init.h>
  13. #include <linux/spinlock.h>
  14. #include <linux/sched.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/cache.h>
  17. #include <linux/profile.h>
  18. #include <linux/errno.h>
  19. #include <linux/mm.h>
  20. #include <linux/err.h>
  21. #include <linux/cpu.h>
  22. #include <linux/smp.h>
  23. #include <linux/seq_file.h>
  24. #include <linux/irq.h>
  25. #include <asm/atomic.h>
  26. #include <asm/cacheflush.h>
  27. #include <asm/cpu.h>
  28. #include <asm/mmu_context.h>
  29. #include <asm/pgtable.h>
  30. #include <asm/pgalloc.h>
  31. #include <asm/processor.h>
  32. #include <asm/tlbflush.h>
  33. #include <asm/ptrace.h>
  34. /*
  35. * bitmask of present and online CPUs.
  36. * The present bitmask indicates that the CPU is physically present.
  37. * The online bitmask indicates that the CPU is up and running.
  38. */
  39. cpumask_t cpu_possible_map;
  40. EXPORT_SYMBOL(cpu_possible_map);
  41. cpumask_t cpu_online_map;
  42. EXPORT_SYMBOL(cpu_online_map);
  43. /*
  44. * as from 2.5, kernels no longer have an init_tasks structure
  45. * so we need some other way of telling a new secondary core
  46. * where to place its SVC stack
  47. */
  48. struct secondary_data secondary_data;
  49. /*
  50. * structures for inter-processor calls
  51. * - A collection of single bit ipi messages.
  52. */
  53. struct ipi_data {
  54. spinlock_t lock;
  55. unsigned long ipi_count;
  56. unsigned long bits;
  57. };
  58. static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
  59. .lock = SPIN_LOCK_UNLOCKED,
  60. };
  61. enum ipi_msg_type {
  62. IPI_TIMER,
  63. IPI_RESCHEDULE,
  64. IPI_CALL_FUNC,
  65. IPI_CPU_STOP,
  66. };
  67. struct smp_call_struct {
  68. void (*func)(void *info);
  69. void *info;
  70. int wait;
  71. cpumask_t pending;
  72. cpumask_t unfinished;
  73. };
  74. static struct smp_call_struct * volatile smp_call_function_data;
  75. static DEFINE_SPINLOCK(smp_call_function_lock);
  76. int __cpuinit __cpu_up(unsigned int cpu)
  77. {
  78. struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
  79. struct task_struct *idle = ci->idle;
  80. pgd_t *pgd;
  81. pmd_t *pmd;
  82. int ret;
  83. /*
  84. * Spawn a new process manually, if not already done.
  85. * Grab a pointer to its task struct so we can mess with it
  86. */
  87. if (!idle) {
  88. idle = fork_idle(cpu);
  89. if (IS_ERR(idle)) {
  90. printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
  91. return PTR_ERR(idle);
  92. }
  93. ci->idle = idle;
  94. }
  95. /*
  96. * Allocate initial page tables to allow the new CPU to
  97. * enable the MMU safely. This essentially means a set
  98. * of our "standard" page tables, with the addition of
  99. * a 1:1 mapping for the physical address of the kernel.
  100. */
  101. pgd = pgd_alloc(&init_mm);
  102. pmd = pmd_offset(pgd, PHYS_OFFSET);
  103. *pmd = __pmd((PHYS_OFFSET & PGDIR_MASK) |
  104. PMD_TYPE_SECT | PMD_SECT_AP_WRITE);
  105. /*
  106. * We need to tell the secondary core where to find
  107. * its stack and the page tables.
  108. */
  109. secondary_data.stack = task_stack_page(idle) + THREAD_START_SP;
  110. secondary_data.pgdir = virt_to_phys(pgd);
  111. wmb();
  112. /*
  113. * Now bring the CPU into our world.
  114. */
  115. ret = boot_secondary(cpu, idle);
  116. if (ret == 0) {
  117. unsigned long timeout;
  118. /*
  119. * CPU was successfully started, wait for it
  120. * to come online or time out.
  121. */
  122. timeout = jiffies + HZ;
  123. while (time_before(jiffies, timeout)) {
  124. if (cpu_online(cpu))
  125. break;
  126. udelay(10);
  127. barrier();
  128. }
  129. if (!cpu_online(cpu))
  130. ret = -EIO;
  131. }
  132. secondary_data.stack = NULL;
  133. secondary_data.pgdir = 0;
  134. *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0);
  135. pgd_free(&init_mm, pgd);
  136. if (ret) {
  137. printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu);
  138. /*
  139. * FIXME: We need to clean up the new idle thread. --rmk
  140. */
  141. }
  142. return ret;
  143. }
  144. #ifdef CONFIG_HOTPLUG_CPU
  145. /*
  146. * __cpu_disable runs on the processor to be shutdown.
  147. */
  148. int __cpuexit __cpu_disable(void)
  149. {
  150. unsigned int cpu = smp_processor_id();
  151. struct task_struct *p;
  152. int ret;
  153. ret = mach_cpu_disable(cpu);
  154. if (ret)
  155. return ret;
  156. /*
  157. * Take this CPU offline. Once we clear this, we can't return,
  158. * and we must not schedule until we're ready to give up the cpu.
  159. */
  160. cpu_clear(cpu, cpu_online_map);
  161. /*
  162. * OK - migrate IRQs away from this CPU
  163. */
  164. migrate_irqs();
  165. /*
  166. * Stop the local timer for this CPU.
  167. */
  168. local_timer_stop(cpu);
  169. /*
  170. * Flush user cache and TLB mappings, and then remove this CPU
  171. * from the vm mask set of all processes.
  172. */
  173. flush_cache_all();
  174. local_flush_tlb_all();
  175. read_lock(&tasklist_lock);
  176. for_each_process(p) {
  177. if (p->mm)
  178. cpu_clear(cpu, p->mm->cpu_vm_mask);
  179. }
  180. read_unlock(&tasklist_lock);
  181. return 0;
  182. }
  183. /*
  184. * called on the thread which is asking for a CPU to be shutdown -
  185. * waits until shutdown has completed, or it is timed out.
  186. */
  187. void __cpuexit __cpu_die(unsigned int cpu)
  188. {
  189. if (!platform_cpu_kill(cpu))
  190. printk("CPU%u: unable to kill\n", cpu);
  191. }
  192. /*
  193. * Called from the idle thread for the CPU which has been shutdown.
  194. *
  195. * Note that we disable IRQs here, but do not re-enable them
  196. * before returning to the caller. This is also the behaviour
  197. * of the other hotplug-cpu capable cores, so presumably coming
  198. * out of idle fixes this.
  199. */
  200. void __cpuexit cpu_die(void)
  201. {
  202. unsigned int cpu = smp_processor_id();
  203. local_irq_disable();
  204. idle_task_exit();
  205. /*
  206. * actual CPU shutdown procedure is at least platform (if not
  207. * CPU) specific
  208. */
  209. platform_cpu_die(cpu);
  210. /*
  211. * Do not return to the idle loop - jump back to the secondary
  212. * cpu initialisation. There's some initialisation which needs
  213. * to be repeated to undo the effects of taking the CPU offline.
  214. */
  215. __asm__("mov sp, %0\n"
  216. " b secondary_start_kernel"
  217. :
  218. : "r" (task_stack_page(current) + THREAD_SIZE - 8));
  219. }
  220. #endif /* CONFIG_HOTPLUG_CPU */
  221. /*
  222. * This is the secondary CPU boot entry. We're using this CPUs
  223. * idle thread stack, but a set of temporary page tables.
  224. */
  225. asmlinkage void __cpuinit secondary_start_kernel(void)
  226. {
  227. struct mm_struct *mm = &init_mm;
  228. unsigned int cpu = smp_processor_id();
  229. printk("CPU%u: Booted secondary processor\n", cpu);
  230. /*
  231. * All kernel threads share the same mm context; grab a
  232. * reference and switch to it.
  233. */
  234. atomic_inc(&mm->mm_users);
  235. atomic_inc(&mm->mm_count);
  236. current->active_mm = mm;
  237. cpu_set(cpu, mm->cpu_vm_mask);
  238. cpu_switch_mm(mm->pgd, mm);
  239. enter_lazy_tlb(mm, current);
  240. local_flush_tlb_all();
  241. cpu_init();
  242. preempt_disable();
  243. /*
  244. * Give the platform a chance to do its own initialisation.
  245. */
  246. platform_secondary_init(cpu);
  247. /*
  248. * Enable local interrupts.
  249. */
  250. local_irq_enable();
  251. local_fiq_enable();
  252. /*
  253. * Setup local timer for this CPU.
  254. */
  255. local_timer_setup(cpu);
  256. calibrate_delay();
  257. smp_store_cpu_info(cpu);
  258. /*
  259. * OK, now it's safe to let the boot CPU continue
  260. */
  261. cpu_set(cpu, cpu_online_map);
  262. /*
  263. * OK, it's off to the idle thread for us
  264. */
  265. cpu_idle();
  266. }
  267. /*
  268. * Called by both boot and secondaries to move global data into
  269. * per-processor storage.
  270. */
  271. void __cpuinit smp_store_cpu_info(unsigned int cpuid)
  272. {
  273. struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
  274. cpu_info->loops_per_jiffy = loops_per_jiffy;
  275. }
  276. void __init smp_cpus_done(unsigned int max_cpus)
  277. {
  278. int cpu;
  279. unsigned long bogosum = 0;
  280. for_each_online_cpu(cpu)
  281. bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
  282. printk(KERN_INFO "SMP: Total of %d processors activated "
  283. "(%lu.%02lu BogoMIPS).\n",
  284. num_online_cpus(),
  285. bogosum / (500000/HZ),
  286. (bogosum / (5000/HZ)) % 100);
  287. }
  288. void __init smp_prepare_boot_cpu(void)
  289. {
  290. unsigned int cpu = smp_processor_id();
  291. per_cpu(cpu_data, cpu).idle = current;
  292. }
  293. static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
  294. {
  295. unsigned long flags;
  296. unsigned int cpu;
  297. local_irq_save(flags);
  298. for_each_cpu_mask(cpu, callmap) {
  299. struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
  300. spin_lock(&ipi->lock);
  301. ipi->bits |= 1 << msg;
  302. spin_unlock(&ipi->lock);
  303. }
  304. /*
  305. * Call the platform specific cross-CPU call function.
  306. */
  307. smp_cross_call(callmap);
  308. local_irq_restore(flags);
  309. }
  310. /*
  311. * You must not call this function with disabled interrupts, from a
  312. * hardware interrupt handler, nor from a bottom half handler.
  313. */
  314. static int smp_call_function_on_cpu(void (*func)(void *info), void *info,
  315. int retry, int wait, cpumask_t callmap)
  316. {
  317. struct smp_call_struct data;
  318. unsigned long timeout;
  319. int ret = 0;
  320. data.func = func;
  321. data.info = info;
  322. data.wait = wait;
  323. cpu_clear(smp_processor_id(), callmap);
  324. if (cpus_empty(callmap))
  325. goto out;
  326. data.pending = callmap;
  327. if (wait)
  328. data.unfinished = callmap;
  329. /*
  330. * try to get the mutex on smp_call_function_data
  331. */
  332. spin_lock(&smp_call_function_lock);
  333. smp_call_function_data = &data;
  334. send_ipi_message(callmap, IPI_CALL_FUNC);
  335. timeout = jiffies + HZ;
  336. while (!cpus_empty(data.pending) && time_before(jiffies, timeout))
  337. barrier();
  338. /*
  339. * did we time out?
  340. */
  341. if (!cpus_empty(data.pending)) {
  342. /*
  343. * this may be causing our panic - report it
  344. */
  345. printk(KERN_CRIT
  346. "CPU%u: smp_call_function timeout for %p(%p)\n"
  347. " callmap %lx pending %lx, %swait\n",
  348. smp_processor_id(), func, info, *cpus_addr(callmap),
  349. *cpus_addr(data.pending), wait ? "" : "no ");
  350. /*
  351. * TRACE
  352. */
  353. timeout = jiffies + (5 * HZ);
  354. while (!cpus_empty(data.pending) && time_before(jiffies, timeout))
  355. barrier();
  356. if (cpus_empty(data.pending))
  357. printk(KERN_CRIT " RESOLVED\n");
  358. else
  359. printk(KERN_CRIT " STILL STUCK\n");
  360. }
  361. /*
  362. * whatever happened, we're done with the data, so release it
  363. */
  364. smp_call_function_data = NULL;
  365. spin_unlock(&smp_call_function_lock);
  366. if (!cpus_empty(data.pending)) {
  367. ret = -ETIMEDOUT;
  368. goto out;
  369. }
  370. if (wait)
  371. while (!cpus_empty(data.unfinished))
  372. barrier();
  373. out:
  374. return 0;
  375. }
  376. int smp_call_function(void (*func)(void *info), void *info, int retry,
  377. int wait)
  378. {
  379. return smp_call_function_on_cpu(func, info, retry, wait,
  380. cpu_online_map);
  381. }
  382. EXPORT_SYMBOL_GPL(smp_call_function);
  383. int smp_call_function_single(int cpu, void (*func)(void *info), void *info,
  384. int retry, int wait)
  385. {
  386. /* prevent preemption and reschedule on another processor */
  387. int current_cpu = get_cpu();
  388. int ret = 0;
  389. if (cpu == current_cpu) {
  390. local_irq_disable();
  391. func(info);
  392. local_irq_enable();
  393. } else
  394. ret = smp_call_function_on_cpu(func, info, retry, wait,
  395. cpumask_of_cpu(cpu));
  396. put_cpu();
  397. return ret;
  398. }
  399. EXPORT_SYMBOL_GPL(smp_call_function_single);
  400. void show_ipi_list(struct seq_file *p)
  401. {
  402. unsigned int cpu;
  403. seq_puts(p, "IPI:");
  404. for_each_present_cpu(cpu)
  405. seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count);
  406. seq_putc(p, '\n');
  407. }
  408. void show_local_irqs(struct seq_file *p)
  409. {
  410. unsigned int cpu;
  411. seq_printf(p, "LOC: ");
  412. for_each_present_cpu(cpu)
  413. seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs);
  414. seq_putc(p, '\n');
  415. }
  416. static void ipi_timer(void)
  417. {
  418. irq_enter();
  419. local_timer_interrupt();
  420. irq_exit();
  421. }
  422. #ifdef CONFIG_LOCAL_TIMERS
  423. asmlinkage void __exception do_local_timer(struct pt_regs *regs)
  424. {
  425. struct pt_regs *old_regs = set_irq_regs(regs);
  426. int cpu = smp_processor_id();
  427. if (local_timer_ack()) {
  428. irq_stat[cpu].local_timer_irqs++;
  429. ipi_timer();
  430. }
  431. set_irq_regs(old_regs);
  432. }
  433. #endif
  434. /*
  435. * ipi_call_function - handle IPI from smp_call_function()
  436. *
  437. * Note that we copy data out of the cross-call structure and then
  438. * let the caller know that we're here and have done with their data
  439. */
  440. static void ipi_call_function(unsigned int cpu)
  441. {
  442. struct smp_call_struct *data = smp_call_function_data;
  443. void (*func)(void *info) = data->func;
  444. void *info = data->info;
  445. int wait = data->wait;
  446. cpu_clear(cpu, data->pending);
  447. func(info);
  448. if (wait)
  449. cpu_clear(cpu, data->unfinished);
  450. }
  451. static DEFINE_SPINLOCK(stop_lock);
  452. /*
  453. * ipi_cpu_stop - handle IPI from smp_send_stop()
  454. */
  455. static void ipi_cpu_stop(unsigned int cpu)
  456. {
  457. spin_lock(&stop_lock);
  458. printk(KERN_CRIT "CPU%u: stopping\n", cpu);
  459. dump_stack();
  460. spin_unlock(&stop_lock);
  461. cpu_clear(cpu, cpu_online_map);
  462. local_fiq_disable();
  463. local_irq_disable();
  464. while (1)
  465. cpu_relax();
  466. }
  467. /*
  468. * Main handler for inter-processor interrupts
  469. *
  470. * For ARM, the ipimask now only identifies a single
  471. * category of IPI (Bit 1 IPIs have been replaced by a
  472. * different mechanism):
  473. *
  474. * Bit 0 - Inter-processor function call
  475. */
  476. asmlinkage void __exception do_IPI(struct pt_regs *regs)
  477. {
  478. unsigned int cpu = smp_processor_id();
  479. struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
  480. struct pt_regs *old_regs = set_irq_regs(regs);
  481. ipi->ipi_count++;
  482. for (;;) {
  483. unsigned long msgs;
  484. spin_lock(&ipi->lock);
  485. msgs = ipi->bits;
  486. ipi->bits = 0;
  487. spin_unlock(&ipi->lock);
  488. if (!msgs)
  489. break;
  490. do {
  491. unsigned nextmsg;
  492. nextmsg = msgs & -msgs;
  493. msgs &= ~nextmsg;
  494. nextmsg = ffz(~nextmsg);
  495. switch (nextmsg) {
  496. case IPI_TIMER:
  497. ipi_timer();
  498. break;
  499. case IPI_RESCHEDULE:
  500. /*
  501. * nothing more to do - eveything is
  502. * done on the interrupt return path
  503. */
  504. break;
  505. case IPI_CALL_FUNC:
  506. ipi_call_function(cpu);
  507. break;
  508. case IPI_CPU_STOP:
  509. ipi_cpu_stop(cpu);
  510. break;
  511. default:
  512. printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
  513. cpu, nextmsg);
  514. break;
  515. }
  516. } while (msgs);
  517. }
  518. set_irq_regs(old_regs);
  519. }
  520. void smp_send_reschedule(int cpu)
  521. {
  522. send_ipi_message(cpumask_of_cpu(cpu), IPI_RESCHEDULE);
  523. }
  524. void smp_send_timer(void)
  525. {
  526. cpumask_t mask = cpu_online_map;
  527. cpu_clear(smp_processor_id(), mask);
  528. send_ipi_message(mask, IPI_TIMER);
  529. }
  530. void smp_timer_broadcast(cpumask_t mask)
  531. {
  532. send_ipi_message(mask, IPI_TIMER);
  533. }
  534. void smp_send_stop(void)
  535. {
  536. cpumask_t mask = cpu_online_map;
  537. cpu_clear(smp_processor_id(), mask);
  538. send_ipi_message(mask, IPI_CPU_STOP);
  539. }
  540. /*
  541. * not supported here
  542. */
  543. int setup_profiling_timer(unsigned int multiplier)
  544. {
  545. return -EINVAL;
  546. }
  547. static int
  548. on_each_cpu_mask(void (*func)(void *), void *info, int retry, int wait,
  549. cpumask_t mask)
  550. {
  551. int ret = 0;
  552. preempt_disable();
  553. ret = smp_call_function_on_cpu(func, info, retry, wait, mask);
  554. if (cpu_isset(smp_processor_id(), mask))
  555. func(info);
  556. preempt_enable();
  557. return ret;
  558. }
  559. /**********************************************************************/
  560. /*
  561. * TLB operations
  562. */
  563. struct tlb_args {
  564. struct vm_area_struct *ta_vma;
  565. unsigned long ta_start;
  566. unsigned long ta_end;
  567. };
  568. static inline void ipi_flush_tlb_all(void *ignored)
  569. {
  570. local_flush_tlb_all();
  571. }
  572. static inline void ipi_flush_tlb_mm(void *arg)
  573. {
  574. struct mm_struct *mm = (struct mm_struct *)arg;
  575. local_flush_tlb_mm(mm);
  576. }
  577. static inline void ipi_flush_tlb_page(void *arg)
  578. {
  579. struct tlb_args *ta = (struct tlb_args *)arg;
  580. local_flush_tlb_page(ta->ta_vma, ta->ta_start);
  581. }
  582. static inline void ipi_flush_tlb_kernel_page(void *arg)
  583. {
  584. struct tlb_args *ta = (struct tlb_args *)arg;
  585. local_flush_tlb_kernel_page(ta->ta_start);
  586. }
  587. static inline void ipi_flush_tlb_range(void *arg)
  588. {
  589. struct tlb_args *ta = (struct tlb_args *)arg;
  590. local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
  591. }
  592. static inline void ipi_flush_tlb_kernel_range(void *arg)
  593. {
  594. struct tlb_args *ta = (struct tlb_args *)arg;
  595. local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end);
  596. }
  597. void flush_tlb_all(void)
  598. {
  599. on_each_cpu(ipi_flush_tlb_all, NULL, 1, 1);
  600. }
  601. void flush_tlb_mm(struct mm_struct *mm)
  602. {
  603. cpumask_t mask = mm->cpu_vm_mask;
  604. on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, 1, mask);
  605. }
  606. void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
  607. {
  608. cpumask_t mask = vma->vm_mm->cpu_vm_mask;
  609. struct tlb_args ta;
  610. ta.ta_vma = vma;
  611. ta.ta_start = uaddr;
  612. on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, 1, mask);
  613. }
  614. void flush_tlb_kernel_page(unsigned long kaddr)
  615. {
  616. struct tlb_args ta;
  617. ta.ta_start = kaddr;
  618. on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1, 1);
  619. }
  620. void flush_tlb_range(struct vm_area_struct *vma,
  621. unsigned long start, unsigned long end)
  622. {
  623. cpumask_t mask = vma->vm_mm->cpu_vm_mask;
  624. struct tlb_args ta;
  625. ta.ta_vma = vma;
  626. ta.ta_start = start;
  627. ta.ta_end = end;
  628. on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, 1, mask);
  629. }
  630. void flush_tlb_kernel_range(unsigned long start, unsigned long end)
  631. {
  632. struct tlb_args ta;
  633. ta.ta_start = start;
  634. ta.ta_end = end;
  635. on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1, 1);
  636. }