Commit ddd31fe
committed
fix(x86_64): specify IA32_MTRRdefType MSR on boot
The IA32_MTRRdefType MSR describes the default memory type
used for physical addresses which are outside of any configured
memory ranges, as well as whether MTRRs and fixed ranges
are enabled.
Without enabling this MSR, guest kernel is not able to change
memory types for memory ranges outside main memory. This was
causing pmem region to be marked as `uncached-minus` which
instructed the cpu to skip all caches (L1, L2, L3) when
reading/writing to that memory region.
To fix this set IA32_MTRRdefType set to 0x806:
- bit 11 enables MTRR
- bits 0..7 specify the memory type used by default
- value 6 represents `write-back` type
Now guest can correctly set pmem memory region to
`write-back` memory type.
Signed-off-by: Egor Lazarchuk <[email protected]>1 parent fa2627a commit ddd31fe
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
422 | 431 | | |
423 | 432 | | |
424 | 433 | | |
| |||
0 commit comments