summaryrefslogtreecommitdiff
path: root/sys/kern/subr_hibernate.c
AgeCommit message (Collapse)Author
2014-03-13get rid of the assumption that the head of the alldevs list is theDavid Gwynne
"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.
2014-02-01Remove some of the excessive cache and TLB flushing going on duringMike Larkin
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
2014-01-21bzero -> memsetTed Unangst
2014-01-14Typo in a printf, should be 'bytes' not 'blocks'Mike Larkin
2013-11-21remove the #define b_cylinder b_resid from bufs. i hated theDavid Gwynne
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@
2013-11-09Remove hibernate_get_next_rle function (unused, and we need to redo itMike Larkin
anyway as we move toward a streamed implmentation)
2013-11-09unbias the chunks and chunktable writing and reading. as a result, itTheo de Raadt
is now possible to move the chunktable right after the chunks, not at the end of the swap. ok mlarkin
2013-11-06simplify a crazy expressionTheo de Raadt
2013-11-06In hibernate_write_chunks(), keep track of relative block numbers insteadTheo de Raadt
of absolute, so that we can add range checking. ok mlarkin
2013-11-06spacingTheo de Raadt
2013-11-06return the known error, instead of EIOTheo de Raadt
2013-11-06shorten dev_t in hib_infoTheo de Raadt
2013-11-06shorten variable name for the hibernate info struct, throughout. MuchTheo de Raadt
easier to read now. ok mlarkin
2013-11-06use DEV_BSIZE instead of "secsize"Theo de Raadt
ok mlarkin
2013-11-06teach the side-effect free drivers about the partition they are dealingTheo de Raadt
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
2013-11-06Errant assignment that snuck in long ago. Pointed out by deraadt@Mike Larkin
2013-11-05Change an #if 0 surrounding a debug printf into a DPRINTF instead.Mike Larkin
2013-11-05new function uvm_hibswap() finds a the largest free zone in swap, whichTheo de Raadt
hibernate can use place the data. ok mlarkin
2013-11-05Replace direct references to p_size, p_offset and d_secperunit withKenneth R Westerback
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.
2013-10-20Informational message on unpack startMike Larkin
2013-10-20Provide more debugging aids when failing to read the packed image from diskMike Larkin
during hibernate resume. requested by deraadt
2013-10-20DPRINTFs for various failure cases, disabled by default (uncommentMike Larkin
HIB_DEBUG to see these)
2013-10-20Flush the cache after bouncing the inflate page to the piglet.Mike Larkin
Fixes resume time stream corruption seen on x230 with large (16GB) unhibernation
2013-10-20Use a second inflate page for stream finalize, since it is possibleMike Larkin
(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
2013-10-03Adds DPRINTF/DNPRINTF macros to hibernate, and adds invocation of saidMike Larkin
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.
2013-09-29Print out the compressed image size during unhibernate, for diagnosticMike Larkin
purposes and to give the user an idea as to how much is going to be read in.
2013-06-01Work around stack smash protector getting confused because we switchedMike Larkin
stacks by not returning (ever) from hibernate_unpack_image.
2013-06-01Change return codes in various hibernate functions to be able to laterMike Larkin
distinguish one failure path from another. Comment the same. Also removed some extraneous comments regarding pmap_activate.
2013-05-31We need to halt the APs on MP hibernate resume or else they will beMike Larkin
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
2013-05-30Make interrupt handling in hibernate resume MI by providing MD-specificMike Larkin
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
2013-05-30Comment a KASSERT whose purpose wasn't immediately apparentMike Larkin
2013-04-09Add a magic number to the head of the signature block. Check for magicMike Larkin
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@
2013-03-28sys/param.h gets you sys/types.h automaticallyTheo de Raadt
2013-03-07Reword some wrong comments and some improperly formatted comments and addMike Larkin
information about piglet memory layout. No functional changes.
2013-03-06Fix a bad comparison when calculating the size of the hibernate signatureMike Larkin
block ok deraadt@
2013-01-17Style, no functional changes.Paul Irofti
Discussed with mlarkin@.
2013-01-17Add a hibernate HIB_DONE op. After the memory-side-effect driver finishesTheo de Raadt
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
2013-01-17increase the number of pages used to hold the chunk ordering map and changeMike Larkin
the index type from int to short. Allows amd64 to hibernate with up to 64GB phys memory
2013-01-17fix an error in the amd64 asm unhibernate code and a slight adjustment toMike Larkin
the MI hibernate code to handle 64 bit archs
2012-07-19say that we are unhibernating..Theo de Raadt
2012-07-16Back out my workaround from r1.43 now that jsing has committed a better fix.Stefan Sperling
2012-07-16Make sure we have a swap partition before trying to read or writeJoel Sing
hibernate info. ok mlarkin@ stsp@
2012-07-15Don't panic in hibernate resume if no swap partition exists on the root disk.Stefan Sperling
ok mlarkin
2012-07-12Temporarily don't do RLE page encoding in hibernate to fix some unpackingMike Larkin
corruption seen earlier. This makes hibernate much slower but seems to fix the corruption problems seen on all machines we've tested on.
2012-07-11Enable the swap checker for hibernateMike Larkin
2012-07-09DVACT_SUSPEND must be done at cold with interrupts disabled. FailureTheo de Raadt
to read a hibernate image should restore the spl ok mlarkin
2012-07-08Quiesce and suspend devices in the resuming kernel for hibernate.Mike Larkin
ok deraadt@
2012-07-08Make hibernate_free() safe to be called even if hibernate areasTheo de Raadt
allocation failed ok mlarkin
2012-07-08Reorganize some hibernate functions for easier readability.Mike Larkin
Fix some incorrect/old comments. ok deraadt@
2012-06-21use regular i/o functions in the hibernate resume path. ahci(4) hibernateJonathan Matthew
i/o will not mix with regular i/o so it can only be used in the hibernate path. ok deraadt@ mlarkin@