Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp197230pxb; Wed, 14 Apr 2021 12:55:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPksOe9isqEW3gTmUhUt7VcziVVO11HueTCvFV0zXBSw6YvR5XNvuUEoe+Ogo8nFiuER7i X-Received: by 2002:a17:902:a406:b029:e6:78c4:71c8 with SMTP id p6-20020a170902a406b02900e678c471c8mr39012341plq.17.1618430137092; Wed, 14 Apr 2021 12:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618430137; cv=none; d=google.com; s=arc-20160816; b=y7Jfr+Wfu7A5nO+skcuzB2FHMxegHj/sTgKpUqd2iMRyCl+U68SOOnO6RV2ZzkyWBD BEDWvjTGalS/7RSf9eZh2IPd2Gu07FzaB9xZoga2qLq1OZ7LCTJ6iKhuAL410cN9IRNR EMEc1pRdFLXUBoZp2Ga58lm52GTbbjn/4Wv+hLul3bp4690rw2HUn3rL9THFGkzTYaUz ARus1RMHtURynRdTETcIN0tRmwJPvkDkjFqLRQ1VpwCSpD7Gc65J2he5ktL+1de8GUGo SkAk0vkVIZp6Bag9cdkkW0iTK6zG8OOnCaXaycYj2zYiXRpzlrriOjDXhNUloVNd7tVi 5bqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=TishmaJEEESj629Uh+2SkBr20iCF9swNt2Uxy5te8Jg=; b=lnb027sxNk+Tnr6eKCum5NTI1bITdt4v7ywj+MFPvjqkMy1dLy9e9zG6ojS/sQXq+U 7KpoChYHaz+Z6FGcjBSI/AknCdvWl4K6XTd1cfQM7Csc25zoMZ//LiqAX5/SRfHwwFlE yO68qUGTQB2ZbVGXBhd7xVMkC0vHX/PeCBojObg5B+JZRhf0par2LNd550e1VNixV9HR +hStp8d1YNy5Gxj5NYXNEjD50139AsrNtt5KI+knVu5LqfVf/PkMRsBJW/TKHTTPR9rA T5fiscLStgK4TwfDiL5dhXdqqh3lKyiEPPo3g7/3cHcy54tySXPtkYExLy84k446n4AC 7TIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si522536pfe.306.2021.04.14.12.55.24; Wed, 14 Apr 2021 12:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233513AbhDNHJl (ORCPT + 99 others); Wed, 14 Apr 2021 03:09:41 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:17331 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbhDNHJi (ORCPT ); Wed, 14 Apr 2021 03:09:38 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FKtnX0Pphz9yT7; Wed, 14 Apr 2021 15:06:56 +0800 (CST) Received: from [10.174.185.226] (10.174.185.226) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Wed, 14 Apr 2021 15:09:05 +0800 Subject: Re: [PATCH v15 00/12] SMMUv3 Nested Stage Setup (IOMMU part) To: Shameerali Kolothum Thodi , "Eric Auger" , "eric.auger.pro@gmail.com" , "jean-philippe@linaro.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "kvmarm@lists.cs.columbia.edu" , "will@kernel.org" , "maz@kernel.org" , "robin.murphy@arm.com" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "tn@semihalf.com" , zhukeqian CC: "jacob.jun.pan@linux.intel.com" , "yi.l.liu@intel.com" , "zhangfei.gao@linaro.org" , "zhangfei.gao@gmail.com" , "vivek.gautam@arm.com" , yuzenghui , "nicoleotsuka@gmail.com" , lushenming , "vsethi@nvidia.com" , "chenxiang (M)" , "vdumpa@nvidia.com" , jiangkunkun , , References: <20210411111228.14386-1-eric.auger@redhat.com> <55930e46-0a45-0d43-b34e-432cf332b42c@huawei.com> From: Xingang Wang Message-ID: <2b8aa93c-1c66-fb0c-f98a-0b59980919d3@huawei.com> Date: Wed, 14 Apr 2021 15:08:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.185.226] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shameer, On 2021/4/14 14:56, Shameerali Kolothum Thodi wrote: > > >> -----Original Message----- >> From: wangxingang >> Sent: 14 April 2021 03:36 >> To: Eric Auger ; eric.auger.pro@gmail.com; >> jean-philippe@linaro.org; iommu@lists.linux-foundation.org; >> linux-kernel@vger.kernel.org; kvm@vger.kernel.org; >> kvmarm@lists.cs.columbia.edu; will@kernel.org; maz@kernel.org; >> robin.murphy@arm.com; joro@8bytes.org; alex.williamson@redhat.com; >> tn@semihalf.com; zhukeqian >> Cc: jacob.jun.pan@linux.intel.com; yi.l.liu@intel.com; zhangfei.gao@linaro.org; >> zhangfei.gao@gmail.com; vivek.gautam@arm.com; Shameerali Kolothum >> Thodi ; yuzenghui >> ; nicoleotsuka@gmail.com; lushenming >> ; vsethi@nvidia.com; chenxiang (M) >> ; vdumpa@nvidia.com; jiangkunkun >> >> Subject: Re: [PATCH v15 00/12] SMMUv3 Nested Stage Setup (IOMMU part) >> >> Hi Eric, Jean-Philippe >> >> On 2021/4/11 19:12, Eric Auger wrote: >>> SMMUv3 Nested Stage Setup (IOMMU part) >>> >>> This series brings the IOMMU part of HW nested paging support >>> in the SMMUv3. The VFIO part is submitted separately. >>> >>> This is based on Jean-Philippe's >>> [PATCH v14 00/10] iommu: I/O page faults for SMMUv3 >>> https://www.spinics.net/lists/arm-kernel/msg886518.html >>> (including the patches that were not pulled for 5.13) >>> >>> The IOMMU API is extended to support 2 new API functionalities: >>> 1) pass the guest stage 1 configuration >>> 2) pass stage 1 MSI bindings >>> >>> Then those capabilities gets implemented in the SMMUv3 driver. >>> >>> The virtualizer passes information through the VFIO user API >>> which cascades them to the iommu subsystem. This allows the guest >>> to own stage 1 tables and context descriptors (so-called PASID >>> table) while the host owns stage 2 tables and main configuration >>> structures (STE). >>> >>> Best Regards >>> >>> Eric >>> >>> This series can be found at: >>> v5.12-rc6-jean-iopf-14-2stage-v15 >>> (including the VFIO part in its last version: v13) >>> >> >> I am testing the performance of an accelerator with/without SVA/vSVA, >> and found there might be some potential performance loss risk for SVA/vSVA. >> >> I use a Network and computing encryption device (SEC), and send 1MB >> request for 10000 times. >> >> I trigger mm fault before I send the request, so there should be no iopf. >> >> Here's what I got: >> >> physical scenario: >> performance: SVA:9MB/s NOSVA:9MB/s >> tlb_miss: SVA:302,651 NOSVA:1,223 >> trans_table_walk_access:SVA:302,276 NOSVA:1,237 >> >> VM scenario: >> performance: vSVA:9MB/s NOvSVA:6MB/s about 30~40% loss >> tlb_miss: vSVA:4,423,897 NOvSVA:1,907 >> trans_table_walk_access:vSVA:61,928,430 NOvSVA:21,948 >> >> In physical scenario, there's almost no performance loss, but the >> tlb_miss and trans_table_walk_access of stage 1 for SVA is quite high, >> comparing to NOSVA. >> >> In VM scenario, there's about 30~40% performance loss, this is because >> the two stage tlb_miss and trans_table_walk_access is even higher, and >> impact the performance. >> >> I compare the procedure of building page table of SVA and NOSVA, and >> found that NOSVA uses 2MB mapping as far as possible, while SVA uses >> only 4KB. >> >> I retest with huge page, and huge page could solve this problem, the >> performance of SVA/vSVA is almost the same as NOSVA. >> >> I am wondering do you have any other solution for the performance loss >> of vSVA, or any other method to reduce the tlb_miss/trans_table_walk. > > Hi Xingang, > > Just curious, do you have DVM enabled on this board or does it use explicit > SMMU TLB invalidations? > > Thanks, > Shameer > For now, DVM is enabled and TLBI is not explicit used. And by the way the performance data above is performance: vSVA:9GB/s(not 9MB/s) NOvSVA:6GB/s(not 6GB/s) Thanks Xingang .