Hi, > > Yes. Knowing both physical and virtual address works only for memory > > you allocated yourself before ExitBootServices. So you can't pass on > > pointers from the OS, you have to copy the data to a buffer where you > > know the physical address instead. Yes, some overhead. Should still > > be much faster than going to pio transfer mode ... > > MacOS takes over the full physical address map past ExitBootServices: Your > code no longer has VA access to random code
That is totally fine. EFI drivers must register everything they need as runtime memory. Anything else can be unmapped by the OS when calling EFI services. > and it literally memcpy()'s all preserved (virtual available) code and > data to different physical addresses. Uhm. I have my doubts this copying behavior is blessed by the UEFI spec. > You simply have nothing that is all of 1) RAM (mapped as cacheable on > ARM), 2) known VA 3) known PA. Bummer. > So we really really need a fallback mechanism that works without DMA > :). On arm it should be relatively simple to move the buffer to device memory. Just place one more region on the platform bus, advertise address + size via device tree, done. Not sure how to do that best on x86 though. Find 64k unused address space over ioapic? Do we have enough free space there? And how future-proof would that be? take care, Gerd