This is totally bogus and prevents users build a kernel which can work in either mode. As such its a regression.
Do the detection check at runtime. If it was booted via EFI then don't grovel in places you shouldn't. Indeed its possible EFI should reserve those memory regions ?