From patchwork Mon Jul 18 21:15:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 12921786 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 31C3CCCA47F for ; Mon, 18 Jul 2022 21:16:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.370123.601793 (Exim 4.92) (envelope-from ) id 1oDY5t-0004Sx-Se; Mon, 18 Jul 2022 21:15:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 370123.601793; Mon, 18 Jul 2022 21:15:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oDY5t-0004Sq-Nu; Mon, 18 Jul 2022 21:15:57 +0000 Received: by outflank-mailman (input) for mailman id 370123; Mon, 18 Jul 2022 21:15:56 +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 1oDY5r-00043p-P7 for xen-devel@lists.xenproject.org; Mon, 18 Jul 2022 21:15:55 +0000 Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cebd73dc-06de-11ed-bd2d-47488cf2e6aa; Mon, 18 Jul 2022 23:15:54 +0200 (CEST) Received: from pps.filterd (m0174680.ppops.net [127.0.0.1]) by mx0b-0039f301.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26IImA9P005163; Mon, 18 Jul 2022 21:15:44 GMT Received: from eur03-ve1-obe.outbound.protection.outlook.com (mail-ve1eur03lp2051.outbound.protection.outlook.com [104.47.9.51]) by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3hcrm7v72d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Jul 2022 21:15:44 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by VI1PR03MB6288.eurprd03.prod.outlook.com (2603:10a6:800:134::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Mon, 18 Jul 2022 21:15:40 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::3db3:dad:7bd7:4488]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::3db3:dad:7bd7:4488%7]) with mapi id 15.20.5417.035; Mon, 18 Jul 2022 21:15:39 +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: cebd73dc-06de-11ed-bd2d-47488cf2e6aa ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OC9zgu3yqwZR5XqSIru2I3ga28LlND5uf5jXSAnCRzCJFYDyVVZwm8prB6ZS8poLcdcw9WhtwNASkm2BFJ3VFsStsgZWgR7kojTUt5wDFXVmTdRuUdo0LjeV0A8i/VhSLxO91fwZ8Q8FW70YV6CXSF6j/W1MD8fmR13fWzRNCShi/McHQdpr+knfv8p0SWr4ieIoNVkX3vmWq3QzI59Ej7SV/nDE6NI27zuAk+149WFFImSxmWxpe4fwRQ53jRLNKrGqHzbgj7QbTVEgsfQ2rqDQGATZWf9Ja2VYQCPVNWNg1BKnI6MWXjre/bwo9kDcV/ctc42z05rOxQF50gj/0A== 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=DVMURCXF+8xKx1eYG9povulw9IOC6DKljZ6HILZCK2I=; b=DLCOVgrg+iBEuI5AMgjr4NTV6r4Sa25v2AEsYgSLBgbprOuWWvPGJazn7W+SXro2Qya67HG/BXgO6piK+IozL8RfG3AjqBEZwafihpDUHSq39Zdtrv28aDomKzy2AWJ+DmF2j3mSTFDLahaFh9B5leuJTxHgro9Os+eJtCU6Xc3dsBdDcDNg8+UEdOHYQhv4ESlI+41/6YjKJtU+YO4F7/aC85tfsMqGoFoBW4eT1zaSpWHEfzu4RoU5/UmHzx/fUNBxJiVJzy5L65NZjcsypaGlcxJDwn+1LsV0i3UH5AM9Kj5wem95/VOgYcRofrazbXCm7eezrWPGv3Q8By91Cg== 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=DVMURCXF+8xKx1eYG9povulw9IOC6DKljZ6HILZCK2I=; b=dgsU0+VJRtS67V+Hxum6prE8spab9owJwsnedF11/kIgYs+OpEuJ40p47qZSqhD3m4+SG8d8j36qyMhYJemi1wnASBJZcNJGOJn1L2Vy3P1hFWLBmOHlbr/+MHRKohXpVFxMBb76rUpOBw8Lzh2k78Y4WdODW/G46chtTSCOFfnrEsXAe7BaYvGtc4mZVMTn17a4nweCjO/wucF8PRNuo5Z3TBZRrbeyo84Q38PeAtwzuNqMr14NT9hmMEWcJNLVRtzAii76nXpyfRYwTJM7YwkI5LwuYF1pX1nMSOE7d2vHNV4UWJxBDtbeUikBarJzPCjyQEtKMSzNtrt93VPwYA== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Volodymyr Babchuk , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , George Dunlap , Julien Grall , Stefano Stabellini , Paul Durrant Subject: [PATCH v2 0/4] vpci: first series in preparation for vpci on ARM Thread-Topic: [PATCH v2 0/4] vpci: first series in preparation for vpci on ARM Thread-Index: AQHYmuuIRfBsTERtW0qM5QZ/dvYwvw== Date: Mon, 18 Jul 2022 21:15:39 +0000 Message-ID: <20220718211521.664729-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.36.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0bde706c-97a2-4ebf-2c23-08da6902aa85 x-ms-traffictypediagnostic: VI1PR03MB6288:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3Uv1IQnqx0q/urAbgCyi/uRhSnyqgnxp3So/01+8+Bl3+dL3eOlaxuw/OuoZ44EC1x4wmvI9kNw2aB6ybmIXrgNbDITddvwDPE+/6oJW8ZkVxDzUEoEtAlNqiM4nzgPMkJFZrd23MIxewUf2TYRglUd91q+wT0K1LSOTV1/uYvQusj/1A5FUPwVhHuCLASOIVrU9VVUMKkOaLBH+PFf60rt7n9/T/LJDrCpON/yJBi+u9jcq3Ono9PZCXnzmRXDf1tPTvYNAW4b8F3Es9GFhqy5UV1w1K3zzmTfoy7wvfj+lE0lmdaxCiX0w+WVU0K0XIt+wmsX+eeoUWT62uBtF+chir2Vx08vzQzYo/pxipYlzfbmBO65sJfR4e7wU/7R+GHC0xkVjpZY3GJz3Kjk9jDus221GCP59q+adON8BKwzOE0o+7ima81FtSejz+idnj3c7+brhkz/abfC+D1sAXRPf8aDotcfUkt+XoqKbk8kif3sxqVBOciFrrT/8s3USF5K+FzL5UAekIjzZZY+Pr531XbeI4gnQhl4udzNvBCcaFqx5Bs2DTzsRnvB5Sge97xMNCWdczGJctJiSa6RB3DKUG4RbAhxr67dF7I2t4jjp5+cd5onG5tpaxg0v+/cB4YnMLiA3QKia0sjlUn2IZurqhzB8uOS73MLgIe6iveTud66M8N806QRr6LzfZQGj0LP9h0QWxzyFXR8QWXpKrzcueP6Rlu5bWWBPvz0Ynv+7ZXpW6j+YB58igyjvr7z3eP/jFskXYoA5QaF4vu1QuFk4biYiOjbyh3TcAGD0GZM= 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:(13230016)(4636009)(396003)(136003)(346002)(39860400002)(366004)(376002)(2906002)(5660300002)(8936002)(36756003)(186003)(4326008)(86362001)(91956017)(64756008)(66946007)(66556008)(8676002)(66446008)(66476007)(76116006)(122000001)(6506007)(478600001)(316002)(2616005)(6512007)(6916009)(26005)(54906003)(6486002)(55236004)(1076003)(41300700001)(38070700005)(83380400001)(38100700002)(71200400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?6iAz758wEVdtkYhOZoaPTlQ1pMCn?= =?utf-8?q?HeFKWpSl1Wux5pQObte0sGfzG+hKQ+S6uPTFrRVCsF8c3Utli9PslzBFELh0E5DnA?= =?utf-8?q?GE87rK8cQsxSleBk/qb62huKizlFgbLOZNa/hPFQRWyWXjpP2q+7E7cYdXdvbR65X?= =?utf-8?q?fVZhJlJ3Mly30pwQUyGqhF4nO71tvd+G3s9weF2OeZdj2zrRL0a7jNv2od3BGnLxq?= =?utf-8?q?RiEdnaI6B8IIWVDKfrp32mhJn2aTvYYgADaljGkqDTD+dxECItA+FegbiwnIWNXs1?= =?utf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koA91XO0FXZwdbOJndiuAGb3f/5RZTfNMTX/eikBlmcW3HbpekMgTElyVJ1GX?= =?utf-8?q?5lje3nOi8k8AA2Eln1UuAjb+rMWWmO/zvCl2kWvEjfYGQPqSMWwIBVvb3dHKySgSo?= =?utf-8?q?jIDj5fX63l3zPfJEn0oulgsvrX1U+4ldKJEbg780cr/RSmgDf2SQOZbUzTR68zLFO?= =?utf-8?q?9Z7PSw1xv6EvLkr5LQBYuHyb5cJqD8zZy/vWR4cbb1/vA0nFkJkUE9J4vsNQu/NLA?= =?utf-8?q?j24jgir7xT4sTfb0yQyZnmQtMMWrvWzDWgxI3r7vJCs9Roj3K9T/uMaY/wUw40fFa?= =?utf-8?q?Y4IdIKrPpEaojaLdYKPEjmfAKJk+J1aySE2wOnEOu7hD+EjyrIdtp/KjiTDr4SBfV?= =?utf-8?q?6/rA5nRYsIsSb1fAzMOINqyokGZFLUjDCw=3D=3D?= Content-ID: 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: 0bde706c-97a2-4ebf-2c23-08da6902aa85 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jul 2022 21:15:39.7895 (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: G9acEArmFjyJxWVHdbvKFkTMraVQNbpr7He9pt0h84Eh5cZahH3LE6xTdO+uOsWPUCZLiLS0nEYV4dWZewkNSrFJkhV6aS4ZcCe8LsdXHwo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6288 X-Proofpoint-GUID: qLpDHAfJOH0v4MFYAdU0qIyRr4MZd4Sw X-Proofpoint-ORIG-GUID: qLpDHAfJOH0v4MFYAdU0qIyRr4MZd4Sw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-18_20,2022-07-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 adultscore=0 spamscore=0 mlxlogscore=359 suspectscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207180089 Hello all, While Oleksandr Andrushchenko is busy with more important matters, I want to continue his work on preparing different Xen subsystems to support PCI on ARM platform. This patch series are mostly focused on next take of PCI locking rework. It introduces reentrant read/write locking mechanism for pcidevs, which will be immediatelly used to decouple readers and writers in the PCI code. There are also some minor changes to a related vpci code. Oleksandr Andrushchenko (3): pci: add rwlock to pcidevs_lock machinery vpci: restrict unhandled read/write operations for guests vpci: use pcidevs locking to protect MMIO handlers Volodymyr Babchuk (1): vpci: include xen/vmap.h to fix build on ARM xen/arch/x86/hvm/vmsi.c | 46 +++++++++++++++++-------- xen/arch/x86/irq.c | 8 ++--- xen/arch/x86/msi.c | 16 ++++----- xen/drivers/passthrough/pci.c | 65 +++++++++++++++++++++++++++++++---- xen/drivers/vpci/header.c | 24 +++++++++++-- xen/drivers/vpci/msi.c | 21 +++++++---- xen/drivers/vpci/msix.c | 55 +++++++++++++++++++++++++---- xen/drivers/vpci/vpci.c | 29 +++++++++++++--- xen/include/xen/pci.h | 11 +++++- xen/include/xen/vpci.h | 2 +- 10 files changed, 223 insertions(+), 54 deletions(-)