UEFI memory map strange attributes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mariuszp
Member
Member
Posts: 593
Joined: Sat Oct 16, 2010 3:38 pm

UEFI memory map strange attributes

Post by mariuszp »

When I get the memory map from UEFI, it returns valid ranges, but the memory marked as EfiConventionalMemory (7) has the attribute 0xF - this means uncacheable, write combining, write-through and write-back. Conventional memory should obviously be write-back. I've heard (but don't know how to confirm) that the memory attributes might be wrong for conventional memory - and these are clearly garbage.

Has anyone else seen this? Am i supposed to just ignore the attributes for conventional memory?
Octocontrabass
Member
Member
Posts: 6247
Joined: Mon Mar 25, 2013 7:01 pm

Re: UEFI memory map strange attributes

Post by Octocontrabass »

Those attributes look correct to me. The attributes indicate capabilities, and ordinary RAM is capable of using any of those four caching modes. Yes, you usually want write-back, but the other three choices are still valid and occasionally necessary (e.g. buffers for HD Audio devices).
mariuszp
Member
Member
Posts: 593
Joined: Sat Oct 16, 2010 3:38 pm

Re: UEFI memory map strange attributes

Post by mariuszp »

I was under the impression that these were telling me how to map them. I guess i should be using the Memory Type instead?
Octocontrabass
Member
Member
Posts: 6247
Joined: Mon Mar 25, 2013 7:01 pm

Re: UEFI memory map strange attributes

Post by Octocontrabass »

You're supposed to use both. The memory type tells you what you're mapping, and the attributes tell you how you're allowed to map it.

I can't think of any situation where ordinary RAM wouldn't have the write-back attribute, though, so it might be okay to ignore the attributes in this case.
Post Reply