Hi!
I see that an AHCI descriptor block's location is given by the corresponding PCI device's BAR. However, I do not see this same memory range being reserved in the UEFI memory map (in QEMU).
Since UEFI performs some initialization of SATA drives, I would have hoped that it would reserve the appropriate memory regions. I haven't found the documentation declaring whether this is UEFI's remit, but perhaps I've missed it in the UEFI spec.
If I am intended to preserve this memory region, I am concerned that I am clobbering other device's memory without realizing. I am also concerned that my driver might not come up fast enough to prevent this memory being handed out, though this seems like a theoretical worry only for the moment.
If anyone could shed info or insight, I would be grateful. Thanks!
[Solved] Is UEFI supposed to reserve AHCI memory regions?
-
- Member
- Posts: 77
- Joined: Fri May 20, 2016 2:29 pm
- Location: London, UK
- GitHub: https://github.com/codyd51
- Contact:
[Solved] Is UEFI supposed to reserve AHCI memory regions?
Last edited by codyd51 on Mon Apr 11, 2022 12:05 am, edited 1 time in total.
Re: Is UEFI supposed to reserve AHCI memory regions?
I assume your writing a UEFI driver. In that case, the driver itself will reserve the memory so long as exitBootServices has not been called. I'm not sure though how that affects the memory map -- I'd assume such memory would be marked as reserved if you acquire the memory map *before* you call ExitBootServices.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Is UEFI supposed to reserve AHCI memory regions?
Are you talking about the HBA memory registers, or are you talking about the RAM used by the UEFI AHCI driver?
If you're talking about the HBA memory registers, those aren't in the memory map at all.
If you're talking about the RAM used by the UEFI AHCI driver, that's not supposed to be reserved because your AHCI driver must allocate its own memory instead of trying to reuse the same memory as the UEFI AHCI driver.
If you're talking about the HBA memory registers, those aren't in the memory map at all.
If you're talking about the RAM used by the UEFI AHCI driver, that's not supposed to be reserved because your AHCI driver must allocate its own memory instead of trying to reuse the same memory as the UEFI AHCI driver.
-
- Member
- Posts: 77
- Joined: Fri May 20, 2016 2:29 pm
- Location: London, UK
- GitHub: https://github.com/codyd51
- Contact:
Re: Is UEFI supposed to reserve AHCI memory regions?
Thanks, both. I'll mark this post as [Solved].
I was talking about the HBA memory registers.Octocontrabass wrote:Are you talking about the HBA memory registers, or are you talking about the RAM used by the UEFI AHCI driver?
Re: [Solved] Is UEFI supposed to reserve AHCI memory regions
Oh, I thought you were talking about the driver that TianoCore/EDK2/<insert UEFI implementation here> uses. In that case no, those definitely won't appear in the memory map -- they're not supposed to. They would most likely show up as a huge block of free memory or MMIO RAM. I suspect that it'd be marked as free RAM though.