From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C549C433E0 for ; Fri, 3 Jul 2020 22:39:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0765620885 for ; Fri, 3 Jul 2020 22:39:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0765620885 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C90F8D00A2; Fri, 3 Jul 2020 18:39:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 678EF8D0010; Fri, 3 Jul 2020 18:39:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58E688D00A2; Fri, 3 Jul 2020 18:39:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 40B158D0010 for ; Fri, 3 Jul 2020 18:39:12 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D46441AB0E for ; Fri, 3 Jul 2020 22:39:11 +0000 (UTC) X-FDA: 76998231702.21.alley11_1a106ba26e95 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id B3468180442C0 for ; Fri, 3 Jul 2020 22:39:11 +0000 (UTC) X-HE-Tag: alley11_1a106ba26e95 X-Filterd-Recvd-Size: 3909 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 22:39:11 +0000 (UTC) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id ECCA91C0C0F; Sat, 4 Jul 2020 00:39:05 +0200 (CEST) Date: Sat, 4 Jul 2020 00:39:05 +0200 From: Pavel Machek To: "Rafael J. Wysocki" Cc: Michal Hocko , "Catangiu, Adrian Costin" , "linux-mm@kvack.org" , "linux-pm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "linux-api@vger.kernel.org" , "akpm@linux-foundation.org" , "rjw@rjwysocki.net" , "len.brown@intel.com" , "fweimer@redhat.com" , "keescook@chromium.org" , "luto@amacapital.net" , "wad@chromium.org" , "mingo@kernel.org" , "bonzini@gnu.org" , "Graf (AWS), Alexander" , "MacCarthaigh, Colm" , "Singh, Balbir" , "Sandu, Andrei" , "Brooker, Marc" , "Weiss, Radu" , "Manwaring, Derek" Subject: Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND 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" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Rspamd-Queue-Id: B3468180442C0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --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--