User space application address = 0x39fcef3c. I do a !vtop 0 0x39fcef3c
to get the physical address = 0x9f8def3c. Now I want check whether it is UC, WB or WP. So, I did a !mtrr it gave me mapping all below 1M. Please advice how can I get MTRR mapping for > 1M. Or is their easier way out not to depend on MTRR mapping.
Another question, suppose it turns out to be neither UC, WB nor WP than can I assume it as Cached? Thanks
xxxxx@gmail.com wrote:
User space application address = 0x39fcef3c. I do a !vtop 0 0x39fcef3c
to get the physical address = 0x9f8def3c. Now I want check whether it is UC, WB or WP. So, I did a !mtrr it gave me mapping all below 1M. Please advice how can I get MTRR mapping for > 1M. Or is their easier way out not to depend on MTRR mapping.
It should have shown you a set of fixed mappings below 1M, then a list
of variable mappings that cover the rest of the address space.
Another question, suppose it turns out to be neither UC, WB nor WP than can I assume it as Cached?
You will probably find that all of your address space is either UC
(uncached) or WB (write-back cached). It’s possible your graphics
driver set up the graphics card’s region as WC, but all of your physical
memory is going to be WB.
The default for regions not covered by MTRR is set in one of the MSRs,
and is usually uncached.
Newer 64-bit processors use a table called the Page Attribute Table to
set this up.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Applications normally allocate memory from the cache-enabled region. The memory type will be set by access type bits in the page table. Use !pte to find out.
Thank you Tim and thanks for the other helpful tips.
I did see the MTRR extensions m but it said unable to get … hence i was not sure to believe it or not. I guess I will ignore it
Variable: Base Mask Length
0. unable to get nt!KiMtrrMaxRangeShift
WB: 00000000:00000000 000000ff:80000000 00000000:80000000(non-contiguous)
- unable to get nt!KiMtrrMaxRangeShift
WB: 00000000:80000000 000000ff:c0000000 00000000:40000000(non-contiguous) - unable to get nt!KiMtrrMaxRangeShift
WB: 00000001:00000000 000000ff:c0000000 00000000:40000000(non-contiguous) - unable to get nt!KiMtrrMaxRangeShift
USWC: 00000000:c4000000 000000ff:ff000000 00000000:01000000(non-contiguous)
Taking the Base and Length I would say the range as follows:
- WB: 00000000:00000000 - 00000000:80000000
- WB: 00000000:80000000 - 00000000:C0000000
- WB: 00000001:00000000 - 00000001:40000000
- USWC: 00000000:c4000000 - 00000000:c5000000
My address of 0x9f8def3c falls in the 2nd range and is WB
Another question: Why do you need to know that?
> to get the physical address = 0x9f8def3c. Now I want check whether it is UC, WB or WP.
Look at caching bits in the PTE.
In Windows, the usual system RAM is usually always cached. UC is usually only used for memory mapped hardware registers, and WC is usually only for video RAM.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com