feat: Add VFIO binding script and update playbook for enhanced virtualization support

This commit is contained in:
2026-01-02 23:15:08 +01:00
parent 03d5b39a4b
commit 3c6647c215
13 changed files with 540 additions and 135 deletions
+1
View File
@@ -0,0 +1 @@
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHHOPBR9p9kq5Cqzpe4cr3jHnweaYrHPXv5sXNzt+sCXP54uc5rWUBhxW2OQVvQzJ47dEVhEKi4WSC7LcuKS2G5AQDzWXNiasHvYIYQU3F/EknVCZnsiXYqXphYkJA6rJCNRnISZCIC1mocq6PB7J08ONdRFCvjfUBuVRT8BNGXNmQ/zQ==
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
DEV="$1"
VENDOR="$2"
DEVICE="$3"
if [ -z "$DEV" ] || [ -z "$VENDOR" ] || [ -z "$DEVICE" ]; then
echo "Usage: $0 <PCI_DEVICE_ID> <VENDOR_ID> <DEVICE_ID>"
echo "Example: $0 0000:3b:00.0 8086 1520"
exit 1
fi
# Wait until device exists
for i in {1..20}; do
[ -e /sys/bus/pci/devices/$DEV ] && break
sleep 0.5
done
# Unbind from current driver
logger -t vfio-bind "Binding device $DEV (vendor: $VENDOR, device: $DEVICE) to vfio-pci"
if [ -L /sys/bus/pci/devices/$DEV/driver ]; then
logger -t vfio-bind "Unbinding device $DEV from current driver"
echo "$DEV" > /sys/bus/pci/devices/$DEV/driver/unbind
fi
# Tell kernel to prefer vfio-pci
logger -t vfio-bind "Setting driver override to vfio-pci for device $DEV"
echo vfio-pci > /sys/bus/pci/devices/$DEV/driver_override
# Bind to vfio-pci
logger -t vfio-bind "Binding device $DEV to vfio-pci driver"
echo "$DEV" > /sys/bus/pci/drivers/vfio-pci/bind