qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 03/12] virtio-sound: handle control messages and streams


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v8 03/12] virtio-sound: handle control messages and streams
Date: Mon, 4 Sep 2023 14:17:36 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

On 4/9/23 13:46, Manos Pitsidianakis wrote:
On Mon, 04 Sep 2023 14:30, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
On 4/9/23 13:00, Manos Pitsidianakis wrote:
On Mon, 04 Sep 2023 13:46, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
+    size_t sz = iov_to_buf(cmd->elem->out_sg,
+                           cmd->elem->out_num,
+                           0,
+                           &cmd->ctrl,
+                           sizeof(cmd->ctrl));
+    if (sz != sizeof(cmd->ctrl)) {
+        qemu_log_mask(LOG_GUEST_ERROR,
+                "%s: virtio-snd command size incorrect %zu vs \
+                %zu\n", __func__, sz, sizeof(cmd->ctrl));
+        return;
+    }
+
+    trace_virtio_snd_handle_code(cmd->ctrl.code,

IIUC the spec, this structure is in little endian, is that right?
So shouldn't swap various fields in this series?

Not sure about the answer to this. Need input from someone more knowledgeable in virtio.

You can test running a big-endian guest (m68k, s390x, sparc64) on your
little-endian host.

The linux driver uses le{32,64}_to_cpu for reading fields, if there's any problem then it would be with the host?

Ah right. Since using a BE guest is often simpler for most developers
than accessing a BE host -- in particular to test recent kernel -- I was
hoping this would be an easy enough suggestion.

Anyhow Linux swapping the fields confirms the virtio-sound model has to
do the same.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]