With efi_disable_vmap md_virt is 0 in every entry, so efi_early_map() never finds the config tables and the kernel panics before the console is up. Fall back to md_phys when md_virt is 0, and keep md_virt otherwise since it can be non-1:1 when booted via kexec from Linux. efi_is_in_map() only runs after a 1:1 map is accepted, so use md_phys there and skip entries that are not 1:1.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sorry, you're right, it isn't necessary. I took it from this report about the Yoga C630 without testing it here:
https://lists.freebsd.org/archives/freebsd-arm/2022-December/002106.html
I've tested without it now and the Vivobook S15 boots fine, so I'm abandoning this revision. I thought they will have a similar problem. Sorry again for the untested change.
I do think that there is something to improve. amd64 always uses 1:1 mapping, so efi_machdep.c does the following:
if (p->md_virt != 0 && p->md_virt != p->md_phys) {
if (bootverbose)
printf("EFI Runtime entry %d is mapped\n", i);
goto fail;
}Does arm64 also insist on 1:1? If yes, it should perhaps use the same pattern.
yeah arm64 does the same 1:1 check in efirt_machdep.c. used your pattern in efi_is_in_map() since that only runs once the 1:1 map is accepted. left md_virt in efi_early_map() though since it was there for kexec from Linux (where Linux already set up a non-1:1 map), only falling back to md_phys when md_virt == 0. boots on the Vivobook with efi_disable_vmap=YES, updated the diff
So apart from the commit message, this is OK. It does add an additional bogus va == pa requirement for runtime entries, but we already do it elsewhere (which is also bogus: I ran for years on a LinuxBoot arm64 machine w/o this requirement... But I've lost access to that environment so since I can't test it, I can't ask someone else to fix something they can't test)....
| sys/dev/efidev/efirt.c | ||
|---|---|---|
| 153 | This is likely wrong. LinuxBoot routinely generates PA != VA in these tables that none-the-less need to be mapped... There's nothing in UEFI standard that requires a PA == VA mapping for runtime entries. | |
| sys/dev/efidev/efirt.c | ||
|---|---|---|
| 153 | It is wrong in the global sense, yes. | |
| sys/dev/efidev/efirt.c | ||
|---|---|---|
| 153 | Yea. I didn't mean we shouldn't commit this, or I didn't approve, just we'll have to deal with that eventually. | |