Re: [PATCH 07/19] Add memtool module with memory allocation stress-test

2021-11-09 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:29:56PM +1100, Daniel Axtens wrote: > When working on memory, it's nice to be able to test your work. > > Add a memtest module. When compiled with --enable-mm-debug, it exposes > 3 commands: > > * lsmem - print all allocations and free space in all regions > * lsfreemem

Re: [PATCH 08/19] mm: Drop unused unloading of modules on OOM

2021-11-09 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:29:57PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > In `grub_memalign ()`, there's a commented section which would allow for > unloading of unneeded modules in case where there is not enough free > memory available to satisfy a request. Given that this cod

Re: [PATCH 09/19] mm: Allow dynamically requesting additional memory regions

2021-11-09 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:29:58PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > Currently, all platforms will set up their heap on initialization of the > platform code. While this works mostly fine, it poses some limitations > on memory management on us. Most notably, allocating big

Re: [PATCH 10/19] efi: mm: Always request a fixed number of pages on init

2021-11-09 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:29:59PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > When initializing the EFI memory subsytem, we will by default request a > quarter of the available memory, bounded by a minimum/maximum value. > Given that we're about to extend the EFI memory system to d

Re: [PATCH 11/19] efi: mm: Extract function to add memory regions

2021-11-09 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:30:00PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > In preparation of support for runtime-allocating additional memory > region, this patch extracts the function to retrieve the EFI memory map > and add a subset of it to GRUB's own memory regions. > > Sign

[RESEND v3 0/3] use confidential computing provisioned secrets for disk decryption

2021-11-09 Thread James Bottomley
From: James Bottomley v3: make password getter specify prompt requirement. Update for TDX: Make name more generic and expand size of secret area https://github.com/tianocore/edk2/commit/96201ae7bf97c3a2c0ef386110bb93d25e9af1ba https://github.com/tianocore/edk2/commit/caf8b3872ae2a

[RESEND v3 2/3] cryptodisk: add OS provided secret support

2021-11-09 Thread James Bottomley
Make use of the new OS provided secrets API so that if the new '-s' option is passed in we try to extract the secret from the API rather than prompting for it. The primary consumer of this is AMD SEV, which has been programmed to provide an injectable secret to the encrypted virtual machine. OVMF

[RESEND v3 3/3] efi: Add API for retrieving the EFI secret for cryptodisk

2021-11-09 Thread James Bottomley
This module is designed to provide an efisecret command which interrogates the EFI configuration table to find the location of the confidential computing secret and tries to register the secret with the cryptodisk. The secret is stored in a boot allocated area, usually a page in size. The layout o

Re: [PATCH 12/19] efi: mm: Pass up errors from `add_memory_regions ()`

2021-11-09 Thread Daniel Kiper
On Tue, Oct 19, 2021 at 04:37:03PM -0500, Glenn Washburn wrote: > On Tue, 12 Oct 2021 18:30:01 +1100 > Daniel Axtens wrote: > > > From: Patrick Steinhardt > > > > The function `add_memory_regions ()` is currently only called on system > > initialization to allocate a fixed amount of pages. As suc

[RESEND v3 1/3] cryptodisk: make the password getter and additional argument to recover_key

2021-11-09 Thread James Bottomley
For AMD SEV environments, the grub boot password has to be retrieved from a given memory location rather than prompted for. This means that the standard password getter needs to be replaced with one that gets the passphrase from the SEV area and uses that instead. Adding the password getter as a

Re: [PATCH 12/19] efi: mm: Pass up errors from `add_memory_regions ()`

2021-11-09 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:30:01PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > The function `add_memory_regions ()` is currently only called on system > initialization to allocate a fixed amount of pages. As such, it didn't > need to return any errors: in case it failed, we cannot p

Re: [PATCH 13/19] efi: mm: Implement runtime addition of pages

2021-11-09 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:30:02PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > Adjust the interface of `grub_efi_mm_add_regions ()` to take a set of > `GRUB_MM_ADD_REGION_*` flags, which most notably is currently only the > `CONSECUTVE` flag. This allows us to set the function up as