From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9C06C433E0 for ; Thu, 4 Mar 2021 06:20:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 365BA64EF6 for ; Thu, 4 Mar 2021 06:20:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 365BA64EF6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/djdF6G+zNLR9IDDw3XXHyZ3T4Fo/otHDsSkn0Y+/ZA=; b=SkAE4VKvkHpk3Gmx3yzygk5uH DGeM9MLnee/3yAND0SghubQPS02vffWQzdsi68ne+rzwJ3gAAvY1b6fFjkacHMqvl+4LUxOPOzF8C jLcdoMlO0cL9UEUOdJ6nsG2LGHYQMZ4pFFOIvZVqDxZcW3CAyg46/myYAkAfCq7qgT2JgZAihJSDN FsLuRVPkp/8zpnHut0CDPHghokmFNLwt4XPQyJIoGELUphhX8iv6z9idiNLllAMfMK/pqZmx32AGg PnKTQilsriC0yZpmFYD9c+I8wSeQEjnrWkjlFy081R59l+EYgDYS9biU6r8pBRkGBwFqGfScR3kql 7HBkUmxtA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHhIZ-007tqe-K5; Thu, 04 Mar 2021 06:17:24 +0000 Received: from mail-eopbgr30055.outbound.protection.outlook.com ([40.107.3.55] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHhIR-007tob-Cv for linux-arm-kernel@lists.infradead.org; Thu, 04 Mar 2021 06:17:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c7q62OBTF4EkX1ZsI2jfOxA25JLYPsVgD44kkdhdghg=; b=Yj7BDjvZfF4dglygE3UHaCa1GPQZq8WuLsv8CYO6/8AswgiEhSbfj7CvGMbOAKr+hODe/ZxzwchlLL94wrD02yyxk0SaclzM2vujYbNYuxlCY/2eoL19rThs/ZM10X8IUbMOKlqk9TkeAbrXjsxaaBKwnDelVgwVfVFVI0Jn4cE= Received: from MR2P264CA0020.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1::32) by VI1PR0801MB1968.eurprd08.prod.outlook.com (2603:10a6:800:88::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.28; Thu, 4 Mar 2021 06:16:58 +0000 Received: from VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:1:cafe::1d) by MR2P264CA0020.outlook.office365.com (2603:10a6:500:1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23 via Frontend Transport; Thu, 4 Mar 2021 06:16:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.infradead.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.infradead.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT008.mail.protection.outlook.com (10.152.18.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Thu, 4 Mar 2021 06:16:57 +0000 Received: ("Tessian outbound 7213b86582b6:v71"); Thu, 04 Mar 2021 06:16:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 68feea4b631c5a43 X-CR-MTA-TID: 64aa7808 Received: from 24b8a9296dbc.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 773A94CC-1683-4430-BD49-05660D601E23.1; Thu, 04 Mar 2021 06:16:51 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 24b8a9296dbc.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 04 Mar 2021 06:16:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMVtiFreEDCedHnvsXb2e+4pDKG7j2+0/JR4pmvDWYAjKTbvcwjIBDKeDMkWseQ9r6xr+KlavDYR+bX5sXMRJvptXqPWNwyEYM0MMFTKY9rtx5a+FA/mx6ZL2p3/wsvh6oG3+0BsZ/iSD91yRe74fdFqr7WZ/F1YnKcm3z5brhlWivSpTIrRT/LaJEAyAwvvw3ENC8NqWENTMhEBL2PlNnwyTRb2/T+6f/zsBmP9PUxhkLq2LCKmQhX4F8jfuD1ndyhDTojud1+w6qAOVzJ9SLR3GsKjgijuyJv+ABp5CJXGEJkMC7jXlW4mldcfOZSNColw6aTpFrbjPJzoty6mzA== 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-SenderADCheck; bh=c7q62OBTF4EkX1ZsI2jfOxA25JLYPsVgD44kkdhdghg=; b=J/jEbgGqYdAx1i6u+PMs6nru9Dl3T8uIBnLP93Rkfo+I1T1TQFyxwXsa3u0ZCPcvOJLpdI73qBlhqmEnYAgdI0LlVxjRIgutRpQsNUeRPsDvFi5gdh4Nh8hbYw8mizU/ZbNAr7ZlJ5FgZ6MqjrTdmKxpFNO2VOvsLh1He2/LFMwwyuLkCIcU0E8ey/iRmJKbvD7CHqbLgHIVJc289IDlJcH/QAQATf3pg5X4GlyAy68dKNroAVy4cMvhWcDUfY6dfK5CPJe+9zRRGO3Nutan8NFlBkcSor00q72RAqAtpvqRKQ6/m871yzb7VLMPII3s2IF7oEMfmr8v7xy7UJnrWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c7q62OBTF4EkX1ZsI2jfOxA25JLYPsVgD44kkdhdghg=; b=Yj7BDjvZfF4dglygE3UHaCa1GPQZq8WuLsv8CYO6/8AswgiEhSbfj7CvGMbOAKr+hODe/ZxzwchlLL94wrD02yyxk0SaclzM2vujYbNYuxlCY/2eoL19rThs/ZM10X8IUbMOKlqk9TkeAbrXjsxaaBKwnDelVgwVfVFVI0Jn4cE= Authentication-Results-Original: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=arm.com; Received: from AM0PR08MB3268.eurprd08.prod.outlook.com (2603:10a6:208:65::26) by AM0PR08MB4498.eurprd08.prod.outlook.com (2603:10a6:208:13c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.19; Thu, 4 Mar 2021 06:16:49 +0000 Received: from AM0PR08MB3268.eurprd08.prod.outlook.com ([fe80::b55a:5a00:982b:a685]) by AM0PR08MB3268.eurprd08.prod.outlook.com ([fe80::b55a:5a00:982b:a685%6]) with mapi id 15.20.3912.017; Thu, 4 Mar 2021 06:16:48 +0000 Subject: Re: [PATCH RFC v1 12/15] iommu/virtio: Add support for INVALIDATE request To: "Tian, Kevin" , Jacob Pan Cc: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux-foundation.org" , "virtualization@lists.linux-foundation.org" , "joro@8bytes.org" , "will.deacon@arm.com" , "mst@redhat.com" , "robin.murphy@arm.com" , "jean-philippe@linaro.org" , "eric.auger@redhat.com" , "alex.williamson@redhat.com" , "Liu, Yi L" , "lorenzo.pieralisi@arm.com" , "shameerali.kolothum.thodi@huawei.com" References: <20210115121342.15093-1-vivek.gautam@arm.com> <20210115121342.15093-13-vivek.gautam@arm.com> <20210303102848.5d879f0e@jacob-builder> From: Vivek Kumar Gautam Message-ID: <92b6384b-29ff-ed15-ce65-02c18eefc5b8@arm.com> Date: Thu, 4 Mar 2021 11:46:40 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [217.140.105.56] X-ClientProxiedBy: PN2PR01CA0126.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:6::11) To AM0PR08MB3268.eurprd08.prod.outlook.com (2603:10a6:208:65::26) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.162.16.71] (217.140.105.56) by PN2PR01CA0126.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.18 via Frontend Transport; Thu, 4 Mar 2021 06:16:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 80d70f82-1d69-4bca-2890-08d8ded51d86 X-MS-TrafficTypeDiagnostic: AM0PR08MB4498:|VI1PR0801MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: KE/g/dCIfVA1VU8pyPPRThVCSuzCQs4OAcNoKEkIIdRvwuClOgwIy8brzdJxVxamfhjWNNb+W2OpFECBlwek+ciopvJoB9TUL2Pt+gsCVTn1ZZf90ALMf46FE94qFKyD6mhfXY1YSZTs9WNeLvQFK3z7wEo2sWVrnuzmrgN1VxkwOZd/zOEUAVYRE8Pkc2qCfuHX+OCVSh4UM4WrzDBgeE7mO6MLr8HZ6xiRp9BHm1BtIwjA+VTszr642DRZAllxFXhLvpbDJmayjRM9Z8h9fVC6C/SHQLjusC28T6A6rFIOLO0RZQSy+v6kgRSX2aOoWdYKsVceKEVZFf7Io7Fl5eza1/7mrskZUZ4OHCtyCWu6yt3TU1Og8tVt/xfL2aQVdZyx3RgVUGUnNvC5j1PZNV+xdWYfNzwNdz0L+RQAb4M/mRsiFlBafiTAlH6b8yA9xBLGJqfy39git3j+xSZz4pg9G1EJWTOxwhw5toEpZaSNFKGSyMjlF7dKvuhkWj5VN2xpX/Xt/QUEi+dxUoXKkBaoRwZkYlOtyevUqANiUpKnOdhztbH8dcbB50xLYKWMLD1PgL9C0MMd5DJm2QV/fKKLaEO/6tFrs0O8qhwLq9A= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB3268.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(136003)(376002)(346002)(366004)(39850400004)(66946007)(66476007)(66556008)(54906003)(6486002)(16576012)(83380400001)(110136005)(8676002)(8936002)(316002)(36756003)(2906002)(52116002)(4326008)(31696002)(86362001)(478600001)(53546011)(5660300002)(186003)(6666004)(31686004)(16526019)(26005)(7416002)(2616005)(956004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?UmJwMXc3ODU5NEpJYW1uNlNETHhWc2Q0TWRFaTRlb2RWeGRtRkYycy9BUDJ3?= =?utf-8?B?a0ZUYXBybTZXdFNGL2xUSWFRaG5KVlY3d0ZPTWpoVGdWRnBiVW52LzEvdHFY?= =?utf-8?B?QkQ3VXBUMXE3M0U0eWgrMklnZkIzUlhIN3NYWmlCUXQzNVJHZVlwcG0rT2J6?= =?utf-8?B?Rmh4Y0dnVEZJeUpqQ1ZSVC81YnhZRTh2aklWOTFuS3hMdHZaYVRpcTM5UmZQ?= =?utf-8?B?VW5JTVVGSEZpRWRnclRJNksrOXdZY0JVS2w1ZmovSkZ5a296TEJrT0JrNWlw?= =?utf-8?B?cExSNlpZdGUySnRpY0VVbGR3Sit6WDFsMVIvQzgwa2dyRTVDUmNNR29JWk9S?= =?utf-8?B?ZitHbDg3TmpNTmRqTXIwWWtxVUd2UEZzZFd4WFFzOHhlNC9MMlljelVCWDEr?= =?utf-8?B?aFA1K3hkMTltamE4Q1NUaW1BYW9sVG9XWXRoUHJLcE1xaktvM0hzQXlvUmVU?= =?utf-8?B?aHNFbWJ3c21HWGxndzJpclMzalhHMnNmeGxaMDNCbGxJWWdFU3NGdDFHeDB1?= =?utf-8?B?cHpHTk5FbkpJT0ZyZjRSdStlSjd2QkFpb2d2WGgwTkl0bzBnKys4YlZqaVU1?= =?utf-8?B?NkwvYURyRUFTam1uU3h5TDZtZEczUk83NCtDaVM0am84OGNBMk1mQTl3NFVN?= =?utf-8?B?bElnak4vbHBlb0lQTXJDSitsRDh3ci9xTHVCeTR4aWRIYW5EVWo5bzU0R3Vx?= =?utf-8?B?bVJZeExLKy9EdjZqakk2bTVFc0dXUUg2TEFRV044R1VhcTBpM2pRNzZiS0VF?= =?utf-8?B?N2xNT3RsZjF3a05CQlNaSExoa1JRU0N2SDcyaFZXN1J6YUtDRWpWQzZPdG9x?= =?utf-8?B?WGRjY016MjA4aFcvbHVwcjh2OXJrYXd5MGJ1WkdCQnVEckQwLzRyOUFIdFRu?= =?utf-8?B?MStXTkNBMkZ0WTFSdDltR2g1VmtQMzVNV2d6Vk95dk1obTluaWgzMmRzZWRa?= =?utf-8?B?WHo5eWVsd1NkWVp5WUM5M3lCZEZpZTgraFpZQ1JQcUlJdzZVRWpDaFVpbmd6?= =?utf-8?B?RDN1S2hiRmNJQ1NJWjg4dGdkYmNWSFVPMk5CcHBlQjhoNElSQVVrT25GbGZD?= =?utf-8?B?MDk1TWZieXRTWXJ3T3g4NWIzMVdETDRiaTdHZFVnWUZ3MEN3OHNkZkVBd2tk?= =?utf-8?B?bzRrc1FsY0ptcHJpeTlPRThpbkhpbjBuZDNlN2F5Z3V6NVFNTUtMSTFxZUNQ?= =?utf-8?B?eGx3dnVzUURlcjRqd0ZTSjJzaEw2SVFnYTZyeXBmUmVtakI1SVV5NHlrc2xt?= =?utf-8?B?bXBtbTFvWHdvcXhUWjJNTFBPRFA3ZVk4cDJyc3l6UWVLVzF4Qm54WlZTa2hQ?= =?utf-8?B?bWpuU21FWU5icUtuOUhYdElXV25makFiOUZvNUF3UVcvYnJIK2U1TmMyOWVQ?= =?utf-8?B?S09ubHBpOHJBakxVM0tiK0ttbFhMRklzWlVUWDljY2htb3lCZmoxL1U3dkQw?= =?utf-8?B?a2c4cGdsZkM2bmJEQ0Rwbk9TdWpjMzRZTXA0K3pVMnpKSDZnU042OVFtdWd5?= =?utf-8?B?YXBPZDFUWVFhNHl5WDA1VFlYR1UxSFVqdDBadlo1bnVQY2V0Uy9vY2xITnhm?= =?utf-8?B?bmdMaytSM0VtS0tZS0VyejIvUTRMZnNTUnVGRU9aZk83ek1uS0poeEZ2RXo2?= =?utf-8?B?SHh6SEdDeXV0RWpVRUJVT09BalRZT3FnQ0hqUklXSTQyTnU1NmNISDQ5bXdr?= =?utf-8?B?OVNZTWRodHpkb3lXTnBvNWhIZmtzaHlHNEVxV3F1d0xwSnlkMEVnR3RVdEJI?= =?utf-8?Q?6r6M0iPc7gGaZOXfX76+8sdd7FO6sA8Qh/TlNnR?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4498 Original-Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 2a0d959e-dc0b-4dc4-4975-08d8ded5179e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DDWoNLEPStm0kW8ItIBEViIRjnMslervyTw2iDUE0pHXu877LnoLC4/KHH7GwTe5IXh1i8MqJez5V9F+gGppGN90qQa2CsQ1Q0Oh8HD7g7PPh7n4ovUxZuEgWyicM/nk1ppqBnELrrZy1uhMlhKsv4asR319VsqOoKqf/LNVK1y3PloiCWSxYFZ1NOAN7zwQBGsGDWJIWGzEQv47APHOxDWL9KU85aKpgESPMdx6mxJPqP7XfLIA5o4LHgMO73gUZHHYHw1zgfIRv/YLkRTU+SCi0uuSFnbifjX+UIse25piH/9Ck1w9kHHaOhEmbIkwB1EKHSFLisDQTO3GFn2n+NONYbIbXSx+rO7Hz7hnL9Xpc9GtoivAsYRp+ImefManS42HCyENzOd2GyhdpTpPwXx8fcc/ZHwM6VqlaKVNU+DiHFumCtvDEdB3oERTst3tlfZIA7MGn49PgA4zdInrgs56eAzPzlLAtdvqohsvE83hOc6tCJY0rgRzFuibvAO6gqRBAZ+HL+cehVJyltcgY17nBMKTc9gCD2H2RJ7c6LU2HVr0gknrBXhiSRf3r938bPIJj/ac1jnECdP3749LmMEE6du+9YCivfa6fw8PH4ztXMs0UcQWmlj9X+UaN/IITOTC5H2oPW1J1b8pDe1cw4fBybCdHoVm1WSWz7NJ/RXtKJN0g+dFz1158Zx4u3EV X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39850400004)(136003)(396003)(376002)(346002)(46966006)(36840700001)(110136005)(8936002)(86362001)(26005)(8676002)(336012)(186003)(70206006)(478600001)(70586007)(82310400003)(2616005)(16576012)(356005)(83380400001)(81166007)(54906003)(316002)(16526019)(31696002)(956004)(47076005)(82740400003)(36756003)(2906002)(6486002)(36860700001)(31686004)(107886003)(4326008)(53546011)(6666004)(5660300002)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2021 06:16:57.5947 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80d70f82-1d69-4bca-2890-08d8ded51d86 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1968 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jacob, Kevin, On 3/4/21 11:28 AM, Tian, Kevin wrote: >> From: Jacob Pan >> Sent: Thursday, March 4, 2021 2:29 AM >> >> Hi Vivek, >> >> On Fri, 15 Jan 2021 17:43:39 +0530, Vivek Gautam >> wrote: >> >>> From: Jean-Philippe Brucker >>> >>> Add support for tlb invalidation ops that can send invalidation >>> requests to back-end virtio-iommu when stage-1 page tables are >>> supported. >>> >> Just curious if it possible to reuse the iommu uapi for invalidation and others. >> When we started out designing the iommu uapi, the intention was to support >> both emulated and virtio iommu. > > IIUC this patch is about the protocol between virtio-iommu frontend and backend. > After the virtio-iommu backend receives invalidation ops, it then needs to > forward the request to the host IOMMU driver through the existing iommu > uapi that you referred to, as a emulated VT-d or SMMU would do. Thanks a lot for looking at the patch. Yes this patch is to provide the front-end virtio interface for invalidation requests during map/unmap and when flushing the pasid tables when virtio-iommu requested pasid table (in other words cd tables for arm-smmu-v3) from the iommu-pasid-table library. The kvmtool back-end virtio driver forwards these requests to vfio driver which then makes use of iommu uapi to finally request host iommu driver for handling these invalidations. Regards Vivek > > Thanks > Kevin > >> >>> Signed-off-by: Jean-Philippe Brucker >>> [Vivek: Refactoring the iommu_flush_ops, and adding only one pasid sync >>> op that's needed with current iommu-pasid-table infrastructure. >>> Also updating uapi defines as required by latest changes] >>> Signed-off-by: Vivek Gautam >>> Cc: Joerg Roedel >>> Cc: Will Deacon >>> Cc: Michael S. Tsirkin >>> Cc: Robin Murphy >>> Cc: Jean-Philippe Brucker >>> Cc: Eric Auger >>> Cc: Alex Williamson >>> Cc: Kevin Tian >>> Cc: Jacob Pan >>> Cc: Liu Yi L >>> Cc: Lorenzo Pieralisi >>> Cc: Shameerali Kolothum Thodi >>> --- >>> drivers/iommu/virtio-iommu.c | 95 >> ++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 95 insertions(+) >>> >>> diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c >>> index ae5dfd3f8269..004ea94e3731 100644 >>> --- a/drivers/iommu/virtio-iommu.c >>> +++ b/drivers/iommu/virtio-iommu.c >>> @@ -13,6 +13,7 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> #include >>> @@ -63,6 +64,8 @@ struct viommu_mapping { >>> }; >>> >>> struct viommu_mm { >>> + int pasid; >>> + u64 archid; >>> struct io_pgtable_ops *ops; >>> struct viommu_domain *domain; >>> }; >>> @@ -692,6 +695,98 @@ static void viommu_event_handler(struct >> virtqueue >>> *vq) virtqueue_kick(vq); >>> } >>> >>> +/* PASID and pgtable APIs */ >>> + >>> +static void __viommu_flush_pasid_tlb_all(struct viommu_domain >> *vdomain, >>> + int pasid, u64 arch_id, int >>> type) +{ >>> + struct virtio_iommu_req_invalidate req = { >>> + .head.type = VIRTIO_IOMMU_T_INVALIDATE, >>> + .inv_gran = >>> cpu_to_le32(VIRTIO_IOMMU_INVAL_G_PASID), >>> + .flags = >>> cpu_to_le32(VIRTIO_IOMMU_INVAL_F_PASID), >>> + .inv_type = cpu_to_le32(type), >>> + >>> + .domain = cpu_to_le32(vdomain->id), >>> + .pasid = cpu_to_le32(pasid), >>> + .archid = cpu_to_le64(arch_id), >>> + }; >>> + >>> + if (viommu_send_req_sync(vdomain->viommu, &req, sizeof(req))) >>> + pr_debug("could not send invalidate request\n"); >>> +} >>> + >>> +static void viommu_flush_tlb_add(struct iommu_iotlb_gather *gather, >>> + unsigned long iova, size_t granule, >>> + void *cookie) >>> +{ >>> + struct viommu_mm *viommu_mm = cookie; >>> + struct viommu_domain *vdomain = viommu_mm->domain; >>> + struct iommu_domain *domain = &vdomain->domain; >>> + >>> + iommu_iotlb_gather_add_page(domain, gather, iova, granule); >>> +} >>> + >>> +static void viommu_flush_tlb_walk(unsigned long iova, size_t size, >>> + size_t granule, void *cookie) >>> +{ >>> + struct viommu_mm *viommu_mm = cookie; >>> + struct viommu_domain *vdomain = viommu_mm->domain; >>> + struct virtio_iommu_req_invalidate req = { >>> + .head.type = VIRTIO_IOMMU_T_INVALIDATE, >>> + .inv_gran = cpu_to_le32(VIRTIO_IOMMU_INVAL_G_VA), >>> + .inv_type = >> cpu_to_le32(VIRTIO_IOMMU_INV_T_IOTLB), >>> + .flags = >>> cpu_to_le32(VIRTIO_IOMMU_INVAL_F_ARCHID), + >>> + .domain = cpu_to_le32(vdomain->id), >>> + .pasid = cpu_to_le32(viommu_mm->pasid), >>> + .archid = cpu_to_le64(viommu_mm->archid), >>> + .virt_start = cpu_to_le64(iova), >>> + .nr_pages = cpu_to_le64(size / granule), >>> + .granule = ilog2(granule), >>> + }; >>> + >>> + if (viommu_add_req(vdomain->viommu, &req, sizeof(req))) >>> + pr_debug("could not add invalidate request\n"); >>> +} >>> + >>> +static void viommu_flush_tlb_all(void *cookie) >>> +{ >>> + struct viommu_mm *viommu_mm = cookie; >>> + >>> + if (!viommu_mm->archid) >>> + return; >>> + >>> + __viommu_flush_pasid_tlb_all(viommu_mm->domain, >> viommu_mm->pasid, >>> + viommu_mm->archid, >>> + VIRTIO_IOMMU_INV_T_IOTLB); >>> +} >>> + >>> +static struct iommu_flush_ops viommu_flush_ops = { >>> + .tlb_flush_all = viommu_flush_tlb_all, >>> + .tlb_flush_walk = viommu_flush_tlb_walk, >>> + .tlb_add_page = viommu_flush_tlb_add, >>> +}; >>> + >>> +static void viommu_flush_pasid(void *cookie, int pasid, bool leaf) >>> +{ >>> + struct viommu_domain *vdomain = cookie; >>> + struct virtio_iommu_req_invalidate req = { >>> + .head.type = VIRTIO_IOMMU_T_INVALIDATE, >>> + .inv_gran = >>> cpu_to_le32(VIRTIO_IOMMU_INVAL_G_PASID), >>> + .inv_type = >> cpu_to_le32(VIRTIO_IOMMU_INV_T_PASID), >>> + .flags = >>> cpu_to_le32(VIRTIO_IOMMU_INVAL_F_PASID), + >>> + .domain = cpu_to_le32(vdomain->id), >>> + .pasid = cpu_to_le32(pasid), >>> + }; >>> + >>> + if (leaf) >>> + req.flags |= >>> cpu_to_le32(VIRTIO_IOMMU_INVAL_F_LEAF); + >>> + if (viommu_send_req_sync(vdomain->viommu, &req, sizeof(req))) >>> + pr_debug("could not send invalidate request\n"); >>> +} >>> + >>> /* IOMMU API */ >>> >>> static struct iommu_domain *viommu_domain_alloc(unsigned type) >> >> >> Thanks, >> >> Jacob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel