-
Notifications
You must be signed in to change notification settings - Fork 23
AppleVTD_English
The purpose of this article is to talk about the features of AppleVTD and how to enable it properly under Hackintosh.
Devices | |
---|---|
Motherboards | Motherboards that support Intel VT-d |
CPU | Compatible with Intel VT-d CPU |
macOS Versions | macOS Monterey and later |
AppleVTD and DriverKit
AppleVTD is Apple Virtualisation, the main functionality of which is provided by Intel VT-d. It allows the use of [VT-d] for Apple-native hardware. It provides DMA remapping policies for Apple native hardware using the DriverKit driver.
- Starting with macOS Monterey, Thunderbolt controllers require this feature to be enabled.
- Starting with macOS Ventura, network adapters can use this feature.
DriverKit builds drivers that run in "user space" rather than as "kernel extensions", which improves system stability and security.
- But does it really improve system stability? In fact, no. Most of DriverKit's drivers are extremely unstable. Moreover, DriverKit runs at the user level, which theoretically does not lead to Kernel Panic, but once it crashes, it will crash the DriverKit framework, and the crash log after the crash is not clear, making it difficult to troubleshoot the problem.
Another purpose of DriverKit is to pave the way for Apple Silicon. For example, the Apollo Thunderbolt driver and the Blackmagic Design driver are DriverKit drivers on Apple Silicon Macs, while they remain kernel extensions on Intel-powered Macs.
- Mount the EFI partition
- Open config.plist from the EFI/OC directory
- In the Kernel - Quirks option
- DisableIoMapper: to enable AppleVTD, disable this option
- DisableIoMapperMapping (macOS 13.3 and later only): Enable this option when you meet any of the following conditions
- With 16G or more RAM
- Internal graphics is enabled
- When your DMAR table contains one or more Reserved Memory Regions. For details on DMAR tables and Reserved Memory Regions, see Fix DMAR Tables.
- Remove
dart=0
from boot-args in config.plist - Save config.plist
At this point, only some computers should be able to enable AppleVTD properly. you should continue reading this article to enable AppleVTD properly.
There are two scenarios we need to discuss in this section of fixing the DMAR table.
- PCs with Intel 12th generation processors (600 series motherboards) and newer configurations, and without internal graphics enabled.
- PCs with Intel 11th generation processors (500 series motherboards) and earlier configurations, PCs with Intel 12th generation processors (600 series motherboards) and newer configurations, and with internal graphics enabled.
If you are in the first category, congratulations, your AppleVTD should have been enabled correctly; if you are in the second category, please continue reading this article to fix your DMAR table.
The first step is to extract the native DMAR table. You can use MaciASL to extract DMAR table directly.
- Open MaciASL
- Click on the File - Get from ACPI option to open the DMAR table.
Open the DMAR table by clicking on the File - Get from ACPI option.
After obtaining the DMAR table, the next step is to delete the Reserved Memory Regions.
-
Locate the sections with Reserved Memory Region and delete them. Note: The two blank lines under Reserved Memory Region need to be deleted as well.
- Click File - Save As in the upper left corner, select ACPI Machine Language Binary in the File Format option, and rename it to SSDT-DMAR.
The next step is to enable the modified SSDT-DMAR.
- Mount the EFI partition
- Copy SSDT-DMAR.aml to the EFI/OC/ACPI directory. You will also need to add the same ACPI entry in ACPI>Add in config.plist
- Save your config.plist
The next step is to delete the native DMAR table to prevent it from loading and instead use the repaired version of the DMAR table.
- Open config.plist in the EFI/OC directory using any editor.
- Add the DMAR to TableSignature under the ACPI>Delete section of config.plist and enable this.
- save your config.plist
After rebooting, the last step is to check and verify that the AppleVTD feature, is loaded under macOS.
I:Download and open IOReg。
Verify the AppleVTD. The AppleVTD is located under the AppleACPIPlatformExpert node.
Note: If there is no AppleVTD under the AppleACPIPlatformExpert node, you need to add [SSDT-DMAC](https://github.com/Fu-Yuxuan-hub/General-EFI-for-H610-B660- Z690-B760-Z790/wiki/AppleVTD_Simplified_Chinese#dmacdirect-memory-access-controller)
If AppleVTD still doesn't work, adding a DMAC device via SSDT-DMAC, which macOS can pass through in order to access all areas of memory, may solve the problem and make AppleVTD work. However, AppleVTD works without DMAC injection in most cases, so it is not common.
DMAC applies to the following SMBIOS:
iMac: 5,1 to 20,x
iMacPro1,1
MacBook: 1,1 to 9,1
MacBookAir: 1,1 to 9,1
MacBookPro: 1,1 to 16,1
MacMini: 1,1 to 8,1
MacPro: 1,1 to 7,1
Xserve: 1,3 to 3,1;
SSDT-DMAC:
//Add DMAC
DefinitionBlock ("", "SSDT", 2, "OCLT", "DMAC", 0)
{
External(_SB.PCI0.LPCB, DeviceObj)
Scope (_SB.PCI0.LPCB)
{
Device (DMAC)
{
Name (_HID, EisaId ("PNP0200"))
Name (_CRS, ResourceTemplate ()
{
IO (Decode16,
0x0000, // Range Minimum
0x0000, // Range Maximum
0x01, // Alignment
0x20, // Length
)
IO (Decode16,
0x0081, // Range Minimum
0x0081, // Range Maximum
0x01, // Alignment
0x11, // Length
)
IO (Decode16,
0x0093, // Range Minimum
0x0093, // Range Maximum
0x01, // Alignment
0x0D, // Length
)
IO (Decode16, // Range Minimum, // Range Maximum )
0x00C0, // Range Minimum
0x00C0, // Range Maximum
0x01, // Alignment
0x20, // Length
)
DMA (Compatibility, NotBusMaster, Transfer8_16, )
{4}
})
Method (_STA, 0, NotSerialized)
Method (_STA, 0, NotSerialized) {
If (_OSI ("Darwin"))
If (_OSI ("Darwin")) {
Return (0x0F)
}
Else
If (_OSI ("Darwin") { Return (0x0F) } Else
Return (Zero)
}
}
}
}
}
Note:
- If this device already exists when you search for
PNP0200
orDMAC
in DSDT, do not add it again. If it is missing, add this item (export as .aml) - When using this patch, make sure that the ACPI path for the LPC Bus (LPC or LPCB) used in the SSDT is the same as the one used in the system DSDT.
- Add SSDT-DMAC.aml to the ACPI folder of your EFI and to config.plist.
- Reboot
- Open IOReg and search for DMAC.
- If the addition is successful, as shown below. The array IODeviceMemory should contain more entries and data:
© 杆杆只爱学习, Released under the MIT License.
--May 27, 2023