summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2013-05-30 20:16:55 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2013-05-30 20:16:55 +0000
commit44440dacaf7f504a2a860b04576e7c1d91c85652 (patch)
tree889ce22c25ff041e180dafc07e0ef4d4206775a6
parent14d0fd7842c8024ed58f6e57f3343ded5d3445a8 (diff)
Fix a bug in amd64 hibernate introduced when we moved the kernel to load at
16MB physical. Document the same in i386 (i386 was not affected, just commented for diffability)
-rw-r--r--sys/arch/amd64/amd64/hibernate_machdep.c4
-rw-r--r--sys/arch/i386/i386/hibernate_machdep.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/hibernate_machdep.c b/sys/arch/amd64/amd64/hibernate_machdep.c
index 1c14d0de895..4e789ba7522 100644
--- a/sys/arch/amd64/amd64/hibernate_machdep.c
+++ b/sys/arch/amd64/amd64/hibernate_machdep.c
@@ -296,7 +296,9 @@ hibernate_populate_resume_pt(union hibernate_info *hib_info,
*/
kern_start_2m_va = (paddr_t)&start & ~(PAGE_MASK_2M);
kern_end_2m_va = (paddr_t)&end & ~(PAGE_MASK_2M);
- phys_page_number = 0;
+
+ /* amd64 kernels load at 16MB phys (on the 8th 2mb page) */
+ phys_page_number = 8;
for (page = kern_start_2m_va; page <= kern_end_2m_va;
page += NBPD_L2, phys_page_number++) {
diff --git a/sys/arch/i386/i386/hibernate_machdep.c b/sys/arch/i386/i386/hibernate_machdep.c
index 1d37f9d5206..db31e28cec0 100644
--- a/sys/arch/i386/i386/hibernate_machdep.c
+++ b/sys/arch/i386/i386/hibernate_machdep.c
@@ -229,6 +229,8 @@ hibernate_populate_resume_pt(union hibernate_info *hib_info,
*/
kern_start_4m_va = (paddr_t)&start & ~(PAGE_MASK_4M);
kern_end_4m_va = (paddr_t)&end & ~(PAGE_MASK_4M);
+
+ /* i386 kernels load at 2MB phys (on the 0th 4mb page) */
phys_page_number = 0;
for (page = kern_start_4m_va; page <= kern_end_4m_va;