From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jfqC5-0006U0-8P for mharc-grub-devel@gnu.org; Mon, 01 Jun 2020 15:33:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfqC3-0006Tj-CF for grub-devel@gnu.org; Mon, 01 Jun 2020 15:33:55 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:59487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfqC2-00025P-0J for grub-devel@gnu.org; Mon, 01 Jun 2020 15:33:55 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 35A78AF3; Mon, 1 Jun 2020 15:33:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 01 Jun 2020 15:33:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:mime-version:content-type; s=fm1; bh=p2B0ocsHooeeowV/EnPbOXVdH3AsWgey4Gs1eeU0S1I=; b=eq2hD2NFo+Gg uzcsEm0ReGiS4GYApGE6l/AwNlhyT1adC3NvMbKLvqHc1c5gZq74K3kK/0SyJ6le Sl4FzOIsRe3DvT8ixOI35Z7x8Slk+Tfseng/pfMglTWDj8+ZZGu/yN7oWg09GHN9 eUuwi7ihfxMrKvvHunkil1meR2+XEepZgJeeJShACEg+XA1AwhYBkdtrVQ2jrqTD FEoYo+YjwX822kctJgFcCJiiiwkdRQijvx7pbMgKui/t0I7I+QQdK05Drx/bUhCF Yw3+M14eOvQ+t+taPzfZOGz1LkJpHPiUk+gObmQmN5WViLLaSMYgQeWgTEFwU/5g EUJZZXx79A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=p2B0ocsHooeeowV/EnPbOXVdH3AsW gey4Gs1eeU0S1I=; b=s6IFsZXL8ms1G1fvotIeWk60qqkCJc9UVZD4VpJk+Gc1K PH+kLlJHFCFLJaEENSbxR8AxXUTOwjZ4KqO9cmRt4hkuyRDwshVrU3mdZkjbodAe xEfDRIHHuZQR4O0wpwQLD9fg1ZT4u5onlA4TMEKExqHKW1P/MSVLFg8H6Pbowg65 AZzvL1WFZJMT/2ADMrrRhjNuNtRFs+JGYaCeNQ1eiyDWtqV0WZyqgx5JvVdi3xkF Ye+xKePygDDDq6blgrUDtMqtoeJaPucVnzV2Op+DqiBwQJNzkq4Fnymb5jvoFb2i vUisRPNa/jP6XPtwgZn5RrgPZKIGu2dkcBmpF4CCQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefhedgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugesghdtreertddtvdenucfhrhhomheprfgrthhrihgt khcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnh epjeeifedvueelfffgjeduffdvgefhiefgjefgvddvfeduvefffeevfffhgfekieffnecu kfhppeejjedrudefrddvfedurddvtdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (x4d0de7cb.dyn.telefonica.de [77.13.231.203]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A7DB30624CC; Mon, 1 Jun 2020 15:33:48 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 193e5b5b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 1 Jun 2020 19:33:44 +0000 (UTC) Date: Mon, 1 Jun 2020 21:34:33 +0200 From: Patrick Steinhardt To: The development of GNU GRUB Cc: Leif Lindholm , Daniel Kiper Subject: [RFC PATCH 0/3] Runtime allocation of memory regions Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline Received-SPF: pass client-ip=64.147.123.21; envelope-from=ps@pks.im; helo=wout5-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/01 15:33:50 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2020 19:33:55 -0000 --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, as you may be aware, LUKS2 currently doesn't support the Argon2 key derival function (KDF). While the implementation itself isn't much of a problem in theory, one issue we currently have is that Argon2 is a memory-safe KDF and thus requires huge chunks of memory. The memory management subsystem isn't currently up to task to handle huge allocations on all platforms. So back in March, we decided to improve the MM subsystem first before landing Argon2 support. This patch series is a first RFC to ask for feedback on my chosen approach. It implements a new callback that may be set up by the platform-MM-implementation. In case currently allocated memory regions don't have sufficient bytes available to satisfy a given memory allocation, the callback will be invoked in order to make an additional memory region available that can satisfy the request. As such, we avoid all the downsides of pre-allocating a huge heap and can just dynamically handle any huge requests. I only compile-tested the code, meaning it probably won't work out-of-the-box. My intention is mainly to first get an agreement on whether this seems like a sensible approach to fix the problem. Patrick Patrick Steinhardt (3): mm: allow dynamically requesting additional memory regions efi: mm: extract function to add memory regions efi: mm: implement runtime addition of pages grub-core/kern/efi/mm.c | 66 +++++++++++++++++------------------------ grub-core/kern/mm.c | 11 ++++++- include/grub/mm.h | 13 ++++++++ 3 files changed, 50 insertions(+), 40 deletions(-) --=20 2.26.2 --7JfCtLOvnd9MIVvH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl7VWEgACgkQVbJhu7ck PpSjIg/+OrSYWPj+RMkhWaspcLqp4/fYjDx1swdPHMH1pCUcJy2X4JXheNFrCCD7 gfImsIKKgn0L9Q9QBDXH3+7DupDHqh+LYppz+lYzwffDFjxFwSwajaWAlwTfJ1OZ RHKsoRWf/mT0FVMLdL9zeZATBJg0Qyjj2qlBndAEK+4xmf3f0PCaA9GpwDXkR32K yuNuBRAF3Cfd5ZdsWRokk0naZPfm0tkNq3B53KpDC4mE5gxV97VRfq1hOBSIpoSs wEq/DYVoAykkAGNDUo20V9Cc07fhjJSuCO8hakI07LwF/QMkSM3B0KDyHewOGAQe PK4s8i5iY5DRrFhPzBr01pibD2s49I9QT1CtKtr7Z2BXqWgiEYUkXrLTo+L0snIV arUedT1YbTbaB6E0GGnCEhKlgNiRNVKWLJ2jP34lsMMZ85vjFiZrL3ePiAbg+Z7K zZQYwJWMnsRsGzKbV3dLNsTsNr8YoKXnQxqsepxCZJlQye+C5/LeqyN7h+/8TT59 Xgtj0c0PTeff8kZLAYPXqtohC0NTotURnIZFXXhVIbcKoeDLazd1maf+OKnyAiDc 336V5GsKOcs+DZFtBt8PLvRqVQGeI2HW+ICLg3DqnY7nAQcf2b02Rih5raFILKoE bVi1gib+s4fLr0v4w+mWq/oksWC94fRBqSqeDijnCKG6FpNWVMk= =RG9r -----END PGP SIGNATURE----- --7JfCtLOvnd9MIVvH--