This fixes a problem encountered on the Thinkpad X220/Yoga 11e where runtime services would try to inexplicably jump to other parts of memory where it shouldn't be when attempting to enumerate EFI vars, causing a panic.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Address feedback by @kib:
- Use already defined NextMemoryDescriptor
- Set VA = PA then memcpy whole descriptor
- Allow efi_disable_vmap to be set in loader.conf(5) to disable virtual mapping
stand/efi/loader/bootinfo.c | ||
---|---|---|
249 | I swear that wasn't there when I was throwing this together last night. |
stand/efi/loader/bootinfo.c | ||
---|---|---|
259 | I wasn't sure if this was OK or not- mmsz seems to be larger than sizeof(*desc), and I wasn't sure if the excess was just padding or firmware-specific bits that should be preserved. |
stand/efi/loader/bootinfo.c | ||
---|---|---|
259 | Ok. |
Comment Actions
Address a couple more concerns:
- Consolidate desc, viter, vmap declarations
- Just set *viter = *desc; I thought I had observed that mmsz > sizeof(*desc) in early testing yesterday, but mmsz is explicitly set to sizeof(EFI_MEMORY_DESCRIPTOR)...
- Don't use implicit boolean tresting for (attribute & EFI_MEMORY_RUNTIME)