Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: libvirt/libvirt Loading
base: master
Choose a base ref
...
head repository: ryan-moeller/libvirt Loading
compare: freebsd-rebase
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 39 files changed
  • 1 contributor

Commits on Apr 23, 2024

  1. bhyve: add hostdev handling

    Handle PCI passthrough and virtio-scsi using hostdev devices.
    
    Example PCI passthrough:
    domain xml snippet
    ```
    <memoryBacking>
      <locked/>
    </memoryBacking>
    <devices>
      <hostdev mode='subsystem' type='pci'>
        <source>
          <address domain='0x0000' bus='0x06' slot='0x02' function='0x00'/>
        </source>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x00'/>
      </hostdev>
    </devices>
    ```
    loader.conf snippet
    ```
    vmm_load="YES"
    pptdevs="6/2/0"
    ```
    
    Example SCSI passthrough:
    domain xml snippet
    ```
    <hostdev mode='subsystem' type='scsi_ctl' model='virtio'>
      <source protocol='ioctl' pp='5' vp='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x00'/>
    </hostdev>
    ```
    ctl.conf snippet
    ```
    portal-group "pg0" {
            discovery-auth-group "no-authentication"
            listen "127.0.0.1"
    }
    
    target iqn.2020-01.com.example:target0 {
            auth-group "no-authentication"
            portal-group "pg0"
            port ioctl/5/0
    
            lun 0 { path "/dev/zvol/storage/lun0" }
            lun 1 { path "/dev/zvol/storage/lun1" }
            lun 2 { path "/dev/zvol/storage/lun2" }
            lun 3 { path "/dev/zvol/storage/lun3" }
    }
    ```
    
    Signed-off-by: Ryan Moeller <[email protected]>
    Ryan Moeller authored and Ryan Moeller committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    7f6202e View commit details
    Browse the repository at this point in the history
  2. bhyve: command: enable booting from hostdevs

    It is possible to boot from virtio-scsi with UEFI, for example.
    
    Signed-off-by: Ryan Moeller <[email protected]>
    Ryan Moeller authored and Ryan Moeller committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    b9988e1 View commit details
    Browse the repository at this point in the history
  3. Allow PCI functions up to 255 for PCI ARI

    PCI Alternative Routing-ID Interpretation (ARI) capable devices
    use an implied Device Number of 0 and repurpose those bits to allow
    for 256 Function Numbers instead of 8.
    
    An example of such a device is the Chelsio T580-LP-CR, which uses the
    additional function numbers to provide Virtual Function (VF) features.
    
    Below is an excerpt from the `pciconf -lvc` output for this device
    when a few VFs are configured:
    
    ppt7@pci0:5:0:21:       class=0x020000 card=0x00001425 chip=0x58101425 rev=0x00 hdr=0x00
        vendor     = 'Chelsio Communications Inc'
        device     = 'T580-LP-CR Unified Wire Ethernet Controller [VF]'
        class      = network
        subclass   = ethernet
        cap 10[70] = PCI-Express 2 endpoint max data 256(2048) FLR NS
                     link x0(x8) speed 0.0(8.0) ASPM disabled(L0s/L1)
        cap 11[b0] = MSI-X supports 8 messages
                     Table in map 0x20[0x0], PBA in map 0x20[0x8000]
        cap 05[50] = MSI supports 32 messages, 64 bit, vector masks
        ecap 0001[100] = AER 2 0 fatal 0 non-fatal 0 corrected
        ecap 000e[140] = ARI 1
        ecap 0017[150] = TPH Requester 1
    
    Of note: the Bus/Device/Function 5/0/21 and the ARI ecap.
    
    Attempting to pass this through to a VM as a PCI device produces a
    validation error due to the function number being out of range.
    
    To enable use of devices that use ARI, relax the schema and validity
    check for PCI addresses to permit function numbers up to 255.
    
    Update a few tests to give coverage.
    
    Ref: https://pcisig.com/sites/default/files/specification_documents/ECN-alt-rid-interpretation-070604.pdf
    
    Signed-off-by: Ryan Moeller <[email protected]>
    Ryan Moeller authored and Ryan Moeller committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    c5e6d51 View commit details
    Browse the repository at this point in the history
Loading