Changeset 37817 in vbox
- Timestamp:
- Jul 7, 2011 1:02:40 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/user_AdvancedTopics.xml
r37264 r37817 541 541 <title>PCI passthrough</title> 542 542 543 <para>When running on Linux hosts, with recent enough kernel (at least version543 <para>When running on Linux hosts, with a recent enough kernel (at least version 544 544 <computeroutput>2.6.31</computeroutput>) experimental host PCI devices 545 545 passthrough is available.<footnote> 546 546 <para>Experimental support for PCI passthrough was introduced with VirtualBox 547 547 4.1.</para> 548 </footnote> Essentially this feature allows to use physical PCI devices549 on host directly by the guest,even if host doesn't have drivers for this550 particular device. Both regular PCI and some PCI Express cardsare548 </footnote> Essentially this feature allows to directly use physical PCI 549 devices on the host by the guest even if host doesn't have drivers for this 550 particular device. Both, regular PCI and some PCI Express cards, are 551 551 supported. AGP and certain PCI Express cards are not supported at the 552 moment ,if they rely on GART (Graphics Address Remapping Table) unit553 programming for texture management ,as it does rather nontrivial552 moment if they rely on GART (Graphics Address Remapping Table) unit 553 programming for texture management as it does rather nontrivial 554 554 operations with pages remapping interfering with IOMMU. 555 555 This limitation may be lifted in future releases.</para> 556 556 557 557 <para>To be fully functional, PCI passthrough support in VirtualBox depends upon 558 IOMMU hardware unit, which is not yet too widely available. To be exact, 559 if device uses bus mastering (i.e. performs DMA to the OS memory on its own), then 560 IOMMU hardware is needed (otherwise such DMA transactions may override wrong physical memory address, 561 as device DMA engine is programmed using device-specific protocol to perform memory transactions). 562 IOMMU functions as translation unit, mapping physical memory access requests from the device, 563 using knowledge of guest physical address to host physical addresses translation rules.</para> 558 an IOMMU hardware unit which is not yet too widely available. If the device uses 559 bus mastering (i.e. it performs DMA to the OS memory on its 560 own), then an IOMMU is required, otherwise such DMA transactions may write to 561 the wrong physical memory address as the device DMA engine is programmed using 562 a device-specific protocol to perform memory transactions. The IOMMU functions 563 as translation unit mapping physical memory access requests from the device 564 using knowledge of the guest physical address to host physical addresses translation 565 rules.</para> 564 566 565 567 <para>Intel's solution for IOMMU is marketed as "Intel Virtualization Technology for 566 568 Directed I/O" (VT-d), and AMD's one is called AMD-Vi. So please check if your 567 569 motherboard datasheet has appropriate technology. 568 Even if your hardware doesn't have IOMMU, certain PCI cards may work569 (such as serial PCI adapters), but guest will show warning on boot,and570 VM execution will terminate, ifguest driver will attempt to enable card570 Even if your hardware doesn't have a IOMMU, certain PCI cards may work 571 (such as serial PCI adapters), but the guest will show a warning on boot and 572 the VM execution will terminate if the guest driver will attempt to enable card 571 573 bus mastering.</para> 572 574 573 575 <para> 574 It 's not uncommon, that BIOS/OS disables IOMMU by default, so before any attempt to use it,575 please make sure that576 It is very common that the BIOS or the host OS disables the IOMMU by default. 577 So before any attempt to use it please make sure that 576 578 <orderedlist> 577 579 <listitem> 578 Your motherboard has IOMMU unit.580 Your motherboard has an IOMMU unit. 579 581 </listitem> 580 582 <listitem> 581 Your CPU supports IOMMU.583 Your CPU supports the IOMMU. 582 584 </listitem> 583 585 <listitem> 584 IOMMU is enabled in the BIOS.586 The IOMMU is enabled in the BIOS. 585 587 </listitem> 586 588 <listitem> … … 591 593 </listitem> 592 594 <listitem> 593 Your Linux kernel recognizes and uses IOMMU unit (<computeroutput>intel_iommu=on</computeroutput> 594 boot option could be needed). Search for DMAR and PCI-DMA in kernel boot log. 595 Your Linux kernel recognizes and uses the IOMMU unit 596 (<computeroutput>intel_iommu=on</computeroutput> 597 boot option could be needed). Search for DMAR and PCI-DMA in kernel boot log. 595 598 </listitem> 596 599 </orderedlist> 597 600 </para> 598 601 599 <para>Once you made sure that host kernel supports IOMMU, next step is to select 600 PCI card, and attach it to the guest. To figure out list of available PCI devices, 601 use <computeroutput>lspci</computeroutput> command. Output will look like this 602 <para>Once you made sure that the host kernel supports the IOMMU, the next step is 603 to select the PCI card and attach it to the guest. To figure out the list of 604 available PCI devices, use the <computeroutput>lspci</computeroutput> command. 605 The output will look like this 602 606 <screen> 603 607 01:00.0 VGA compatible controller: ATI Technologies Inc Cedar PRO [Radeon HD 5450] … … 608 612 06:00.0 VGA compatible controller: nVidia Corporation G86 [GeForce 8500 GT] (rev a1) 609 613 </screen> 610 First column hereis a PCI address (in format <computeroutput>bus:device.function</computeroutput>).611 This address could be used to identify device for further operations.612 For example, to attach PCI network controller on system listed above,613 to second PCI bus in the guest, as device 5, function 0, use the following command:614 <screen>VBoxManage modifyvm "VM name" -- attachpci02:00.0@01:05.0</screen>614 The first column is a PCI address (in format <computeroutput>bus:device.function</computeroutput>). 615 This address could be used to identify the device for further operations. 616 For example, to attach a PCI network controller on the system listed above 617 to the second PCI bus in the guest, as device 5, function 0, use the following command: 618 <screen>VBoxManage modifyvm "VM name" --pciattach 02:00.0@01:05.0</screen> 615 619 To detach same device, use 616 <screen>VBoxManage modifyvm "VM name" -- detachpci02:00.0</screen>617 Please note , that both host and guest could freely assigndifferent PCI address to618 card attached during runtime, so those addresses only apply to address of card at619 the moment of attachment (host), and during BIOS PCI init (guest).620 <screen>VBoxManage modifyvm "VM name" --pcidetach 02:00.0</screen> 621 Please note that both host and guest could freely assign a different PCI address to 622 the card attached during runtime, so those addresses only apply to the address of 623 the card at the moment of attachment (host), and during BIOS PCI init (guest). 620 624 </para> 621 625 622 <para>If virtual machine has PCI device attached, certain limitations apply.626 <para>If the virtual machine has a PCI device attached, certain limitations apply: 623 627 <orderedlist> 624 628 <listitem> 625 Only PCI cards with non-shared interrupts (such as using MSI on host) can be629 Only PCI cards with non-shared interrupts (such as using MSI on host) are 626 630 supported at the moment. 627 631 </listitem> 628 632 <listitem> 629 No guest state can be reliably saved/restored (as PCI card internal state could630 not be retrieved).633 No guest state can be reliably saved/restored (as the internal state of the PCI 634 card could not be retrieved). 631 635 </listitem> 632 636 <listitem> … … 634 638 </listitem> 635 639 <listitem> 636 No lazy physical memory allocation, host preallocates whole RAM on startup 637 (as we cannot catch physical hardware access to physical memory). 640 No lazy physical memory allocation. The host will preallocate the whole RAM 641 required for the VM on startup (as we cannot catch physical hardware accesses 642 to the physical memory). 638 643 </listitem> 639 644 </orderedlist> -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r37763 r37817 152 152 " [--acpi on|off]\n" 153 153 #ifdef VBOX_WITH_PCI_PASSTHROUGH 154 " [-- attachpci03:04.0]\n"155 " [-- attachpci03:04.0@02:01.0]\n"156 " [-- detachpci03:04.0]\n"154 " [--pciattach 03:04.0]\n" 155 " [--pciattach 03:04.0@02:01.0]\n" 156 " [--pcidetach 03:04.0]\n" 157 157 #endif 158 158 " [--ioapic on|off]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r37525 r37817 302 302 { "--chipset", MODIFYVM_CHIPSET, RTGETOPT_REQ_STRING }, 303 303 #ifdef VBOX_WITH_PCI_PASSTHROUGH 304 { "-- attachpci", MODIFYVM_ATTACH_PCI, RTGETOPT_REQ_STRING },305 { "-- detachpci", MODIFYVM_DETACH_PCI, RTGETOPT_REQ_STRING },304 { "--pciattach", MODIFYVM_ATTACH_PCI, RTGETOPT_REQ_STRING }, 305 { "--pcidetach", MODIFYVM_DETACH_PCI, RTGETOPT_REQ_STRING }, 306 306 #endif 307 307 }; … … 2259 2259 if (iHostAddr == -1 || iGuestAddr == -1) 2260 2260 { 2261 errorArgument("Invalid -- attachpciargument '%s' (valid: 'HB:HD.HF@GB:GD.GF' or just 'HB:HD.HF')", ValueUnion.psz);2261 errorArgument("Invalid --pciattach argument '%s' (valid: 'HB:HD.HF@GB:GD.GF' or just 'HB:HD.HF')", ValueUnion.psz); 2262 2262 rc = E_FAIL; 2263 2263 } … … 2276 2276 if (iHostAddr == -1) 2277 2277 { 2278 errorArgument("Invalid -- detachpciargument '%s' (valid: 'HB:HD.HF')", ValueUnion.psz);2278 errorArgument("Invalid --pcidetach argument '%s' (valid: 'HB:HD.HF')", ValueUnion.psz); 2279 2279 rc = E_FAIL; 2280 2280 }
Note:
See TracChangeset
for help on using the changeset viewer.