Setting up MTRRs
Posted: Sat Dec 10, 2011 1:53 pm
After looking through chapter 11 volume 3 of the intel manuals on caching, I have a couple questions about the use of MTRRs and PAT bits:
1. As far as memory types/caching modes, it seems that the MTRRs do pretty much the same thing as PAT bits in allowing you to select memory types. Other than giving you more control/granularity, is there any reason that an OS would want to use PAT bits in paging structure entries? I can see how it would also be useful for overriding MTRR settings on a per-page/per-process basis, but I'm not even sure what that would be needed for. The reason I'm asking is that I'm trying to decide if it's worth it to write a module in my kernel to allow configuration of memory types.
2. From what I've seen on the forums and wiki, it appears that BIOS sets up MTRRs based on the system memory map. If this is the case, would there be any reason at all for my kernel to want to change the MTRRs? I've seen a few posts about modifying an MTRR for the video buffer, but other than that there doesn't seem like any reason to change them. It seems like the BIOS would be much better at determining the system memory map and configuring MTRRs on a per-system basis than my kernel could be...
Thanks for your help
1. As far as memory types/caching modes, it seems that the MTRRs do pretty much the same thing as PAT bits in allowing you to select memory types. Other than giving you more control/granularity, is there any reason that an OS would want to use PAT bits in paging structure entries? I can see how it would also be useful for overriding MTRR settings on a per-page/per-process basis, but I'm not even sure what that would be needed for. The reason I'm asking is that I'm trying to decide if it's worth it to write a module in my kernel to allow configuration of memory types.
2. From what I've seen on the forums and wiki, it appears that BIOS sets up MTRRs based on the system memory map. If this is the case, would there be any reason at all for my kernel to want to change the MTRRs? I've seen a few posts about modifying an MTRR for the video buffer, but other than that there doesn't seem like any reason to change them. It seems like the BIOS would be much better at determining the system memory map and configuring MTRRs on a per-system basis than my kernel could be...
Thanks for your help