1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Fix a copy-paste bug when reading data from the last 3 (7 for PAE) bytes of

a page mapped by a large page in the kernel.

Submitted by:	Dorr H. Clark  dclark of engr.scu.edu
MFC after:	1 week
This commit is contained in:
John Baldwin 2009-11-06 13:10:12 +00:00
parent 1f02c0f7a9
commit 50c3239e85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=198986

View File

@ -295,9 +295,9 @@ _kvm_vatop(kvm_t *kd, u_long va, off_t *pa)
#define PG_FRAME4M (~PAGE4M_MASK)
pde_pa = ((u_long)pde & PG_FRAME4M) + (va & PAGE4M_MASK);
s = _kvm_pa2off(kd, pde_pa, &ofs);
if (s < sizeof pde) {
_kvm_syserr(kd, kd->program,
"_kvm_vatop: pde_pa not found");
if (s == 0) {
_kvm_err(kd, kd->program,
"_kvm_vatop: 4MB page address not in dump");
goto invalid;
}
*pa = ofs;
@ -391,9 +391,9 @@ _kvm_vatop_pae(kvm_t *kd, u_long va, off_t *pa)
#define PG_FRAME2M (~PAGE2M_MASK)
pde_pa = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK);
s = _kvm_pa2off(kd, pde_pa, &ofs);
if (s < sizeof pde) {
_kvm_syserr(kd, kd->program,
"_kvm_vatop_pae: pde_pa not found");
if (s == 0) {
_kvm_err(kd, kd->program,
"_kvm_vatop: 2MB page address not in dump");
goto invalid;
}
*pa = ofs;