pde_pa = (pde_pa + PG_FRAME) + (pl3_i(va) * sizeof(pd_entry_t));
pde_pa = (pde & PG_FRAME) + (pl3_pi(va) * sizeof(pd_entry_t));
_kvm_kvatop(kd, va, pa)	kvm_t *kd;	u_long va;	u_long *pa;{	cpu_kcore_hdr_t *cpu_kh;	u_long page_off;	pd_entry_t pde;	pt_entry_t pte;	paddr_t pde_pa, pte_pa;	if (ISALIVE(kd)) {		_kvm_err(kd, 0, "vatop called in live kernel!");		return (0);	}	cpu_kh = kd->cpu_data;	page_off = va & PGOFSET;	/*	 * Find and read all entries to get to the pa.	 */	/*	 * Level 4.	 */	pde_pa = cpu_kh->ptdpaddr + (pl4_i(va) * sizeof(pd_entry_t));	if (pread(kd->pmfd, (void *)&pde, sizeof(pde),	    _kvm_pa2off(kd, pde_pa)) != sizeof(pde)) {		_kvm_syserr(kd, 0, "could not read PT level 4 entry");		goto lose;	}	if ((pde & PG_V) == 0) {		_kvm_err(kd, 0, "invalid translation (invalid level 4 PDE)");		goto lose;	}	/*	 * Level 3.	 */	pde_pa = (pde_pa + PG_FRAME) + (pl3_i(va) * sizeof(pd_entry_t));	if (pread(kd->pmfd, (void *)&pde, sizeof(pde),	    _kvm_pa2off(kd, pde_pa)) != sizeof(pde)) {		_kvm_syserr(kd, 0, "could not read PT level 3 entry");		goto lose;	}	if ((pde & PG_V) == 0) {		_kvm_err(kd, 0, "invalid translation (invalid level 3 PDE)");		goto lose;	}	/*	 * Level 2.	 */	pde_pa = (pde_pa & PG_FRAME) + (pl2_i(va) * sizeof(pd_entry_t));	if (pread(kd->pmfd, (void *)&pde, sizeof(pde),	    _kvm_pa2off(kd, pde_pa)) != sizeof(pde)) {		_kvm_syserr(kd, 0, "could not read PT level 2 entry");		goto lose;	}	if ((pde & PG_V) == 0) {		_kvm_err(kd, 0, "invalid translation (invalid level 2 PDE)");		goto lose;	}	/*	 * Level 1.	 */	pte_pa = (pde_pa & PG_FRAME) + (pl1_i(va) * sizeof(pt_entry_t));	if (pread(kd->pmfd, (void *) &pte, sizeof(pte),	    _kvm_pa2off(kd, pte_pa)) != sizeof(pte)) {		_kvm_syserr(kd, 0, "could not read PTE");		goto lose;	}	/*	 * Validate the PTE and return the physical address.	 */	if ((pte & PG_V) == 0) {		_kvm_err(kd, 0, "invalid translation (invalid PTE)");		goto lose;	}	*pa = (pte & PG_FRAME) + page_off;	return (int)(NBPG - page_off); lose:	*pa = (u_long)~0L;	return (0);}