Don't use the tpa instruction to implement pmap_kextract. The tpa
instruction requires that a translation is present in the TC. This may trigger a TLB miss and a subsequent call to vm_fault(). This implementation is deliberately non-inline for debugging and profiling purposes. Partial or full inlining should eventually be done. Valuable insights by: jake
This commit is contained in:
parent
eea2b01ecc
commit
bbf5306d5f
@ -1333,6 +1333,31 @@ pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte, vm_offset_t va,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the physical page address associated with a kernel
|
||||
* virtual address.
|
||||
*/
|
||||
vm_paddr_t
|
||||
pmap_kextract(vm_offset_t va)
|
||||
{
|
||||
struct ia64_lpte *pte;
|
||||
|
||||
KASSERT(va >= IA64_RR_BASE(5), ("Must be kernel VA"));
|
||||
|
||||
/* Regions 6 and 7 are direct mapped. */
|
||||
if (va >= IA64_RR_BASE(6))
|
||||
return (IA64_RR_MASK(va));
|
||||
|
||||
/* Bail out if the virtual address is beyond our limits. */
|
||||
if (IA64_RR_MASK(va) >= nkpt * PAGE_SIZE * NKPTEPG)
|
||||
return (0);
|
||||
|
||||
pte = pmap_find_kpte(va);
|
||||
if (!pte->pte_p)
|
||||
return (0);
|
||||
return ((pte->pte_ppn << 12) | (va & PAGE_MASK));
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a list of wired pages to the kva
|
||||
* this routine is only used for temporary
|
||||
|
@ -59,14 +59,6 @@
|
||||
#endif
|
||||
#define MAXKPT (PAGE_SIZE/sizeof(vm_offset_t))
|
||||
|
||||
/*
|
||||
* Routine: pmap_kextract
|
||||
* Function:
|
||||
* Extract the physical page address associated
|
||||
* kernel virtual address.
|
||||
*/
|
||||
#define pmap_kextract ia64_tpa
|
||||
|
||||
#define vtophys(va) pmap_kextract(((vm_offset_t) (va)))
|
||||
|
||||
#endif /* _KERNEL */
|
||||
@ -127,6 +119,7 @@ extern vm_offset_t virtual_end;
|
||||
vm_offset_t pmap_steal_memory(vm_size_t);
|
||||
void pmap_bootstrap(void);
|
||||
void pmap_kenter(vm_offset_t va, vm_offset_t pa);
|
||||
vm_paddr_t pmap_kextract(vm_offset_t va);
|
||||
void pmap_kremove(vm_offset_t);
|
||||
void pmap_setdevram(unsigned long long basea, vm_offset_t sizea);
|
||||
int pmap_uses_prom_console(void);
|
||||
|
Loading…
Reference in New Issue
Block a user