Enabling write-combining through PAT in long mode.
Posted: Wed Aug 27, 2014 11:37 am
Let's presume that LFB is located at 0xD0000000. MTRR's
are untouched and left in a state where bios has left them.
This is what I do:
-------------------
1) I setup long mode with 2mb paging.
2) I check PAT support and I get positive result.
3) PA2 entry from IA32_PAT MSR is set to write-combining (==0x1)
4) I calculate 0xD0000000 /0x200000 = 0x680 = (1664 dec)
5) Then I convert the result from stage 4 to bytes and subtract
8 bytes: ((0x680*0x8)-0x8)
6) I add the offset from stage 5 to PDE (Page directory table) start.
7) I change PAT,PCD and PWT bits from following entries Of PDE table
and select PA2=entry. (PAT==0,PCD==1, PWT==0)
I'am still unable to get the write combining to work properly.
Everything else works but no speed is improved,
So what I'am doing wrong?
regards
M2004
are untouched and left in a state where bios has left them.
This is what I do:
-------------------
1) I setup long mode with 2mb paging.
2) I check PAT support and I get positive result.
3) PA2 entry from IA32_PAT MSR is set to write-combining (==0x1)
4) I calculate 0xD0000000 /0x200000 = 0x680 = (1664 dec)
5) Then I convert the result from stage 4 to bytes and subtract
8 bytes: ((0x680*0x8)-0x8)
6) I add the offset from stage 5 to PDE (Page directory table) start.
7) I change PAT,PCD and PWT bits from following entries Of PDE table
and select PA2=entry. (PAT==0,PCD==1, PWT==0)
I'am still unable to get the write combining to work properly.
Everything else works but no speed is improved,
So what I'am doing wrong?
regards
M2004