From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47136C433EF for ; Tue, 18 Jan 2022 20:48:31 +0000 (UTC) Received: from localhost ([::1]:36894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9vP3-00061i-TZ for qemu-devel@archiver.kernel.org; Tue, 18 Jan 2022 15:48:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9vGL-0006c9-FZ for qemu-devel@nongnu.org; Tue, 18 Jan 2022 15:39:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41342) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9vGJ-0003JK-Ja for qemu-devel@nongnu.org; Tue, 18 Jan 2022 15:39:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642538366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gccVtjqdXPcWela0w8NV10LOW8M/f5w43auUyaYbmCg=; b=Y3ls1X0uIT9IeAvciH2+SXOqogWELAqqoN8QZdVBxiZEvR2AJVAJQKIXuqxV95gsc+QvUd jSoY+50dip6dAvnmGV8Eqr4u4cSENXbRsZi2YitWbLJ0TW6xLKXY777fIEKQ1jgYCDHdML TICgKmmTYAkW0Gt1qj/Lq9s5T5Qe9Ao= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-L_buEKNCMz6E-bnCAWnXBw-1; Tue, 18 Jan 2022 15:39:23 -0500 X-MC-Unique: L_buEKNCMz6E-bnCAWnXBw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 526CA1091DA0; Tue, 18 Jan 2022 20:39:22 +0000 (UTC) Received: from laptop.redhat.com (unknown [10.39.194.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F4C85DB8B; Tue, 18 Jan 2022 20:39:10 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, thuth@redhat.com, pbonzini@redhat.com, lvivier@redhat.com, qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, mst@redhat.com, david@gibson.dropbear.id.au, clg@kaod.org, eesposit@redhat.com Subject: [PATCH v2 4/6] tests/qtest/vhost-user-blk-test: Setup MSIx to avoid error on aarch64 Date: Tue, 18 Jan 2022 21:38:31 +0100 Message-Id: <20220118203833.316741-5-eric.auger@redhat.com> In-Reply-To: <20220118203833.316741-1-eric.auger@redhat.com> References: <20220118203833.316741-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=170.10.129.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jean-philippe@linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" When run on ARM, basic and indirect tests currently fail with the following error: ERROR:../tests/qtest/libqos/virtio.c:224:qvirtio_wait_used_elem: assertion failed (got_desc_idx == desc_idx): (50331648 == 0) Bail out! ERROR:../tests/qtest/libqos/virtio.c:224: qvirtio_wait_used_elem: assertion failed (got_desc_idx == desc_idx): (50331648 == 0) Setting up and enabling MSIX fixes the issue. Also remove the useless libqos/libqos-pc.h header inclusion. Signed-off-by: Eric Auger Acked-by: Thomas Huth --- tests/qtest/vhost-user-blk-test.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c index 1316aae0fa..2606428df3 100644 --- a/tests/qtest/vhost-user-blk-test.c +++ b/tests/qtest/vhost-user-blk-test.c @@ -19,7 +19,6 @@ #include "standard-headers/linux/virtio_pci.h" #include "libqos/qgraph.h" #include "libqos/vhost-user-blk.h" -#include "libqos/libqos-pc.h" #define TEST_IMAGE_SIZE (64 * 1024 * 1024) #define QVIRTIO_BLK_TIMEOUT_US (30 * 1000 * 1000) @@ -224,6 +223,10 @@ static QVirtQueue *test_basic(QVirtioDevice *dev, QGuestAllocator *alloc) char *data; QTestState *qts = global_qtest; QVirtQueue *vq; + QVirtioPCIDevice *vpcidev = container_of(dev, QVirtioPCIDevice, vdev); + + qpci_msix_enable(vpcidev->pdev); + qvirtio_pci_set_msix_configuration_vector(vpcidev, alloc, 0); features = qvirtio_get_features(dev); features = features & ~(QVIRTIO_F_BAD_FEATURE | @@ -236,9 +239,12 @@ static QVirtQueue *test_basic(QVirtioDevice *dev, QGuestAllocator *alloc) g_assert_cmpint(capacity, ==, TEST_IMAGE_SIZE / 512); vq = qvirtqueue_setup(dev, alloc, 0); + qvirtqueue_pci_msix_setup(vpcidev, (QVirtQueuePCI *)vq, alloc, 1); qvirtio_set_driver_ok(dev); + qvirtio_wait_queue_isr(qts, dev, vq, QVIRTIO_BLK_TIMEOUT_US); + /* Write and read with 3 descriptor layout */ /* Write request */ req.type = VIRTIO_BLK_T_OUT; @@ -468,6 +474,10 @@ static void indirect(void *obj, void *u_data, QGuestAllocator *t_alloc) uint8_t status; char *data; QTestState *qts = global_qtest; + QVirtioPCIDevice *vpcidev = container_of(dev, QVirtioPCIDevice, vdev); + + qpci_msix_enable(vpcidev->pdev); + qvirtio_pci_set_msix_configuration_vector(vpcidev, t_alloc, 0); features = qvirtio_get_features(dev); g_assert_cmphex(features & (1u << VIRTIO_RING_F_INDIRECT_DESC), !=, 0); @@ -480,8 +490,12 @@ static void indirect(void *obj, void *u_data, QGuestAllocator *t_alloc) g_assert_cmpint(capacity, ==, TEST_IMAGE_SIZE / 512); vq = qvirtqueue_setup(dev, t_alloc, 0); + qvirtqueue_pci_msix_setup(vpcidev, (QVirtQueuePCI *)vq, t_alloc, 1); + qvirtio_set_driver_ok(dev); + qvirtio_wait_queue_isr(qts, dev, vq, QVIRTIO_BLK_TIMEOUT_US); + /* Write request */ req.type = VIRTIO_BLK_T_OUT; req.ioprio = 1; -- 2.26.3