From nobody Mon May 6 16:47:44 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=1566912862; cv=none; d=zoho.com; s=zohoarc; b=l811UIFn9vQgoDXL8wSxwPdfjDe18I6zNpmULJrK9RaNAs8OUZF7yJardkH/4yz2rWV/wv4Tipt7r54aarc0KfQbco/9qHQmj3CSbKiJu0JHqkZRQNY2Qbx+XRF2pwl+IcCTzHUIpfheYx2Y2vYperr3Is7OalC4PrMEaXN72nM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566912862; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=QQY9rD7B8zix4uK7KrXw7xmHJv1D+bEXXADFnpENlbU=; b=RX1z9G0XS+sZ2oMp+puA/ymC8PHP9ILvub6JazBtdOYWj6xUFOW+RPahJAC1fSzxt0LhLInXr+msFW7GwraTfMbgodkOk8yeJDz8ebAm4n0IOv2OgtuVVh+wTCZS7irhMsAp+CHlVrNHPcFEnvJqOZGl7rZUp3GoylzE6wtNwI8= 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 1566912862264919.2819058742381; Tue, 27 Aug 2019 06:34:22 -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 1i2bb2-0004MS-8K; Tue, 27 Aug 2019 13:33:16 +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 1i2bb1-0004MI-Ab for xen-devel@lists.xenproject.org; Tue, 27 Aug 2019 13:33:15 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3734c2c6-c8cf-11e9-ae35-12813bfff9fa; Tue, 27 Aug 2019 13:33:12 +0000 (UTC) X-Inumbo-ID: 3734c2c6-c8cf-11e9-ae35-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1566912792; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Evh/5LyKfZIwz6MpzK7DNYlQ6kRXiowbyoltKQb/7FM=; b=ZQx+LRS+BxukOWl0mGPY5uRtxxyiCZF0WuTrxUcL2HInOz4qskCkqD5W 3VhXg1DegKi1tYlmNzPTeOetv/udR6JhbW8a63QQlBWqSUyGZsycWLMLh tN3VT/dloqogE9qlyM801duQlKAdHNFE0PlFyMHzXRE+jmvXZE/Oqd0gc g=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@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 (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 7kfNZTu9scceGpJZthsMQ9YewLEBz1yUgwFlRBbfBFUikoMNgoesa8K7VsE5hwSkZRtr/RAAFx dHka7gqfcjMpE7J1qMp2O0YQ3oZNa/j5IWVVJNA5lDITUguAd2ONoKCSsTL6OxNWquMu9phLH9 i3xv0CZ+KK1v7Ve2o0Ldb03FF7gUirljMBnJv2CmZbSgObT+D1WFbK9nBvnCDZJJGfFp4C7MyC vHJzCWtLf+x7+qZo66SglD8ipqq4zi6xFIMzPiAvFrJg/SIwHkk2yebV4ve3zflAwbIdv45+j+ 5Ok= X-SBRS: 2.7 X-MesageID: 4987742 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,437,1559534400"; d="scan'208";a="4987742" From: Anthony PERARD To: Date: Tue, 27 Aug 2019 14:32:56 +0100 Message-ID: <20190827133259.32084-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190827133259.32084-1-anthony.perard@citrix.com> References: <20190827133259.32084-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PULL 1/4] xen: Fix ring.h header 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: Anthony PERARD , xen-devel@lists.xenproject.org, Peter Maydell 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 xen_[rw]?mb() macros defined in ring.h can't be used and the fact that there are gated behind __XEN_INTERFACE_VERSION__ means that it needs to be defined somewhere. QEMU doesn't implement interfaces with the Xen hypervisor so defining __XEN_INTERFACE_VERSION__ is pointless. This leads to: include/hw/xen/io/ring.h:47:5: error: "__XEN_INTERFACE_VERSION__" is not defined, evaluates to 0 [-Werror=3Dundef] Cleanup ring.h. The xen_*mb() macros are already defined in xenctrl.h which is included in xen_common.h. Reported-by: Markus Armbruster Signed-off-by: Anthony PERARD Reviewed-by: Markus Armbruster Message-Id: <20190704153605.4140-1-anthony.perard@citrix.com> [aperard: Adding the comment proposed upstream] Signed-off-by: Anthony PERARD --- include/hw/xen/interface/io/ring.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/hw/xen/interface/io/ring.h b/include/hw/xen/interface/= io/ring.h index 1adacf09f9..5d048b335c 100644 --- a/include/hw/xen/interface/io/ring.h +++ b/include/hw/xen/interface/io/ring.h @@ -33,6 +33,13 @@ * - standard integers types (uint8_t, uint16_t, etc) * They are provided by stdint.h of the standard headers. * + * Before using the different macros, you need to provide the following + * macros: + * - xen_mb() a memory barrier + * - xen_rmb() a read memory barrier + * - xen_wmb() a write memory barrier + * Example of those can be found in xenctrl.h. + * * In addition, if you intend to use the FLEX macros, you also need to * provide the following, before invoking the FLEX macros: * - size_t @@ -42,12 +49,6 @@ * and grant_table.h from the Xen public headers. */ =20 -#if __XEN_INTERFACE_VERSION__ < 0x00030208 -#define xen_mb() mb() -#define xen_rmb() rmb() -#define xen_wmb() wmb() -#endif - typedef unsigned int RING_IDX; =20 /* Round a 32-bit unsigned constant down to the nearest power of two. */ --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon May 6 16:47:44 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=1566912863; cv=none; d=zoho.com; s=zohoarc; b=Lq4Gdn4UmIx+ZrJecC7vOgmhFy6RLanMzgaaTlpoLMR7VQImRPaGwbQX8VnRfEzsao1RD0wbVfCIFOpaqFBbzyWHofBy//usVqEBad72Hyba1GKwnXu3rEyUZ29lLVzCysDiR1SIimPZo66GS5bEWWVLhtu1KH0s/qETEUOFB6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566912863; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=wbxpJpBwnZpAo0watY3LR6RpW1TW7PwdTggfD9j0lio=; b=W5X4Bgw9dsExIyGKIc5XS5Dyb6AVqtogBwPciJml5Eg9hhetHFCYDfL0NuThujAfTyClZvg5XVjMdEAp7bDi10zawT0g8cxOKAOOq/zNB/YMxCrWwyKq1KXTXEdzaJYUzLZBDLF2exlKPho7lOJIWVgfa96JSkJ7AH0pvdrDzRU= 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 1566912863020972.4384099674355; Tue, 27 Aug 2019 06:34:23 -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 1i2bb4-0004NP-Hj; Tue, 27 Aug 2019 13:33:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i2bb3-0004N3-6u for xen-devel@lists.xenproject.org; Tue, 27 Aug 2019 13:33:17 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 372b068c-c8cf-11e9-ac23-bc764e2007e4; Tue, 27 Aug 2019 13:33:12 +0000 (UTC) X-Inumbo-ID: 372b068c-c8cf-11e9-ac23-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1566912791; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=il5wHWdG08K/WwVCv6LOoDJJTxpyyVsB6uhiMfXgDN0=; b=TQKffYkU2Ny/T5epIg/Nr0x3p3hPTkyFtpP553ESOQwoM2u1KpWJYXAa GzEzRBdVxcrFlp/rDdc7khVrfO00W+hZExE7VegOB2im249K0UMeOibrk v4925/eZT9U/9yB992i573tYqf1/Ru9HrNRYHy7OG6t/7y5okqlcYyP6G w=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@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 (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: k6cQQl2ZxP20PgYhA2iJRLQBKsMiG/cpdwY4VI7aZXr7LYb+lz0iDggO69NpK4QXvFBfAMN1eP k5Xt+z58a2WzEyMwvPAXnVaAk7i1KUszcvLD4r3UBsLE1qwsHyV+7n9W0MYKVgkyRPkfEIDXZQ Hdh8lJhkkMFnG+7wH3dc2ChLnANfrea81ibnrQ9CWVML0DRFY3BWa161Wo3RuTZX/v2hx5cySp J9ixesfwyLaxc3faogJ9oUc0McjszPNSnLiyGpsJv6KnZBv2Wq6C2Gd85xseKS2XGPBE0nNF2t bQU= X-SBRS: 2.7 X-MesageID: 4987741 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,437,1559534400"; d="scan'208";a="4987741" From: Anthony PERARD To: Date: Tue, 27 Aug 2019 14:32:57 +0100 Message-ID: <20190827133259.32084-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190827133259.32084-1-anthony.perard@citrix.com> References: <20190827133259.32084-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PULL 2/4] xen: cleanup IOREQ server on exit 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: Anthony PERARD , xen-devel@lists.xenproject.org, Peter Maydell 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) From: Igor Druzhinin Device model is supposed to destroy IOREQ server for itself. Signed-off-by: Igor Druzhinin Acked-by: Paul Durrant Message-Id: <1564428563-1006-1-git-send-email-igor.druzhinin@citrix.com> Signed-off-by: Anthony PERARD --- hw/i386/xen/xen-hvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 5d3e4750e6..6b5e5bb7f5 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -1247,6 +1247,8 @@ static void xen_exit_notifier(Notifier *n, void *data) { XenIOState *state =3D container_of(n, XenIOState, exit); =20 + xen_destroy_ioreq_server(xen_domid, state->ioservid); + xenevtchn_close(state->xce_handle); xs_daemon_close(state->xenstore); } --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon May 6 16:47:44 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=1566912866; cv=none; d=zoho.com; s=zohoarc; b=hWV6AGEeceqoZyAWLMIGLzdAIJolHXvAJaV5yVqqgLF5O9NYN1nErhwuwmTKmAgyT3gFdQSBUciLB33m9xHCOgGcSYQ8S45+rhWW4PVBul6C3NTr0YGEM92L1KBlZlz66ONqLP+LWe2WFAZsYgwFyoRYknyzdm6XNdiFheMWdgg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566912866; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=NfCHAuMZQFGoNqWAx4zad8ypxzWUYx6oFMqUah4agZ4=; b=e9rzkIZ9QtX8pQQUcrxbLAbY2UKp5Gqp009msrPQ+ph0svQgz5AxPYAKzqGe6HE/vSc+6L2pB7zSjgr7VRM7j06HSnYH5m52zRGs7K1ziMscGka8Jx9uddATd30cG/Xwbk5W3HLBc3dAwNShP0PyJgeUVqTX/qHpjA2PcxUGz68= 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 1566912866387593.4812829812496; Tue, 27 Aug 2019 06:34:26 -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 1i2bb9-0004PH-QM; Tue, 27 Aug 2019 13:33:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i2bb8-0004Ok-6z for xen-devel@lists.xenproject.org; Tue, 27 Aug 2019 13:33:22 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3777dac0-c8cf-11e9-ac23-bc764e2007e4; Tue, 27 Aug 2019 13:33:12 +0000 (UTC) X-Inumbo-ID: 3777dac0-c8cf-11e9-ac23-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1566912792; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5CoqJCQiLnVu+dsWN0Ou8DoSb81hsrlnHmMIXfN/N8w=; b=Z1dTidY3qNzn8Q3fBC81ThKeulJ9+7PeqeopqOBokRX5lW6hkNKdVDeC cOr6dPTajt7E2fulzrwpjVRZw7uiwJ0A4KIahNaTzRYI1m5xcLc1jIkwk UejCSqxA3dcN4Du32PvQAIToZ7Jz4VGfXC+BquNbxGS42gJZ/Dvm7a12q o=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@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 (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: GW8W5dlZtUCLO1Vzx2t4NsAYwjqY6hvEaixyskr+gUrAyyxApEOGhLt2RAvLY7lTiU3ZQ2ZK1U PzWSQGmayvN9+al2cizXAQiZhOvKvLOaSx+YeesjOCyRNFnP7kAaShNhuqDMhEFkl0Va1hYMwj 6eHsNra41WDXZCmwUkvTe/EkkMiyqCCY6NkrYNQ2UJJwhpUrvVAF44rSOxifUwyHBeVmiEWDmx KAfcLAlTc2MyXw5fe1VdsnCtmSoXLjLpDhARvUAAYYDjGYS6kHuX5xLyBvc08GHm312dPB+Swn k4A= X-SBRS: 2.7 X-MesageID: 4987743 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,437,1559534400"; d="scan'208";a="4987743" From: Anthony PERARD To: Date: Tue, 27 Aug 2019 14:32:58 +0100 Message-ID: <20190827133259.32084-4-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190827133259.32084-1-anthony.perard@citrix.com> References: <20190827133259.32084-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PULL 3/4] xen-bus: Fix backend state transition on device reset 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: Anthony PERARD , xen-devel@lists.xenproject.org, Peter Maydell 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) When a frontend wants to reset its state and the backend one, it starts with setting "Closing", then waits for the backend (QEMU) to do the same. But when QEMU is setting "Closing" to its state, it triggers an event (xenstore watch) that re-execute xen_device_backend_changed() and set the backend state to "Closed". QEMU should wait for the frontend to set "Closed" before doing the same. Before setting "Closed" to the backend_state, we are also going to check if there is a frontend. If that the case, when the backend state is set to "Closing" the frontend should react and sets its state to "Closing" then "Closed". The backend should wait for that to happen. Fixes: b6af8926fb858c4f1426e5acb2cfc1f0580ec98a Signed-off-by: Anthony PERARD Reviewed-by: Paul Durrant Message-Id: <20190823101534.465-2-anthony.perard@citrix.com> --- hw/xen/xen-bus.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index e40500242d..62c127b926 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -516,6 +516,23 @@ static void xen_device_backend_set_online(XenDevice *x= endev, bool online) xen_device_backend_printf(xendev, "online", "%u", online); } =20 +/* + * Tell from the state whether the frontend is likely alive, + * i.e. it will react to a change of state of the backend. + */ +static bool xen_device_state_is_active(enum xenbus_state state) +{ + switch (state) { + case XenbusStateInitWait: + case XenbusStateInitialised: + case XenbusStateConnected: + case XenbusStateClosing: + return true; + default: + return false; + } +} + static void xen_device_backend_changed(void *opaque) { XenDevice *xendev =3D opaque; @@ -539,11 +556,11 @@ static void xen_device_backend_changed(void *opaque) =20 /* * If the toolstack (or unplug request callback) has set the backend - * state to Closing, but there is no active frontend (i.e. the - * state is not Connected) then set the backend state to Closed. + * state to Closing, but there is no active frontend then set the + * backend state to Closed. */ if (xendev->backend_state =3D=3D XenbusStateClosing && - xendev->frontend_state !=3D XenbusStateConnected) { + !xen_device_state_is_active(state)) { xen_device_backend_set_state(xendev, XenbusStateClosed); } =20 --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon May 6 16:47:44 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=1566912867; cv=none; d=zoho.com; s=zohoarc; b=ayYzyF/VvxClk4UQcMVVuJxwkBh0bP9Or4iFxqiLJHkVfLK189QOqSa0zKKBeK52JXtCsJ+RalbQkNEGAC+N2g3kjt0L15VpRprTb+rqZj+D/Ses7dEaqph+GrXo2HAdj0r2p0Gkfa4wF2CSDMXDQqpFI5xL7QsOZoe3sr7kQAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566912867; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2RfvhwS/iAH9h4JiwmfRYSjX0T4e3HGae/iDCP0XsoQ=; b=L0x5g/y+0wdz8ViAtd8PbeIa7YKHyRPRf6u/KBwJYyJRfzpPx41iJqoypaMGWSDB5sIzr27uMQ48JM3+l4WH+sc8mmg91Ug9gqdhzzWRFgQlpmxcpAExDkDv2i+hy4Qg05WR7lgEibvfnP3dLd4CnIBNSAjSPRKZttypk/SmhWQ= 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 1566912867236652.5273045146997; Tue, 27 Aug 2019 06:34:27 -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 1i2bbE-0004R5-4Y; Tue, 27 Aug 2019 13:33:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i2bbD-0004Qi-7y for xen-devel@lists.xenproject.org; Tue, 27 Aug 2019 13:33:27 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 37da8e86-c8cf-11e9-ac23-bc764e2007e4; Tue, 27 Aug 2019 13:33:13 +0000 (UTC) X-Inumbo-ID: 37da8e86-c8cf-11e9-ac23-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1566912793; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pFwuW4Axd7YdiPFuPhw6DuqGqqdqinpa0zNIxL6MtZY=; b=PFd73FtPiB8VA18xyDz161dJbfUbKR+/Q45hY3dQ00sLrd9mPkc+iUYL m4c5i/nzD72n6BficJvTuD6EMceI03iRnPhwU/dGrfkzfIMirCw51BlXa UQI6hXPIyU4pUB71XPsHd8ZpqNIr2HX+pEpeuQ2zzaWp6VFJdPrdO7sjH Y=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@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 (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: lYPEPaREY4DL5UdRC5M3ckSf4IAECkdpa878CASsb0YtKo3zvfIHnPzbLBK3Tz/Dcfq6CepxMi 1SnFYEKZXLcoNM8+jp48NF/16gGjKaa1MGOlfox0OdIRroJWslu5iZIuXh4qEMhbO/jZkozFNf b2NEJuE101G5wfVQRm5jUZ+GemWqoLIyZpurJLvTrlfJWuLh6FG1iurHzk7VpLXcOa35jO8n8T BKmvg9LLvGfXY8DpCQZPFYNTJPrm0yqnTD7FxbdIEgDo7yTrcM7aYYpXgXhKEeospwf5sca6Y3 UN8= X-SBRS: 2.7 X-MesageID: 4987744 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,437,1559534400"; d="scan'208";a="4987744" From: Anthony PERARD To: Date: Tue, 27 Aug 2019 14:32:59 +0100 Message-ID: <20190827133259.32084-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190827133259.32084-1-anthony.perard@citrix.com> References: <20190827133259.32084-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PULL 4/4] xen-bus: Avoid rewriting identical values to xenstore 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: Anthony PERARD , xen-devel@lists.xenproject.org, Peter Maydell 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) When QEMU receives a xenstore watch event suggesting that the "state" of the frontend changed, it records this in its own state but it also re-write the value back into xenstore even so there were no change. This triggers an unnecessary xenstore watch event which QEMU will process again (and maybe the frontend as well). Also QEMU could potentially write an already old value. Signed-off-by: Anthony PERARD Reviewed-by: Paul Durrant Message-Id: <20190823101534.465-3-anthony.perard@citrix.com> --- hw/xen/xen-bus.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 62c127b926..a04478ad4f 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -698,7 +698,8 @@ int xen_device_frontend_scanf(XenDevice *xendev, const = char *key, } =20 static void xen_device_frontend_set_state(XenDevice *xendev, - enum xenbus_state state) + enum xenbus_state state, + bool publish) { const char *type =3D object_get_typename(OBJECT(xendev)); =20 @@ -710,7 +711,9 @@ static void xen_device_frontend_set_state(XenDevice *xe= ndev, xs_strstate(state)); =20 xendev->frontend_state =3D state; - xen_device_frontend_printf(xendev, "state", "%u", state); + if (publish) { + xen_device_frontend_printf(xendev, "state", "%u", state); + } } =20 static void xen_device_frontend_changed(void *opaque) @@ -726,7 +729,7 @@ static void xen_device_frontend_changed(void *opaque) state =3D XenbusStateUnknown; } =20 - xen_device_frontend_set_state(xendev, state); + xen_device_frontend_set_state(xendev, state, false); =20 if (state =3D=3D XenbusStateInitialising && xendev->backend_state =3D=3D XenbusStateClosed && @@ -1169,7 +1172,7 @@ static void xen_device_realize(DeviceState *dev, Erro= r **errp) xen_device_frontend_printf(xendev, "backend-id", "%u", xenbus->backend_id); =20 - xen_device_frontend_set_state(xendev, XenbusStateInitialising); + xen_device_frontend_set_state(xendev, XenbusStateInitialising, true); =20 xendev->exit.notify =3D xen_device_exit; qemu_add_exit_notifier(&xendev->exit); --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel