From 6328d8ffa6cb9d750e4bfcfd73ac25d3a39ceb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Mon, 25 Mar 2024 14:48:32 +0100 Subject: misc/pca955*: Move models under hw/gpio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PCA9552 and PCA9554 devices are both I2C GPIO controllers and the PCA9552 also can drive LEDs. Do all the necessary adjustments to move the models under hw/gpio. Cc: Glenn Miles Signed-off-by: Cédric Le Goater Message-ID: <20240325134833.1484265-1-clg@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/pca9552-test.c | 2 +- tests/qtest/pnv-host-i2c-test.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/qtest/pca9552-test.c b/tests/qtest/pca9552-test.c index ccca2b3..7474957 100644 --- a/tests/qtest/pca9552-test.c +++ b/tests/qtest/pca9552-test.c @@ -12,7 +12,7 @@ #include "libqtest.h" #include "libqos/qgraph.h" #include "libqos/i2c.h" -#include "hw/misc/pca9552_regs.h" +#include "hw/gpio/pca9552_regs.h" #define PCA9552_TEST_ID "pca9552-test" #define PCA9552_TEST_ADDR 0x60 diff --git a/tests/qtest/pnv-host-i2c-test.c b/tests/qtest/pnv-host-i2c-test.c index c635177..7f64d59 100644 --- a/tests/qtest/pnv-host-i2c-test.c +++ b/tests/qtest/pnv-host-i2c-test.c @@ -8,8 +8,8 @@ */ #include "qemu/osdep.h" #include "libqtest.h" -#include "hw/misc/pca9554_regs.h" -#include "hw/misc/pca9552_regs.h" +#include "hw/gpio/pca9554_regs.h" +#include "hw/gpio/pca9552_regs.h" #include "pnv-xscom.h" #define PPC_BIT(bit) (0x8000000000000000ULL >> (bit)) -- cgit v1.1 From 66e411885a23c96ff73742d06b793fec3ceaebb7 Mon Sep 17 00:00:00 2001 From: Zheyu Ma Date: Wed, 20 Mar 2024 10:04:42 +0100 Subject: libqos/virtio.c: Correct 'flags' reading in qvirtqueue_kick MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In qvirtqueue_kick(), the 'flags' were previously being incorrectly read from vq->avail instead of the correct vq->used location. This update ensures 'flags' are read from the correct location as per the virtio standard. Signed-off-by: Zheyu Ma Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Message-ID: <20240320090442.267525-1-zheyuma97@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/libqos/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c index 82a6e12..a21b6ee 100644 --- a/tests/qtest/libqos/virtio.c +++ b/tests/qtest/libqos/virtio.c @@ -394,7 +394,7 @@ void qvirtqueue_kick(QTestState *qts, QVirtioDevice *d, QVirtQueue *vq, qvirtio_writew(d, qts, vq->avail + 2, idx + 1); /* Must read after idx is updated */ - flags = qvirtio_readw(d, qts, vq->avail); + flags = qvirtio_readw(d, qts, vq->used); avail_event = qvirtio_readw(d, qts, vq->used + 4 + sizeof(struct vring_used_elem) * vq->size); -- cgit v1.1 From f9b29c636442e917a56a725d774ea99be3b28111 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Mon, 18 Mar 2024 21:27:11 +0100 Subject: tests/tcg/s390x: Test TEST AND SET Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-ID: <20240318202722.20675-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/ts.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/tcg/s390x/ts.c (limited to 'tests') diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target index e2aba2e..a8f86c9 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -47,6 +47,7 @@ TESTS+=add-logical-with-carry TESTS+=lae TESTS+=cvd TESTS+=cvb +TESTS+=ts cdsg: CFLAGS+=-pthread cdsg: LDFLAGS+=-pthread diff --git a/tests/tcg/s390x/ts.c b/tests/tcg/s390x/ts.c new file mode 100644 index 0000000..441faf3 --- /dev/null +++ b/tests/tcg/s390x/ts.c @@ -0,0 +1,35 @@ +/* + * Test the TEST AND SET instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include + +static int ts(char *p) +{ + int cc; + + asm("ts %[p]\n" + "ipm %[cc]" + : [cc] "=r" (cc) + , [p] "+Q" (*p) + : : "cc"); + + return (cc >> 28) & 3; +} + +int main(void) +{ + char c; + + c = 0x80; + assert(ts(&c) == 1); + assert(c == 0xff); + + c = 0x7f; + assert(ts(&c) == 0); + assert(c == 0xff); + + return EXIT_SUCCESS; +} -- cgit v1.1