Lines Matching refs:kd

74 hpt_insert(kvm_t *kd, vm_paddr_t pa, int64_t off)
84 hpte->next = kd->vmst->hpt_head[fnv];
85 kd->vmst->hpt_head[fnv] = hpte;
89 hpt_find(kvm_t *kd, vm_paddr_t pa)
96 for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) {
104 inithash(kvm_t *kd, uint64_t *base, int len, off_t off)
116 hpt_insert(kd, pa, off);
124 _kvm_minidump_freevtop(kvm_t *kd)
126 struct vmstate *vm = kd->vmst;
133 kd->vmst = NULL;
137 _kvm_minidump_initvtop(kvm_t *kd)
142 vmst = _kvm_malloc(kd, sizeof(*vmst));
144 _kvm_err(kd, kd->program, "cannot allocate vm");
147 kd->vmst = vmst;
149 if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) !=
151 _kvm_err(kd, kd->program, "cannot read dump header");
155 _kvm_err(kd, kd->program, "not a minidump for this platform");
164 _kvm_err(kd, kd->program, "wrong minidump version. expected %d got %d",
172 vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
174 _kvm_err(kd, kd->program, "cannot allocate %d bytes for bitmap", vmst->hdr.bitmapsize);
177 if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) !=
179 _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize);
184 vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize);
186 _kvm_err(kd, kd->program, "cannot allocate %d bytes for page_map", vmst->hdr.pmapsize);
189 if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) !=
191 _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", vmst->hdr.pmapsize);
197 inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off);
203 _kvm_minidump_vatop_v1(kvm_t *kd, u_long va, off_t *pa)
212 vm = kd->vmst;
221 _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
225 ofs = hpt_find(kd, a);
227 _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%lx not in minidump", a);
234 ofs = hpt_find(kd, a);
236 _kvm_err(kd, kd->program, "_kvm_vatop: direct map address 0x%lx not in minidump", va);
242 _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va);
247 _kvm_err(kd, 0, "invalid address (0x%lx)", va);
252 _kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa)
264 vm = kd->vmst;
273 _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid");
278 ofs = hpt_find(kd, a);
280 _kvm_err(kd, kd->program, "_kvm_vatop: pt physical address 0x%lx not in minidump", a);
283 if (pread(kd->pmfd, &pt, PAGE_SIZE, ofs) != PAGE_SIZE) {
284 _kvm_err(kd, kd->program, "cannot read %d bytes for pt", PAGE_SIZE);
290 _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
298 ofs = hpt_find(kd, a);
300 _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%lx not in minidump", a);
307 ofs = hpt_find(kd, a);
309 _kvm_err(kd, kd->program, "_kvm_vatop: direct map address 0x%lx not in minidump", va);
315 _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va);
320 _kvm_err(kd, 0, "invalid address (0x%lx)", va);
325 _kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa)
328 if (ISALIVE(kd)) {
329 _kvm_err(kd, 0, "kvm_kvatop called in live kernel!");
332 if (((struct vmstate *)kd->vmst)->hdr.version == 1)
333 return (_kvm_minidump_vatop_v1(kd, va, pa));
335 return (_kvm_minidump_vatop(kd, va, pa));