|
| 1 | +.. _ahci-hld: |
| 2 | + |
| 3 | +AHCI Virtualization in Device Model |
| 4 | +################################### |
| 5 | + |
| 6 | +AHCI (Advanced Host Controller Interface), which is a hardware mechanism |
| 7 | +that allows software to communicate with Serial ATA devices. AHCI HBA |
| 8 | +(host bus adapters) is a PCI class device that acts as a data movement |
| 9 | +engine between system memory and Serial ATA devices. The ACPI HBA in |
| 10 | +ACRN support both ATA and ATAPI devices. The architecture is shown in |
| 11 | +below diagram. |
| 12 | + |
| 13 | +.. figure:: images/ahci-image1.png |
| 14 | + :align: center |
| 15 | + :width: 750px |
| 16 | + :name: achi-device |
| 17 | + |
| 18 | +HBA is registered to PCI system with device id 0x2821 and vendor id |
| 19 | +0x8086. And its memory registers are mapped in BAR 5. It only supports 6 |
| 20 | +ports refer to ICH8 AHCI. AHCI driver in Guest OS can access HBA in DM |
| 21 | +through the PCI BAR. And HBA can inject MSI interrupts through PCI |
| 22 | +framework. |
| 23 | + |
| 24 | +When application in Guest OS reads data from /dev/sda, the request will |
| 25 | +send through the AHCI driver then the PCI driver. Guest VM will trap to |
| 26 | +hypervisor, and hypervisor dispatch the request to DM. According to the |
| 27 | +offset in the BAR, the request will dispatch to port control handler. |
| 28 | +Then the request is parse to a block I/O request which can be processed |
| 29 | +by Block backend model. |
| 30 | + |
| 31 | +Usage: |
| 32 | + |
| 33 | +***-s <slot>,ahci,<type:><filepath>*** |
| 34 | + |
| 35 | +Type: ‘hd’ and ‘cd’ are available. |
| 36 | + |
| 37 | +Filepath: the path for the backend file, could be a partition or a |
| 38 | +regular file. |
| 39 | + |
| 40 | +E.g. |
| 41 | + |
| 42 | + SOS: -s 20,ahci,\ `hd:/dev/mmcblk0p1 <http://hd/dev/mmcblk0p1>`__ |
| 43 | + |
| 44 | + UOS: /dev/sda |
0 commit comments