Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6203377iob; Tue, 10 May 2022 12:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbsvaXo/V+D37Q/xK0vqzHKoYXI9isRB5GL4iR30Wc97sF6FjkzL81D6VfAbsifT+wJG7F X-Received: by 2002:a17:90a:1d1:b0:1dd:220a:c433 with SMTP id 17-20020a17090a01d100b001dd220ac433mr1485284pjd.196.1652211919689; Tue, 10 May 2022 12:45:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652211919; cv=none; d=google.com; s=arc-20160816; b=W4nHcYGOjP+PA/WaT8jn+gEgVIY7tGyFJVHA9/AhqfCZYkeltiz5PKccpolCejK9wX 6TbQ6w3zHSl46Cbe/qrzXJmCMBHjmTtF7/m3Se6OtU33pcMVvk8xghrU6Nm+BULH5dnZ pBLiv5vMprNpL9qEDXFWvinph9AZpfDa8YJPvgWG9qlopnlGmW58qYcNKHTAzG64YfB1 CipRlpCDoGVB4/r16rtT5ei1dOMK+7G3/Uu8H2SxDKLrDk4vAJ0hFkvCmtjgjMiXx29J Llrog/1toVL8NjUoRwFNFKrIJ0b7oJ+H0CXcOJ4Ktzxq3fk20o0759u+3efR96BqpNlp Cb1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ax7SDPEzP/qgE51Zjj2ezI4jBQEP7Sh02o9hC2jUGso=; b=zuXsjaHUsdoFAaf0+yHtDcNF8W5XQWRA3sSkR0uOfrNsG8IMAA9BsJGBeTEqmfjUoc Ce2Qnm2nIcjmY1VDwWdOTo60pO7se6VVIB1n3PYznOidhP90Jpyz3vX7ueh8oyEaii6I eSc2FwLGdZmIkAClI1i8RsAN9j/kEO1OfaE2XLyieF21v83TfbnjbgBr0ujEjS2LSafH OJJ71KBCCniS/Ai5uxS1kWe0TMImiBr4G2bLBeMbqZDExRFXG6OEOQBaffmb/5qXDG3u kVZB82ntqBPF5dKZwjUxXAhx/O1+0Ehz6kVS2WqKz72la6s415pcscrvu+Lj7T4Wbo1c viWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a6552ca000000b003c66102b79esi158119pgp.853.2022.05.10.12.45.03; Tue, 10 May 2022 12:45:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241441AbiEJMd3 (ORCPT + 99 others); Tue, 10 May 2022 08:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238445AbiEJMd2 (ORCPT ); Tue, 10 May 2022 08:33:28 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDFBA2A3760; Tue, 10 May 2022 05:29:30 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 5E9151C0B95; Tue, 10 May 2022 14:29:28 +0200 (CEST) Date: Tue, 10 May 2022 14:29:27 +0200 From: Pavel Machek To: Evan Green Cc: LKML , Matthew Garrett , Daniil Lunev , zohar@linux.ibm.com, "James E.J. Bottomley" , linux-integrity@vger.kernel.org, Jonathan Corbet , rjw@rjwysocki.net, Gwendal Grignou , Jarkko Sakkinen , Linux PM , Len Brown , "Rafael J. Wysocki" Subject: Re: [PATCH 08/10] PM: hibernate: Mix user key in encrypted hibernate Message-ID: <20220510122927.GA19328@amd> References: <20220504232102.469959-1-evgreen@chromium.org> <20220504161439.8.I87952411cf83f2199ff7a4cc8c828d357b8c8ce3@changeid> <20220506160820.GB1060@bug> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > One annoyance of the "preloading" scheme is that hibernate image memo= ry > > > is effectively double-allocated: first by the usermode process pulling > > > encrypted contents off of disk and holding it, and second by the kern= el > > > in its giant allocation in prepare_image(). An interesting future > > > optimization would be to allow the kernel to accept and store encrypt= ed > > > page data before the user key is available. This would remove the > > > double allocation problem, as usermode could push the encrypted pages > > > loaded from disk immediately without storing them. The kernel could d= efer > > > decryption of the data until the user key is available, while still > > > knowing the correct page locations to store the encrypted data in. > > > > Um. Dunno. Won't you run out of memory? Hibernation images can be quite= big... > > >=20 > As you know, with the way the snapshot mechanism works, a hibernation > image can be at most 50% of RAM. If the system was using more than There used to be 50% of RAM limit, but it was removed. Best regards, Pavel =09 --=20 People of Russia, stop Putin before his war on Ukraine escalates. --sdtB3X0nJg68CQEu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmJ6WqcACgkQMOfwapXb+vKwggCfU6LTG5MoZ6aeMEdfwivj1685 yUIAnR0jzeK1d2wmq0UYRYOrpRjaWwNn =UpfY -----END PGP SIGNATURE----- --sdtB3X0nJg68CQEu--