On 30/04/2025 15.50, Philippe Mathieu-Daudé wrote:
On 30/4/25 15:28, Thomas Huth wrote:
From: Thomas Huth <th...@redhat.com>
The logic in the qvirtio_read/write function is rather a headache,
involving byte-swapping when the target is big endian, just to
maybe involve another byte-swapping in the qtest_read/write
function immediately afterwards (on the QEMU side). Let's do it in
a more obvious way here: For virtio 1.0, we know that the values have
to be little endian, so let's read/write the bytes in that well known
order here.
Signed-off-by: Thomas Huth <th...@redhat.com>
---
This also decreases our usage of qtest_big_endian() which might (or
might not) get helpful for the universal binary one day...
v2: Use leXX_to_cpu() / cpu_to_leXX() instead of doing it manually
tests/qtest/libqos/virtio.c | 44 ++++++++++++++++++++++++-------------
1 file changed, 29 insertions(+), 15 deletions(-)
Thanks!
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
I tried this on top:
-- >8 --
diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h
index 930a91dcb7d..5e01c1effc7 100644
--- a/tests/qtest/libqtest.h
+++ b/tests/qtest/libqtest.h
@@ -731,8 +730,0 @@ int64_t qtest_clock_set(QTestState *s, int64_t val);
-/**
- * qtest_big_endian:
- * @s: QTestState instance to operate on.
- *
- * Returns: True if the architecture under test has a big endian
configuration.
- */
-bool qtest_big_endian(QTestState *s);
I think you might be able to get rid of the big_endian stuff there
completely if we can be sure that all tests run with VIRTIO_1.
As far as I can see, the PCI-based tests should be fine, but the MMIO-based
tests still seem to run in legacy mode. Maybe this could be fixed by adding
a "-global virtio-mmio.force-legacy=false" somewhere in the right spot?
Or could we set force-legacy to false by default in the QEMU binary nowadays?
Thomas