From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND Date: Sat, 4 Jul 2020 00:39:05 +0200 Message-ID: <20200703223905.GB25072@amd> References: <20200703113026.GT18446@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oC1+HKm2/end4ao3" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Rafael J. Wysocki" Cc: Michal Hocko , "Catangiu, Adrian Costin" , "linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org" , "linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org" , "rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org" , "len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org" , "fweimer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org" , "luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org" , "wad-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org" , "mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "bonzini-mXXj517/zsQ@public.gmane.org" , "Graf (AWS), Alexander" List-Id: virtualization@lists.linuxfoundation.org --oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2020-07-03 14:17:50, Rafael J. Wysocki wrote: > On Fri, Jul 3, 2020 at 1:30 PM Michal Hocko wrote: > > > > On Fri 03-07-20 10:34:09, Catangiu, Adrian Costin wrote: > > > This patch adds logic to the kernel power code to zero out contents of > > > all MADV_WIPEONSUSPEND VMAs present in the system during its transiti= on > > > to any suspend state equal or greater/deeper than Suspend-to-memory, > > > known as S3. > > > > How does the application learn that its memory got wiped? S2disk is an > > async operation and it can happen at any time during the task execution. > > So how does the application work to prevent from corrupted state - e.g. > > when suspended between two memory loads? >=20 > This doesn't affect hibernation AFAICS, but system suspend > (suspend-to-RAM or suspend-to-idle, or standby) is async too. >=20 > I guess this calls for an interface to notify user space (that opted > in to receive such notifications) on system-wide suspend start and > finish. We could simply provide a file that would produce single byte 'e' when entering the suspend and different byte 'x' when exiting... Not sure how useful that would be for the crypto stuff... Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --oC1+HKm2/end4ao3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl7/s4kACgkQMOfwapXb+vIUJQCfZyt+lUVQmqy5smyeJI74Hz2s FDAAoJdmlYDuJFsp9s0LjrrhyUvYHQG+ =XPvj -----END PGP SIGNATURE----- --oC1+HKm2/end4ao3--