Dato che sono molto paranoico sulla sicurezza, configuro il mio MacBook in modo da essere sempre in "stato di sicurezza" e distruggo il suo tasto FileVault entrando in standby:
$ sudo pmset -a hibernatemode 25 DestroyFVKeyOnStandby 1
Come spiegato in pmset (1) :
hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you should use this setting.
e
destroyfvkeyonstandby - Destroy File Vault Key when going to standby mode. By default File vault keys are retained even when system goes to standby. If the keys are destroyed, user will be prompted to enter the password while coming out of standby mode.(value: 1 - Destroy, 0 - Retain)
Di conseguenza, quando la macchina si risveglia dal sonno bisogna:
- prima sblocca FileVault in una schermata di blocco EFI; e poi
- sblocca OS X in una finestra di accesso.
Storicamente, c'è stato un ritardo comprensibile tra questi due passaggi, come OS X deve ripristinare dall'immagine del disco (copiando il file hibernate nella RAM) prima che sia in grado di fare qualsiasi altra cosa. Mentre ciò accadeva, il display mostrava la finestra di login sovrapposta a una copertura semitrasparente insieme a una barra di avanzamento.
Tuttavia, non vedo più alcun ritardo tra i passaggi 1 e 2. Sembra che OS X sia in grado di riprendere non appena FileVault è sbloccato, il che mi suggerisce che il potere potrebbe non avere stato rimosso dalla RAM come promesso da hibernatemode 25.
Cosa sta succedendo? Come suggerito dai log qui sotto, Apple ha trovato un modo magico per ripristinare gigabyte di RAM dall'immagine del disco in modo impercettibilmente veloce (e, in tal caso, non tutti gli utenti di laptop preferirebbero un "sonno sicuro", magari senza distruggere le chiavi di FileVault, piuttosto che mantenere la RAM alimentata e sprecare la batteria)? O, più probabilmente (?), Il mio MacBook non sta più entrando realmente nel "sonno sicuro"? Se quest'ultimo, perché -e come posso risolverlo?
$ sw_vers ProductName: Mac OS X ProductVersion: 10.11.3 BuildVersion: 15D21 $ pmset -g System-wide power settings: SleepDisabled 0 DestroyFVKeyOnStandby 1 Active Profiles: Battery Power -1 AC Power -1* Currently in use: standbydelay 10800 standby 1 womp 0 halfdim 1 hibernatefile /var/vm/sleepimage powernap 0 gpuswitch 2 networkoversleep 0 disksleep 10 sleep 1 autopoweroffdelay 14400 hibernatemode 25 autopoweroff 0 ttyskeepawake 1 displaysleep 10 acwake 0 lidwake 1 $ cat /var/log/system.log Feb 5 01:19:35 eggyal PowerChime[622]: 53728.262434: GOING TO SLEEP: kStateDarkWake -> kStateAsleep Feb 5 01:19:35 eggyal PowerChime[622]: 53728.262821: Calling goingToSleepBlock Feb 5 01:19:38 eggyal kernel[0]: PM response took 3072 ms (57, powerd) Feb 5 01:19:38 eggyal kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000280 Feb 5 01:19:38 eggyal kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340 Feb 5 01:19:38 eggyal kernel[0]: kern_open_file_for_direct_io(0) Feb 5 01:19:38 eggyal kernel[0]: kern_open_file_for_direct_io took 24 ms Feb 5 01:19:38 eggyal kernel[0]: Opened file /var/log/SleepWakeStacks.bin, size 172032, extents 1, maxio 40000 ssd 1 Feb 5 01:19:38 eggyal kernel[0]: polled file major 1, minor 0, blocksize 4096, pollers 3 Feb 5 07:52:38 eggyal kernel[0]: hibernate image path: /var/vm/sleepimage Feb 5 07:52:38 eggyal kernel[0]: efi pagecount 72 Feb 5 07:52:38 eggyal kernel[0]: hibernate_page_list_setall(preflight 1) start Feb 5 07:52:38 eggyal kernel[0]: hibernate_page_list_setall time: 292 ms Feb 5 07:52:38 eggyal kernel[0]: pages 1229108, wire 262730, act 464069, inact 1872, cleaned 0 spec 10, zf 3948, throt 0, compr 155445, xpmapped 40000 Feb 5 07:52:38 eggyal kernel[0]: could discard act 169997 inact 38206 purgeable 85433 spec 47398 cleaned 0 Feb 5 07:52:38 eggyal kernel[0]: WARNING: hibernate_page_list_setall skipped 10768 xpmapped pages Feb 5 07:52:38 eggyal kernel[0]: hibernate_page_list_setall preflight pageCount 262730 est comp 39 setfile 491782144 min 1073741824 Feb 5 07:52:38 eggyal kernel[0]: kern_open_file_for_direct_io(0) Feb 5 07:52:38 eggyal kernel[0]: kern_open_file_for_direct_io took 21 ms Feb 5 07:52:38 eggyal kernel[0]: Opened file /var/vm/sleepimage, size 1073741824, extents 2, maxio 40000 ssd 1 Feb 5 07:52:38 eggyal kernel[0]: polled file major 1, minor 0, blocksize 4096, pollers 3 Feb 5 07:52:38 eggyal kernel[0]: vm_compressor_record_warmup (29246 - 32193) Feb 5 07:52:38 eggyal kernel[0]: vm_compressor_flush - starting Feb 5 07:52:38 eggyal kernel[0]: vm_compressor_flush completed - took 7834 msecs Feb 5 07:52:38 eggyal kernel[0]: hibernate_flush_memory: buffer_cache_gc freed up 13242 wired pages Feb 5 07:52:38 eggyal kernel[0]: hibernate_alloc_pages act 261470, inact 39096, anon 11567, throt 0, spec 47402, wire 274180, wireinit 32085 Feb 5 07:52:38 eggyal kernel[0]: hibernate_setup(0) took 9624 ms Feb 5 07:52:38 eggyal kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340 Feb 5 01:19:49 eggyal kernel[0]: hibernate_page_list_setall(preflight 0) start Feb 5 07:52:38 eggyal kernel[0]: hibernate_teardown started Feb 5 07:52:38 eggyal kernel[0]: hibernate_teardown: wired_pages 274183, free_pages 1766704, active_pages 40000, inactive_pages 0, speculative_pages 0, cleaned_pages 0, compressor_pages 80 Feb 5 07:52:38 eggyal kernel[0]: hibernate_teardown_pmap_structs done: last_valid_compact_indx 181266 Feb 5 07:52:38 eggyal kernel[0]: hibernate_teardown: mark_as_unneeded_pages 2048, 26515, 18518 Feb 5 07:52:38 eggyal kernel[0]: hibernate_teardown completed - discarded 47081 Feb 5 07:52:38 eggyal kernel[0]: hibernate_page_list_setall time: 649 ms Feb 5 07:52:38 eggyal kernel[0]: pages 550280, wire 202232, act 40000, inact 0, cleaned 0 spec 0, zf 0, throt 0, compr 80, xpmapped 40000 Feb 5 07:52:38 eggyal kernel[0]: did discard act 136037 inact 39096 purgeable 85433 spec 47402 cleaned 0 Feb 5 07:52:38 eggyal kernel[0]: WARNING: hibernate_page_list_setall skipped 16430 xpmapped pages Feb 5 07:52:38 eggyal kernel[0]: hibernate_page_list_setall found pageCount 242312 Feb 5 07:52:38 eggyal kernel[0]: IOHibernatePollerOpen, ml_get_interrupts_enabled 0 Feb 5 07:52:38 eggyal kernel[0]: IOHibernatePollerOpen(0) Feb 5 07:52:38 eggyal kernel[0]: encryptStart 14010 Feb 5 07:52:38 eggyal kernel[0]: bitmap_size 0x3f444, previewSize 0x4028, writing 241958 pages @ 0x5747c Feb 5 07:52:38 eggyal kernel[0]: hibernate_rebuild started Feb 5 07:52:38 eggyal kernel[0]: hibernate_rebuild_pmap_structs done: last_valid_compact_indx 181266 Feb 5 07:52:38 eggyal kernel[0]: hibernate_rebuild completed - took 51 msecs Feb 5 07:52:38 eggyal kernel[0]: booter start at 1073 ms smc 0 ms, [17, 0, 0] total 16393 ms, dsply 0, 0 ms, tramp 544 ms Feb 5 07:52:38 eggyal kernel[0]: hibernate_machine_init: state 2, image pages 202019, sum was be127fc2, imageSize 0x17cb5000, image1Size 0xecb6000, conflictCount 2498, nextFree acf Feb 5 07:52:38 eggyal kernel[0]: hibernate_newruntime_map time: 0 ms, IOPolledFilePollersOpen(), ml_get_interrupts_enabled 0 Feb 5 07:52:38 eggyal kernel[0]: IOPolledFilePollersOpen(0) 1 ms Feb 5 07:52:38 eggyal kernel[0]: hibernate_machine_init reading Feb 5 07:52:38 eggyal kernel[0]: PMStats: Hibernate read took 281 ms Feb 5 07:52:38 eggyal kernel[0]: hibernate_machine_init pagesDone 242099 sum2 91d0cb87, time: 281 ms, disk(0x20000) 512 Mb/s, comp bytes: 47316992 time: 36 ms 1232 Mb/s, crypt bytes: 150990848 time: 38 ms 3702 Mb/s