Hi Liming,
Overall, DxeCore will ingest the NX_COMPAT flag on image load.
In the base case, when modules make allocations of type EfiLoaderCode, EfiBootServicesCode, and EfiRuntimeServicesCode, the EFI_MEMORY_XP access attribute will be applied with the expectation that the allocating modules will remove the EFI_MEMORY_XP attribute and apply the EFI_MEMORY_RO attribute once they have loaded their code into the buffer for execution.
In the exception case, if an EFI_APPLICATION type image is loaded without the NX_COMPAT flag then allocations of type EfiLoaderCode, EfiBootServicesCode, and EfiRuntimeServicesCode will no longer have EFI_MEMORY_XP applied for the remainder of boot.
Note that a patch series for the supporting DxeCore logic has not yet been submitted.
Thanks,
Joey