From nobody Thu Apr 25 16:35:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1570013461; cv=none; d=zoho.com; s=zohoarc; b=mlYHOWT/YwZeLGXr+Po5fdM3XNwTww3yx94aAYRFuaptlzCw+kdGKwZT2k+aqlnkvrxwezFp/9D/6ZYM71YQu7J6YCJnpiXvneux2RdrfJfN2PoRadi10wwXPnBv+B/iGTZxSdVaRUN7ZFCk10Nib0jwhcPPW/9FoU92/vBG9dU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570013461; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=IYxpIuCBTyhVI2IDm9JMYcJSXeJGZ+8nCPM/hg+rvpM=; b=fsFpmpHjFcRY6R06IHBhScy6LlgcJmZ0mzTaoYvbgy5R1B0yaSLBfegGnXa8eE9Q87TA/9NLfXF1u+UBO57w2GZAH011Ox5TDAG2C5pP++1nLmSuHK31WHxSEsgsLBwHlLaTnRceXD62lg5/mcvX1EhWTPUVxyL7CD/+LqRqO3g= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1570013461093170.65820092744343; Wed, 2 Oct 2019 03:51:01 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFcCa-0006VZ-Ak; Wed, 02 Oct 2019 10:49:48 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFcCY-0006VU-Jo for xen-devel@lists.xenproject.org; Wed, 02 Oct 2019 10:49:46 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by localhost (Halon) with ESMTPS id 58a95b16-e502-11e9-9712-12813bfff9fa; Wed, 02 Oct 2019 10:49:45 +0000 (UTC) X-Inumbo-ID: 58a95b16-e502-11e9-9712-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1570013385; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9g3yQ8/yFu8MB+e69ExSbEN8NzP8qzfavPEi88ss+tE=; b=TBZDUnZ14Lgqz9umZ+Io2kD727Jo66haq1Dfol8gxSNWvLHwUXM+1kh0 fLRdoDxcVL5svxn4q2b5aMyfxM5CydiryM2M6waLKIvf5gmB8dgEdCGC5 BQHeBMdKj3AMylmLYIKKayhaIxkFDjRVKtbO3HGI2U1D97eRk0tr3hybQ w=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 1frYUEHpB7lfN6RuIEiYr3dkP7V4b5rkcyIzoDBs8P60rVtZw80pHzagrxp+fGo6JsNox6tgyH RW2xiVcIddEQSlvXBz0jJtnoOMRiQIroCZHLJkDlguWIuW/foZ82yg2e14yWiMq0ygN+pOKMWc JvDF2YiOfw9l2fHALLGl2hDr4T8JR/+lN2CHl6ZKke0qzoGoYzLfozikzoSux3IvsU3o2rrPzR zEBnCyK1JnBxOeRc4lFuLijU7sA3Vam1pL3gj1rJmuwIoM8i2xliJY2xPyjQRElubuRpEXENXq z3k= X-SBRS: 2.7 X-MesageID: 6715069 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,574,1559534400"; d="scan'208";a="6715069" From: Roger Pau Monne To: Date: Wed, 2 Oct 2019 12:49:35 +0200 Message-ID: <20191002104935.60245-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] pci: clear host_maskall field on assign X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Chao Gao , "Spassov, Stanislav" , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The current implementation of host_maskall makes it sticky across assign and deassign calls, which means that once a guest forces Xen to set host_maskall the maskall bit is not going to be cleared until a call to PHYSDEVOP_prepare_msix is performed. Such call however shouldn't be part of the normal flow when doing PCI passthrough, and hence the flag needs to be cleared when assigning in order to prevent host_maskall being carried over from previous assignations. Note that other mask fields, like guest_masked or the entry maskbit are already reset when the msix capability is initialized. Also note that doing the reset of host_maskall there would allow the guest to reset such field by enabling and disabling MSIX, which is not intended. Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Chao Gao Cc: "Spassov, Stanislav" Cc: Pasi K=C3=A4rkk=C3=A4inen --- Chao, Stanislav, can you please check if this patch fixes your issues? --- xen/drivers/passthrough/pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 7deef2f12b..b4f1ac2dd9 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -1504,7 +1504,10 @@ static int assign_device(struct domain *d, u16 seg, = u8 bus, u8 devfn, u32 flag) } =20 if ( pdev->msix ) + { msixtbl_init(d); + pdev->msix->host_maskall =3D false; + } =20 pdev->fault.count =3D 0; =20 --=20 2.23.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel