From patchwork Sun Jan 14 10:01:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mykyta Poturai X-Patchwork-Id: 13519129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C9A6C4707B for ; Sun, 14 Jan 2024 10:02:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.667095.1038104 (Exim 4.92) (envelope-from ) id 1rOxJm-0006AX-AM; Sun, 14 Jan 2024 10:02:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 667095.1038104; Sun, 14 Jan 2024 10:02:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rOxJm-0006AQ-6U; Sun, 14 Jan 2024 10:02:14 +0000 Received: by outflank-mailman (input) for mailman id 667095; Sun, 14 Jan 2024 10:02:12 +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 1rOxJk-0006AA-Cp for xen-devel@lists.xenproject.org; Sun, 14 Jan 2024 10:02:12 +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 fa2730a7-b2c3-11ee-9b0f-b553b5be7939; Sun, 14 Jan 2024 11:02:09 +0100 (CET) Received: from pps.filterd (m0174678.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40E3ctSc031009; Sun, 14 Jan 2024 10:01:53 GMT Received: from eur05-am6-obe.outbound.protection.outlook.com (mail-am6eur05lp2105.outbound.protection.outlook.com [104.47.18.105]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3vkmhw1tj0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 14 Jan 2024 10:01:53 +0000 (GMT) Received: from AS2PR03MB10110.eurprd03.prod.outlook.com (2603:10a6:20b:57a::22) by AM9PR03MB7725.eurprd03.prod.outlook.com (2603:10a6:20b:41e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Sun, 14 Jan 2024 10:01:48 +0000 Received: from AS2PR03MB10110.eurprd03.prod.outlook.com ([fe80::9640:139b:8daa:fc9e]) by AS2PR03MB10110.eurprd03.prod.outlook.com ([fe80::9640:139b:8daa:fc9e%3]) with mapi id 15.20.7181.022; Sun, 14 Jan 2024 10:01:48 +0000 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: fa2730a7-b2c3-11ee-9b0f-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U3gQolu3Be+Uev/qghi1VnDCEZGuvXHPG7OgQlt41O8du5DGkApg9RDE0Gfy4m1iA4e35BBHvC29xl3Uke6EFeg+WOY5MRQBU+zrQTlDCTdYOMO61ACqmgPaw9haTfW0kMWPNBto723UBGk82ALfNP6yOK9XQCGUB/bG/3P0rPSkXFA79+6XqRUropzRwDTWjmq3Ivn6zpbloBxuZhpkT4EK6HOmkERLPLs+gb9IeUjh/Wte0KV2gY0Uigh2lyGhX47EotwhEbaB0Sh+foee/E9MbLYhg00VK3hlFSnN9MJkprKsn58qWfP4ll1kdvnSnzdVkWmsb+xe5jQEtiMTnA== 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=sRVOy0vPlI2Ik0MoBGOJBYPBn3f+l8ozQjhm7KSEaDI=; b=Epjav0g1plWyr49zFaq0D2KOJWDF9sRAgvf8KKsNuMdQZVlVQ7rNbBaSOHU8O4nB8Su0TPOXYI0Co73Hg2VAUctyQF12WFIRWzBTKb7TqO8YMdx2C7WYXmQJZsKkWFfL0r9MKN7lLWCWEohXIfEQuF4+/gpBUzTu+ccIXkGubP3iD8szv/thNS7iatyHF7Ik4RdSS8wzGaCDfdPqEeJFwIO0lPFs0lfqSCmTBjwCHcNQnGcy165rrsLDMqNi4fTQiLaUWzfVGNZDEx1pRaab4gdsnzNlLirdqBUnXUgurJfw3M6Yk6HudO47shbqgLeZPzmzV/2a4UQo+5+ds6BCGA== 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=sRVOy0vPlI2Ik0MoBGOJBYPBn3f+l8ozQjhm7KSEaDI=; b=TILprAW5MyCjWkHARTUSPTE4mFPiZsUzq8EO7N8y8vP9EpjFJGtFXuBeGcKKXS2w5f2bW2hrDoi9+T0m3P8cWfnQ3smJPuN9hXYBt9cf/UiYx+gtm3CyIV5AJ7NHb5Ap9tyYwkNwtItAnen+4xeA+4eH/urOwxWDD9WpMQUhlhvHKvpXUwNRiooxN/rZQVle1xj0KWgtyWIWdhDqFOgoUNG2FUqeYqmW0tXWg+kx2TQHFnNEwxX7rbnyYPPpq3L7/WD6f6ti5jz1fvKMCct3WgpK5/M8a1FlSBwv6nCJ4+JVAHOX8urj+n0Q7Rk27yJ1mu8fNQZQXtD0X2CM35PC0A== From: Mykyta Poturai To: "xen-devel@lists.xenproject.org" CC: Mykyta Poturai , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Wei Liu , Anthony PERARD , Juergen Gross , Andrew Cooper , George Dunlap , Jan Beulich , =?iso-8859-1?q?Roger_Pau_Monn=E9?= Subject: [PATCH 0/2] Add support for MSI injection on Arm Thread-Topic: [PATCH 0/2] Add support for MSI injection on Arm Thread-Index: AQHaRtCwUl38pp01cEa3npHNYwCgZw== Date: Sun, 14 Jan 2024 10:01:48 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS2PR03MB10110:EE_|AM9PR03MB7725:EE_ x-ms-office365-filtering-correlation-id: f88ff70f-1cee-49c7-e899-08dc14e7d2be x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NMwkXZj2W5uJXw1ykIOf0XQ5MN2KRH57gHPjVunBiGlHW+h2QtwjvADCJqog9wIuRy8YnGE4k+tp66ROixRhwh2mZsNSuz5rRK4pT126zkycGMEpxQMF66LlL3wt0d6Rik9h1flUux1IjssDqaX1b+s0rs7OXB106LvAmqCVTu3XmRykGRql2tfga7tUszwaw4q74iqvBvQ8Cj02aNedxe693uAW2WKmSEp2NDARDxrkNSjZKGcqnbYZzuXYg06IXu//DAO/+QtrDrLWk9xDYkMfbDLv2hSshBZm1hBanzVgMqZqbT66KNKGaIP4bdnF6SiT2NOCWvZAB27lWeEwHxTNwHMkVC8wddNiHl1zdSgqe1ieH/aL6DF7QRVTYdTm9e/cPkWugsvXqt3kRhunc/5Q6ryh2tDtw7oMIkJBrdZVijE6WoBNJshmWQCfJLNKgo8AEzMI6wVoXEL8YDhQsJ7aXImkxkpX1FlZLQ0GzpQ02GsdpRpiw9NRuEMsXppSmEswKa/T5JGckrDvuMRd9P6TFnDom+KEzt43zrtL+WGVujBStgbAdqBfIAR7h9NJsvHRDtpGdVpB4Teizpd4kyvHqqFWRo+y75L1Hm2rpcs= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS2PR03MB10110.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(136003)(39860400002)(396003)(376002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6512007)(316002)(8936002)(8676002)(91956017)(71200400001)(66476007)(64756008)(66446008)(54906003)(6916009)(6506007)(66556008)(478600001)(66946007)(6486002)(966005)(76116006)(2616005)(26005)(7416002)(5660300002)(4326008)(41300700001)(2906002)(38070700009)(36756003)(122000001)(38100700002)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?+lbi6aNuJ9frERTVrua61wl?= =?iso-8859-1?q?DezAlA7iZlWYIN7fINmeAZZ7gC2naHujyGgItRw8s4uPEw6OarmF63vmPRqH?= =?iso-8859-1?q?4TbPvUgWMXceADWYsIatA8fHBLGp1BSbzLoti4yc/Rogu/36uo4sJ4gjxje2?= =?iso-8859-1?q?ttS54vPMnot7A/vBZayD12FMrDBRHI4bBSS1Pjce7OH6O+9LreJMtStpNQlg?= =?iso-8859-1?q?WOayjk6kszbRfZpIKM7rBXBzGVxEHGi0nrbrjwXo04/AInyMmB6NlMZASgN6?= =?iso-8859-1?q?vFCE5n5Yrg+aZmzTG+EMKLfVqja77WzhfSz39WmAnGbX0rompVrF9ef2Vs/I?= =?iso-8859-1?q?KDlkCnuIjRGe2tkUC1+als+D5FOrWht8WA4YwrpfcQEZI9iG60Vo1L1rY52p?= =?iso-8859-1?q?Gq7ostOsuBdBiPcRb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wvR8CJNOIjb7Kbsk6rZ19tDjRfm?= =?iso-8859-1?q?NgfNSkBrcMoL2UqKlciLj+K5bDS/OdsoYsob+r50BTpNEQgN+hTswCvMDTxC?= =?iso-8859-1?q?6t3VL5upjCk11sDfFykHjAu62SMcAP9BChVrUG5iuUizaXpTflF2PM8g67EL?= =?iso-8859-1?q?92iJyP8dMJeCYdqMTWVFnesnzjMPBsBbk66Xm8KhMsTteC9iuKx3GpHjuK0q?= =?iso-8859-1?q?WY3S6lvx3F71LVljlm+VyAB/wBarEhmJj5NQd1Dlr56wXueHmeIr84VvDUp2?= =?iso-8859-1?q?cWS34HqGMViRJWuUvkpIS6GXkKW0n086sKHFAnqKtVc7Nz6RT2XEpX4aKS67?= =?iso-8859-1?q?U1z5c08uikLY6HtqpsGt9Ad7MiTtfc0qrn9WGGg=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS2PR03MB10110.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f88ff70f-1cee-49c7-e899-08dc14e7d2be X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2024 10:01:48.4875 (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: xU8y1dzsgJBTXYH6uKf1HxIAsv6kZZPjwbzyY/krqW/78fMQNJL8565+piR+UDJXruZQzg7aMSTweLvqq2rSFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7725 X-Proofpoint-ORIG-GUID: ufgqS3AlmZpHo-UkJrog7CUcX-A3IAEV X-Proofpoint-GUID: ufgqS3AlmZpHo-UkJrog7CUcX-A3IAEV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 clxscore=1011 mlxlogscore=535 malwarescore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401140078 This series adds the base support for MSI injection on Arm. This is needed to streamline virtio-pci interrupt triggering. With this patches, MSIs can be triggered in guests by issuing the new DM op, inject_msi2. This op is similar to inject_msi, but it allows to specify the source id of the MSI. We chose the approach of adding a new DM op instead of using the pad field of inject_msi because we have no clear way of distinguishing between set and unset pad fields. New implementations also adds flags field to clearly specify if the SBDF is set. Patches were tested on QEMU with QEMU virtio-pci backends, with virtio-pci patches and patches for ITS support for DomUs applied. Virtio-pci patches: https://github.com/xen-troops/xen/tree/xen-4.18-xt0.2 ITS patches: https://github.com/stewdk/xen/commits/pcie-passthrough-arm-vpci-v11 Mykyta Poturai (2): arm: vgic: Add the ability to trigger MSIs from the Hypervisor xen/dm: arm: Introduce inject_msi2 DM op tools/include/xendevicemodel.h | 14 ++++++++ tools/libs/devicemodel/core.c | 22 ++++++++++++ tools/libs/devicemodel/libxendevicemodel.map | 5 +++ xen/arch/arm/dm.c | 15 +++++++++ xen/arch/arm/include/asm/vgic.h | 11 ++++++ xen/arch/arm/vgic-v3-its.c | 35 ++++++++++++++++++++ xen/arch/x86/hvm/dm.c | 13 ++++++++ xen/include/public/hvm/dm_op.h | 12 +++++++ 8 files changed, 127 insertions(+)