MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dmar_load_root_entry_ptr

Function dmar_load_root_entry_ptr

freebsd/x86/iommu/intel_utils.c:400–420  ·  view source on GitHub ↗

* Load the root entry pointer into the hardware, busily waiting for * the completion. */

Source from the content-addressed store, hash-verified

398 * the completion.
399 */
400int
401dmar_load_root_entry_ptr(struct dmar_unit *unit)
402{
403 vm_page_t root_entry;
404 int error;
405
406 /*
407 * Access to the GCMD register must be serialized while the
408 * command is submitted.
409 */
410 DMAR_ASSERT_LOCKED(unit);
411
412 VM_OBJECT_RLOCK(unit->ctx_obj);
413 root_entry = vm_page_lookup(unit->ctx_obj, 0);
414 VM_OBJECT_RUNLOCK(unit->ctx_obj);
415 dmar_write8(unit, DMAR_RTADDR_REG, VM_PAGE_TO_PHYS(root_entry));
416 dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd | DMAR_GCMD_SRTP);
417 DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_RTPS)
418 != 0));
419 return (error);
420}
421
422/*
423 * Globally invalidate the context entries cache, busily waiting for

Callers 1

dmar_attachFunction · 0.85

Calls 4

vm_page_lookupFunction · 0.85
dmar_write8Function · 0.85
dmar_write4Function · 0.85
dmar_read4Function · 0.85

Tested by

no test coverage detected