OpenBSD CVS

CVS log for src/sys/kern/subr_hibernate.c


[BACK] Up to [local] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.141 / (download) - annotate - [select for diffs], Wed Jun 5 11:04:17 2024 UTC (5 days, 17 hours ago) by krw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.140: +22 -34 lines
Diff to previous 1.140 (colored)

No need to call d_open/d_close for every hibernate resume i/o.

Speeds up resuming from hibernate.

Testing florian@ stsp@

ok mlarkin@ stsp@

Revision 1.140 / (download) - annotate - [select for diffs], Tue Jun 4 20:31:35 2024 UTC (6 days, 8 hours ago) by krw
Branch: MAIN
Changes since 1.139: +56 -49 lines
Diff to previous 1.139 (colored)

Enable hibernate/resume to nvme(4) disks with 4096 byte sectors.

testing by florian@ mglocker@ mlarkin@

ok deraadt@ mglocker@ mlarkin@

Revision 1.139 / (download) - annotate - [select for diffs], Tue Apr 30 17:12:19 2024 UTC (5 weeks, 6 days ago) by krw
Branch: MAIN
Changes since 1.138: +2 -2 lines
Diff to previous 1.138 (colored)

Add '\n' to DPRINTF() string that used to be a panic() string.

ok mlarkin@

Revision 1.138 / (download) - annotate - [select for diffs], Sat Sep 3 18:17:15 2022 UTC (21 months, 1 week ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.137: +2 -3 lines
Diff to previous 1.137 (colored)

whitespace

Revision 1.137 / (download) - annotate - [select for diffs], Fri Sep 2 09:02:37 2022 UTC (21 months, 1 week ago) by mlarkin
Branch: MAIN
Changes since 1.136: +15 -1 lines
Diff to previous 1.136 (colored)

Get the retguard region's phys address from pmap, instead of using linker
script symbols. This is needed since we don't have those symbols on all
archs where we want hibernate.

ok kettenis, and input and help from miod.

Revision 1.136 / (download) - annotate - [select for diffs], Thu Sep 1 21:50:19 2022 UTC (21 months, 1 week ago) by mlarkin
Branch: MAIN
Changes since 1.135: +1 -2 lines
Diff to previous 1.135 (colored)

whitespace

Revision 1.135 / (download) - annotate - [select for diffs], Fri Jul 29 17:47:12 2022 UTC (22 months, 1 week ago) by semarie
Branch: MAIN
Changes since 1.134: +3 -3 lines
Diff to previous 1.134 (colored)

Replace the swap extent(9) usage by a blist data structure.

It makes uvm_swap_free() faster: extents have a cost of O(n*n) which doesn't
really scale with gigabytes of swap.

Based on initial work from mpi@
The blist implementation comes from DragonFlyBSD.

The diff adds also a ddb(4) 'show swap' command to show the blist and help
debugging, and fix some off-by-one in size printed during hibernate.

ok mpi@

Revision 1.134 / (download) - annotate - [select for diffs], Sat Feb 19 23:57:09 2022 UTC (2 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.133: +2 -2 lines
Diff to previous 1.133 (colored)

The suspend/resume code sleeps-not-allowed phases are protected with
cold=2.  Use the same strategy in a a similar phase during hibernate.

Revision 1.133 / (download) - annotate - [select for diffs], Mon Jan 17 02:54:28 2022 UTC (2 years, 4 months ago) by mlarkin
Branch: MAIN
Changes since 1.132: +15 -23 lines
Diff to previous 1.132 (colored)

Allow more memory ranges in hibernate

The previous limit of VM_PHYSSEG_MAX ranges (16) was proving too small for
newer machines. This diff reorganizes the hibernate signature block to allow
for 22 ranges by removing the kernel version comparison and replacing it
with a SHA of several unique kernel features (the version string and several
addresses of functions not inside the same .o).

Reported by claudio@, who also helped fix some issues in the diff. Input
from deraadt@ as well.

Tested by myself and claudio on a variety of machines. Only compile tested on
i386 as I have no more S4-capable i386 hardware anymore.

ok claudio@

Revision 1.132 / (download) - annotate - [select for diffs], Fri Jan 7 02:47:07 2022 UTC (2 years, 5 months ago) by guenther
Branch: MAIN
Changes since 1.131: +6 -11 lines
Diff to previous 1.131 (colored)

hibernate_clear_signature() is only used by hibernate_resume(), so
pass in the already read hibernate_info instead of reading it again.

ok deraadt@

Revision 1.131 / (download) - annotate - [select for diffs], Fri Jan 7 02:26:53 2022 UTC (2 years, 5 months ago) by guenther
Branch: MAIN
Changes since 1.130: +12 -10 lines
Diff to previous 1.130 (colored)

Extract the slice from the zeroth swap device instead of assuming
it's the 'b' slice and (sanity) check against the partition count.
Also, make the "is union hibernate_info too large?" a compile time
check.

ok deraadt@

Revision 1.130 / (download) - annotate - [select for diffs], Tue Jan 4 18:13:31 2022 UTC (2 years, 5 months ago) by guenther
Branch: MAIN
Changes since 1.129: +2 -1 lines
Diff to previous 1.129 (colored)

Use the device we read the hibernate signature from for the entire
resume.  This fixes setups where a umass device no longer attaching
at resume results in a softraid device being renumbered so the
hibernate-time device is no longer correct

ok mlarkin@ jsing@

Revision 1.129 / (download) - annotate - [select for diffs], Tue Aug 31 14:45:25 2021 UTC (2 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (colored)

printing the hibernate image size in MB is easier on the eyes
ok mlarkin

Revision 1.128 / (download) - annotate - [select for diffs], Mon Aug 30 09:45:29 2021 UTC (2 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.127: +4 -3 lines
Diff to previous 1.127 (colored)

increase hibernate writeout speed a little.  modern machines have vast
tracts of unused memory, and the empty-space RLE scanner (uvm_page_rle)
would rescan for empty space needlessly wasting excessive cpu time
16G machine, 100sec -> 9sec
40G machine, 325sec -> 28sec
with kettenis mlarkin

Revision 1.127 / (download) - annotate - [select for diffs], Thu Jul 8 23:19:51 2021 UTC (2 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.126: +12 -12 lines
Diff to previous 1.126 (colored)

whitespace fixes, no code change.

Revision 1.126 / (download) - annotate - [select for diffs], Wed Mar 10 10:21:47 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored)

spelling

ok gnezdo@ semarie@ mpi@

Revision 1.125 / (download) - annotate - [select for diffs], Thu Jun 21 07:49:13 2018 UTC (5 years, 11 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.124: +10 -1 lines
Diff to previous 1.124 (colored)

don't let the retguard skip region exceed the space we have reserved for
it in the piglet during unhibernate. Missed this block during the previous
commit. We'll panic, which will likely just reboot the machine, but that's
better than trashing a chunk and causing mystery errors later.

Revision 1.124 / (download) - annotate - [select for diffs], Thu Jun 21 07:33:30 2018 UTC (5 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.123: +28 -5 lines
Diff to previous 1.123 (colored)

Save and restore retguard area during hibernate unpack. This copies the
original retguard data to the piglet and bcopys it back in place
immediately before resuming via the ACPI Sx trampoline.

ok deraadt, guenther, tested by many.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Aug 17 06:50:41 2017 UTC (6 years, 9 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.122: +5 -5 lines
Diff to previous 1.122 (colored)

print why the signature block check of an unhibernate attempt failed, to
let people know what changed.

ok kettenis, phessler

Revision 1.122 / (download) - annotate - [select for diffs], Thu Jun 22 15:56:29 2017 UTC (6 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.121: +19 -1 lines
Diff to previous 1.121 (colored)

calculate a "sum" based upon pointers to functions all over the kernel,
so that an unhibernate kernel can detect if it is running with the
kernel it booted.
ok mlarkin

Revision 1.121 / (download) - annotate - [select for diffs], Mon Mar 27 20:26:39 2017 UTC (7 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.120: +11 -6 lines
Diff to previous 1.120 (colored)

If hibernate_alloc() encounters a problem it should undo the partial
work.
ok mlarkin kettenis

Revision 1.120 / (download) - annotate - [select for diffs], Tue Sep 27 02:53:49 2016 UTC (7 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.119: +13 -13 lines
Diff to previous 1.119 (colored)

move from RB macros to RBT functions

Revision 1.119 / (download) - annotate - [select for diffs], Fri Sep 16 02:35:41 2016 UTC (7 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.118: +5 -5 lines
Diff to previous 1.118 (colored)

move the vm_page struct from being stored in RB macro trees to RBT functions

vm_page structs go into three trees, uvm_objtree, uvm_pmr_addr, and
uvm_pmr_size. all these have been moved to RBT code.

this should give us a decent chunk of code space back.

Revision 1.118 / (download) - annotate - [select for diffs], Mon Sep 5 22:27:23 2016 UTC (7 years, 9 months ago) by beck
Branch: MAIN
Changes since 1.117: +46 -2 lines
Diff to previous 1.117 (colored)

Fix hibernation - make stack protector writable during resume
Committing for guenther@ because he is on United and apparently
they break ssh (as well as guitars)

ok deraadt@ in the car from cambridge

Revision 1.117 / (download) - annotate - [select for diffs], Thu Sep 1 13:12:59 2016 UTC (7 years, 9 months ago) by akfaew
Branch: MAIN
Changes since 1.116: +5 -2 lines
Diff to previous 1.116 (colored)

Fix undefined behaviour when comparing pointers by casting them to vaddr_t.

OK mlarkin@

Revision 1.116 / (download) - annotate - [select for diffs], Mon May 4 02:18:05 2015 UTC (9 years, 1 month ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.115: +3 -1 lines
Diff to previous 1.115 (colored)


Clarify that hibernate_resume must be called with interrupts enabled.

Revision 1.115 / (download) - annotate - [select for diffs], Sat Feb 7 02:50:53 2015 UTC (9 years, 4 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.114: +39 -4 lines
Diff to previous 1.114 (colored)


Preserve a page's worth of random data on hibernate resume. Used to improve
entropy after resuming.

Tested on i386 and amd64.
ok deraadt@

Revision 1.114 / (download) - annotate - [select for diffs], Sat Feb 7 01:19:40 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.113: +7 -1 lines
Diff to previous 1.113 (colored)

New framework that allows hibernate to pass in entropy from it's fresh
boot.
ok mlarkin

Revision 1.113 / (download) - annotate - [select for diffs], Fri Feb 6 05:17:48 2015 UTC (9 years, 4 months ago) by mlarkin
Branch: MAIN
Changes since 1.112: +7 -6 lines
Diff to previous 1.112 (colored)


Fix a hibernate crash on some machines due to unmapping a page that
may not have been mapped previously (in the failure to hibernate case).

Also ensure that the lowmem ptp is mapped in all cases (not just MP).

ok kettenis

Revision 1.112 / (download) - annotate - [select for diffs], Mon Jan 12 07:11:41 2015 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.111: +4 -9 lines
Diff to previous 1.111 (colored)

hibernate_suspend() should not pmap_kremove by itself; hibernate_free()
must do that.  otherwise, pmap_kremove is called twice.  i386 in particular
does not tolerate that, found by sebastia
ok mlarkin kettenis

Revision 1.111 / (download) - annotate - [select for diffs], Mon Dec 22 22:22:35 2014 UTC (9 years, 5 months ago) by mlarkin
Branch: MAIN
Changes since 1.110: +3 -2 lines
Diff to previous 1.110 (colored)


fix an error in piglet allocation when requesting an alignment < PAGE_SIZE
(which we never did, but it was a bug nonetheless).

ok kettenis, deraadt

Revision 1.110 / (download) - annotate - [select for diffs], Wed Dec 17 19:42:15 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.109: +4 -1 lines
Diff to previous 1.109 (colored)

remove lock.h from uvm_extern.h. another holdover from the simpletonlock
era. fix uvm including c files to include lock.h or atomic.h as necessary.
ok deraadt

Revision 1.109 / (download) - annotate - [select for diffs], Sun Nov 16 12:31:00 2014 UTC (9 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.108: +7 -7 lines
Diff to previous 1.108 (colored)

Replace a plethora of historical protection options with just
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h.
PROT_MASK is introduced as the one true way of extracting those bits.
Remove UVM_ADV_* wrapper, using the standard names.
ok doug guenther kettenis

Revision 1.108 / (download) - annotate - [select for diffs], Wed Nov 5 05:48:45 2014 UTC (9 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.107: +8 -6 lines
Diff to previous 1.107 (colored)


No reason to have things like the hibernate allocation area and chunk
ordering regions mapped executable, so remove those permissions.

ok deraadt@

Revision 1.107 / (download) - annotate - [select for diffs], Sun Nov 2 22:59:58 2014 UTC (9 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.106: +10 -7 lines
Diff to previous 1.106 (colored)


Unmap the hibernate hiballoc page after we are done with it.

ok deraadt, kettenis

Revision 1.106 / (download) - annotate - [select for diffs], Wed Oct 22 05:44:00 2014 UTC (9 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.105: +1 -9 lines
Diff to previous 1.105 (colored)

Remove some unused/unneeded code.

Revision 1.105 / (download) - annotate - [select for diffs], Wed Oct 22 04:46:05 2014 UTC (9 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.104: +22 -10 lines
Diff to previous 1.104 (colored)


Use the global piglet address variables as sparingly as possible to avoid
redundant copies of the same information. No functional change.

Also add some comments as to how these globals are used.

Revision 1.104 / (download) - annotate - [select for diffs], Thu Oct 16 04:19:33 2014 UTC (9 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.103: +5 -37 lines
Diff to previous 1.103 (colored)


No need to reserve separate KVA ranges for the RLE and copy pages in
hibernate anymore.

Revision 1.103 / (download) - annotate - [select for diffs], Thu Oct 9 00:50:54 2014 UTC (9 years, 8 months ago) by mlarkin
Branch: MAIN
Changes since 1.102: +12 -10 lines
Diff to previous 1.102 (colored)



fix some data type mismatches in the zlib paths in hibernate

Revision 1.102 / (download) - annotate - [select for diffs], Thu Oct 9 00:42:05 2014 UTC (9 years, 8 months ago) by mlarkin
Branch: MAIN
Changes since 1.101: +2 -39 lines
Diff to previous 1.101 (colored)



remove an unused function and some unused variables in hibernate

Revision 1.101 / (download) - annotate - [select for diffs], Fri Sep 26 09:25:38 2014 UTC (9 years, 8 months ago) by kettenis
Branch: MAIN
Changes since 1.100: +79 -226 lines
Diff to previous 1.100 (colored)

Rework piglet and pig allocation.  Currently the piglet gets allocated
deep down in the suspend path, where it is really hard to recover from
allocation failure.  So allocate the piglet early on in the suspend path.
Also change the piglet and piglet allocation functions to use km_alloc(9)
instead of doing pmemrange magic.  This removes a bunch of code which, in the
case of the piglet allocation, is broken since it results in a NULL pointer
dereference.  Also switch the piglet allocation to not wait.  If we can't
allocate 16MB of phys contig memory on a halfway modern machine we're almost
certainly under a lot of memory pressure and we're better off not trying to
hibernate anyway.

ok mlarkin@

Revision 1.100 / (download) - annotate - [select for diffs], Fri Sep 19 20:02:25 2014 UTC (9 years, 8 months ago) by kettenis
Branch: MAIN
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored)

Use config_suspend_all(9).

Revision 1.99 / (download) - annotate - [select for diffs], Mon Jul 21 01:57:55 2014 UTC (9 years, 10 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.98: +9 -11 lines
Diff to previous 1.98 (colored)



fix some wrong comments and a bit of KNF

Revision 1.98 / (download) - annotate - [select for diffs], Sun Jul 20 18:05:21 2014 UTC (9 years, 10 months ago) by mlarkin
Branch: MAIN
Changes since 1.97: +3 -3 lines
Diff to previous 1.97 (colored)


Support hibernating to softraid crypto volumes.

much help and ok from deraadt@

Revision 1.97 / (download) - annotate - [select for diffs], Wed Jul 16 07:42:51 2014 UTC (9 years, 10 months ago) by mlarkin
Branch: MAIN
Changes since 1.96: +187 -25 lines
Diff to previous 1.96 (colored)



Reenable hibernate RLE support and flush+zero all memory after unpack.

Revision 1.96 / (download) - annotate - [select for diffs], Wed Jul 9 15:12:34 2014 UTC (9 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.95: +11 -6 lines
Diff to previous 1.95 (colored)



Minor cleanups in wording in some comments and printfs, and added some
dprintfs to help debugging in the field (disabled by default)

Revision 1.95 / (download) - annotate - [select for diffs], Wed Jul 9 15:03:12 2014 UTC (9 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.94: +14 -10 lines
Diff to previous 1.94 (colored)



Don't use the suspending kernel's VA mapping for the piglet. It's far
easier and much less error-prone to just identity map it in the resuming
kernel as we have more control over the VA space layout there (otherwise
we are at the mercy of the suspending kernel's placement of the piglet VA).

This diff also increases the size of the piglet to 4 chunks, to avoid an
overwrite issue seen in m2k14 where the start of the kernel text was
overwritten with a bounced chunk before unpack.

Revision 1.94 / (download) - annotate - [select for diffs], Wed Jul 9 14:10:25 2014 UTC (9 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.93: +47 -106 lines
Diff to previous 1.93 (colored)



Cleanup the chunk placement routine by removing the conflict resolver.
Chunks are now sorted by ascending PA and all chunks are bounced before
unpack. This fixes an issue where the trampoline chunks were being placed
at the end of the unpack ordering, causing overwrite during unpack.

Revision 1.93 / (download) - annotate - [select for diffs], Wed Jul 9 12:43:51 2014 UTC (9 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.92: +15 -1 lines
Diff to previous 1.92 (colored)



Use suspending kernel's stack smash guard to avoid panicing during unpack.

ok deraadt@

Revision 1.92 / (download) - annotate - [select for diffs], Sat May 31 04:36:59 2014 UTC (10 years ago) by mlarkin
Branch: MAIN
Changes since 1.91: +6 -3 lines
Diff to previous 1.91 (colored)


Fix a format specifier in a debug printf.

Noticed by Josh Grosse.

Revision 1.91 / (download) - annotate - [select for diffs], Thu May 29 08:00:24 2014 UTC (10 years ago) by mlarkin
Branch: MAIN
Changes since 1.90: +30 -14 lines
Diff to previous 1.90 (colored)


Read MAXPHYS bytes at a time in the hibernate image read, instead of
PAGE_SIZE bytes. Completes the MAXPHYS optimizations in the read path.

with input from guenther@ who suggested a version that was a little easier
to understand. Tested on i386 and amd64.

Revision 1.90 / (download) - annotate - [select for diffs], Wed May 21 02:26:49 2014 UTC (10 years ago) by mlarkin
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

Change use of Z_PARTIAL_FLUSH to Z_SYNC_FLUSH in the hibernate code as per
a warning/comment in zlib.h that Z_PARTIAL_FLUSH "will be removed, use
Z_SYNC_FLUSH instead".

Revision 1.89 / (download) - annotate - [select for diffs], Sat Apr 26 05:43:00 2014 UTC (10 years, 1 month ago) by mlarkin
Branch: MAIN
Changes since 1.88: +21 -14 lines
Diff to previous 1.88 (colored)



Perform MAXPHYS-sized reads for the chunktable instead of PAGE_SIZE-sized
reads.

Also fix a VA leak in the chunktable read error path.

Revision 1.88 / (download) - annotate - [select for diffs], Sun Apr 20 14:02:57 2014 UTC (10 years, 1 month ago) by mlarkin
Branch: MAIN
Changes since 1.87: +1 -9 lines
Diff to previous 1.87 (colored)



More dead stores removal in subr_hibernate.c

Revision 1.87 / (download) - annotate - [select for diffs], Sat Apr 19 16:19:07 2014 UTC (10 years, 1 month ago) by mlarkin
Branch: MAIN
Changes since 1.86: +2 -9 lines
Diff to previous 1.86 (colored)



Dead stores in subr_hibernate.c

Revision 1.86 / (download) - annotate - [select for diffs], Fri Mar 21 21:39:36 2014 UTC (10 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.85: +3 -5 lines
Diff to previous 1.85 (colored)

Allow for two more pmap-specific bits in vm_page pg_flags. Define
PG_PMAPMASK as all the possible pmap-specific bits (similar to the other
PG_fooMASK) to make sure MI code does not need to be updated, the next time
more bits are allocated to greedy pmaps.

No functional change, soon to be used by the (greedy) mips64 pmap.

Revision 1.85 / (download) - annotate - [select for diffs], Thu Mar 13 03:52:56 2014 UTC (10 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored)

get rid of the assumption that the head of the alldevs list is the
"mainbus" device. this breaks when mpath is enabled because it
attaches before mainbus and therefore takes the head position.

have autoconf provide device_mainbus() which looks up mainbus_cd,
and use that instead.

discussed with deraadt who just wants mpath stuff to move forward
despite there being many ways to shine this particular turd.

Revision 1.84 / (download) - annotate - [select for diffs], Sat Feb 1 07:10:33 2014 UTC (10 years, 4 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.83: +1 -8 lines
Diff to previous 1.83 (colored)



Remove some of the excessive cache and TLB flushing going on during
hibernate unpack - these were added a while ago when we were fighting
different issues that have now been solved.

Tested by myself and dcoppa on a variety of machines

Revision 1.83 / (download) - annotate - [select for diffs], Tue Jan 21 01:48:44 2014 UTC (10 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.82: +6 -6 lines
Diff to previous 1.82 (colored)

bzero -> memset

Revision 1.82 / (download) - annotate - [select for diffs], Tue Jan 14 09:57:51 2014 UTC (10 years, 4 months ago) by mlarkin
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)



Typo in a printf, should be 'bytes' not 'blocks'

Revision 1.81 / (download) - annotate - [select for diffs], Thu Nov 21 00:13:33 2013 UTC (10 years, 6 months ago) by dlg
Branch: MAIN
Changes since 1.80: +1 -2 lines
Diff to previous 1.80 (colored)

remove the #define b_cylinder b_resid from bufs. i hated the
overloading of that thing.

the only hardware that seems to care about cylinders in our tree
are floppy drives, and the drivers for those calculate their own
cylinders from logical block addresses and ignore whatever the rest
of the kernel thought b_cylinders should be.

most of this diff is moving the floppy drivers to using b_resid as
a resid and using that as part of the calculation for real cylinder
values.

the rest of the diff is getting rid of the useless assignments to
b_cylinder that dont get used by anything (now that disksort is
gone).

ok miod@

Revision 1.80 / (download) - annotate - [select for diffs], Sat Nov 9 06:54:00 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.79: +1 -37 lines
Diff to previous 1.79 (colored)



Remove hibernate_get_next_rle function (unused, and we need to redo it
anyway as we move toward a streamed implmentation)

Revision 1.79 / (download) - annotate - [select for diffs], Sat Nov 9 04:38:42 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.78: +4 -7 lines
Diff to previous 1.78 (colored)

unbias the chunks and chunktable writing and reading.  as a result, it
is now possible to move the chunktable right after the chunks, not at
the end of the swap.
ok mlarkin

Revision 1.78 / (download) - annotate - [select for diffs], Wed Nov 6 19:53:08 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.77: +4 -5 lines
Diff to previous 1.77 (colored)

simplify a crazy expression

Revision 1.77 / (download) - annotate - [select for diffs], Wed Nov 6 19:50:56 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.76: +10 -11 lines
Diff to previous 1.76 (colored)

In hibernate_write_chunks(), keep track of relative block numbers instead
of absolute, so that we can add range checking.
ok mlarkin

Revision 1.76 / (download) - annotate - [select for diffs], Wed Nov 6 19:48:37 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.75: +5 -7 lines
Diff to previous 1.75 (colored)

spacing

Revision 1.75 / (download) - annotate - [select for diffs], Wed Nov 6 19:47:30 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.74: +6 -11 lines
Diff to previous 1.74 (colored)

return the known error, instead of EIO

Revision 1.74 / (download) - annotate - [select for diffs], Wed Nov 6 19:45:47 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.73: +15 -15 lines
Diff to previous 1.73 (colored)

shorten dev_t in hib_info

Revision 1.73 / (download) - annotate - [select for diffs], Wed Nov 6 18:41:00 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.72: +118 -118 lines
Diff to previous 1.72 (colored)

shorten variable name for the hibernate info struct, throughout.  Much
easier to read now.
ok mlarkin

Revision 1.72 / (download) - annotate - [select for diffs], Wed Nov 6 17:03:00 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.71: +17 -19 lines
Diff to previous 1.71 (colored)

use DEV_BSIZE instead of "secsize"
ok mlarkin

Revision 1.71 / (download) - annotate - [select for diffs], Wed Nov 6 12:06:58 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.70: +13 -16 lines
Diff to previous 1.70 (colored)

teach the side-effect free drivers about the partition they are dealing
by passing a start/length in the HIB_INIT op.  Then rebase all
hibernate-time block offsets to be relative to the start of that partition.
This simplifies things a lot.
ok mlarkin

Revision 1.70 / (download) - annotate - [select for diffs], Wed Nov 6 00:52:46 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.69: +1 -3 lines
Diff to previous 1.69 (colored)



Errant assignment that snuck in long ago. Pointed out by deraadt@

Revision 1.69 / (download) - annotate - [select for diffs], Tue Nov 5 07:38:26 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.68: +2 -4 lines
Diff to previous 1.68 (colored)



Change an #if 0 surrounding a debug printf into a DPRINTF instead.

Revision 1.68 / (download) - annotate - [select for diffs], Tue Nov 5 06:02:44 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.67: +21 -15 lines
Diff to previous 1.67 (colored)

new function uvm_hibswap() finds a the largest free zone in swap, which
hibernate can use place the data.
ok mlarkin

Revision 1.67 / (download) - annotate - [select for diffs], Tue Nov 5 00:51:58 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.66: +6 -6 lines
Diff to previous 1.66 (colored)

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Oct 20 17:16:47 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.65: +3 -1 lines
Diff to previous 1.65 (colored)



Informational message on unpack start

Revision 1.65 / (download) - annotate - [select for diffs], Sun Oct 20 10:08:05 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.64: +3 -2 lines
Diff to previous 1.64 (colored)



Provide more debugging aids when failing to read the packed image from disk
during hibernate resume.

requested by deraadt

Revision 1.64 / (download) - annotate - [select for diffs], Sun Oct 20 10:01:29 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.63: +16 -4 lines
Diff to previous 1.63 (colored)



DPRINTFs for various failure cases, disabled by default (uncomment
HIB_DEBUG to see these)

Revision 1.63 / (download) - annotate - [select for diffs], Sun Oct 20 09:44:17 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.62: +5 -1 lines
Diff to previous 1.62 (colored)



Flush the cache after bouncing the inflate page to the piglet.

Fixes resume time stream corruption seen on x230 with large (16GB)
unhibernation

Revision 1.62 / (download) - annotate - [select for diffs], Sun Oct 20 09:27:39 2013 UTC (10 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.61: +7 -5 lines
Diff to previous 1.61 (colored)



Use a second inflate page for stream finalize, since it is possible
(though unlikely) for the end of stream marker to overflow from one page.
This should fix a few (but not all) spurious failure-to-hibernate errors.

Also remove an unnecessary cache flush during deflate.

ok deraadt

Revision 1.61 / (download) - annotate - [select for diffs], Thu Oct 3 03:51:16 2013 UTC (10 years, 8 months ago) by mlarkin
Branch: MAIN
Changes since 1.60: +56 -33 lines
Diff to previous 1.60 (colored)



Adds DPRINTF/DNPRINTF macros to hibernate, and adds invocation of said
macros in various places to assist in debugging "failure to hibernate"
errors.

Macros are disabled by default - Uncomment #define HIB_DEBUG if you want
more verbose messages during hibernate.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Sep 29 15:47:35 2013 UTC (10 years, 8 months ago) by mlarkin
Branch: MAIN
Changes since 1.59: +5 -3 lines
Diff to previous 1.59 (colored)



Print out the compressed image size during unhibernate, for diagnostic
purposes and to give the user an idea as to how much is going to be read
in.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Jun 1 19:06:34 2013 UTC (11 years ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.58: +22 -18 lines
Diff to previous 1.58 (colored)



Work around stack smash protector getting confused because we switched
stacks by not returning (ever) from hibernate_unpack_image.

Revision 1.58 / (download) - annotate - [select for diffs], Sat Jun 1 17:39:20 2013 UTC (11 years ago) by mlarkin
Branch: MAIN
Changes since 1.57: +21 -12 lines
Diff to previous 1.57 (colored)



Change return codes in various hibernate functions to be able to later
distinguish one failure path from another. Comment the same.

Also removed some extraneous comments regarding pmap_activate.

Revision 1.57 / (download) - annotate - [select for diffs], Fri May 31 20:00:00 2013 UTC (11 years ago) by mlarkin
Branch: MAIN
Changes since 1.56: +5 -1 lines
Diff to previous 1.56 (colored)



We need to halt the APs on MP hibernate resume or else they will be
executing code possibly causing side effects during the image unpack
operation. But before we can halt the APs, we need to complete their init
(as they will be hatched but idling, possibly with interrupts off).

Introduces MD function hibernate_quiesce_cpus to do this, called from the
MI hibernate resume code.

ok deraadt

Revision 1.56 / (download) - annotate - [select for diffs], Thu May 30 19:00:59 2013 UTC (11 years ago) by mlarkin
Branch: MAIN
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored)



Make interrupt handling in hibernate resume MI by providing MD-specific
functions to enable and disable interrupts, if needed. If a platform doesnt
need interrupt handling in this way, the MD function can be a no-op.

discussed with pirofti and deraadt

Revision 1.55 / (download) - annotate - [select for diffs], Thu May 30 16:00:54 2013 UTC (11 years ago) by mlarkin
Branch: MAIN
Changes since 1.54: +3 -1 lines
Diff to previous 1.54 (colored)



Comment a KASSERT whose purpose wasn't immediately apparent

Revision 1.54 / (download) - annotate - [select for diffs], Tue Apr 9 18:58:03 2013 UTC (11 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.53: +51 -9 lines
Diff to previous 1.53 (colored)



Add a magic number to the head of the signature block. Check for magic
number match during signature block read during speculative unhibernate on
boot. If the magic number matches but we have otherwise chosen to not
unhibernate (due to kernel/memory mismatch), clear the signature block
early to avoid accidentally trying to unhibernate on subsequent boots. This
prevents accidental unhibernates and endless unhibernate/reboot cycles.

Add a define for HIBERNATE_DEBUG for various debugging printfs (disabled by
default).

Finally, change some KASSERTs to warning printfs (they probably shouldn't
have been KASSERTs in the first place).

"looks good" deraadt@

Revision 1.53 / (download) - annotate - [select for diffs], Thu Mar 28 16:58:45 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.52: +1 -2 lines
Diff to previous 1.52 (colored)

sys/param.h gets you sys/types.h automatically

Revision 1.52 / (download) - annotate - [select for diffs], Thu Mar 7 01:26:54 2013 UTC (11 years, 3 months ago) by mlarkin
Branch: MAIN
Changes since 1.51: +65 -27 lines
Diff to previous 1.51 (colored)



Reword some wrong comments and some improperly formatted comments and add
information about piglet memory layout. No functional changes.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Mar 6 08:34:05 2013 UTC (11 years, 3 months ago) by mlarkin
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)



Fix a bad comparison when calculating the size of the hibernate signature
block

ok deraadt@

Revision 1.50 / (download) - annotate - [select for diffs], Thu Jan 17 02:51:08 2013 UTC (11 years, 4 months ago) by pirofti
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.49: +43 -23 lines
Diff to previous 1.49 (colored)

Style, no functional changes.

Discussed with mlarkin@.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Jan 17 02:36:45 2013 UTC (11 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.48: +6 -1 lines
Diff to previous 1.48 (colored)

Add a hibernate HIB_DONE op.  After the memory-side-effect driver finishes
IO to the disk, DVACT_RESUME the controller back to normal operation.  That
allows us to do the full DVACT_POWERDOWN sequence afterwards.
ok mlarkin

Revision 1.48 / (download) - annotate - [select for diffs], Thu Jan 17 01:28:01 2013 UTC (11 years, 4 months ago) by mlarkin
Branch: MAIN
Changes since 1.47: +8 -9 lines
Diff to previous 1.47 (colored)



increase the number of pages used to hold the chunk ordering map and change
the index type from int to short. Allows amd64 to hibernate with up to 64GB
phys memory

Revision 1.47 / (download) - annotate - [select for diffs], Thu Jan 17 00:11:24 2013 UTC (11 years, 4 months ago) by mlarkin
Branch: MAIN
Changes since 1.46: +63 -38 lines
Diff to previous 1.46 (colored)



fix an error in the amd64 asm unhibernate code and a slight adjustment to
the MI hibernate code to handle 64 bit archs

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jul 19 18:07:03 2012 UTC (11 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.45: +3 -1 lines
Diff to previous 1.45 (colored)

say that we are unhibernating..

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jul 16 12:31:15 2012 UTC (11 years, 10 months ago) by stsp
Branch: MAIN
Changes since 1.44: +3 -5 lines
Diff to previous 1.44 (colored)

Back out my workaround from r1.43 now that jsing has committed a better fix.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jul 16 12:15:58 2012 UTC (11 years, 10 months ago) by jsing
Branch: MAIN
Changes since 1.43: +5 -0 lines
Diff to previous 1.43 (colored)

Make sure we have a swap partition before trying to read or write
hibernate info.

ok mlarkin@ stsp@

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jul 15 16:09:14 2012 UTC (11 years, 10 months ago) by stsp
Branch: MAIN
Changes since 1.42: +5 -3 lines
Diff to previous 1.42 (colored)

Don't panic in hibernate resume if no swap partition exists on the root disk.
ok mlarkin

Revision 1.42 / (download) - annotate - [select for diffs], Thu Jul 12 09:44:09 2012 UTC (11 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.41: +13 -102 lines
Diff to previous 1.41 (colored)



Temporarily don't do RLE page encoding in hibernate to fix some unpacking
corruption seen earlier. This makes hibernate much slower but seems to fix
the corruption problems seen on all machines we've tested on.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Jul 11 16:19:04 2012 UTC (11 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.40: +13 -2 lines
Diff to previous 1.40 (colored)



Enable the swap checker for hibernate

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jul 9 09:47:42 2012 UTC (11 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.39: +15 -9 lines
Diff to previous 1.39 (colored)

DVACT_SUSPEND must be done at cold with interrupts disabled. Failure
to read a hibernate image should restore the spl
ok mlarkin

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jul 8 21:11:49 2012 UTC (11 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.38: +7 -1 lines
Diff to previous 1.38 (colored)



Quiesce and suspend devices in the resuming kernel for hibernate.

ok deraadt@

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jul 8 14:29:52 2012 UTC (11 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.37: +20 -7 lines
Diff to previous 1.37 (colored)

Make hibernate_free() safe to be called even if hibernate areas
allocation failed
ok mlarkin

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jul 8 12:22:26 2012 UTC (11 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.36: +114 -90 lines
Diff to previous 1.36 (colored)



Reorganize some hibernate functions for easier readability.
Fix some incorrect/old comments.

ok deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Jun 21 12:46:30 2012 UTC (11 years, 11 months ago) by jmatthew
Branch: MAIN
Changes since 1.35: +36 -34 lines
Diff to previous 1.35 (colored)

use regular i/o functions in the hibernate resume path.  ahci(4) hibernate
i/o will not mix with regular i/o so it can only be used in the hibernate
path.

ok deraadt@ mlarkin@

Revision 1.35 / (download) - annotate - [select for diffs], Wed Jun 20 17:31:55 2012 UTC (11 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.34: +79 -46 lines
Diff to previous 1.34 (colored)



Fix some hibernate issues on machines with > 3.5GB phys mem

ok deraadt@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Apr 12 14:57:36 2012 UTC (12 years, 2 months ago) by ariane
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

hibernate: fix lock/unlock mismatch

Unlock missed an 'f', which caused it to unlock the in-use pageqs, rather
than the free pageqs as it was supposed to.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Mar 26 16:15:42 2012 UTC (12 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.32: +12 -13 lines
Diff to previous 1.32 (colored)



Fix an integer math error when using the result of uvm_page_rle, and
at the same time increase said function's max RLE page count return value.

Add hooks in the right places to call the hibernate suspend and resume
routines, so that we can enable hibernation with a HIBERNATE option
line in GENERIC and appropriate acpi.c goo.

discussed on and off with deraadt@ over the past few months

Revision 1.32 / (download) - annotate - [select for diffs], Tue Nov 29 05:21:08 2011 UTC (12 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.31: +22 -23 lines
Diff to previous 1.31 (colored)

ready this for big-endian support later on
ok mlarkin

Revision 1.31 / (download) - annotate - [select for diffs], Tue Nov 29 04:59:22 2011 UTC (12 years, 6 months ago) by mlarkin
Branch: MAIN
Changes since 1.30: +4 -2 lines
Diff to previous 1.30 (colored)



Only free the piglet on hibernate fail if we are suspending.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Nov 23 07:11:31 2011 UTC (12 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +5 -4 lines
Diff to previous 1.29 (colored)

clamp uvm_page_rle() to 255 pages at a time
ok mlarkin

Revision 1.29 / (download) - annotate - [select for diffs], Tue Nov 22 07:59:06 2011 UTC (12 years, 6 months ago) by mlarkin
Branch: MAIN
Changes since 1.28: +37 -23 lines
Diff to previous 1.28 (colored)



Ensure we are unpacking the right source address after skipping a range of
RLE pages in hibernate.

ok deraadt@

Revision 1.28 / (download) - annotate - [select for diffs], Fri Nov 18 01:31:37 2011 UTC (12 years, 6 months ago) by mlarkin
Branch: MAIN
Changes since 1.27: +1 -4 lines
Diff to previous 1.27 (colored)



no need to zero all the free pages since we will be skipping them with
rle.

noticed by jasper

Revision 1.27 / (download) - annotate - [select for diffs], Fri Nov 18 00:51:27 2011 UTC (12 years, 6 months ago) by jasper
Branch: MAIN
Changes since 1.26: +10 -10 lines
Diff to previous 1.26 (colored)

- fix a few trailing whitespaces and a spello
- panic strings already get printed with a '\n', so remove the extra ones

ok mlarkin@

Revision 1.26 / (download) - annotate - [select for diffs], Fri Nov 18 00:28:46 2011 UTC (12 years, 6 months ago) by mlarkin
Branch: MAIN
Changes since 1.25: +27 -1 lines
Diff to previous 1.25 (colored)



fix a corner case in rle processing where the rle byte was the last byte
being written to an output buffer

Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 17 23:18:13 2011 UTC (12 years, 6 months ago) by mlarkin
Branch: MAIN
Changes since 1.24: +84 -9 lines
Diff to previous 1.24 (colored)



physmem run length encoding (rle) for hibernate - don't compress or write
pages that are free

Revision 1.24 / (download) - annotate - [select for diffs], Wed Nov 16 23:52:27 2011 UTC (12 years, 6 months ago) by mlarkin
Branch: MAIN
Changes since 1.23: +43 -76 lines
Diff to previous 1.23 (colored)



Reduce use of globals in hibernate code.

discussed with deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Nov 15 17:13:53 2011 UTC (12 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +4 -4 lines
Diff to previous 1.22 (colored)

on failure, hibernate io functions return an errno.  not 1.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Nov 14 00:25:17 2011 UTC (12 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.21: +35 -46 lines
Diff to previous 1.21 (colored)



Use a fixed io_page for all hibernate I/O, which is needed for
ahci_hibernate_io, a skeleton of which is also provided in this diff.

This code is from deraadt@. Tested on a few wd machines to ensure it works
there as well.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Nov 13 23:13:29 2011 UTC (12 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.20: +7 -7 lines
Diff to previous 1.20 (colored)



Add some #defines for the various hibernate I/O modes, some of the
groundwork for *_hibernate_io functions other than wd_hibernate_io

These changes were sent to me by deraadt@

Revision 1.20 / (download) - annotate - [select for diffs], Sun Nov 13 22:36:27 2011 UTC (12 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.19: +22 -2 lines
Diff to previous 1.19 (colored)



In hibernate resume, free the piglet and other VAs we allocated during
suspend.

ok pirofti@

Revision 1.19 / (download) - annotate - [select for diffs], Sun Nov 13 18:38:10 2011 UTC (12 years, 7 months ago) by mlarkin
Branch: MAIN
Changes since 1.18: +60 -41 lines
Diff to previous 1.18 (colored)



Fix a handful of bugs that were causing reboots and other bad behavior
during hibernate resumes.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Sep 22 22:12:45 2011 UTC (12 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +171 -201 lines
Diff to previous 1.17 (colored)

KNF of mlarkin's code, requested by him.  Some improvements to the interface
for talking to the disk driver snuck in.
ok mlarkin

Revision 1.17 / (download) - annotate - [select for diffs], Wed Sep 21 06:13:39 2011 UTC (12 years, 8 months ago) by mlarkin
Branch: MAIN
Changes since 1.16: +7 -6 lines
Diff to previous 1.16 (colored)



Cleanup page calculation for final memory chunk ordering list for
hibernate resume.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Sep 21 02:51:23 2011 UTC (12 years, 8 months ago) by mlarkin
Branch: MAIN
Changes since 1.15: +897 -81 lines
Diff to previous 1.15 (colored)



Perform most of the remaining refactoring of hibernate code into
MI/MD parts. This also introduces a chunk placement routine that was
originally developed at c2k11 with help from drahn and ariane.

There are still a few more things to do for hibernate, but those can be
worked on in-tree. This code is disabled by default, and not yet called.

ok deraadt@ (and deraadt@ said kettenis@ also ok'ed it :) )

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jul 18 16:50:56 2011 UTC (12 years, 10 months ago) by ariane
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Allocations fit if [the end of free space] >= [the end of allocated space].
Change > in comparison to >=.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jul 18 16:48:26 2011 UTC (12 years, 10 months ago) by ariane
Branch: MAIN
Changes since 1.13: +1 -5 lines
Diff to previous 1.13 (colored)

Fix uvm_pmr_alloc_piglet.
A wrong check could cause the piglet allocator to attempt to extract memory
from a range in which the alignment caused it not to fit.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jul 11 03:30:32 2011 UTC (12 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.12: +67 -1 lines
Diff to previous 1.12 (colored)



Add hibernate_read_block and fix a couple of typos in the previous commit.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Jul 9 03:10:27 2011 UTC (12 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.11: +32 -1 lines
Diff to previous 1.11 (colored)



Call (temporarily, until we have RLE page encoding) uvm_pmr_zero_everything
on suspend to ensure we get good zlib compression.

Add MI signature block (hibernate_info) comparison routine

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jul 9 01:30:39 2011 UTC (12 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.10: +123 -1 lines
Diff to previous 1.10 (colored)



Extract hibernate_write_signature and hibernate_clear_signature to the MI
hibernate code, and add chunk range overlap checking.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jul 9 00:55:00 2011 UTC (12 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.9: +83 -7 lines
Diff to previous 1.9 (colored)



Extract MI pmap function hibernate_enter_resume_mapping, refactor old i386
resume pmap code to match.

Add hibernate deflater and inflater and cache flush routines.

Code is not presently called or automatically built.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jul 9 00:27:31 2011 UTC (12 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.8: +28 -1 lines
Diff to previous 1.8 (colored)



Add zlib reset, alloc, and free functions for hibernate image compression

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jul 9 00:08:04 2011 UTC (12 years, 11 months ago) by mlarkin
Branch: MAIN
Changes since 1.7: +74 -2 lines
Diff to previous 1.7 (colored)



Separate some MD and MI bits and a bit of refactoring to make subsequent
commits easier.

Work in progress, hibernate will still not work for you.

ok deraadt@

Revision 1.7 / (download) - annotate - [select for diffs], Fri Jul 8 21:02:49 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.6: +2 -5 lines
Diff to previous 1.6 (colored)

no reason to zero pages we are about to mark dirty

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jul 8 21:00:53 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.5: +42 -1 lines
Diff to previous 1.5 (colored)

Ensure all pages in pmemrange can be marked as dirty.
It'd be a very bad idea to hand out dirty pages as zeroed, just because
we came back from hibernate.

No callers at the moment, will be called on hibernate resume path.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jul 8 18:34:46 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.4: +34 -1 lines
Diff to previous 1.4 (colored)

Put in RLE logic for hibernate compressor.

These have the potential to compress 1MB of physmem into 1 byte.
This works by noting the page is not in use and therefor skipping it.

Needed by mlarkin@ for hibernate.  No callers yet.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Jul 8 18:31:16 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.3: +172 -27 lines
Diff to previous 1.3 (colored)

Change pig allocator to a highest-address selection.
Add piglet allocator, which does a lowest-address selection.

No callers yet, needed by mlarkin@ for hibernate voodoo.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Jul 8 18:25:56 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.2: +45 -1 lines
Diff to previous 1.2 (colored)

Move uvm_pmr_alloc_pig to kern/subr_hibernate.c

No callers, no functional change.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jul 8 18:20:10 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.1: +41 -1 lines
Diff to previous 1.1 (colored)

Move uvm_pmr_zero_everything() to subr_hibernate.

This function will probably die before ever being called
from the in-tree code, since hibernate will move to RLE encoding.

No functional change, function had no callers.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Jul 8 17:58:16 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN

Move hiballoc to hibernate.h, subr_hibernate.c
Next few commits will move other hibernate-specific functionality,
like the pig-allocator, to subr_hibernate.

No functional change, no callers either.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.