* Load the root entry pointer into the hardware, busily waiting for * the completion. */
| 398 | * the completion. |
| 399 | */ |
| 400 | int |
| 401 | dmar_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 |
no test coverage detected