From nobody Wed Nov 5 10:47:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534155656089477.22982705996003; Mon, 13 Aug 2018 03:20:56 -0700 (PDT) Received: from localhost ([::1]:38521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp9y1-00033A-DL for importer@patchew.org; Mon, 13 Aug 2018 06:20:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp9sj-0007Hi-AD for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:15:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fp9si-00026v-9B for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:15:25 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:37784) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fp9sh-00025u-Vx; Mon, 13 Aug 2018 06:15:24 -0400 Received: by mail-ed1-x52a.google.com with SMTP id b10-v6so7962062eds.4; Mon, 13 Aug 2018 03:15:23 -0700 (PDT) Received: from localhost.localdomain ([194.230.159.125]) by smtp.gmail.com with ESMTPSA id s27-v6sm11670006edb.73.2018.08.13.03.15.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 03:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2vLKRofZrxM3meruSk8g+MCm2/3lJflXuD24g3CK+EY=; b=gVH6UELehcW8uEoTd4V4vZ4Y2QRK/Jla/rtYWv7ZxD+SKmpbzs4iHc3eqZ+DByc45Z i6x5CtbhFn1B4/ODMJfMuUp5yUButikfG57rdbf9n81bC8f87NklXtxz34DGyuU/NELc /Ws5mvM+TeuPXgvgjEuG1Xk18r6WaxXpdSWKn2mV8dakPkuqv3qviyofkAOqQLxBIKX/ DHtZyQuy/hXU8fgqQ1x/3NrHVF2qXxjnxDz5Wil4sjw6LEkmcWjqLRycyPShLzO4GRFE /TFtzIovSPUd0piknuNLZWli4u9jHLWEHXQncfAZc7Mp3vKX5FI0t6j6n37UkgM6WK+2 HsuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2vLKRofZrxM3meruSk8g+MCm2/3lJflXuD24g3CK+EY=; b=JT90RoclJI2xtc9jXxOU6W38lQYDcZN+FKGiQTY73I3OU5rK0wxze/t9X+k6k8VnXv D1jY15V3qhWkEEAM3p1Wzhz5rI2DSv5lwf6U3jl3zGnt15iuGQUmkHykRHrgJ8Yy/C2O sr4+WoOywXkrjSxgmF6+KJqZqjDnf+mN1CVMX1XXs4MbTVENU/53Ku6KxbT2XQHLRdc1 GhsOzNUHgQk1FEYd3ArrQAwQmWvBIw4aH/1ALHqDqgQQYltB0YuMjWBMAoizClgr9tD/ OFN6DZi08+XpDEq6mF8Yf0vfWNAQ/r+DKnDrnTgg1Fi/Yn4ePSvFLydp3u+x83QtBEg6 gU0Q== X-Gm-Message-State: AOUpUlGD+0vNnuyVoFYN5bcE5dYie4TF5XK47hxIlefETfdtljH0HzX2 1+MTuMX/KzeVY3LCamBH7Y+QwdBGIjI= X-Google-Smtp-Source: AA+uWPxKcY1IpQkc0UVahYpvbuyM4iAL5V5c19D/hsfYEzRoVcwSgBi9B8wOeZ8fsB9s97J+osIMUQ== X-Received: by 2002:a50:ade6:: with SMTP id b35-v6mr21591563edd.168.1534155322627; Mon, 13 Aug 2018 03:15:22 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 12:14:30 +0200 Message-Id: <20180813101453.10200-11-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813101453.10200-1-e.emanuelegiuseppe@gmail.com> References: <20180813101453.10200-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52a Subject: [Qemu-devel] [PATCH 10/33] tests/qgraph: 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: Laurent Vivier , Fam Zheng , qemu-block@nongnu.org, "Michael S. Tsirkin" , Jason Wang , Amit Shah , Emanuele Giuseppe Esposito , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- tests/libqos/pci-pc.c | 3 +++ tests/libqos/pci-spapr.c | 3 +++ tests/libqos/pci.c | 5 +++++ tests/libqos/pci.h | 3 +++ 4 files changed, 14 insertions(+) diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index 93cbfbce6b..0cf87f51b5 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -123,6 +123,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 24f2c2c60d..502a0e5129 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 080e87533e..d5bace9d6a 100644 --- a/tests/libqos/pci.c +++ b/tests/libqos/pci.c @@ -51,6 +51,11 @@ 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; +} + 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 bcfa6d85a4..5fb3c550c5 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 @@ -80,6 +81,8 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int= device_id, void *data); QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn); void qpci_device_init(QPCIDevice *dev, QPCIBus *bus, QPCIAddress *addr); +/* returns the bus has_buggy_msi flag */ +bool qpci_has_buggy_msi(QPCIDevice *dev); =20 void qpci_device_enable(QPCIDevice *dev); uint8_t qpci_find_capability(QPCIDevice *dev, uint8_t id); --=20 2.17.1