crosvm virtio-gpu can't create virt-queue

79 views
Skip to first unread message

lttle sad

unread,
Dec 5, 2022, 6:58:43 AM12/5/22
to crosvm-dev
Hello,

I want to check myos's virtio-gpu device, so, I use command run myos:
cargo run --features=gpu,x,virgl_renderer,virgl_renderer_next -- run \
    --cpus 8 \
    --mem 1024 \
    --disable-sandbox \
    --gpu backend=virglrenderer,width=1920,height=1080 \
    ./myos


During myos initialization,like Linux,cerate two queue for virtio_gpu.
First queue:ctrlq,create success,
But, second queue:cursorq, create failed. And, crosvm report a WRONG:
[2022-12-05T19:40:19.384103334+08:00 WARN  devices::virtio::queue] ignoring write to vector on ready queue

And, when I try to get EDID from host virtio-gpu, I sent meg, but I received zero intrrrput.

Under normal conditions, in linux code, two queue could create success and could get interrupt. But I am in an abnormal conditions.

It seems like my crosvm commands Error ?
Why crosvm tells me WRONG ?
Why I can't communicate with host virtio-gpu ? 

I am so confused,
Hope your help,

thanks

Daniel Verkamp

unread,
Dec 5, 2022, 2:17:19 PM12/5/22
to lttle sad, crosvm-dev
Hi,

According to the virtio specification (Virtio 1.2, section 4.1.4.3.2,
"Driver Requirements: Common configuration structure layout"), the
per-queue configuration (including the MSI-X vector) needs to happen
before enabling the queue ("enabled" is referred to as "ready" in the
crosvm code):
> The driver MUST configure the other virtqueue fields before enabling the virtqueue with queue_enable.

It seems that the driver is attempting to change the MSI-X vector for
a queue after that queue was enabled. It should be possible to avoid
the problem by configuring queue_msix_vector before enabling the
queue.

Side note: maybe my reading of the virtio spec is not totally accurate
(the quoted line above doesn't explicitly prohibit the driver from
writing to the virtqueue-specific fields after enabling the queue,
just requires that they are initialized before enabling), but that is
the current behavior of crosvm virtio devices.
> --
> You received this message because you are subscribed to the Google Groups "crosvm-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to crosvm-dev+...@chromium.org.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/crosvm-dev/a62f906f-2bbb-43da-a8a6-c65d86598fb3n%40chromium.org.
> For more options, visit https://groups.google.com/a/chromium.org/d/optout.
Reply all
Reply to author
Forward
0 new messages