On 04/15/20 18:25, Laszlo Ersek wrote: > In other words, I personally believe that bug#1974 should have been > closed as INVALID (without patching the edk2 source). The EBS handler in > SnpDxe is necessary (as long as it does not alter the UEFI memory map > itself), because sending the Shutdown CDB at EBS *is* needed, and the > UNDI-providing agent that processes the Shutdown CDB *cannot* release > UEFI-owned memory.
For the patch that's being proposed in this thread: Reviewed-by: Laszlo Ersek <ler...@redhat.com> However, there *is* a bug in SnpNotifyExitBootServices(). Namely, it calls PxeShutdown(), and PxeShutdown() does two things: (a) it sends the Shutdown CDB, (b) it calls Snp->PciIo->FreeBuffer(). Step (a) is required in the EBS handler context. Step (b) is *forbidden* in the EBS handler context. Therefore, the cut must be made *between* steps (a) and (b). PxeShutdown() is alright to call from SimpleNetworkDriverStop(), but it is *not* fit for an EBS handler. (SnpNotifyExitBootServices() also calls PxeStop(). I'm not sure if that is really necessary, but at least PxeStop() only sends a CDB to UNDI, and manipulates "Snp->Mode.State". Those actions do not interfere with the UEFI memmap, so they are harmless in this aspect.) "in my opinion", as always :) Thanks, Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#57418): https://edk2.groups.io/g/devel/message/57418 Mute This Topic: https://groups.io/mt/72903680/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-