From nobody Wed Nov 27 06:34:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1699648995; cv=pass; d=zohomail.com; s=zohoarc; b=Gh/pX8n6J7Ibgovf/yC3UR2w3t99nbu3g9VY4huXXY/5Rri5cp32srBeHQ2e2levFuthfyF15ZiF8nntz9X4YG6/0Dyo7ZqzEsv89bxnCfsmWM3b9JxD4XGAsFhYawWLLmiOoac/zOhtEN290OHK2mD7Hqf+br1pg5kqoE6c0UQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699648995; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UnRtHURNzIPLY0JeVnzQOo2dxqvod8upLt3UTqjtXyc=; b=f2xP2as99axRr6FBPwpYZMOXUAJ1riNiK/ebrtXMN82Gr/AreQ7h9VOG5Gb/hyx1XSBe7XJkL+NMG3HsNx68Ruuj5fVeeGgQssVvkbctxh36xjQaJn4vmXR1oBWE5hscyT5MXnhvWGB1Q4XkxPj+AV7TM3/iD9rJRhfC4FG6eig= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699648995513876.3893884997985; Fri, 10 Nov 2023 12:43:15 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.630793.983888 (Exim 4.92) (envelope-from ) id 1r1YKp-0004yx-P7; Fri, 10 Nov 2023 20:42:35 +0000 Received: by outflank-mailman (output) from mailman id 630793.983888; Fri, 10 Nov 2023 20:42:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKp-0004yq-MA; Fri, 10 Nov 2023 20:42:35 +0000 Received: by outflank-mailman (input) for mailman id 630793; Fri, 10 Nov 2023 20:42:34 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKo-0004yj-0X for xen-devel@lists.xenproject.org; Fri, 10 Nov 2023 20:42:34 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id aac58679-8009-11ee-98da-6d05b1d4d9a1; Fri, 10 Nov 2023 21:42:31 +0100 (CET) Received: from pps.filterd (m0174677.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAKIjQs010025; Fri, 10 Nov 2023 20:42:26 GMT Received: from eur05-am6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3u9kkysufj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:26 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:22 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: aac58679-8009-11ee-98da-6d05b1d4d9a1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AFlv+cRUfIHOzTpuKPONH2keS/ngQwhpsNVDHbQKm7s6VSU3RbMGtweQs4XUVtS+C9skJ+dLnQN57wvl86H0tYteb+blj4AFQZLE0hcsfi7Fxfpx8COMBF4w83UIrDwreI28/Nimn91VGqXY+srZ9oYyWa2/oU/WhdeCkkwUuL7BNtqQCm7NXHfonEovFn6yL6H/CwOMh01IvGBMlL/IUFpswTx6W7UUEGCYYWlr0xi8TfNneZphar3VEAIlwOLD1rbYsYNFyM6pNPReGuQilA4vkeRsW/PVCpIkbcVdg/ZSL94r7O09zgOaafEPq0v52mrpMTUXeTH0qh6tNKY4DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UnRtHURNzIPLY0JeVnzQOo2dxqvod8upLt3UTqjtXyc=; b=mjJR8ebmXmodBIyS8X0qHXslXnTMoAiIuwmYjGWd34FJzp7k7RMPezZktIEW64tBSWgdMPdjRQ1krwbkulaBMnMdXXfExFsC5CZ3InxA6cRdZF3yIgxOksa1w/intCg5RarVChex26QbuIlVw4LJOyiDWNOwF5smvWB8q6YHjhUqzJIMVl/14UyMvNsTW5HeDvWTmcSCSuOHKz8ERX6osqlRU01hgfMqOiEPS3pwSIfWEdgrIc8h/mbbAIvSMHERn0JDCbeMuefER7VDtSJ+FBY+zvNLtTQ6htx+F/Oy9dnvbMdfN7wfRzKZgtEBOo81uCKZOiu0MIdgL/ZYA9rysQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UnRtHURNzIPLY0JeVnzQOo2dxqvod8upLt3UTqjtXyc=; b=jnOZv8V5g+HU5vED9+PeS0uHs1PXt+mkG/5kGwVmvONgXmh8mSGyPz7JKtPvz0wVVCzp7PkAvQMmcaBkArKD+EsbkPnMl6Iy7cffwix3csNGHKKnQdkq6OZQ18xMqJOl1YDPvtf7z9ZrWpg9+nyidCthrkm0Hd5wXzerxcV8sfB09t45iig8oFDMjK4h2N7hHMsx0IJ7tgbxi9NTblQOe7RQET9mCm6J7uk2vCur3jVBxK+80yjsxMWBA+VzkcO7ag+rjx8SvVWzRvq7Gshbdj0NlA8o+FKp+sBrY0UxOt+b8OcbsXBkasozyg9Tpy8AApeGFBrhyegEvwHhIJncoA== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Oleksandr Tyshchenko , Volodymyr Babchuk , Stefano Stabellini , Anthony Perard , Paul Durrant , Kevin Wolf , Hanna Reitz , "open list:X86 Xen CPUs" , "open list:Block layer core" Subject: [PATCH v1 1/7] xen-block: Do not write frontend nodes Thread-Topic: [PATCH v1 1/7] xen-block: Do not write frontend nodes Thread-Index: AQHaFBZngjGHt2Wnc0CJ36bDt34c6A== Date: Fri, 10 Nov 2023 20:42:21 +0000 Message-ID: <20231110204207.2927514-2-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: 7e7ff430-02f3-4bbb-08d3-08dbe22d8a6a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +t2p/y7ZRDtOXl8MyGRMsxJ1lL4x70IflYG65zjO2x4DwsKjW5PmLEcCZc+NfYLkWNvsZqzO3lbY3TQ+KU6gXpPeJBafAmt4r+FDGI6CA8/oaAsqVAIgylmWcnUQnuFmYJvlYXPOe890SrfvH7peKyqoWoiz68xpYZaDyGRZV7UvKjoT0HZW6rUgFE0/G3/chNUGhh4eo6O6P5dFOLdUcM88cCFhA4Afm0xC4xHi9OwWFkflYMr7AeBf02Y2C+Pb/BOurklrNBMWBAs+UOmrhWAy6MOT9IpF6M+Uyd/FA2C4DSzwNXykCq9cGeeFwYjAm/c/Cr2ushefM4DSt0Vvi+bJYc4jTiQH42qP/Bo5HVx6iEBCTX7EK190OyhrVA47IeCgUbRMMtysccl75D58qIJrqU5URirl6T13lRIRIYIuaQ6aqLpTc7UsVgb5SQz6Yenib6rhjVDT1qzwoVPF9PmZfXPX912O3L214YEvYimCn3FH1wmyzvyPNiZk0uA5LRDaR/FQMVV/RFsgPCOITHy3nhV2Xz4jd28cfQZVhia3oHCzfYL3RQtjufEYs1D95dmD6YmavaPmjDzUjnJniaX/fAtDecTLUjkbqYh+uXptzf3yLa9QUFg4r6fU+qFI x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(86362001)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?341y8SHaRk1EQ0QaPLM8F6h8YKA7bwcqC1Cb1MoLd0PR9LJDK3ktkrV/3l?= =?iso-8859-1?Q?81niSqoAyrtuG42GUe/4maa1jrq054Iv/SaQK2PnGEgTDpyYHxFOFUIF9R?= =?iso-8859-1?Q?IsGksnxofRFII/7zQ8v08d0XMSWLFJGslmnj/xqYcj3GW9LzOx9Kisw1kZ?= =?iso-8859-1?Q?dTETuwYPTrmr0CICo93TAhzHOQ352mBUFaNv770/3drh+NlokAt31+Fm7Z?= =?iso-8859-1?Q?c+jVIgKsvli/rVHB/mr4R+UhZ34XIV/7IPKdvLRh43ZxuE7DhTEh93rVYD?= =?iso-8859-1?Q?3IBNdf/kKT31b071snFOGNIsG0ZPMp3t+Yn9M9vHdisZfLLLiQJRV9wxUg?= =?iso-8859-1?Q?C3FWxdB8RcoDtjAysCguctFzI8Tlhqgn3CkNwjP0dml+i4NZdf9NhME9Qg?= =?iso-8859-1?Q?vCs0mZo9BFcOH88eb3PuWNLihFOY22vO/RBhJbFuW/tv9WL7mQObEJCNA2?= =?iso-8859-1?Q?tmaGwKbx+BW/CONPGIVjeHnSZ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8859-1?Q?3YiC+2p3c2d2s7AkLgpMTvjrMK1+8TK/129xGqf0ASlOruk907ZWgP2hRd?= =?iso-8859-1?Q?smftjNsQqJ5dAwpJ7+YkfzeRO4rX7RJrTxBvwEh78Gsyr1Oz55yMWAYPFl?= =?iso-8859-1?Q?vIhV0jpfItHMFw9cN5Lb3JjLfs/uRL9jTaoa9pLAnxwoKgJKyCENkEJewS?= =?iso-8859-1?Q?7H9toJx6ax62l578HZe293GNyP1Scz3LjkAI++Th1lulJ1/K4XCEeB3SSN?= =?iso-8859-1?Q?AjT1BDfbVs06gqY3A14UH8C23OOT57dHiAVP4CkWehiMg7uUf9NbHusw?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e7ff430-02f3-4bbb-08d3-08dbe22d8a6a X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:21.5521 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +zFXmpaAZ3YQ9XZADoakCzmb4xIBYWzFCDwrR6dpMEUJ5PCMtm8OKNtjm6z39PMVQPmBWXLEQPstNyD6CcvCV4Dnp65tEutR2CLXBwg5ic0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-GUID: ZHeeUMuC7l0RDea5kDJ6Zrl-9h5z9xBi X-Proofpoint-ORIG-GUID: ZHeeUMuC7l0RDea5kDJ6Zrl-9h5z9xBi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 clxscore=1011 bulkscore=0 priorityscore=1501 mlxlogscore=691 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1699648996560100001 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko The PV backend running in other than Dom0 domain (non toolstack domain) is not allowed to write frontend nodes. The more, the backend does not need to do that at all, this is purely toolstack/xl devd business. I do not know for what reason the backend does that here, this is not really needed, probably it is just a leftover and all xen_device_frontend_printf() instances should go away completely. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/block/xen-block.c | 11 +++++++---- hw/xen/xen-bus.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index a07cd7eb5d..dc4d477c22 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -221,6 +221,7 @@ static void xen_block_realize(XenDevice *xendev, Error = **errp) XenBlockVdev *vdev =3D &blockdev->props.vdev; BlockConf *conf =3D &blockdev->props.conf; BlockBackend *blk =3D conf->blk; + XenBus *xenbus =3D XEN_BUS(qdev_get_parent_bus(DEVICE(xendev))); =20 if (vdev->type =3D=3D XEN_BLOCK_VDEV_TYPE_INVALID) { error_setg(errp, "vdev property not set"); @@ -280,10 +281,12 @@ static void xen_block_realize(XenDevice *xendev, Erro= r **errp) =20 xen_device_backend_printf(xendev, "info", "%u", blockdev->info); =20 - xen_device_frontend_printf(xendev, "virtual-device", "%lu", - vdev->number); - xen_device_frontend_printf(xendev, "device-type", "%s", - blockdev->device_type); + if (xenbus->backend_id =3D=3D 0) { + xen_device_frontend_printf(xendev, "virtual-device", "%lu", + vdev->number); + xen_device_frontend_printf(xendev, "device-type", "%s", + blockdev->device_type); + } =20 xen_device_backend_printf(xendev, "sector-size", "%u", conf->logical_block_size); diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index ece8ec40cd..06d5192aca 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -1048,7 +1048,7 @@ static void xen_device_realize(DeviceState *dev, Erro= r **errp) xen_device_backend_set_online(xendev, true); xen_device_backend_set_state(xendev, XenbusStateInitWait); =20 - if (!xen_device_frontend_exists(xendev)) { + if (!xen_device_frontend_exists(xendev) && xenbus->backend_id =3D=3D 0= ) { xen_device_frontend_printf(xendev, "backend", "%s", xendev->backend_path); xen_device_frontend_printf(xendev, "backend-id", "%u", --=20 2.42.0 From nobody Wed Nov 27 06:34:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1699649001; cv=pass; d=zohomail.com; s=zohoarc; b=M2nZnCKJp9sf7pRlRTQo7G/5XxE82/znVyH2FMkiL7aTJ9Q5AojeTTUfo3B7P+I95VaEZ3xMDPGnw8wCJkTFhWPED3bd8fA4ZmwfFuPGKbi4Dqf9ha8qRVLFSByWGyrQ7j6oocGHTMLOkwWih1LhJC5eRSsVuhCzxZRoQHZ90Nw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699649001; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OKWARBfkUGbfwrphZNisw+1lvrxJ4IcHq6RYQnSJRuE=; b=AOOd0zdpKZyHdq4bTzwVaiVpmBozkHmvfEjKgNGdnhQx+S8gOGs1tXQmUYwdWxEiNkVtthEEIXcDG406CcretPVuxRMnUSM1Bh9CwFS8FWp0W77jO6tRqy6JbmidpUdg7HLMTwVHlLtr3QmM0qJiQfb2FG1n7wDihcFUBvou9js= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699649001375534.7866861662701; Fri, 10 Nov 2023 12:43:21 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.630794.983897 (Exim 4.92) (envelope-from ) id 1r1YKs-0005Ds-04; Fri, 10 Nov 2023 20:42:38 +0000 Received: by outflank-mailman (output) from mailman id 630794.983897; Fri, 10 Nov 2023 20:42:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKr-0005Dl-Tm; Fri, 10 Nov 2023 20:42:37 +0000 Received: by outflank-mailman (input) for mailman id 630794; Fri, 10 Nov 2023 20:42:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKq-0004yp-H5 for xen-devel@lists.xenproject.org; Fri, 10 Nov 2023 20:42:36 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id aadc3ae5-8009-11ee-9b0e-b553b5be7939; Fri, 10 Nov 2023 21:42:32 +0100 (CET) Received: from pps.filterd (m0174677.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAKIjQt010025; Fri, 10 Nov 2023 20:42:27 GMT Received: from eur05-am6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3u9kkysufj-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:27 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:23 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: aadc3ae5-8009-11ee-9b0e-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C7dj0MfiNhBcQRxOXWlLu+E8hDVjZ4M/bAd97c+F09PNhDkq6PB+58Oi811KA+U5QsX5i6jHY4e4Wt4304XprWFNR+t9Y1qankKjmD2epfw3E0+T3I03rBmXx+NetH7LdEmJiposO5pEv9bvgYxaXpcxjEeAmEcQhS0I/Hc70HsC9gyYkKKtfnbgVfAYQuBB9Ri4B/IiUmb1C6wBt99wQwM2E901Fvxbm98VwtGuGbd3bgD6on+6gRW/ooMP5fDZzdBVJOZ+4pPJ38qj4NF3b7Vi9P/jhzRNv5vANNXd3LCoV9W7jeLSBRXeCCpysC2Nvu92PqBlcLZI8M1/TK4L8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OKWARBfkUGbfwrphZNisw+1lvrxJ4IcHq6RYQnSJRuE=; b=E26+7tTYs5Vb45W2X5Nga72XsY/IoP4LX8fHXDkAKXZ3PlYsLbh18raJ81iZQQZQaG/38GWH2SXgy2gBvEeLdnZqdHnuRsMrF9Syp6sUTtXkFnx6JHw56Qx26e6vqlouKJmhJrZ2oPAc7YpOr45xmPX4EJsuvW6HLTMltwc6OnCccYKWckVf/AacYqMaMEvVwCHHO6QxqH51Rz8C8qx4VZ+mB/M6aSTQIBFuOQ0SxT7uF34qklJf+YjON8lbkVjz3i2JLNmwaoJEwt5Wods5c9nn9wpyI85lO3qkXITNoBsYlsYXhlxsBvlFiyRjrJeVnRvlISWt5V1ohCRtTDQH0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OKWARBfkUGbfwrphZNisw+1lvrxJ4IcHq6RYQnSJRuE=; b=BNIe2UUcVtrvYCL9/nRZ8oH+N9+9MFwo/bxvlJYU2vxi9rwIjIG4xzlfR6qCon+lH0nZukftKOSbzv9+QhFxqPaer3/YbFsVYJgh9sEvZUBTrClVJNqeCwwn15h8fE5/XYEv570YZQondgAKe/DiAY7fw5EPdwJ8Eua/iBVIYeKmheCl7ZHRJOWS39KaawYKdE+2nL1vDqojC9LSUul/lIcDMA/S9vCXqhTW26nYOaer9MtkzMifC7lAU1YiOuUq4h6pFMpUrMovytMg3IdavnLWNzZ8lQICWvk7aKYxd/x/xlYya7E1fHHRqv65rv3x4iZupqr0YTRyny0jewleqg== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Oleksandr Tyshchenko , Volodymyr Babchuk , Stefano Stabellini , Anthony Perard , Paul Durrant , "open list:X86 Xen CPUs" Subject: [PATCH v1 2/7] xen-bus: Do not destroy frontend/backend directories Thread-Topic: [PATCH v1 2/7] xen-bus: Do not destroy frontend/backend directories Thread-Index: AQHaFBZnKqlUX8wCr0GIKTREthBW5Q== Date: Fri, 10 Nov 2023 20:42:22 +0000 Message-ID: <20231110204207.2927514-3-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: 5bc8600f-bd49-4902-caac-08dbe22d8aac x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eMdTJYD8hdUfjYRSfS49W/otw7oU2rlT7EZkqGf1DooukUiBpoK9jUnSvMo2/4ejhwEJ1TSlJM5alts0x+Q479PTwHvu/NmPcKGtNDr8igBN8spOOATeULQnekd/nSG0cBsaLpkYBK4EUYoxNCb3Q2I9ihpv16U8AJXZzJd5s6DXEJPy8FfmB89UQzL2aL8SR26X5D01s9hhOQz17EZwAez1TlmGPRyZSYhJpsQ/mSuXx6x6bWP8e357/R6lQLBEPgnSLvr9+9AtMnYpFUr1bm373HTNNxO3xRPbXCViW4PZ3zh7opC8t2DMKjryPRiGBzPoDLxkmzJnMCKRxGv8inoZmYazCg58+FR2hId6cZKyJ6IzeqQSLTK+ZSl6VFW+bchrs56QIpf9ZM+wIJyRYmA508cS/a05szLh/0bF0VxCbNuZU8vP6oJPhWF3lsNUP5Tb5RIVjYW0IFDPN2OpOFySCmtbfp1hLEbnIKyu/3R/y1MM8cfQiag8G/oRr6xxJjO3KSO7iblvseXtNjhm01fyIrSOd4Cwrb/L1i94Yel/yY9QjIGBiqLbZRRJSMFgwi1A0Bb3+7teaNnY872SsVvnq8sNd293Ya/wEOnBkRCzXXgpeaBXd10kh+VdzUfB x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(86362001)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?232sTjS/Gy/kngS8P2pcprtA+UZK7UcGFy+3w4XwY9/Z2d5IMTkpNJsuPi?= =?iso-8859-1?Q?H549jXIFHIriUBo49FPcfrWlBcMuAJZ5+rW5QAbLuIyPsOORTiGH9uY8Fm?= =?iso-8859-1?Q?4wDLlVJ3ZtyN3ka2wNCBxA81WFBu7DpU3AwsW+q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ZTOzIQLnzDFkqx2I7218Qxj5YlTxfLrtssX2iHD5csMi2n?= =?iso-8859-1?Q?0I16UhrLwyVlhMF61RlyPU3/EF9KwTO/MoRApQVaEngj7LDR+KGG7iFIv2?= =?iso-8859-1?Q?y1pkn+9Q2hHyK/Zd/8qdNKDA18CINMF0p9So5kNg+IClF4b+8m4NedWGac?= =?iso-8859-1?Q?edpddUbJwiC/NORVfnAeQEMwF3GHQAzpCXXHdMox5VX8dLqm+0UWKyy4+Y?= =?iso-8859-1?Q?EsuiJaqqzkba6jBxtvz0Iifx5F25jz2lo4K9NFta5v2svK1kp5TBks4FQQ?= =?iso-8859-1?Q?WaUL+QiRuvX41J6Oh6dUx5O0aPMur8ALdlrHp10C5beUmEONP/RhbpNUZt?= =?iso-8859-1?Q?vwzWDqeGejx81dmuADqLTlqJAK9ut7mv2xDAalRLg2jCHx/qU0k7q7/BEr?= =?iso-8859-1?Q?OUbIkriBBTuj62DiBXncLtTJMZWPN4+8lGVuw3/m935n2WaiX45DAiVR5U?= =?iso-8859-1?Q?AU/J3JdqIyQJ2YPimJB3zTo2lQGOLlTxdFsK5ZQ9QXtFjFMqpdIovfSKyK?= =?iso-8859-1?Q?rAJIQMtX3IpVI0tmOz4AcBeeBOMXugQ90976pNXmTDEG8RjCy1czQzLSbR?= =?iso-8859-1?Q?NY9XSnuXXMFPW9Q5xgRR/O/j4mo9kEdBmTNiG+vEDV6d5dFu6q56qczQ?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bc8600f-bd49-4902-caac-08dbe22d8aac X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:22.3490 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9kgIgaLSbA0ltG1jaSIk80Pe31b2A3q3L0zvgGTgvkIsDcF81mLGR1gaUpfjxsniawGKFWNA7zylwSu+UkBu6qEdmht3+/gYttvKHfuWA4s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-GUID: kKNgRHbizpDH08hwtsCO87z5qaDmoW4x X-Proofpoint-ORIG-GUID: kKNgRHbizpDH08hwtsCO87z5qaDmoW4x X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 mlxlogscore=631 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1699649002369100004 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko The PV backend running in other than Dom0 domain (non toolstack domain) is not allowed to destroy frontend/backend directories. The more, it does not need to do that at all, this is purely toolstack/xl devd business. I do not know for what reason the backend does that here, this is not really needed, probably it is just a leftover and all xs_node_destroy() instances should go away completely. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen-bus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 06d5192aca..75474d4b43 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -598,8 +598,9 @@ static void xen_device_backend_destroy(XenDevice *xende= v) =20 g_assert(xenbus->xsh); =20 - xs_node_destroy(xenbus->xsh, XBT_NULL, xendev->backend_path, - &local_err); + if (xenbus->backend_id =3D=3D 0) + xs_node_destroy(xenbus->xsh, XBT_NULL, xendev->backend_path, + &local_err); g_free(xendev->backend_path); xendev->backend_path =3D NULL; =20 @@ -754,8 +755,9 @@ static void xen_device_frontend_destroy(XenDevice *xend= ev) =20 g_assert(xenbus->xsh); =20 - xs_node_destroy(xenbus->xsh, XBT_NULL, xendev->frontend_path, - &local_err); + if (xenbus->backend_id =3D=3D 0) + xs_node_destroy(xenbus->xsh, XBT_NULL, xendev->frontend_path, + &local_err); g_free(xendev->frontend_path); xendev->frontend_path =3D NULL; =20 --=20 2.42.0 From nobody Wed Nov 27 06:34:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1699648998; cv=pass; d=zohomail.com; s=zohoarc; b=l/xiBcHX2vCGeTLlCmDP1xS/qLhd6ZyH8Ldl3qTWhd5msAKOCGNQnaLXIbCWGaAhcVWxxmrxKXX2SmFMhRatkML1UUB1413YG0rUHx18XNfBNaSrChNgbuSgZfBh0L9ZCeKZANGRauKRGmgsQrlEBtNylaIOsjb1bd1cq648hJM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699648998; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SABzLS8E3EK1EwtQXVPOLYVkhNHLc3HH77gb89y98Ks=; b=EjkE3eS2crBDF2xafqkgpACV51RdU657s7DuPS5afJ6LDWsIorDRunPxKzmjnLdXSDUhdNUzhC3bQL7ycc8uwcfdFtLEVoyQEdgSVDgbKlIYWX8R+8qGiy6cxaEP4FuBhE0Gzf5cXUmwEO7rLdBuC2fdCsEDDPsFV3Sv3SM3klw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699648998887301.0039099753876; Fri, 10 Nov 2023 12:43:18 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.630798.983938 (Exim 4.92) (envelope-from ) id 1r1YKy-0006Hw-CW; Fri, 10 Nov 2023 20:42:44 +0000 Received: by outflank-mailman (output) from mailman id 630798.983938; Fri, 10 Nov 2023 20:42:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKy-0006Hi-8W; Fri, 10 Nov 2023 20:42:44 +0000 Received: by outflank-mailman (input) for mailman id 630798; Fri, 10 Nov 2023 20:42:42 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKw-0004yp-OO for xen-devel@lists.xenproject.org; Fri, 10 Nov 2023 20:42:42 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b0766972-8009-11ee-9b0e-b553b5be7939; Fri, 10 Nov 2023 21:42:40 +0100 (CET) Received: from pps.filterd (m0174677.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAKIjQu010025; Fri, 10 Nov 2023 20:42:28 GMT Received: from eur05-am6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3u9kkysufj-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:27 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:23 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b0766972-8009-11ee-9b0e-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dKcz7x8xXlO4kWqIz9otbJNVc4wI2HkDTsHnmnw6opnLvqoi8bI4eDGEbtGWi6cUSTAYt4lG8IssbW3zJWvx/K+mgjlw5ePCKioTtMJ8BESpH/FVj2oTK+4jffg/S2IY0y/Cwfuzn0MpU2h6ngtRoQMZjoGXw0FXAklqpCqSpS6eeu4dmTONjlflvNgyJGRBTE0SIVa+xevGAmv8q6Bpoo0E7uTYFhe4jyH9ILcOm3ir/uM8SqVhjXg0FZLhzesAfTQOC2P9PMVz1eywUipCCNkc95SDyLPybgyIMgaAhvTZ1ac4bO6mMKKcVBR0RFajA3W29vzN1RDsCnnLheQLLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SABzLS8E3EK1EwtQXVPOLYVkhNHLc3HH77gb89y98Ks=; b=BlTJ+vasQ1Cj1ZYyJZRxH+ZDDoJlAHrEhiij7cvT6BELs0wC7JiqRsCXRaUc0rqkRM7KTh4dHlCICtjdPNF4A6sLNECZUFJ1gBpZqdJSaZXRig2/NDnMHy9gEJS0qaqCWgQ59XVphNwAxmF/42tFD0uS0mcP1eua7O2x9aAifvXunZjhBMGpa0XGq6rAY4V9MVu8GxQken11HLpUCezidzGlZan6elhXN/isvtpNXDyMTbBypdJwqo3jErdxyu9iVfTAvzKBZnqqEouevVdzAzSwOyJEqcxNZ8GCNQxBz+3dwzjvXT8k6fkycx9eEDaGYtEzkwD02eff9F4s//B0Vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SABzLS8E3EK1EwtQXVPOLYVkhNHLc3HH77gb89y98Ks=; b=oP4WRw5c4LEQBuvGKyNQUcvT1gNXC+ibxESZQpHwy6KhVw6Iuc3QHlakjetZRJ8vDVhl+y3lVow5ndYTx6WXMjjutiR6qaRik5g9zEZbOd5zw+jCzCqN4Z21XnxjowCpkCgTsCU3K3XDp4BrQAzS1LCb9HcymhcbpOqPvhd08zRbbPosLLjNU/45cjy9teetxChSwt9eCoDsCl3FjzuxHBWm3IBoFVSnXzhKZv54du2dsD7z0vVBg1nrBYjR3DNiYKNzNgPEWAiUZcRS5KemL/FB5obhC/oR+WdAvhS20U70AeXxKvFDEYcUp0S8K4ZGgevqCZWb2EZR/A2NxWrn6w== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Volodymyr Babchuk , David Woodhouse , Paul Durrant , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Stefano Stabellini , Anthony Perard , "open list:X86 Xen CPUs" Subject: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner Thread-Topic: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner Thread-Index: AQHaFBZoS99E/RofVU6d/7dbafCRig== Date: Fri, 10 Nov 2023 20:42:22 +0000 Message-ID: <20231110204207.2927514-4-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: 77270297-91eb-4348-0324-08dbe22d8ae6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +a2Yghv5ArmvyyJbAO9TzYFQtRBgH77ysh6SAyw5lEDcY5veCuiPVCt6lzXvYOdLs2VxvN/bbFAGJgvoCRe+G26pUFvqfCOFZN8ZWrARa7EqQk8hjPD+Nhw4yJDePcH/nZYIHmxtRG+QE0zFnP8u8MUXAn82cu3uT8E1rCLMBblYp6JLK85J8g/FhLLJGYYZmP4u82bCQnFiXe/i3ZT/45mrHO+d24X/gjCgo0jdf3NVXkEZ6/VLGRfspcgmL2cMHpbpD45o1lDT3M3BJ4e07FzoYcZWYWD98sdXE8T6N4ECRnU+sNF/RSGH/wo+zpjWoxEIzRjA/jqkdzKDx32+szAe5yCgpyizLSb0oJnx77XprSLLVlzNcd0y5+WCD9Oo6spOes+ObHA7F57VLmP8Y0YceZyVw8j+UTF3f6l2n9LxV8I3QYP3HVrufCTOEkKYYhDE3YmUGpuY6/sef+UKkVClKMZoaXdydX2LzbzKctpmmDhswaBjesvLWbLM4J+pUw21aZJNjh3mBkviL9kUnHrLjnF5thYmirW7Trxc+PRaKucKV1RHRGps8d2mpAo9YT3LQT+Ay7Fw9Jk0TBx3Knkza0O2DoW7C6rdlhtPmfPUmqlMOQpAd4gwHkILcK51 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(86362001)(7416002)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?HWygDQEb1PyFhR+kL4GJ9srPJBGZX6do22PpT5Z1cW1ZpH0799bRH+Cvpj?= =?iso-8859-1?Q?qYcp3dWIwbloXapxCndoQJkNJuHcjB0sPNLrW+I2cxwni0WxoI0lLuxrk9?= =?iso-8859-1?Q?CxWjiej+pQKw74a1PzG8Xj3asWbYTpgikX8+lHNr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uuU3SHP8ARQnSF1Y9e0vlPqBB9MrTGlFEl0Pgat7s3yv+Y?= =?iso-8859-1?Q?SamMuUe5QIkNmXlFY7IhjbrYbKVV+oYhlKo6lhI8TgHon/BDGB/aJrasVU?= =?iso-8859-1?Q?wCOvUhyHx4htDv1QfGzhQctkaasH1Lz44T/JGIcMwk5x/OHYaTgXFvmK36?= =?iso-8859-1?Q?WFSeCN2gE11YLAhNwaKZwrSDT9SIBLaiMqiF/9J6ezEiQ75kw/HbTGUkLB?= =?iso-8859-1?Q?YDMn4wgGjjidUj6kC8uSl6V4blVcepLcIvFSPOj+d8gu2yRHlFUWqDtCGW?= =?iso-8859-1?Q?snbNtnWVSvBUVa7/XMMj29qKx1yx2dYO9vyj4PKh3zzTiQNPbncKa+6jcC?= =?iso-8859-1?Q?KctOHytKb78Z2YI/lvLS+b7sW8bQRdWO5r05zO5H9dXKnlNJQXwO90+aew?= =?iso-8859-1?Q?8+Obep2ysIh6fnIjIj7Di7gMDJe0LGX7Pf82Pl6q/CtXz2fdYYg90xX8jE?= =?iso-8859-1?Q?JftA3ZD+Si7IV7mQQHPrgXte/6wktbssahKM4u21gYl7rdgBnwLLziLebx?= =?iso-8859-1?Q?tUEN2iW2m6jidAPWx13ThctbkWG5w6XT6bQGLe+V0bj+bc4e1811eanseS?= =?iso-8859-1?Q?R3Xd7hbMKXlzpb+qiiEDxlZUH46LgGnF+AR31zGtx9OknjwGk6MS4crg?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77270297-91eb-4348-0324-08dbe22d8ae6 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:22.8222 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Oa45hKbQ2wDZG6dY7ToKqKfLd/1QA2aaw2GaUN/X6GUfMzjt5CxK3sZczkRfndpLUec+NAqcFeQ3yRghmoMfApynPzdJJEmigu9vtJLQcbg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-GUID: BLNE5bGVc9v_qqRAms0kbUuAPLVvFkZl X-Proofpoint-ORIG-GUID: BLNE5bGVc9v_qqRAms0kbUuAPLVvFkZl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 clxscore=1011 bulkscore=0 priorityscore=1501 mlxlogscore=943 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1699649000612100001 Content-Type: text/plain; charset="utf-8" Add option to preserve owner when creating an entry in Xen Store. This may be needed in cases when Qemu is working as device model in a domain that is Domain-0, e.g. in driver domain. "owner" parameter for qemu_xen_xs_create() function can have special value XS_PRESERVE_OWNER, which will make specific implementation to get original owner of an entry and pass it back to set_permissions() call. Signed-off-by: Volodymyr Babchuk --- hw/i386/kvm/xen_xenstore.c | 18 ++++++++++++++++++ hw/xen/xen-operations.c | 12 ++++++++++++ include/hw/xen/xen_backend_ops.h | 2 ++ 3 files changed, 32 insertions(+) diff --git a/hw/i386/kvm/xen_xenstore.c b/hw/i386/kvm/xen_xenstore.c index 660d0b72f9..7b894a9884 100644 --- a/hw/i386/kvm/xen_xenstore.c +++ b/hw/i386/kvm/xen_xenstore.c @@ -1572,6 +1572,24 @@ static bool xs_be_create(struct qemu_xs_handle *h, x= s_transaction_t t, return false; } =20 + if (owner =3D=3D XS_PRESERVE_OWNER) { + GList *perms; + char letter; + + err =3D xs_impl_get_perms(h->impl, 0, t, path, &perms); + if (err) { + errno =3D err; + return false; + } + + if (sscanf(perms->data, "%c%u", &letter, &owner) !=3D 2) { + errno =3D EFAULT; + g_list_free_full(perms, g_free); + return false; + } + g_list_free_full(perms, g_free); + } + perms_list =3D g_list_append(perms_list, xs_perm_as_string(XS_PERM_NONE, owner)); perms_list =3D g_list_append(perms_list, diff --git a/hw/xen/xen-operations.c b/hw/xen/xen-operations.c index e00983ec44..1df59b3c08 100644 --- a/hw/xen/xen-operations.c +++ b/hw/xen/xen-operations.c @@ -300,6 +300,18 @@ static bool libxenstore_create(struct qemu_xs_handle *= h, xs_transaction_t t, return false; } =20 + if (owner =3D=3D XS_PRESERVE_OWNER) { + struct xs_permissions *tmp; + unsigned int num; + + tmp =3D xs_get_permissions(h->xsh, 0, path, &num); + if (tmp =3D=3D NULL) { + return false; + } + perms_list[0].id =3D tmp[0].id; + free(tmp); + } + return xs_set_permissions(h->xsh, t, path, perms_list, ARRAY_SIZE(perms_list)); } diff --git a/include/hw/xen/xen_backend_ops.h b/include/hw/xen/xen_backend_= ops.h index 90cca85f52..273e414559 100644 --- a/include/hw/xen/xen_backend_ops.h +++ b/include/hw/xen/xen_backend_ops.h @@ -266,6 +266,8 @@ typedef uint32_t xs_transaction_t; #define XS_PERM_READ 0x01 #define XS_PERM_WRITE 0x02 =20 +#define XS_PRESERVE_OWNER 0xFFFE + struct xenstore_backend_ops { struct qemu_xs_handle *(*open)(void); void (*close)(struct qemu_xs_handle *h); --=20 2.42.0 From nobody Wed Nov 27 06:34:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1699648997; cv=pass; d=zohomail.com; s=zohoarc; b=lkFk6dHVasP91dL80s6Jfx1m8F93QoDWxe4ls0XMNkmad1AFwohn3tZiNxZHMoz+wI9kTy37tM6mecRsReqpnPTXYbMQ3ZGjNEBn2KcYhnA6wKcHP2/u4XFxH4woga/v5v8jQ382KkDrHmzFQ7DXvGqIMA2nY3k2zCoYjIh70QE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699648997; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gvW436DHGoKHwxC73icUcWiaYr0+vXQ+sVSK+d7PBeg=; b=RCVqfzksCzp5hXQzXYRT9trKdiyD2YPWgVquUsJymyWKWZuc0L2HZkHUsAE5t3ZujENV8I6Womk+LapaOfERJpDfOm1YD+NgavwFcfNKnC2AZJqC9hzEmJ3bOybXogU71ehl1GKRKYq1x/OFHFO/pLK0D0Er6dMXq7dUNa465MI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699648997146243.27430549613894; Fri, 10 Nov 2023 12:43:17 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.630795.983904 (Exim 4.92) (envelope-from ) id 1r1YKs-0005HF-BT; Fri, 10 Nov 2023 20:42:38 +0000 Received: by outflank-mailman (output) from mailman id 630795.983904; Fri, 10 Nov 2023 20:42:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKs-0005Gk-5J; Fri, 10 Nov 2023 20:42:38 +0000 Received: by outflank-mailman (input) for mailman id 630795; Fri, 10 Nov 2023 20:42:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKq-0004yp-O6 for xen-devel@lists.xenproject.org; Fri, 10 Nov 2023 20:42:36 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id abc769dc-8009-11ee-9b0e-b553b5be7939; Fri, 10 Nov 2023 21:42:33 +0100 (CET) Received: from pps.filterd (m0174677.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAKIjQv010025; Fri, 10 Nov 2023 20:42:29 GMT Received: from eur05-am6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3u9kkysufj-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:28 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:23 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: abc769dc-8009-11ee-9b0e-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PLzbX+PFHfdrpRDvIHh/f7PsfqIacoGaQkRrO8MspJ5r/z10EryU2zR+5nyrvcHJQCBsz0/r3gbmLGZUZ7yUq97zUChu/gqEbyZmHbOQAONo3RsEW7Gsd0EPgbQQH2eU7rGXyCN9zFge89C4yGwxKVUVRf7unl4j3e8xc1gEaLWWJ+UEJUNIAE5E5j5Yi/ddgbi0iVjudVo4cWDrpGpJ79wsw0f1ulc9QSbZSFOCKXhEOzNhrO3TPOW/QRaWzRbS0z1dzEW5J81lJy16206Lsv2LuKBzu3fm5nQjFpKsrkkPICvAi8cOfjB4omcw39tv2BawW/FqnSF8gtOqE3CtOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gvW436DHGoKHwxC73icUcWiaYr0+vXQ+sVSK+d7PBeg=; b=NrMHJiUYnSClmG816XDXYmI+1IUU4zufT0z6svvjtdu1QeBk62D1ii5RTukXffD2d71xf4fflD0v8oXrMHlv2yAPHt9uTlZa5K6NxrYUcJq0QUSk+cEw7SFkccb1og6dxPStbiZklI0Hay2jCX9/legUw4We41hUni8yUZ/ylAnS6dp8IlkAm+rMovF3xg5Wi3cY/NNAsONBpZAmqi2pQwTncLep+/+1Jo4nbYAcJ3OkUKFgPHNC3TRFKxB8jlrto2KQldF2rWR56hIYWIeBPN1lVhEC915R5J6S1u8Xo3tdo8+JLpQOBO6lNoVyYwgOcLCIWhIxcaDHMlNAimXsrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gvW436DHGoKHwxC73icUcWiaYr0+vXQ+sVSK+d7PBeg=; b=G5tIeKCiYONkoAE1+JYYUJ8NQL6C51brQmsEYkH9Cw1e3xv/uztgaTFhoA9E+2hD2FNnrr+4btYXxuBbsmYw2Y8/8TJBg5XCLEPIg45AUTpW2NhxksSa+ZOiL0sejg8UWXNoVAh8dGl55Hd4EHXvEdEoIBl8mzejuVrsd8QRvyeQn2yTq5CXJtn2kBMfsWYpM4XcHTV1IpI4qOeqWCV4MrsXhPcjU0AO44eVBNVEQjpiPIsGABn8bkuHGSugb10M45wNdiyiTmcfaKqjK1ANCpomSn5uZqVBjhxeSL7jYMB5FHhIJyPR9Tw34fQjp93rINYjTFi2IBj7BYROcvMUaQ== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Oleksandr Tyshchenko , Volodymyr Babchuk , Stefano Stabellini , Anthony Perard , Paul Durrant , "open list:X86 Xen CPUs" Subject: [PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory Thread-Topic: [PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory Thread-Index: AQHaFBZoMLHgqbm5ZUeTIEOOIKOHAA== Date: Fri, 10 Nov 2023 20:42:23 +0000 Message-ID: <20231110204207.2927514-5-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: 42f2e465-0743-49e9-3ba7-08dbe22d8b1f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9AnWrnyU4cpyeXaqz6rMYJVaIi2R7rkJocbJGcGqLL/P9pMFO09TbONg8nbvbqKlBEVi9s2QfMrLWBzlfs72oo9KgiM0zgdkoVDSbkRadklanWodmrcZDHlPTiGvL3VxmSKBoX7pQcvVg2qRjSir4tFENXtcvLNHZI6NhX+wn6tZQnzTYqFE4SJi18cURyQpeB8GISrnBWJmWtIEdZ3pBKImEQDCt3fqWkNP6oXvLv12Q3Fzk1UtSP2Iegx/54fZ8XwrZnkAWQQSWZ5fyl0hWfg4TviHVZOZgw+bhEkdLZsxmrA+W1eAyzpMzzeP6cUpidYkT7BtcodF67mWVcSeugY3cRqLKgEnfUzRLM8s/O7SGe/IaItckBw52iXnqw6zDWRwFUUkDkG0J+uzHzDjVB2YbSC27yVatJzlwYxh37sf+Q/kkW+KMAHIpJ9kI1tTpu4uWc7EaRHXIHIgu4TX+mgYYDe14t6LqVCoJR2k7sSS9oCCBLKw9HGK+qtL7qGe4A6N5f8F4Gue3tHUVCDUq9SmeIgKhVKZt+lfb1JOfuw7v/Kf7dfRVRYIlk02YzOTd3Aj5c/MgJ/0iw+5NbN0508KKdwcGegDvtpjHICRhLTzjLhdQkEhmHem4siC2Xu5 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(4744005)(86362001)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?6jAyKfAeJlgQWEybzi/BOuxfXmGcsnT+2Da9xE9MkpQRhUhA9osB1o72SR?= =?iso-8859-1?Q?p2hgyoBs4RrEI20M4b0tBPTpfJDlxW+mjMLUtt5SdCu8nSlhROpMP4CG/I?= =?iso-8859-1?Q?SggdmlJjrU0coEDa+Yc0wQ+BZQkmgUGUJUFkg6WOhXdmWDqW77eF38/8g0?= =?iso-8859-1?Q?FKkaNfIkthwudliq7E+16Na1DiM+msitgNicGE/KIejRESmAn/yMw3O5TD?= =?iso-8859-1?Q?QPvSxBMHsa6hD1DVb2A7hdaybzU/0l2JmcJ44fuAFVh1mvAxSIfSyoyZ+9?= =?iso-8859-1?Q?/bNapeCg+OzrSYwwYl51/Jkukxorj3TxM/BEnIL1yKOGd3FqOTaOI9c0jx?= =?iso-8859-1?Q?jnoqN9s9lPArIvJFqsEvvohfYzOQMZYOcu4dA0wmdC+RNy1Iwx/R+CPaL5?= =?iso-8859-1?Q?kV6ZFVkF7z4sb+ddTB8X5JWewm5PmxqosUOFe7WpsPOLkdIryRzj+m7Uxt?= =?iso-8859-1?Q?5GJxWGae5sGYhdg1RfelzdeU17keHI58Yk9pFc7bUTl+8eUKU9zGro+PCe?= =?iso-8859-1?Q?xnS6K/bg9tiJwvcUrVwN3sk+R+eQc5e68eKVnhEhmFFj+BtjXCsWHEzc5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VlgkfatTfjOhaQZR/R8yMcBtfhITnaTuzstS?= =?iso-8859-1?Q?bcng2phJV6gDafbt1sM+7PRgGfPB0hBSScCWKGZ9yFFypzCm16YIYGL+bn?= =?iso-8859-1?Q?hvReQTvG3CVF6nQTNGGNOw8jKn0HaiNSapWC0PpvUaEkFzZypLVnlS1sPb?= =?iso-8859-1?Q?eIX4LsXjapL+zkSZp1DbBd0nOoodhH4zqeB+9bPgoUJnAh4LfRNgRA9g?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42f2e465-0743-49e9-3ba7-08dbe22d8b1f X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:23.2225 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fOncCzEfv+h6yDb8uPraSPueoRoUPP85zBDlMuxCDhfgt4gtBqdtx6Y2sEGhkSqsVvfcfTdKOUFOUlLdCV++GPCyk1lQUUtIdY7v6xsUBdQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-GUID: w1g9lBFxP7b-80B2x1nYalgPezXtntVp X-Proofpoint-ORIG-GUID: w1g9lBFxP7b-80B2x1nYalgPezXtntVp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 mlxlogscore=593 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1699648998301100003 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to save the previous owner of the directory. Note that for other than Dom0 domain (non toolstack domain) the "driver_domain" property should be set in domain config file for the toolstack to create required directories in advance. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen_pvdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index c5ad71e8dc..42bdd4f6c8 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -60,7 +60,8 @@ void xen_config_cleanup(void) =20 int xenstore_mkdir(char *path, int p) { - if (!qemu_xen_xs_create(xenstore, 0, 0, xen_domid, p, path)) { + if (!qemu_xen_xs_create(xenstore, 0, XS_PRESERVE_OWNER, + xen_domid, p, path)) { xen_pv_printf(NULL, 0, "xs_mkdir %s: failed\n", path); return -1; } --=20 2.42.0 From nobody Wed Nov 27 06:34:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1699649001; cv=pass; d=zohomail.com; s=zohoarc; b=T1CQm77VVmUNV2dY+xkmkkF/TzS91JywrsOeUqHKrFvmae+4XPWvlQ9J+sn85g4zCo631tc8jbpRPmpR1a6ZmukGGGUYn5f4hHEnvaXZ0KuuCKCri2CyqYKmPpZ9sGLv1U0j6oeTKgrfI77yK2JrxAcjG3O9JZhnaXKkVQayFR8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699649001; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MrOm9LNsn91tP/CeZzcWh0KSoCIqcM3e2ReDFqdpkMs=; b=kncJuAY4RSU/fTZKbzrFoWA/n2PnNh6frcrexOhPZtH/+EE3kvKfs2/AwxoL1mnDvZj1aE5RNZFMCwUvqV3SSmJR040eQ58TfYAkaMwdTx5ufiYIWQfbjk/LqJfvW7RUBQjJF3Me6cRDyt6Wc9am8UdA8RBiLud/Aqaa7eE8jpw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699649001818498.6701734267913; Fri, 10 Nov 2023 12:43:21 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.630796.983909 (Exim 4.92) (envelope-from ) id 1r1YKs-0005O9-JK; Fri, 10 Nov 2023 20:42:38 +0000 Received: by outflank-mailman (output) from mailman id 630796.983909; Fri, 10 Nov 2023 20:42:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKs-0005Mt-E6; Fri, 10 Nov 2023 20:42:38 +0000 Received: by outflank-mailman (input) for mailman id 630796; Fri, 10 Nov 2023 20:42:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKq-0004yp-V4 for xen-devel@lists.xenproject.org; Fri, 10 Nov 2023 20:42:36 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ac2cad76-8009-11ee-9b0e-b553b5be7939; Fri, 10 Nov 2023 21:42:33 +0100 (CET) Received: from pps.filterd (m0174677.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAKIjQw010025; Fri, 10 Nov 2023 20:42:29 GMT Received: from eur05-am6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3u9kkysufj-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:29 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:24 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ac2cad76-8009-11ee-9b0e-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7P7vS5qGnKmGuBUQrXZQz8y8GUn3VwSxrXtQW6EIfrO1OYgVCG3NI8LKeAU9n914lSb3/7RudL2L1zFPqgMsqKbf8lp3BAc1ur7NEyTMQLpbSzOqxgqPr0AyLVx1hHZwonqxLwdacXs/F/MIG0sNG+X0rtgtUKCs01g/JjWRnNsr0d4U1S3TMyL0x+ie5PoOjiwVTLv3NFgKGxstuy+HR9HSSv2NCrQiAtPLOmGSBXle5CHKgBYDtR/sy+vBTpgs8GNIucb5qGnoQVGF9+e+0vrQu/EBaLNDAO9ceHy4lt8NkNv5yys6gAUerrS7WVUzmBgUMu6bYh+3zOOjzdUIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MrOm9LNsn91tP/CeZzcWh0KSoCIqcM3e2ReDFqdpkMs=; b=MWJuumrsANCXTTfhbrqqArsfoSGQwtAwmOkSD/68Vu/CQrn32XKYlzt46IehEyGs76XNFOn8u0wRJgv0qEsp8JNas2oCSpOJHKeHEIo+UL77ONGpELLH96N41XB6vySXFVTreMTg/suptPTgpWyKt2HiUoYFp1BEcUKCWwlygfzTkWXpCuXXqxn7J2QuXaIyJeF5F9CUfUSGfY4o39mDtH841Z+drLBLblBQKgrIt1OJHahP6wMDL2HepsY132iMlyxHcOftAhwUSwma0rYiskBJJRxuAOGgt3iHUZXOaO6eg+/WRn4RYAnrbePEFgWGDPVuRjTn7VGErVHEE5rpOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MrOm9LNsn91tP/CeZzcWh0KSoCIqcM3e2ReDFqdpkMs=; b=Z7wiTcmSJVEYD+hzPUh9SND3rduTyjqI49Pzvlv3ttOvIbFD0ahOjQyJDKF1vNiBblW6tx9NnUfBTsEtWoinQ6jVCNnTWXseLDmoLPI00G+Z+in4UHSNLpZJwV/NXAPAadccu91FKjq01BD2rtLetUGYlxzqPm78OHH8ZRac+AJ46LDF4f75FT0KuZGOPOmNCiW2c8Qq/Pp90skmxd0kbJVfjZGkoMGrbYnHSJh1Tf4+tQxUWfh8psQdXYCeAfYXWxWHijhJvGPP2MAKhmk5/RmtLZmv/s3nw9LuE8l70Yjrr183wwxe39AKieiCcOhDA8H+c9xR6YX2GDElTWVvCA== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Oleksandr Tyshchenko , Volodymyr Babchuk , Stefano Stabellini , Anthony Perard , Paul Durrant , "open list:X86 Xen CPUs" Subject: [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed Thread-Topic: [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed Thread-Index: AQHaFBZoiczA8QKKJkeUUC5gOc8rQg== Date: Fri, 10 Nov 2023 20:42:23 +0000 Message-ID: <20231110204207.2927514-6-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: 5703c808-08b1-42e3-7423-08dbe22d8b58 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sOWUR49bPCHq2MDz4OKjUebc6vL1/adN+YxOBCawkCdh289XyABMU17ZIHdt3zae6BUL+oTOpbcJXoTxvHuFAlMMBdU4OpWAizWs9lMQK//lueKKf6qyLFESjY2jB3oeokSVEjy9RVENSfxXQxjE4gNQFUY2dWbXxGvEKzHLXTnTYLj7tZjkYO7Nyj8dPGDdjf8tt7Zs2DDwce5uwZhfo921VZgNjvITHh2ujworYJbsDOHgVtRVpeO7Z4LbZm/G0kUC/77WNeHe8mDV1I5Nc6Inb2RcglR/fWAByZaorDGtN+nv0ZD/lr96uHRwpeOux5bnQRu0YB2tvytlLCcTQ4STX5FUTsWcUL+cPlH+oT9dBgwa0cIF5hsWSRrakdZdq48q1zE7YPcMVAvqHZjOa9Cx7R30Xy1Ml2CFFN6ImtuWYeHvmm20BmBDCvOFZl83fnl9w/K0NzSV2C0+U9D9yVbo8GwIL0BmJaBDLSmrGnYmNePe0LEeGawADZG4zL3EHFBeMlU7qzPANauGyOtgGiL4l8566K1a6gAsi+EoMJRNu/DiDAUdjmvgpjPTTMADKfsW9jQyS6jd5e3DSegNUEFEz5xcXoWiw8AB9UlTONY+TWChdATiKpD5IE81hVov x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(4744005)(86362001)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?/FSoOQPzYuRmlIFZl0HXXBfrupib9qLujN5V2UPKaGu12YeZkQV23hCfFk?= =?iso-8859-1?Q?IqFiACkHR/djiff0fcA4ZNhYaMK9IxiFtlSRDRsijprxBJBuQuuqSXDnqC?= =?iso-8859-1?Q?K+DyaoeqL2HYkiOeQ0+AUt7h9p4BT/gOzz07KEGNuHXeT5I2Fd0RcN15o3?= =?iso-8859-1?Q?yFJ2tJ0yjgkY3qIu06ctw7CTPejOjaV1smIyET0rJdS5oCA1UlyxOrWWqj?= =?iso-8859-1?Q?ZjJ4XaV7BJxfKthmVkR5OlQQk5+4v3fnm85NT/tC7hkoLyBDXbQfG+UuUF?= =?iso-8859-1?Q?CgsMGm+z+7I4IIu9w0rbH2NVKmrWIBaqy1QvHD++HmD0t6LYptgfOBVI3a?= =?iso-8859-1?Q?KAoHouX2F63KQ9uRBVpD4TEqWZudwcSpapvASL7Rw8vI9DIg3o0Glcg1a3?= =?iso-8859-1?Q?r5xdA1HLRzHZth3LrdlA0qxeAK7z9a66lAdtfFJNaicvUOvR/GFB8pCxx8?= =?iso-8859-1?Q?yz58LLUJooh/y65oIne7sUGBKwnWGSk2MEj5zse9xoab65QhVvlgSPDeEh?= =?iso-8859-1?Q?STW0+u+TxYhUvcAs4bqohYXZe40m4AtIy52afhka3e1L3jDhTGFSy/XAsh?= =?iso-8859-1?Q?d2zfT4yVFS9sygxLdztItiUfn6svZKNSC0s8mh7H0/pryfS8CK0ZrvWft/?= =?iso-8859-1?Q?Q7W3pEpUymKULw0A0IFLZ5pzXbrRryXUBSJdxZFzgNihg2yNH+cwLS1oc2?= =?iso-8859-1?Q?ClujJ8fspHqotmPzWqxe9jAMNJqXU5p9LPzYovKsjE2C1DZQXO6vdvXAFB?= =?iso-8859-1?Q?4yLSBdSBZTSFBna/JoGW8Nbic5Y0f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= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5703c808-08b1-42e3-7423-08dbe22d8b58 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:23.5860 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: h4tOOluxqO/4qLsSZ71s/8uGodtx/tTK1A/oB/q+pw/PxM7PTNVc6xuXjWs7VmAOigTjSZvqrWFoM+hJ+tEiGM8NqVj0JTH0+SPYRQUxg3Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-GUID: CO5DezGelvZJUtJQjvaAJuNKkslVZEkG X-Proofpoint-ORIG-GUID: CO5DezGelvZJUtJQjvaAJuNKkslVZEkG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1699649002363100003 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko Both state (XenbusStateClosed) and online (0) are expected by toolstack/xl devd to completely destroy the device. But "offline" is never being set by the backend resulting in timeout during domain destruction, garbage in Xestore and still running Qemu instance. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/xen/xen-bus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 75474d4b43..6e7ec3af64 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -519,6 +519,10 @@ static void xen_device_backend_changed(void *opaque, c= onst char *path) xen_device_backend_set_state(xendev, XenbusStateClosed); } =20 + if (xen_device_backend_get_state(xendev) =3D=3D XenbusStateClosed) { + xen_device_backend_set_online(xendev, false); + } + /* * If a backend is still 'online' then we should leave it alone but, * if a backend is not 'online', then the device is a candidate --=20 2.42.0 From nobody Wed Nov 27 06:34:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1699652169; cv=pass; d=zohomail.com; s=zohoarc; b=h7FNsASXjpstib8R07wm6aqpa7L9LdeVWBD2DYi5NhieWmrteM6b2xhkWPYALb7LwMO2nJWfrPhE4pK4nU4vtlIRj/Oij+lKDchJVXA6oqyiSPFy/2tXodzGYAa0N/lQNQYtf6uVX5fU/TCAZrDLhbm10T3IrGhRoGMAOBVaKcU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699652169; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MQhMXgI0DmtKlJZnPxUK5w6V43NeKKerokDdW5sHBw8=; b=DuXb9A2GQNIPRgYpYWaiJOQDQdqXfKM9Pwq0gvn2FkhsV7/DYyHpH4wWhFVAzy9+O8xD0f+h/fuueRsZjjXnd7BEzQkz3v+c8rdrWUYHK6vAA+jjXd8tjuDCIDsTsrkMIYsET3JvhPnInF406sNkNDfMaGwA+uVgA1i4HYD3Nwo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169965216945750.23786222870331; Fri, 10 Nov 2023 13:36:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1Z91-0002SU-9E; Fri, 10 Nov 2023 16:34:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1YKr-00015R-CQ; Fri, 10 Nov 2023 15:42:37 -0500 Received: from mx0b-0039f301.pphosted.com ([148.163.137.242]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1YKp-0003I4-L1; Fri, 10 Nov 2023 15:42:37 -0500 Received: from pps.filterd (m0174683.ppops.net [127.0.0.1]) by mx0b-0039f301.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 3AAKI1MR020361; Fri, 10 Nov 2023 20:42:33 GMT Received: from eur01-he1-obe.outbound.protection.outlook.com (mail-he1eur01lp2050.outbound.protection.outlook.com [104.47.0.50]) by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3u9jbx27f5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:33 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:24 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MOK36g/Pl2ODq37wiWTkrdMQbE0ICJRGgAJkbBIPbpqWkZ447Chj9frPNCX32xQRy5aqDjKpes9J2qhVeQGM1I3j8GpcR/C1S4IMtY+luQ+R88WpuQmK29cE39GqKiAT6UEyl0zubAVqtf1npa4z0SklEoUyuT0j7GrX61B4UeWk/n69UQzuk20rNUVcILjOSxZN3C/hznBeBDAiKjF5ld8bDgS1LAddIUXEk7nZ5NTZw5AXcDF8ILj+c/F3AUHXplzHK6ZZxhYd1cSbMxD3YZV1uIitr4qzbU9avSf+GAZM6htYVl9Z2RI1V8gVVpZ8KoUZcH4nU2xSqClhcjADIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MQhMXgI0DmtKlJZnPxUK5w6V43NeKKerokDdW5sHBw8=; b=Dl1h/EP9ius4cX/wtcYC/bBqVQUI/f93b4YupCKx+o4/oEKBtvrvBX8dTYWs68KhTZKim+ZQzUVVVqMiUD1kf0JOSv/npjmyiPOLqNZYzP8hvMqql3OzhxbmYw0MJKem4MWt2FKWZDlo4wrs2YbYtuTb87r3KO2a27oQRD4dUrGf38zGldJDv+CPvhvK8ZRlCefTp2vwAT2CzPXC3tJJQJi1E+9d7QYPjVGNsMCh6Nu/Jz/Y4+6KKBs1IMwhR4m/ATpOPhQBPqL5DDqPSOdxU6EyhOBRbGGAapi3VEGUGQsmCUxXuyF3lv+10fPQ6wajTkfVi6SEAtU2KTH3ED44QQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MQhMXgI0DmtKlJZnPxUK5w6V43NeKKerokDdW5sHBw8=; b=rDoEtW3/rDdGAlcLMWze7yFkMXvH0DZxH4MjVMIX7cj9EBhmzxbbcFIap2tyZPHrcrzNtkY1ujeLpNQNkl4wS2AiQ9VFsOxR0oHb6zlqvrTZRsBjxzMWcdOcOAQL6+fu+ouAIWQ5WbuoyXTiMk1qBWzPqnE1NMkSrVsnvvH3KCOfran0AvuT4elXuNGVMA9YmNd4pbeEpY9T3eUGxGeub/K8U9j4Q/bE2zeZsxPYgzvf1q8ju3RiwWNx/2xM6yJ5Z6ChgdE3pPPrOFTBq3FJ0SxTQzqrHvcZlQkjKoQn3urx5kQu7CLV8TA72bX/wROafRJCPNIOYf75jqUJs7g8Vw== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Oleksandr Tyshchenko , Volodymyr Babchuk , Peter Maydell , "open list:ARM TCG CPUs" Subject: [PATCH v1 6/7] xen_arm: Set mc->max_cpus to GUEST_MAX_VCPUS in xen_arm_init() Thread-Topic: [PATCH v1 6/7] xen_arm: Set mc->max_cpus to GUEST_MAX_VCPUS in xen_arm_init() Thread-Index: AQHaFBZo7E1DnNqpy0eDQLoZ6N62MQ== Date: Fri, 10 Nov 2023 20:42:23 +0000 Message-ID: <20231110204207.2927514-7-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: 5b2aa615-8726-46d3-0eea-08dbe22d8b94 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pPMQlOKRU/1RzLzEprT9jsmzH0fENRAHQs6h3QmCJD6oC15qONzgUKuD4wGGYFGmDzj77aCUR+NdbgBglNE1rAS1Pn683L89BbluYLDEzOqVWbSz1R8IBQCx4Qv1QBoV6a845E2s5mseHo/L781ODsk7FmD9Q17E6N2UuC8Hm6fZgvC6MTzT3BIKYQV2EhRj54A+4gjndMhz2qx5AeQ/8BJYL3UnRYSumeyK842L6jL1vnEGEnWelIYrzXVtL/Dt/s/k9R5KnKVDAhGlOAn0LdS0B7C533+fmgkEWpzuCOxYhMxYdmNMiwnNAuFmpxQsqWl4yIRwl6GtP3trlj7z1wT01ONgITaggXN+gaSpBTOE72vFeFM3Lg8nQrwgH0caGup71JjQF13MVFqs0NhGcoB80X5IGA59rmM+UXB+A1KzhfUXdDLIiUvZtnA0aFfvS7tCnD4UvgJaoW/ZheM4PQEYVfxq/Y0YsvvSBEW+oE+KoUQhZrhZsfRqLLdVDoiCeBmFcXulUNyYZwxMxP3wrRQ/DkDYT5CZnHsWyOl9J3NgrrFdPhxpAf9NGdr/wS85nwrSKguC+t4JU13yT/FLzIYMmOnvrREjiz1Scl9wj0lziwOmIUVnYMvAY8RgdYsT x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR03MB3710.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(86362001)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?asAw3NgwFsmtYKl00ZdbDxpAG4E4dGtWv/b9m3Ga44sYDnSTRIYlnUBKQa?= =?iso-8859-1?Q?7+4vRArrW6i0e+M09DtS886Ak55OCwKr9eSjlof/9gjX40TWXpHiuY2Fod?= =?iso-8859-1?Q?TnnJpUVbceVFkP239mRO5ht/ie0gHSiGjakkoZuAl6DfFkMPZebkJ3Bety?= =?iso-8859-1?Q?85r47q04fRv4xuFU6DxQal9zsXeyiYYaCLjTKrfBA8lrylqqGoBbuWIUdE?= =?iso-8859-1?Q?A+gC6MCXmWTb6V98GopUyHyHHT9XTjrvNj+hjh7MpnHkoE7toQh4CimuGP?= =?iso-8859-1?Q?+0j4ALZZjH33I06qjCxotWHvGUHSyGfgn1coTmqxxFpw3wODEFWUcjzL0F?= =?iso-8859-1?Q?ahis0wbDLlQB6GIXG+yu0bUPH0BxX4w5U0KRwRqrY15gM6wJ6npJdU25/1?= =?iso-8859-1?Q?aWSugAdgT5L/hC/hml/CD/8dq26/zaH/uPSZRnq8llMeP/c25pklsBr/nc?= =?iso-8859-1?Q?xK0yuqN/kqvOdlPQuW/9/OQnRaxfuBkRod7Mqt83vi3SqTRbRSc9U2hrd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Z6QQIj1SjXxjJKf+vc7Tf?= =?iso-8859-1?Q?2lwy3FRRbv/e+MyjTqADrVTr7+F68piZKWjh9x61ZNYxCKf4uianK65n2A?= =?iso-8859-1?Q?t4J4idpaTb5zAIrMWZJTf24oLVUr5aKpY7m2Zri3OEGn/1WxpUqYnQfb8a?= =?iso-8859-1?Q?t8YVn8uwrtHsKdb5pK7uu1Ya9/pMKJy+u6tF1RyBXzokgZjUlp2vcsGx26?= =?iso-8859-1?Q?VKUoPs/+vDGhHwExvk5QgdPXlfV/9gTz90fjfIP/0Mmg//UpE20ivRuA?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b2aa615-8726-46d3-0eea-08dbe22d8b94 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:23.9150 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0/ubqvU/d2GXaIFjsFkYPxjdN2sXXTDT27SD1aY3nVyuLkr0x1sNbmQFd5INbF4E1+kTbLaoXQ28GppU3xDF0fXNaO9P0lPPlhb5bxHTxgE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-ORIG-GUID: URn1e9JojTyjRIlC9e89918NbANoDH_l X-Proofpoint-GUID: URn1e9JojTyjRIlC9e89918NbANoDH_l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.137.242; envelope-from=prvs=56783987ff=volodymyr_babchuk@epam.com; helo=mx0b-0039f301.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 10 Nov 2023 16:34:26 -0500 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1699652171026100003 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko The number of vCPUs used for the IOREQ configuration (machine->smp.cpus) should really match the system value as for each vCPU we setup a dedicated evtchn for the communication with Xen at the runtime. This is needed for the IOREQ to be properly configured and work if the involved domain has more than one vCPU assigned. Set the number of current supported guest vCPUs here (128) which is defined in public header arch-arm.h. And the toolstack should then pass max_vcpus using "-smp" arg. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/arm/xen_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index f83b983ec5..a2b41dc2de 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -229,7 +229,7 @@ static void xen_arm_machine_class_init(ObjectClass *oc,= void *data) MachineClass *mc =3D MACHINE_CLASS(oc); mc->desc =3D "Xen Para-virtualized PC"; mc->init =3D xen_arm_init; - mc->max_cpus =3D 1; + mc->max_cpus =3D GUEST_MAX_VCPUS; mc->default_machine_opts =3D "accel=3Dxen"; /* Set explicitly here to make sure that real ram_size is passed */ mc->default_ram_size =3D 0; --=20 2.42.0 From nobody Wed Nov 27 06:34:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1699648998; cv=pass; d=zohomail.com; s=zohoarc; b=nYBonlESq6bqCBaNmKaF+Tiqo0K3T5hrz2PCVrlaJZRAL440JbR1be8XkmrKVSkp1Mx9u4zvMEhP4LfCWFKFbyU1HzNjk/W7JaRagCJBnDGa3UpsuqFM0chw9RHJtClaHuIWd2Aui/fQuanNvbMgNT68IffJqZkg/4wKwirlfkM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699648998; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jQr5NbNk/LsGXPtDi59H3/Vtk1SC+nBMV+Y5YtBMVTo=; b=XwQR/vQbQGiw4him+3skwgf7cdUpEIuz8CYzKVufOUCZz7oyf4ErewXL+Gc1OsItSeKjbF7WPNd0qWxrvugIegeuiLv+7U1ZNkJtzXAkwb790zamHx7EUb3mFYO3L2ux/bdvvjem0kudKOpw+tYTTHEIH2/WEfkVBewntLtyY68= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699648998057906.222691805122; Fri, 10 Nov 2023 12:43:18 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.630797.983928 (Exim 4.92) (envelope-from ) id 1r1YKu-0005xl-Va; Fri, 10 Nov 2023 20:42:40 +0000 Received: by outflank-mailman (output) from mailman id 630797.983928; Fri, 10 Nov 2023 20:42:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKu-0005xY-Sf; Fri, 10 Nov 2023 20:42:40 +0000 Received: by outflank-mailman (input) for mailman id 630797; Fri, 10 Nov 2023 20:42:40 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r1YKt-0004yp-VS for xen-devel@lists.xenproject.org; Fri, 10 Nov 2023 20:42:40 +0000 Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id aec3391b-8009-11ee-9b0e-b553b5be7939; Fri, 10 Nov 2023 21:42:37 +0100 (CET) Received: from pps.filterd (m0174683.ppops.net [127.0.0.1]) by mx0b-0039f301.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 3AAKI1MQ020361; Fri, 10 Nov 2023 20:42:32 GMT Received: from eur01-he1-obe.outbound.protection.outlook.com (mail-he1eur01lp2050.outbound.protection.outlook.com [104.47.0.50]) by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3u9jbx27f5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 20:42:32 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DB3PR0302MB8991.eurprd03.prod.outlook.com (2603:10a6:10:437::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Fri, 10 Nov 2023 20:42:25 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::8e03:368:1fd7:1822%5]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 20:42:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: aec3391b-8009-11ee-9b0e-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i8jo9DaTQHselkLEVbKvhgXbwpfsRdbiK+1l7/PCa8iR8Gk5YyIeT9HV6BkS9PAhaSJ8IFT79zRSUNwLLoXzwI/cQvkQtCO8Qc4iNhT1YxDH7OJprI/lU8C8OASE9P9/OCtGlW4WN8eJqS1Kfs1/CjwpXB4X5n80K6Ap+0Tf5U6wPZbeLxgkvuVZbuUgQQHeusSCbNDugaj/gyacPO+ky9oazzuK6Ft9jo4ekYvSnlIcAxN+mHUNNTbr+Vlv9aaAOr3YBLq+p/BxxdcQO3EVmZ2HCYC9zy7/CDl0n+hkyWHBYEdd1yPv3agC3sGeLRwg2Kd2L7jPuNJRlfrvqVbqKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jQr5NbNk/LsGXPtDi59H3/Vtk1SC+nBMV+Y5YtBMVTo=; b=b/f3xonK41fGxgUOG6XCVUT1y3oD0GxUckYAvmieiGqRLrSLTG8Ei+jDAlaYn5jzjEhfbvsdJTCw8f1OCPmF2/Lpqe/uFgsjI5eBXmimU2dVnuuJM0tAMH0M5mFVGZcVc2UzU+WOiwsvVA2JATMYIwNmxxcWbwzzESAYR3TXOfe1P9n8wSZ0+ADOaD5+4FlhKVcW84AK57DinBygcXDanKQbkzEsqrPzvMPcahUF5OSPU67VNRmZxlUZXbV6a6QGexWjbPfcU9UGxlLEIdssaT8w6AvKVzDu3Xqf6HYyxS38rR5SDzZCllhzMTzWkQnygR3OnkevSfYVQQSJA0xPrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jQr5NbNk/LsGXPtDi59H3/Vtk1SC+nBMV+Y5YtBMVTo=; b=S2u5aL+6ddDqU33BeXbGx+uFPhBonH0LPJv21LudYVehVh+b4jfF3QL+9TkYoenVVImWfGrU4seDd13IQ+0iEG9l2S1CDYAruFETWQB5LlYG84xbm10fxPOWHSNdoJt4vMk+w4Gg+dL7vB7VGNAklQJB97UKRvvdGE628R0s9QaUBmi7EgtBmUczGkBQQoW2L7KUSVsd9MrFv4Y3Nxl2KEs3LGH9XFnAvKoMM8qA/xlOvoxs+uf67qyZ369UHMF9hOZHBqfeK6jaVM9X1O3OirsrMwFmmdaqX7MUi4jLw4Fdp6Yl6zLfVvwndBFJE6qwJ4JQSIeKQiIAOO8PhjrH3g== From: Volodymyr Babchuk To: "qemu-devel@nongnu.org" CC: Oleksandr Tyshchenko , Volodymyr Babchuk , Peter Maydell , Stefano Stabellini , Anthony Perard , Paul Durrant , "open list:ARM TCG CPUs" , "open list:X86 Xen CPUs" Subject: [PATCH v1 7/7] xen_arm: Add basic virtio-pci support Thread-Topic: [PATCH v1 7/7] xen_arm: Add basic virtio-pci support Thread-Index: AQHaFBZpa05Dc66DRUqpQfiy75awpQ== Date: Fri, 10 Nov 2023 20:42:24 +0000 Message-ID: <20231110204207.2927514-8-volodymyr_babchuk@epam.com> References: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231110204207.2927514-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB3PR0302MB8991:EE_ x-ms-office365-filtering-correlation-id: b652af3a-6098-4dfb-1f13-08dbe22d8be5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P1MjZH/ndxFdNGjLrLQjyodaCcCWHvZef0JEMD0iq414F9M9++NgC055vSsfzq4tn9yaJtNLsxWvIeLgoXryFIHBnLLMr456fayHsj79XCKeZzqLFrJGSn3yCcxy+2JQthI5/MkfNKfGHbIJFXxUzHta+RKb/tyE31RwaKu8zSIufwuuOXjhcmVZTOty6wx2suZHOwa6Av8VW8C+7CSuXu5hN3fENmyrhawagflAa5nVSZT/V2uQ4CMzgm5BUc7HfvzKxanSjLCFi8U/xGd+fSjaNV0Dnt+0CIDaZyk1SQOALxNN97Bb0u95yh2p8L33ThPSlYyU1TTRMro4Zpat3fh1X6cx1i0YkT14jsCgmfflFF7Qfi+pIAHLAIMMG0h2AvAvT8xqdPmkllcwnwqK9X/Mwf0Ae5jgqtZwpDpk+Kzqo0rt/IpLe+/msY4LJbx/x/GuX/9Z9YboWKVuUXCM6ODubBHSYR/ahGBSTd40RVQddx3k6KBn3zInqyh5JLrumeq9BlqxcIJzxKwYdTR//Fq6Dze431Mg/uvde2Es2jtSiYu60UiIY0NqutGgvDfITVkioF+AUyzCOajGdbci6evmbFezkkSmbF7fgCoeTR2CFdKuELoqO4iMjtMjlmN8 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(346002)(39860400002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(41300700001)(2906002)(8936002)(4326008)(86362001)(5660300002)(38070700009)(8676002)(316002)(36756003)(83380400001)(38100700002)(478600001)(2616005)(1076003)(6512007)(6486002)(71200400001)(122000001)(6506007)(55236004)(91956017)(76116006)(66556008)(66446008)(26005)(6916009)(64756008)(66476007)(66946007)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?hZ8QAbO3H9AAWFxvJi4+qIfoTqamDgikWUCihisG4Ag6mkRkHL6HCruAvO?= =?iso-8859-1?Q?W+hqc0Y4xs8gFl5/PY4vJ7mrnKlI0imy4RNOdVTs30Aa8NxtbtgyS69wPq?= =?iso-8859-1?Q?aU8OM2FxrEEWLoMkZS6RX6m7EkFeUqYPr/n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-1?Q?f5qKA2uINH9sEQUiIVeSMxmXjm5iQRAZo0vlW015BPPzgGl4521rhq0Uct?= =?iso-8859-1?Q?mDFjgL6rC60SXPcpMo8Pf0vwWqlPVStGwSgPJ03jv1RKNYqoR8jOOBZBIG?= =?iso-8859-1?Q?EFPIdu2GGXlHSvfSc82jboOU+iGZtLOQQYQq0oFNmdGtVJthfnsrukV0XW?= =?iso-8859-1?Q?Y3KasHz2Sf/hwjWfuseS+tL2TErANF2Gil71F7IG2b/T9V2bkzGDfG9I4t?= =?iso-8859-1?Q?cD7V2uF7GjdNMIdP5Rq93r9UeswhWFTqQJARANxgflqTFPPHnQ+GNcXfR6?= =?iso-8859-1?Q?x0/zsFD8fr37sbOLeIeQ8zGaqKPz1CCA4phMoXn5JaldGuinvgAH8l7ppZ?= =?iso-8859-1?Q?hFK7XIQl9wPYwEjIsxFTXX2zH5qLfFdUt1B+ycbj4f/w/q81AE5dFUqEla?= =?iso-8859-1?Q?Nzagz/n5HgKK/Ls3mAr0FJxEcXQB6NioK4vFVrlCwsfcovxjLDoiP9H8PQ?= =?iso-8859-1?Q?nT25ZYTn9XnDBe0NtlzqRha65HwTKMnJ0KBUgpIzGYhsk7NNDSRzIaRhut?= =?iso-8859-1?Q?rx35o/cXnYch4qMPrSupuQRvdmJv8IFh3+UA93lw2O7eQo49eEp04qOlIu?= =?iso-8859-1?Q?ra9KPEKQAU3zXjWugkOUfLtNul1p2NCIId6jgFzpVA24QshFfGrELthA?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b652af3a-6098-4dfb-1f13-08dbe22d8be5 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 20:42:24.6686 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gxMo61Dihk/IxNaBZ/nZDzUwECoAne/6QWKbp9wyEubTH5ytiEI0Dz3UOdOJCX24rVm+4j2lbB3WEPSh7If4IWYfyuk8PpFLKpEAJhZ/VJw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8991 X-Proofpoint-ORIG-GUID: LhxBLxz5CcYwugUNNU8YpKjHme2Csnma X-Proofpoint-GUID: LhxBLxz5CcYwugUNNU8YpKjHme2Csnma X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 mlxlogscore=908 malwarescore=0 suspectscore=0 clxscore=1011 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100172 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1699648998361100005 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko This patch adds basic virtio-pci support for xen_arm machine. It provides a flexible way to configure virtio-pci resources with xenstore. We made this for several reasons: - We don't want to clash with vPCI devices, so we need information from Xen toolstack on which PCI bus to use. - The guest memory layout that describes these resources is not stable and may vary between guests, so we cannot rely on static resources to be always the same for both ends. - Also the device-models which run in different domains and serve virtio-pci devices for the same guest should use different host bridge resources for Xen to distinguish. The rule for the guest device-tree generation is one PCI host bridge per backend domain. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Volodymyr Babchuk --- hw/arm/xen_arm.c | 186 ++++++++++++++++++++++++++++++++++++ hw/xen/xen-hvm-common.c | 9 +- include/hw/xen/xen_native.h | 8 +- 3 files changed, 200 insertions(+), 3 deletions(-) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index a2b41dc2de..4a0a6726a8 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -22,6 +22,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "qapi/qapi-commands-migration.h" #include "qapi/visitor.h" @@ -34,6 +35,9 @@ #include "hw/xen/xen-hvm-common.h" #include "sysemu/tpm.h" #include "hw/xen/arch_hvm.h" +#include "exec/address-spaces.h" +#include "hw/pci-host/gpex.h" +#include "hw/virtio/virtio-pci.h" =20 #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh") OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM) @@ -58,6 +62,11 @@ struct XenArmState { struct { uint64_t tpm_base_addr; } cfg; + + MemMapEntry pcie_mmio; + MemMapEntry pcie_ecam; + MemMapEntry pcie_mmio_high; + int pcie_irq; }; =20 static MemoryRegion ram_lo, ram_hi; @@ -73,6 +82,7 @@ static MemoryRegion ram_lo, ram_hi; #define NR_VIRTIO_MMIO_DEVICES \ (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST) =20 +/* TODO It should be xendevicemodel_set_pci_intx_level() for PCI interrupt= s. */ static void xen_set_irq(void *opaque, int irq, int level) { xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level); @@ -127,6 +137,176 @@ static void xen_init_ram(MachineState *machine) } } =20 +static void xen_create_pcie(XenArmState *xam) +{ + MemoryRegion *mmio_alias, *mmio_alias_high, *mmio_reg; + MemoryRegion *ecam_alias, *ecam_reg; + DeviceState *dev; + int i; + + dev =3D qdev_new(TYPE_GPEX_HOST); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + + /* Map ECAM space */ + ecam_alias =3D g_new0(MemoryRegion, 1); + ecam_reg =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); + memory_region_init_alias(ecam_alias, OBJECT(dev), "pcie-ecam", + ecam_reg, 0, xam->pcie_ecam.size); + memory_region_add_subregion(get_system_memory(), xam->pcie_ecam.base, + ecam_alias); + + /* Map the MMIO space */ + mmio_alias =3D g_new0(MemoryRegion, 1); + mmio_reg =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1); + memory_region_init_alias(mmio_alias, OBJECT(dev), "pcie-mmio", + mmio_reg, + xam->pcie_mmio.base, + xam->pcie_mmio.size); + memory_region_add_subregion(get_system_memory(), xam->pcie_mmio.base, + mmio_alias); + + /* Map the MMIO_HIGH space */ + mmio_alias_high =3D g_new0(MemoryRegion, 1); + memory_region_init_alias(mmio_alias_high, OBJECT(dev), "pcie-mmio-high= ", + mmio_reg, + xam->pcie_mmio_high.base, + xam->pcie_mmio_high.size); + memory_region_add_subregion(get_system_memory(), xam->pcie_mmio_high.b= ase, + mmio_alias_high); + + /* Legacy PCI interrupts (#INTA - #INTD) */ + for (i =3D 0; i < GPEX_NUM_IRQS; i++) { + qemu_irq irq =3D qemu_allocate_irq(xen_set_irq, NULL, + xam->pcie_irq + i); + + sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq); + gpex_set_irq_num(GPEX_HOST(dev), i, xam->pcie_irq + i); + } + + DPRINTF("Created PCIe host bridge\n"); +} + +static bool xen_read_pcie_prop(XenArmState *xam, unsigned int xen_domid, + const char *prop_name, unsigned long *data) +{ + char path[128], *value =3D NULL; + unsigned int len; + bool ret =3D true; + + snprintf(path, sizeof(path), "device-model/%d/virtio_pci_host/%s", + xen_domid, prop_name); + value =3D xs_read(xam->state->xenstore, XBT_NULL, path, &len); + + if (qemu_strtou64(value, NULL, 16, data)) { + error_report("xenpv: Failed to get 'virtio_pci_host/%s' prop", + prop_name); + ret =3D false; + } + + free(value); + + return ret; +} + +static int xen_get_pcie_params(XenArmState *xam) +{ + char path[128], *value =3D NULL, **entries =3D NULL; + unsigned int len, tmp; + int rc =3D -1; + + snprintf(path, sizeof(path), "device-model/%d/virtio_pci_host", + xen_domid); + entries =3D xs_directory(xam->state->xenstore, XBT_NULL, path, &len); + if (entries =3D=3D NULL) { + error_report("xenpv: 'virtio_pci_host' dir is not present"); + return -1; + } + free(entries); + if (len !=3D 9) { + error_report("xenpv: Unexpected number of entries in 'virtio_pci_h= ost' dir"); + goto out; + } + + snprintf(path, sizeof(path), "device-model/%d/virtio_pci_host/id", + xen_domid); + value =3D xs_read(xam->state->xenstore, XBT_NULL, path, &len); + if (qemu_strtoui(value, NULL, 10, &tmp)) { + error_report("xenpv: Failed to get 'virtio_pci_host/id' prop"); + goto out; + } + free(value); + value =3D NULL; + if (tmp > 0xffff) { + error_report("xenpv: Wrong 'virtio_pci_host/id' value %u", tmp); + goto out; + } + xen_pci_segment =3D tmp; + + if (!xen_read_pcie_prop(xam, xen_domid, "ecam_base", + &xam->pcie_ecam.base)) { + goto out; + } + + if (!xen_read_pcie_prop(xam, xen_domid, "ecam_size", + &xam->pcie_ecam.size)) { + goto out; + } + + if (!xen_read_pcie_prop(xam, xen_domid, "mem_base", + &xam->pcie_mmio.base)) { + goto out; + } + + if (!xen_read_pcie_prop(xam, xen_domid, "mem_size", + &xam->pcie_mmio.base)) { + goto out; + } + + if (!xen_read_pcie_prop(xam, xen_domid, "prefetch_mem_base", + &xam->pcie_mmio_high.base)) { + goto out; + } + + if (!xen_read_pcie_prop(xam, xen_domid, "prefetch_mem_size", + &xam->pcie_mmio_high.size)) { + goto out; + } + + snprintf(path, sizeof(path), "device-model/%d/virtio_pci_host/irq_firs= t", + xen_domid); + value =3D xs_read(xam->state->xenstore, XBT_NULL, path, &len); + if (qemu_strtoi(value, NULL, 10, &xam->pcie_irq)) { + error_report("xenpv: Failed to get 'virtio_pci_host/irq_first' pro= p"); + goto out; + } + free(value); + value =3D NULL; + DPRINTF("PCIe host bridge: irq_first %u\n", xam->pcie_irq); + + snprintf(path, sizeof(path), "device-model/%d/virtio_pci_host/num_irqs= ", + xen_domid); + value =3D xs_read(xam->state->xenstore, XBT_NULL, path, &len); + if (qemu_strtoui(value, NULL, 10, &tmp)) { + error_report("xenpv: Failed to get 'virtio_pci_host/num_irqs' prop= "); + goto out; + } + free(value); + value =3D NULL; + if (tmp !=3D GPEX_NUM_IRQS) { + error_report("xenpv: Wrong 'virtio_pci_host/num_irqs' value %u", t= mp); + goto out; + } + DPRINTF("PCIe host bridge: num_irqs %u\n", tmp); + + rc =3D 0; +out: + if (value) { + free(value); + } + + return rc; +} + void arch_handle_ioreq(XenIOState *state, ioreq_t *req) { hw_error("Invalid ioreq type 0x%x\n", req->type); @@ -187,6 +367,12 @@ static void xen_arm_init(MachineState *machine) xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener= ); =20 xen_create_virtio_mmio_devices(xam); + if (!xen_get_pcie_params(xam)) { + xen_create_pcie(xam); + } else { + DPRINTF("PCIe host bridge is not available," + "only virtio-mmio can be used\n"); + } =20 #ifdef CONFIG_TPM if (xam->cfg.tpm_base_addr) { diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index b7255977a5..b1eb2972d5 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -47,6 +47,8 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, = MemoryRegion *mr, g_free(pfn_list); } =20 +uint16_t xen_pci_segment; + static void xen_set_memory(struct MemoryListener *listener, MemoryRegionSection *section, bool add) @@ -382,7 +384,12 @@ static void cpu_ioreq_config(XenIOState *state, ioreq_= t *req) } =20 QLIST_FOREACH(xendev, &state->dev_list, entry) { - if (xendev->sbdf !=3D sbdf) { + /* + * As we append xen_pci_segment just before forming dm_op in + * xen_map_pcidev() we need to check with appended xen_pci_segment + * here as well. + */ + if ((xendev->sbdf | (xen_pci_segment << 16)) !=3D sbdf) { continue; } =20 diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h index 5d2718261f..a8fac902f1 100644 --- a/include/hw/xen/xen_native.h +++ b/include/hw/xen/xen_native.h @@ -431,6 +431,8 @@ static inline void xen_unmap_io_section(domid_t dom, 0, start_addr, end_add= r); } =20 +extern uint16_t xen_pci_segment; + static inline void xen_map_pcidev(domid_t dom, ioservid_t ioservid, PCIDevice *pci_dev) @@ -441,7 +443,8 @@ static inline void xen_map_pcidev(domid_t dom, =20 trace_xen_map_pcidev(ioservid, pci_dev_bus_num(pci_dev), PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn= )); - xendevicemodel_map_pcidev_to_ioreq_server(xen_dmod, dom, ioservid, 0, + xendevicemodel_map_pcidev_to_ioreq_server(xen_dmod, dom, ioservid, + xen_pci_segment, pci_dev_bus_num(pci_dev), PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn)); @@ -457,7 +460,8 @@ static inline void xen_unmap_pcidev(domid_t dom, =20 trace_xen_unmap_pcidev(ioservid, pci_dev_bus_num(pci_dev), PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->dev= fn)); - xendevicemodel_unmap_pcidev_from_ioreq_server(xen_dmod, dom, ioservid,= 0, + xendevicemodel_unmap_pcidev_from_ioreq_server(xen_dmod, dom, ioservid, + xen_pci_segment, pci_dev_bus_num(pci_dev), PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn)= ); --=20 2.42.0