Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
This repository was archived by the owner on May 12, 2021. It is now read-only.

the unbinding of vfio device would be hang when using vhost and vfio #1669

@xs3c

Description

@xs3c

Description of problem

the unbinding of vfio device would be hang when using vhost and vfio.

I get this in dmesg:

vfio-pci 0000:5c:00.0: Relaying device request to user

The vhost FD is opened by the containerd-shim-kata-v2 process and qemu

lsof -p 8733 | grep vhost
container 8733 root 18u CHR 10,238 0t0 63842 /dev/vhost-net
lsof -p 8751 | grep vhost
qemu-kvm 8751 root 3u CHR 10,238 0t0 63842 /dev/vhost-net

In the scenario, vhost net kernel thread tasks a reference to qemu's mm. and the reference
also includes the mmap regions on the vfio device file. so vhost kernel thread would be not
released when qemu is killed as the vhost file descriptor still is opened by shim v2 process, and vfio device is not released because there's still a reference to the mmap.

Expected result

the kata container is stopped

Actual result

I got a hang when unbinding network device from vfio-pci.
I get this in dmesg:

vfio-pci 0000:5c:00.0: Relaying device request to user


(replace this text with the output of the kata-collect-data.sh script, after
you have reviewed its content to ensure it does not contain any private
information).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions