zircon/kernel/arch/x86/mmu.cc
/**
 * @brief Execute a queued TLB invalidation
 *
 * @param pt The page table we're invalidating for (if nullptr, assume for current one)
 * @param pending The planned invalidation
 */
@brief Execute a queued TLB invalidation
@param pt The page table we're invalidating for (if nullptr, assume for current one)
@param pending The planned invalidation
@brief Execute a queued TLB invalidation @param pt The page table we ' re invalidating for ( if nullptr assume for current one ) @param pending The planned invalidation
static void x86_tlb_invalidate_page(const X86PageTableBase* pt, PendingTlbInvalidation* pending) {
  if (pending->count == 0) {
    return;
  }
  kcounter_add(tlb_invalidations_sent, 1);
  ulong cr3 = pt ? pt->phys() : x86_get_cr3();
  struct TlbInvalidatePage_context task_context = {
      .target_cr3 = cr3,
      .pending = pending,
  };
  mp_ipi_target_t target;
  cpu_mask_t target_mask = 0;
  if (pending->contains_global || pt == nullptr) {
    target = MP_IPI_TARGET_ALL;
  } else {
    target = MP_IPI_TARGET_MASK;
    target_mask = static_cast<X86ArchVmAspace*>(pt->ctx())->active_cpus();
  }
  mp_sync_exec(target, target_mask, TlbInvalidatePage_task, &task_context);
  pending->clear();
}
static void x86_tlb_invalidate_page ( const X86PageTableBase * pt , PendingTlbInvalidation * pending ) { if ( pending -> count == 0 ) { return ; } kcounter_add ( tlb_invalidations_sent , 1 ) ; ulong cr3 = pt ? pt -> phys ( ) : x86_get_cr3 ( ) ; struct TlbInvalidatePage_context task_context = { . target_cr3 = cr3 , . pending = pending , } ; mp_ipi_target_t target ; cpu_mask_t target_mask = 0 ; if ( pending -> contains_global || pt == nullptr ) { target = MP_IPI_TARGET_ALL ; } else { target = MP_IPI_TARGET_MASK ; target_mask = static_cast < X86ArchVmAspace * > ( pt -> ctx ( ) ) -> active_cpus ( ) ; } mp_sync_exec ( target , target_mask , TlbInvalidatePage_task , & task_context ) ; pending -> clear ( ) ; }
@brief Execute a queued TLB invalidation
 @param pt The page table we're invalidating for (if nullptr, assume for current one)
 @param pending The planned invalidation
@brief Execute a queued TLB invalidation @param pt The page table we ' re invalidating for ( if nullptr assume for current one ) @param pending The planned invalidation
/* Target only CPUs this aspace is active on.  It may be the case that some
   * other CPU will become active in it after this load, or will have left it
   * just before this load.  In the former case, it is becoming active after
   * the write to the page table, so it will see the change.  In the latter
   * case, it will get a spurious request to flush. */