Page MenuHomeFreeBSD

efirt: Don't enter EFI context early, convert addrs to KVA instead
ClosedPublic

Authored by kevans on Aug 4 2018, 3:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 30, 6:26 AM
Unknown Object (File)
Tue, Nov 26, 1:18 AM
Unknown Object (File)
Nov 15 2024, 3:38 PM
Unknown Object (File)
Nov 10 2024, 12:17 AM
Unknown Object (File)
Nov 5 2024, 1:28 PM
Unknown Object (File)
Oct 22 2024, 2:35 AM
Unknown Object (File)
Oct 17 2024, 8:35 PM
Unknown Object (File)
Oct 17 2024, 8:35 PM
Subscribers

Details

Summary

efi_enter here was needed because efi_runtime dereference causes a fault outside of EFI context, due to runtime table living in runtime service space. This may cause problems early in boot, though, so instead access it by converting paddr to KVA.

While here, remove the other direct PHYS_TO_DMAP calls and the DMAP requirement from efidev.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Upload correct version of patch, with (void *) cast.

No, this is not enough to support arbitrary arch for RT. There is no way we can prevent EFIRT runtime memory overlapping with the vital kernel memory, so we generally need to relocate runtime memory during the loading. And this means that loader must know enough about the KVA layout.

Amd64 and arm64 use a trick which cannot be directly ported to i386 or armv7.

This revision is now accepted and ready to land.Aug 4 2018, 4:02 PM
In D16591#352449, @kib wrote:

No, this is not enough to support arbitrary arch for RT. There is no way we can prevent EFIRT runtime memory overlapping with the vital kernel memory, so we generally need to relocate runtime memory during the loading. And this means that loader must know enough about the KVA layout.

Right, no, I realize there's more. =) That comment was strictly directed at DMAP requirement in efidev, which is only there to do this conversion..

I was going to hold off on this a bit, but this would seem to be objectively the more correct way to do whether it fixes Eitan's and this other PR's problem or not.

This revision was automatically updated to reflect the committed changes.