1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 * 5 * Derived from MIPS: 6 * Copyright (C) 2000, 2001 Kanoj Sarcar 7 * Copyright (C) 2000, 2001 Ralf Baechle 8 * Copyright (C) 2000, 2001 Silicon Graphics, Inc. 9 * Copyright (C) 2000, 2001, 2003 Broadcom Corporation 10 */ 11 #include <linux/acpi.h> 12 #include <linux/cpu.h> 13 #include <linux/cpumask.h> 14 #include <linux/init.h> 15 #include <linux/interrupt.h> 16 #include <linux/profile.h> 17 #include <linux/seq_file.h> 18 #include <linux/smp.h> 19 #include <linux/threads.h> 20 #include <linux/export.h> 21 #include <linux/syscore_ops.h> 22 #include <linux/time.h> 23 #include <linux/tracepoint.h> 24 #include <linux/sched/hotplug.h> 25 #include <linux/sched/task_stack.h> 26 27 #include <asm/cpu.h> 28 #include <asm/idle.h> 29 #include <asm/loongson.h> 30 #include <asm/mmu_context.h> 31 #include <asm/numa.h> 32 #include <asm/paravirt.h> 33 #include <asm/processor.h> 34 #include <asm/setup.h> 35 #include <asm/time.h> 36 37 int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 38 EXPORT_SYMBOL(__cpu_number_map); 39 40 int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ 41 EXPORT_SYMBOL(__cpu_logical_map); 42 43 /* Representing the threads (siblings) of each logical CPU */ 44 cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly; 45 EXPORT_SYMBOL(cpu_sibling_map); 46 47 /* Representing the core map of multi-core chips of each logical CPU */ 48 cpumask_t cpu_core_map[NR_CPUS] __read_mostly; 49 EXPORT_SYMBOL(cpu_core_map); 50 51 static DECLARE_COMPLETION(cpu_starting); 52 static DECLARE_COMPLETION(cpu_running); 53 54 /* 55 * A logcal cpu mask containing only one VPE per core to 56 * reduce the number of IPIs on large MT systems. 57 */ 58 cpumask_t cpu_foreign_map[NR_CPUS] __read_mostly; 59 EXPORT_SYMBOL(cpu_foreign_map); 60 61 /* representing cpus for which sibling maps can be computed */ 62 static cpumask_t cpu_sibling_setup_map; 63 64 /* representing cpus for which core maps can be computed */ 65 static cpumask_t cpu_core_setup_map; 66 67 struct secondary_data cpuboot_data; 68 static DEFINE_PER_CPU(int, cpu_state); 69 70 static const char *ipi_types[NR_IPI] __tracepoint_string = { 71 [IPI_RESCHEDULE] = "Rescheduling interrupts", 72 [IPI_CALL_FUNCTION] = "Function call interrupts", 73 }; 74 75 void show_ipi_list(struct seq_file *p, int prec) 76 { 77 unsigned int cpu, i; 78 79 for (i = 0; i < NR_IPI; i++) { 80 seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >= 4 ? " " : ""); 81 for_each_online_cpu(cpu) 82 seq_printf(p, "%10u ", per_cpu(irq_stat, cpu).ipi_irqs[i]); 83 seq_printf(p, " LoongArch %d %s\n", i + 1, ipi_types[i]); 84 } 85 } 86 87 static inline void set_cpu_core_map(int cpu) 88 { 89 int i; 90 91 cpumask_set_cpu(cpu, &cpu_core_setup_map); 92 93 for_each_cpu(i, &cpu_core_setup_map) { 94 if (cpu_data[cpu].package == cpu_data[i].package) { 95 cpumask_set_cpu(i, &cpu_core_map[cpu]); 96 cpumask_set_cpu(cpu, &cpu_core_map[i]); 97 } 98 } 99 } 100 101 static inline void set_cpu_sibling_map(int cpu) 102 { 103 int i; 104 105 cpumask_set_cpu(cpu, &cpu_sibling_setup_map); 106 107 for_each_cpu(i, &cpu_sibling_setup_map) { 108 if (cpus_are_siblings(cpu, i)) { 109 cpumask_set_cpu(i, &cpu_sibling_map[cpu]); 110 cpumask_set_cpu(cpu, &cpu_sibling_map[i]); 111 } 112 } 113 } 114 115 static inline void clear_cpu_sibling_map(int cpu) 116 { 117 int i; 118 119 for_each_cpu(i, &cpu_sibling_setup_map) { 120 if (cpus_are_siblings(cpu, i)) { 121 cpumask_clear_cpu(i, &cpu_sibling_map[cpu]); 122 cpumask_clear_cpu(cpu, &cpu_sibling_map[i]); 123 } 124 } 125 126 cpumask_clear_cpu(cpu, &cpu_sibling_setup_map); 127 } 128 129 /* 130 * Calculate a new cpu_foreign_map mask whenever a 131 * new cpu appears or disappears. 132 */ 133 void calculate_cpu_foreign_map(void) 134 { 135 int i, k, core_present; 136 cpumask_t temp_foreign_map; 137 138 /* Re-calculate the mask */ 139 cpumask_clear(&temp_foreign_map); 140 for_each_online_cpu(i) { 141 core_present = 0; 142 for_each_cpu(k, &temp_foreign_map) 143 if (cpus_are_siblings(i, k)) 144 core_present = 1; 145 if (!core_present) 146 cpumask_set_cpu(i, &temp_foreign_map); 147 } 148 149 for_each_online_cpu(i) 150 cpumask_andnot(&cpu_foreign_map[i], 151 &temp_foreign_map, &cpu_sibling_map[i]); 152 } 153 154 /* Send mailbox buffer via Mail_Send */ 155 static void csr_mail_send(uint64_t data, int cpu, int mailbox) 156 { 157 uint64_t val; 158 159 /* Send high 32 bits */ 160 val = IOCSR_MBUF_SEND_BLOCKING; 161 val |= (IOCSR_MBUF_SEND_BOX_HI(mailbox) << IOCSR_MBUF_SEND_BOX_SHIFT); 162 val |= (cpu << IOCSR_MBUF_SEND_CPU_SHIFT); 163 val |= (data & IOCSR_MBUF_SEND_H32_MASK); 164 iocsr_write64(val, LOONGARCH_IOCSR_MBUF_SEND); 165 166 /* Send low 32 bits */ 167 val = IOCSR_MBUF_SEND_BLOCKING; 168 val |= (IOCSR_MBUF_SEND_BOX_LO(mailbox) << IOCSR_MBUF_SEND_BOX_SHIFT); 169 val |= (cpu << IOCSR_MBUF_SEND_CPU_SHIFT); 170 val |= (data << IOCSR_MBUF_SEND_BUF_SHIFT); 171 iocsr_write64(val, LOONGARCH_IOCSR_MBUF_SEND); 172 }; 173 174 static u32 ipi_read_clear(int cpu) 175 { 176 u32 action; 177 178 /* Load the ipi register to figure out what we're supposed to do */ 179 action = iocsr_read32(LOONGARCH_IOCSR_IPI_STATUS); 180 /* Clear the ipi register to clear the interrupt */ 181 iocsr_write32(action, LOONGARCH_IOCSR_IPI_CLEAR); 182 wbflush(); 183 184 return action; 185 } 186 187 static void ipi_write_action(int cpu, u32 action) 188 { 189 uint32_t val; 190 191 val = IOCSR_IPI_SEND_BLOCKING | action; 192 val |= (cpu << IOCSR_IPI_SEND_CPU_SHIFT); 193 iocsr_write32(val, LOONGARCH_IOCSR_IPI_SEND); 194 } 195 196 static void loongson_send_ipi_single(int cpu, unsigned int action) 197 { 198 ipi_write_action(cpu_logical_map(cpu), (u32)action); 199 } 200 201 static void loongson_send_ipi_mask(const struct cpumask *mask, unsigned int action) 202 { 203 unsigned int i; 204 205 for_each_cpu(i, mask) 206 ipi_write_action(cpu_logical_map(i), (u32)action); 207 } 208 209 /* 210 * This function sends a 'reschedule' IPI to another CPU. 211 * it goes straight through and wastes no time serializing 212 * anything. Worst case is that we lose a reschedule ... 213 */ 214 void arch_smp_send_reschedule(int cpu) 215 { 216 mp_ops.send_ipi_single(cpu, ACTION_RESCHEDULE); 217 } 218 EXPORT_SYMBOL_GPL(arch_smp_send_reschedule); 219 220 static irqreturn_t loongson_ipi_interrupt(int irq, void *dev) 221 { 222 unsigned int action; 223 unsigned int cpu = smp_processor_id(); 224 225 action = ipi_read_clear(cpu_logical_map(cpu)); 226 227 if (action & SMP_RESCHEDULE) { 228 scheduler_ipi(); 229 per_cpu(irq_stat, cpu).ipi_irqs[IPI_RESCHEDULE]++; 230 } 231 232 if (action & SMP_CALL_FUNCTION) { 233 generic_smp_call_function_interrupt(); 234 per_cpu(irq_stat, cpu).ipi_irqs[IPI_CALL_FUNCTION]++; 235 } 236 237 return IRQ_HANDLED; 238 } 239 240 static void loongson_init_ipi(void) 241 { 242 int r, ipi_irq; 243 244 ipi_irq = get_percpu_irq(INT_IPI); 245 if (ipi_irq < 0) 246 panic("IPI IRQ mapping failed\n"); 247 248 irq_set_percpu_devid(ipi_irq); 249 r = request_percpu_irq(ipi_irq, loongson_ipi_interrupt, "IPI", &irq_stat); 250 if (r < 0) 251 panic("IPI IRQ request failed\n"); 252 } 253 254 struct smp_ops mp_ops = { 255 .init_ipi = loongson_init_ipi, 256 .send_ipi_single = loongson_send_ipi_single, 257 .send_ipi_mask = loongson_send_ipi_mask, 258 }; 259 260 static void __init fdt_smp_setup(void) 261 { 262 #ifdef CONFIG_OF 263 unsigned int cpu, cpuid; 264 struct device_node *node = NULL; 265 266 for_each_of_cpu_node(node) { 267 if (!of_device_is_available(node)) 268 continue; 269 270 cpuid = of_get_cpu_hwid(node, 0); 271 if (cpuid >= nr_cpu_ids) 272 continue; 273 274 if (cpuid == loongson_sysconf.boot_cpu_id) { 275 cpu = 0; 276 numa_add_cpu(cpu); 277 } else { 278 cpu = cpumask_next_zero(-1, cpu_present_mask); 279 } 280 281 num_processors++; 282 set_cpu_possible(cpu, true); 283 set_cpu_present(cpu, true); 284 __cpu_number_map[cpuid] = cpu; 285 __cpu_logical_map[cpu] = cpuid; 286 } 287 288 loongson_sysconf.nr_cpus = num_processors; 289 set_bit(0, loongson_sysconf.cores_io_master); 290 #endif 291 } 292 293 void __init loongson_smp_setup(void) 294 { 295 fdt_smp_setup(); 296 297 if (loongson_sysconf.cores_per_package == 0) 298 loongson_sysconf.cores_per_package = num_processors; 299 300 cpu_data[0].core = cpu_logical_map(0) % loongson_sysconf.cores_per_package; 301 cpu_data[0].package = cpu_logical_map(0) / loongson_sysconf.cores_per_package; 302 303 pv_ipi_init(); 304 iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_EN); 305 pr_info("Detected %i available CPU(s)\n", loongson_sysconf.nr_cpus); 306 } 307 308 void __init loongson_prepare_cpus(unsigned int max_cpus) 309 { 310 int i = 0; 311 312 parse_acpi_topology(); 313 314 for (i = 0; i < loongson_sysconf.nr_cpus; i++) { 315 set_cpu_present(i, true); 316 csr_mail_send(0, __cpu_logical_map[i], 0); 317 cpu_data[i].global_id = __cpu_logical_map[i]; 318 } 319 320 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 321 } 322 323 /* 324 * Setup the PC, SP, and TP of a secondary processor and start it running! 325 */ 326 void loongson_boot_secondary(int cpu, struct task_struct *idle) 327 { 328 unsigned long entry; 329 330 pr_info("Booting CPU#%d...\n", cpu); 331 332 entry = __pa_symbol((unsigned long)&smpboot_entry); 333 cpuboot_data.stack = (unsigned long)__KSTK_TOS(idle); 334 cpuboot_data.thread_info = (unsigned long)task_thread_info(idle); 335 336 csr_mail_send(entry, cpu_logical_map(cpu), 0); 337 338 loongson_send_ipi_single(cpu, ACTION_BOOT_CPU); 339 } 340 341 /* 342 * SMP init and finish on secondary CPUs 343 */ 344 void loongson_init_secondary(void) 345 { 346 unsigned int cpu = smp_processor_id(); 347 unsigned int imask = ECFGF_IP0 | ECFGF_IP1 | ECFGF_IP2 | 348 ECFGF_IPI | ECFGF_PMC | ECFGF_TIMER | ECFGF_SIP0; 349 350 change_csr_ecfg(ECFG0_IM, imask); 351 352 iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_EN); 353 354 #ifdef CONFIG_NUMA 355 numa_add_cpu(cpu); 356 #endif 357 per_cpu(cpu_state, cpu) = CPU_ONLINE; 358 cpu_data[cpu].package = 359 cpu_logical_map(cpu) / loongson_sysconf.cores_per_package; 360 cpu_data[cpu].core = pptt_enabled ? cpu_data[cpu].core : 361 cpu_logical_map(cpu) % loongson_sysconf.cores_per_package; 362 } 363 364 void loongson_smp_finish(void) 365 { 366 local_irq_enable(); 367 iocsr_write64(0, LOONGARCH_IOCSR_MBUF0); 368 pr_info("CPU#%d finished\n", smp_processor_id()); 369 } 370 371 #ifdef CONFIG_HOTPLUG_CPU 372 373 int loongson_cpu_disable(void) 374 { 375 unsigned long flags; 376 unsigned int cpu = smp_processor_id(); 377 378 if (io_master(cpu)) 379 return -EBUSY; 380 381 #ifdef CONFIG_NUMA 382 numa_remove_cpu(cpu); 383 #endif 384 set_cpu_online(cpu, false); 385 clear_cpu_sibling_map(cpu); 386 calculate_cpu_foreign_map(); 387 local_irq_save(flags); 388 irq_migrate_all_off_this_cpu(); 389 clear_csr_ecfg(ECFG0_IM); 390 local_irq_restore(flags); 391 local_flush_tlb_all(); 392 393 return 0; 394 } 395 396 void loongson_cpu_die(unsigned int cpu) 397 { 398 while (per_cpu(cpu_state, cpu) != CPU_DEAD) 399 cpu_relax(); 400 401 mb(); 402 } 403 404 void __noreturn arch_cpu_idle_dead(void) 405 { 406 register uint64_t addr; 407 register void (*init_fn)(void); 408 409 idle_task_exit(); 410 local_irq_enable(); 411 set_csr_ecfg(ECFGF_IPI); 412 __this_cpu_write(cpu_state, CPU_DEAD); 413 414 __smp_mb(); 415 do { 416 __asm__ __volatile__("idle 0\n\t"); 417 addr = iocsr_read64(LOONGARCH_IOCSR_MBUF0); 418 } while (addr == 0); 419 420 local_irq_disable(); 421 init_fn = (void *)TO_CACHE(addr); 422 iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_CLEAR); 423 424 init_fn(); 425 BUG(); 426 } 427 428 #endif 429 430 /* 431 * Power management 432 */ 433 #ifdef CONFIG_PM 434 435 static int loongson_ipi_suspend(void) 436 { 437 return 0; 438 } 439 440 static void loongson_ipi_resume(void) 441 { 442 iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_EN); 443 } 444 445 static struct syscore_ops loongson_ipi_syscore_ops = { 446 .resume = loongson_ipi_resume, 447 .suspend = loongson_ipi_suspend, 448 }; 449 450 /* 451 * Enable boot cpu ipi before enabling nonboot cpus 452 * during syscore_resume. 453 */ 454 static int __init ipi_pm_init(void) 455 { 456 register_syscore_ops(&loongson_ipi_syscore_ops); 457 return 0; 458 } 459 460 core_initcall(ipi_pm_init); 461 #endif 462 463 /* Preload SMP state for boot cpu */ 464 void smp_prepare_boot_cpu(void) 465 { 466 unsigned int cpu, node, rr_node; 467 468 set_cpu_possible(0, true); 469 set_cpu_online(0, true); 470 set_my_cpu_offset(per_cpu_offset(0)); 471 472 rr_node = first_node(node_online_map); 473 for_each_possible_cpu(cpu) { 474 node = early_cpu_to_node(cpu); 475 476 /* 477 * The mapping between present cpus and nodes has been 478 * built during MADT and SRAT parsing. 479 * 480 * If possible cpus = present cpus here, early_cpu_to_node 481 * will return valid node. 482 * 483 * If possible cpus > present cpus here (e.g. some possible 484 * cpus will be added by cpu-hotplug later), for possible but 485 * not present cpus, early_cpu_to_node will return NUMA_NO_NODE, 486 * and we just map them to online nodes in round-robin way. 487 * Once hotplugged, new correct mapping will be built for them. 488 */ 489 if (node != NUMA_NO_NODE) 490 set_cpu_numa_node(cpu, node); 491 else { 492 set_cpu_numa_node(cpu, rr_node); 493 rr_node = next_node_in(rr_node, node_online_map); 494 } 495 } 496 } 497 498 /* called from main before smp_init() */ 499 void __init smp_prepare_cpus(unsigned int max_cpus) 500 { 501 init_new_context(current, &init_mm); 502 current_thread_info()->cpu = 0; 503 loongson_prepare_cpus(max_cpus); 504 set_cpu_sibling_map(0); 505 set_cpu_core_map(0); 506 calculate_cpu_foreign_map(); 507 #ifndef CONFIG_HOTPLUG_CPU 508 init_cpu_present(cpu_possible_mask); 509 #endif 510 } 511 512 int __cpu_up(unsigned int cpu, struct task_struct *tidle) 513 { 514 loongson_boot_secondary(cpu, tidle); 515 516 /* Wait for CPU to start and be ready to sync counters */ 517 if (!wait_for_completion_timeout(&cpu_starting, 518 msecs_to_jiffies(5000))) { 519 pr_crit("CPU%u: failed to start\n", cpu); 520 return -EIO; 521 } 522 523 /* Wait for CPU to finish startup & mark itself online before return */ 524 wait_for_completion(&cpu_running); 525 526 return 0; 527 } 528 529 /* 530 * First C code run on the secondary CPUs after being started up by 531 * the master. 532 */ 533 asmlinkage void start_secondary(void) 534 { 535 unsigned int cpu; 536 537 sync_counter(); 538 cpu = raw_smp_processor_id(); 539 set_my_cpu_offset(per_cpu_offset(cpu)); 540 541 cpu_probe(); 542 constant_clockevent_init(); 543 loongson_init_secondary(); 544 545 set_cpu_sibling_map(cpu); 546 set_cpu_core_map(cpu); 547 548 notify_cpu_starting(cpu); 549 550 /* Notify boot CPU that we're starting */ 551 complete(&cpu_starting); 552 553 /* The CPU is running, now mark it online */ 554 set_cpu_online(cpu, true); 555 556 calculate_cpu_foreign_map(); 557 558 /* 559 * Notify boot CPU that we're up & online and it can safely return 560 * from __cpu_up() 561 */ 562 complete(&cpu_running); 563 564 /* 565 * irq will be enabled in loongson_smp_finish(), enabling it too 566 * early is dangerous. 567 */ 568 WARN_ON_ONCE(!irqs_disabled()); 569 loongson_smp_finish(); 570 571 cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); 572 } 573 574 void __init smp_cpus_done(unsigned int max_cpus) 575 { 576 } 577 578 static void stop_this_cpu(void *dummy) 579 { 580 set_cpu_online(smp_processor_id(), false); 581 calculate_cpu_foreign_map(); 582 local_irq_disable(); 583 while (true); 584 } 585 586 void smp_send_stop(void) 587 { 588 smp_call_function(stop_this_cpu, NULL, 0); 589 } 590 591 #ifdef CONFIG_PROFILING 592 int setup_profiling_timer(unsigned int multiplier) 593 { 594 return 0; 595 } 596 #endif 597 598 static void flush_tlb_all_ipi(void *info) 599 { 600 local_flush_tlb_all(); 601 } 602 603 void flush_tlb_all(void) 604 { 605 on_each_cpu(flush_tlb_all_ipi, NULL, 1); 606 } 607 608 static void flush_tlb_mm_ipi(void *mm) 609 { 610 local_flush_tlb_mm((struct mm_struct *)mm); 611 } 612 613 void flush_tlb_mm(struct mm_struct *mm) 614 { 615 if (atomic_read(&mm->mm_users) == 0) 616 return; /* happens as a result of exit_mmap() */ 617 618 preempt_disable(); 619 620 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { 621 on_each_cpu_mask(mm_cpumask(mm), flush_tlb_mm_ipi, mm, 1); 622 } else { 623 unsigned int cpu; 624 625 for_each_online_cpu(cpu) { 626 if (cpu != smp_processor_id() && cpu_context(cpu, mm)) 627 cpu_context(cpu, mm) = 0; 628 } 629 local_flush_tlb_mm(mm); 630 } 631 632 preempt_enable(); 633 } 634 635 struct flush_tlb_data { 636 struct vm_area_struct *vma; 637 unsigned long addr1; 638 unsigned long addr2; 639 }; 640 641 static void flush_tlb_range_ipi(void *info) 642 { 643 struct flush_tlb_data *fd = info; 644 645 local_flush_tlb_range(fd->vma, fd->addr1, fd->addr2); 646 } 647 648 void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) 649 { 650 struct mm_struct *mm = vma->vm_mm; 651 652 preempt_disable(); 653 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { 654 struct flush_tlb_data fd = { 655 .vma = vma, 656 .addr1 = start, 657 .addr2 = end, 658 }; 659 660 on_each_cpu_mask(mm_cpumask(mm), flush_tlb_range_ipi, &fd, 1); 661 } else { 662 unsigned int cpu; 663 664 for_each_online_cpu(cpu) { 665 if (cpu != smp_processor_id() && cpu_context(cpu, mm)) 666 cpu_context(cpu, mm) = 0; 667 } 668 local_flush_tlb_range(vma, start, end); 669 } 670 preempt_enable(); 671 } 672 673 static void flush_tlb_kernel_range_ipi(void *info) 674 { 675 struct flush_tlb_data *fd = info; 676 677 local_flush_tlb_kernel_range(fd->addr1, fd->addr2); 678 } 679 680 void flush_tlb_kernel_range(unsigned long start, unsigned long end) 681 { 682 struct flush_tlb_data fd = { 683 .addr1 = start, 684 .addr2 = end, 685 }; 686 687 on_each_cpu(flush_tlb_kernel_range_ipi, &fd, 1); 688 } 689 690 static void flush_tlb_page_ipi(void *info) 691 { 692 struct flush_tlb_data *fd = info; 693 694 local_flush_tlb_page(fd->vma, fd->addr1); 695 } 696 697 void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) 698 { 699 preempt_disable(); 700 if ((atomic_read(&vma->vm_mm->mm_users) != 1) || (current->mm != vma->vm_mm)) { 701 struct flush_tlb_data fd = { 702 .vma = vma, 703 .addr1 = page, 704 }; 705 706 on_each_cpu_mask(mm_cpumask(vma->vm_mm), flush_tlb_page_ipi, &fd, 1); 707 } else { 708 unsigned int cpu; 709 710 for_each_online_cpu(cpu) { 711 if (cpu != smp_processor_id() && cpu_context(cpu, vma->vm_mm)) 712 cpu_context(cpu, vma->vm_mm) = 0; 713 } 714 local_flush_tlb_page(vma, page); 715 } 716 preempt_enable(); 717 } 718 EXPORT_SYMBOL(flush_tlb_page); 719 720 static void flush_tlb_one_ipi(void *info) 721 { 722 unsigned long vaddr = (unsigned long) info; 723 724 local_flush_tlb_one(vaddr); 725 } 726 727 void flush_tlb_one(unsigned long vaddr) 728 { 729 on_each_cpu(flush_tlb_one_ipi, (void *)vaddr, 1); 730 } 731 EXPORT_SYMBOL(flush_tlb_one); 732