Hello, I am doing research with Linux Power Management interactions with USB 
devices. Which is why I would like to be able to wake the vm from suspend with 
a passed through USB device. I have been able to pass through the usb device 
from the launch command and enable the wakeup file with a udev rule for the 
/sys/bus/usb/devices/usb#/power/wakeup file. But the issue is that the actual 
device's wakeup files are missing (/sys/bus/usb/devices/#-#/power/wakeup). 
These files are present on my linux host where the keyboard wakes the host from 
suspend just fine. I know that these files come from the gadget's bmAttribute 
byte having the correct bits set to inform the host that it can perform remote 
wakeup. Since these files originate from that low of a level, is this even a 
problem with my qemu configuration or is this something that is even supported 
by qemu's usb passthrough?

I have also been able to suspend the vm and wake it from the qemu shell using 
system_wake so I know that the vm wakes properly. I have also seen old posts 
about using evdev to pass through usb devices, but this seems to be old and not 
the best method.

Here are the details of my configuration:

Launch Script:
qemu-system-x86_64 \
        -m 2G \
        -smp 2 \
        -kernel /home/darrion/linux-6.10-rc4/arch/x86/boot/bzImage \
        -append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0" \
        -drive file=qemu_image/bookworm.img,format=raw \
        -net user,host=10.0.2.10,hostfwd=tcp:127.0.0.1:10021-:22 \
        -net nic,model=e1000 \
        -monitor unix:qemu-monitor-socket,server,nowait \
        -enable-kvm \
        -cpu host \
        -usb \
        -device nec-usb-xhci \
        -device usb-host,hostbus=3,hostaddr=5 \
        -nographic \
        -D ./log.txt \
        -pidfile vm.pid \
        2>&1 | tee vm.log

Image:
      Debian 12 from:
      https://github.com/google/syzkaller/blob/master/tools/create-image.sh

Qemu:
Tried using version 6.2 from apt and 9.0.90 from source

Linux Kernel:

  *
Tried 6.10, 6.10-rc4, 6.6.43
  *
Config: 
https://github.com/google/syzkaller/blob/master/dashboard/config/linux/upstream-usb.config
 (with CONFIG_KCOV_INSTRUMENT_ALL turned off since this breaks suspend/resume)
     *
Also tried the standard kvm_guest.config generated config

Reply via email to