Changeset 89292 in vbox for trunk/src/VBox
- Timestamp:
- May 26, 2021 12:26:30 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp
r89288 r89292 730 730 static uint8_t vtdCapRegGetSagaw(uint8_t uMgaw) 731 731 { 732 switch (uMgaw + 1) 733 { 734 case 39: return 1; 735 case 48: return 2; 736 case 57: return 3; 737 } 738 return 0; 732 /* 733 * It doesn't make sense to me that a CPU (or IOMMU hardware) will support 5-level paging 734 * but not 4 or 3 level paging. So smaller page-table levels are always OR'ed in. 735 * 736 * The values below (57, 48, 39 bits) represents the levels of page-table walks for 737 * 4KB base page size. 738 * See Intel VT-d spec. 10.4.2 "Capability Register". 739 */ 740 ++uMgaw; 741 uint8_t const fSagaw = uMgaw >= 57 ? RT_BIT(3) | RT_BIT(2) | RT_BIT(1) 742 : uMgaw >= 48 ? RT_BIT(2) | RT_BIT(1) 743 : uMgaw >= 39 ? RT_BIT(1) 744 : 0; 745 return fSagaw; 739 746 } 740 747
Note:
See TracChangeset
for help on using the changeset viewer.