From nobody Sun Nov 9 22:27:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551982135699742.2649252519539; Thu, 7 Mar 2019 10:08:55 -0800 (PST) Received: from localhost ([127.0.0.1]:56627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1xRr-0000ws-IF for importer@patchew.org; Thu, 07 Mar 2019 13:08:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wqi-00035X-Hi for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1wqh-00082Z-Ib for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:28 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:35437) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1wqh-00081s-A9 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:27 -0500 Received: by mail-wm1-x32d.google.com with SMTP id y15so10118955wma.0 for ; Thu, 07 Mar 2019 09:30:27 -0800 (PST) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d206sm9979753wmc.11.2019.03.07.09.30.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 09:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=j7nLYa5t0iwQMQlb2p9lucvgT7D/mA9jbc3SpY3WtAU=; b=lrKRJWtB/BTQvrWFGW11FSPybNP+qvhwlJkw3oscVSYu922KLh8AZZt8B2X3z2IlYB FLecY3glz8t+Az2CCjARgRhifuPk3R5kyhtBqAvGRq3C/II8SoGTWTSFd2uu+Hasrh3f l4chGfkOp0yIaFOAn5cV8NFv7ZVN7L867Bzk7/hU8egZyMMCFdZEN2uj4jvN9CWxUIOt 726RmJFZvddXCnuSIe76WiBljocA4B7bI8mbXvHlRFPLMLm0PjeuS9AL69L6PYtCFK3B ngxue+gdvR3fidmmd7u81TSVYsjvPVx1i99TpD6Jb9dsuuO9RiKWDWZxNgnPa77I/D8k T2AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=j7nLYa5t0iwQMQlb2p9lucvgT7D/mA9jbc3SpY3WtAU=; b=mj+hWhEonDBKIl6Fhe6xCj9ExFYJItmBI+jG4OluYMGJ15zrZDzUbDJfbiT0orX3Sk BW/hxElIy6PejVAm3c04uLyHV796BXf4PSpAkSgOugffWU/GDvhCfb8hdMMKYV6t4x17 H0yDEotP50uZYLJYtH5MRfy1GahNmg1YXvkDA3epnyh31F5cNEKx+vqTQlUmd4o3xbct YMQcdAX8dGqw74IALXMnHvgS28dNxr2Jf74hsC1IDXm60H3yTY3DN/SfXHtsN9MlBhzP yE9ymGTN8gNQ8AbFbchqQNVqcToRzUg6wTT3FIiMzBbyphr6yXxA35v5L2hKV+TpNCHD bl7g== X-Gm-Message-State: APjAAAVZH214BB0av5nfm8SMlgC7VWzEtmXLLBBB8si9JmtrxrcQ9ro1 /Dsde+jqm/U0hbHFjO7dFmmGKKc4 X-Google-Smtp-Source: APXvYqzRgVRscQKIDQCgWm5iZY0/yYUVy60mbmW2VXbR3ZtsoN98rkU0bkXc4dTe2aMDSB+8rocW+g== X-Received: by 2002:a1c:ce46:: with SMTP id e67mr6699867wmg.40.1551979825881; Thu, 07 Mar 2019 09:30:25 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 18:29:25 +0100 Message-Id: <1551979804-6060-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551979804-6060-1-git-send-email-pbonzini@redhat.com> References: <1551979804-6060-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d Subject: [Qemu-devel] [PULL 18/57] tests/libqos: has_buggy_msi flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, Emanuele Giuseppe Esposito , lviver@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Emanuele Giuseppe Esposito The Qgraph framework makes any test using pci bus run the same function using pci-pci and pci-spapr bus. However, some tests are not ready to use the spapr bus, due to a MSI bug. Until it does not get fixed, this flag allows them to skip the test Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Paolo Bonzini --- tests/libqos/pci-pc.c | 3 +++ tests/libqos/pci-spapr.c | 3 +++ tests/libqos/pci.c | 14 ++++++++++++++ tests/libqos/pci.h | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index d729ad4..4ab16fa 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -124,6 +124,9 @@ void qpci_init_pc(QPCIBusPC *qpci, QTestState *qts, QGu= estAllocator *alloc) { assert(qts); =20 + /* tests can use pci-bus */ + qpci->bus.has_buggy_msi =3D FALSE; + qpci->bus.pio_readb =3D qpci_pc_pio_readb; qpci->bus.pio_readw =3D qpci_pc_pio_readw; qpci->bus.pio_readl =3D qpci_pc_pio_readl; diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c index d9b87a7..6925925 100644 --- a/tests/libqos/pci-spapr.c +++ b/tests/libqos/pci-spapr.c @@ -155,6 +155,9 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qt= s, { assert(qts); =20 + /* tests cannot use spapr, needs to be fixed first */ + qpci->bus.has_buggy_msi =3D TRUE; + qpci->alloc =3D alloc; =20 qpci->bus.pio_readb =3D qpci_spapr_pio_readb; diff --git a/tests/libqos/pci.c b/tests/libqos/pci.c index 8257904..662ee7a 100644 --- a/tests/libqos/pci.c +++ b/tests/libqos/pci.c @@ -51,6 +51,20 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, in= t device_id, } } =20 +bool qpci_has_buggy_msi(QPCIDevice *dev) +{ + return dev->bus->has_buggy_msi; +} + +bool qpci_check_buggy_msi(QPCIDevice *dev) +{ + if (qpci_has_buggy_msi(dev)) { + g_test_skip("Skipping due to incomplete support for MSI"); + return true; + } + return false; +} + static void qpci_device_set(QPCIDevice *dev, QPCIBus *bus, int devfn) { g_assert(dev); diff --git a/tests/libqos/pci.h b/tests/libqos/pci.h index 9fd521a..8e1d292 100644 --- a/tests/libqos/pci.h +++ b/tests/libqos/pci.h @@ -53,6 +53,7 @@ struct QPCIBus { QTestState *qts; uint16_t pio_alloc_ptr; uint64_t mmio_alloc_ptr, mmio_limit; + bool has_buggy_msi; /* TRUE for spapr, FALSE for pci */ =20 }; =20 @@ -81,6 +82,9 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int= device_id, QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn); void qpci_device_init(QPCIDevice *dev, QPCIBus *bus, QPCIAddress *addr); =20 +bool qpci_has_buggy_msi(QPCIDevice *dev); +bool qpci_check_buggy_msi(QPCIDevice *dev); + void qpci_device_enable(QPCIDevice *dev); uint8_t qpci_find_capability(QPCIDevice *dev, uint8_t id); void qpci_msix_enable(QPCIDevice *dev); --=20 1.8.3.1