On Tue, 27 Jun 2023 at 10:00, Matthew Garrett <mjg59@xxxxxxxxxxxxx> wrote: > > On Tue, Jun 27, 2023 at 09:41:32AM +0200, Ard Biesheuvel wrote: > > > However, the stub will invoke DisconnectController() on all endpoints > > downstream of the PCI bridges it disables, and this may affect the > > layout of the EFI memory map, making it likely that ExitBootServices() > > will fail the first time around, and that the EFI memory map needs to be > > reloaded. > > Isn't it always likely that ExitBootServices() will fail the first time > around, but disable_early_pci_dma makes it more likely it'll have > changed by enough that we need a bigger map? Not quite. It should only fail the first time if the memory map changed since the last call to GetMemoryMap(), and normally, this will only happen if some kind of asynchronous event was triggered after GetMemoryMap() but before ExitBootServices(). (This is why calling ExitBootServices() at most twice should always suffice: the first call disables the timer interrupt, so the second time around, no events will fire in the mean time) In this case, we explicitly invoke boot services between GetMemoryMap() and ExitBootServices(), making the first failure substantially more likely. > Other than that potential > quibble over the changelog, > > Acked-by: Matthew Garrett <mjg59@xxxxxxxxxxxxx> Thanks