On 20.03.2025 09:34, Jan Beulich wrote: > On 20.03.2025 09:14, Roger Pau Monné wrote: >> I wonder how this worked then, as I've tested with the xen.efi smoke >> test in gitlab CI. Maybe ovmf doesn't acknowledge the RX sections and >> unconditionally sets all mappings as writable? > > Possible. And that would be in line with the mode being call "physical mode": > There are no permissions to enforce there. It just so happens that x86-64 > requires paging to be enabled to be able to run 64-bit code. > > My experience with OVMF has been that it's hard to find where certain code > lives. Perhaps I should try whether I can find respective code there. Then > again if I find nothing, there wouldn't be any guarantee that I merely didn't > spot the right place.
All I can find is BaseTools/Source/C/Common/BasePeCoff.c:PeCoffLoaderLoadImage(), which doesn't look to care about section flags at all. (By implication this would mean they needlessly load all the .debug_* sections as well. Then again we need to be glad they ignore the discard flag, or else .reloc wouldn't be loaded either.) Jan