mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
tests: Fix test_vfio
The new kernel 5.12 requires the devices to be manually bound to vfio-pci while adding a new_id is only needed once per device_id:vendor_id pair. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
9be27bf92e
commit
fdcfec081b
@ -36,14 +36,15 @@ write_files:
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
mount /dev/vdc /mnt
|
mount /dev/vdc /mnt
|
||||||
|
bash -c "echo 1af4 1041 > /sys/bus/pci/drivers/vfio-pci/new_id"
|
||||||
bash -c "echo 0000:00:06.0 > /sys/bus/pci/devices/0000\:00\:06.0/driver/unbind"
|
bash -c "echo 0000:00:06.0 > /sys/bus/pci/devices/0000\:00\:06.0/driver/unbind"
|
||||||
bash -c "echo 1af4 1041 > /sys/bus/pci/drivers/vfio-pci/new_id"
|
bash -c "echo 0000:00:06.0 > /sys/bus/pci/drivers/vfio-pci/bind"
|
||||||
bash -c "echo 0000:00:07.0 > /sys/bus/pci/devices/0000\:00\:07.0/driver/unbind"
|
bash -c "echo 0000:00:07.0 > /sys/bus/pci/devices/0000\:00\:07.0/driver/unbind"
|
||||||
bash -c "echo 1af4 1041 > /sys/bus/pci/drivers/vfio-pci/new_id"
|
bash -c "echo 0000:00:07.0 > /sys/bus/pci/drivers/vfio-pci/bind"
|
||||||
# 1G ram requires 512 pages
|
# 1G ram requires 512 pages
|
||||||
echo 512 | sudo tee /proc/sys/vm/nr_hugepages
|
echo 512 | sudo tee /proc/sys/vm/nr_hugepages
|
||||||
sudo chmod a+rwX /dev/hugepages
|
sudo chmod a+rwX /dev/hugepages
|
||||||
/mnt/cloud-hypervisor --kernel /mnt/vmlinux --cmdline "console=hvc0 reboot=k panic=1 nomodules i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd root=/dev/vda1 VFIOTAG" --disk path=/mnt/focal-server-cloudimg-amd64-custom-20210407-0.qcow2 path=/mnt/cloudinit.img --cpus boot=1 --memory size=512M,hotplug_size=1G,hugepages=on --device path=/sys/bus/pci/devices/0000:00:06.0/ path=/sys/bus/pci/devices/0000:00:07.0/ --api-socket /tmp/ch_api.sock
|
/mnt/cloud-hypervisor --kernel /mnt/vmlinux --cmdline "console=hvc0 reboot=k panic=1 nomodules root=/dev/vda1 VFIOTAG" --disk path=/mnt/focal-server-cloudimg-amd64-custom-20210407-0.qcow2 path=/mnt/cloudinit.img --cpus boot=1 --memory size=512M,hotplug_size=1G,hugepages=on --device path=/sys/bus/pci/devices/0000:00:06.0/ path=/sys/bus/pci/devices/0000:00:07.0/ --api-socket /tmp/ch_api.sock
|
||||||
|
|
||||||
-
|
-
|
||||||
path: /etc/systemd/system/notify-booted.service
|
path: /etc/systemd/system/notify-booted.service
|
||||||
|
@ -3559,7 +3559,7 @@ mod tests {
|
|||||||
).unwrap();
|
).unwrap();
|
||||||
guest
|
guest
|
||||||
.ssh_command_l1(
|
.ssh_command_l1(
|
||||||
"echo 1af4 1041 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id",
|
"echo 0000:00:08.0 | sudo tee /sys/bus/pci/drivers/vfio-pci/bind",
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let vfio_hotplug_output = guest
|
let vfio_hotplug_output = guest
|
||||||
|
Loading…
Reference in New Issue
Block a user