Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp510083ybj; Thu, 7 May 2020 00:48:29 -0700 (PDT) X-Google-Smtp-Source: APiQypIoKFmhbGdHDFetAHAY1Cn2zTd5OVwXF9wYsM6Rtj+G3DZ/ofyJoX4bEXNXLsPw9C0CvNih X-Received: by 2002:a05:6402:30ae:: with SMTP id df14mr10068841edb.86.1588837709422; Thu, 07 May 2020 00:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588837709; cv=none; d=google.com; s=arc-20160816; b=SL3fsdB9iiG2iB2TvlYfTSW8kH0bi9ravL6TmPEqa6uZLN4kuN8gWu38Fcaguc8Wf+ x3LFhFO/SVPjeo1tmWcrso2IBk/fbVjByiPiUG+c/2RieyXtbS2wGXfRqVoL8cmSL3vU QA3dhY7lxqckRviT/+PTNDeE7bDwoyirNcHIX9j+/XSm+iWe8Vl39b5JowdCMQHZ7Qla cgAOWFfKRvcOlsJ8gLYPDrQL2c0GvI6hbVHctdAjJe8mDrLI7x7wrZ3/O0ij/kRc/YCV l8in+DT630hw8FG04hpiSP1MMFjImG5bYqStQ9F8l21mKGyzOGPjvTnSmeZHvLf8fnO/ LQYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=R/fSRFrdrjSnuIOxHUSCOfP/3ESQFRE1q+R9NH0xsQg=; b=nvVZ3P8u/W7hkltdk49SjGrqElCZST/p6bUrk7TPSjofjMUFoWIShtEQD8B5uTNlJf crFePJgJmjQiX1rXkhbucm2a8OoLeQuTQLDbl8TAu+qaMiq7lgysKBML+YfMDzuLBMrL wGSLjPAa0AmZtq4Rfee++k+QEvGwIlVpNIjFAV88lPD+/nyzDlQ9LGncC4NZBrVIF6Jr vECy3TCrneYBnc6LcfSOA6/a9Hxu5+sx9KzciVIT7viOiQ5xCztSgl5GJBQ5nQeDYHUa XqoV125RrLBGOsRxMH9X+A+yK5NE0BG04IJWy7Sj/ubBKVUc97ZWKqQX3xd6G0uR0fx7 JFPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DxHTfuWi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si2616454ejb.281.2020.05.07.00.48.06; Thu, 07 May 2020 00:48:29 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DxHTfuWi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbgEGHqM (ORCPT + 99 others); Thu, 7 May 2020 03:46:12 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34566 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725834AbgEGHqL (ORCPT ); Thu, 7 May 2020 03:46:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588837569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R/fSRFrdrjSnuIOxHUSCOfP/3ESQFRE1q+R9NH0xsQg=; b=DxHTfuWi4gjUIsFr1aiImOH5dsuvTzIlZA5ADNth2nhxmvlcQyXEhnOV8yMl3BjAFrYjxI 2Of633Xk/+VNCsxyR0RjxjhB+kh6YvivgXNg2ur9xNLgU/DCtOKP55ZJ+LZ7EO9v+9mY5e 0jc6O1Ow1nHzPC0umddZcrzxG4mXAh8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-cVJMtdwgMcyLqQcpvcN9Qg-1; Thu, 07 May 2020 03:46:05 -0400 X-MC-Unique: cVJMtdwgMcyLqQcpvcN9Qg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CCF618015CF; Thu, 7 May 2020 07:46:02 +0000 (UTC) Received: from [10.36.114.214] (ovpn-114-214.ams2.redhat.com [10.36.114.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47DEB5C1B0; Thu, 7 May 2020 07:45:52 +0000 (UTC) Subject: Re: [PATCH v11 00/13] SMMUv3 Nested Stage Setup (IOMMU part) To: Shameerali Kolothum Thodi , Zhangfei Gao , "eric.auger.pro@gmail.com" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "kvmarm@lists.cs.columbia.edu" , "will@kernel.org" , "joro@8bytes.org" , "maz@kernel.org" , "robin.murphy@arm.com" Cc: "jean-philippe@linaro.org" , "alex.williamson@redhat.com" , "jacob.jun.pan@linux.intel.com" , "yi.l.liu@intel.com" , "peter.maydell@linaro.org" , "tn@semihalf.com" , "bbhushan2@marvell.com" References: <20200414150607.28488-1-eric.auger@redhat.com> <06fe02f7-2556-8986-2f1e-dcdf59773b8c@redhat.com> From: Auger Eric Message-ID: <21e162a0-b29f-94a4-8371-7e3ac2743539@redhat.com> Date: Thu, 7 May 2020 09:45:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shameer, On 5/7/20 8:59 AM, Shameerali Kolothum Thodi wrote: > Hi Eric, >=20 >> -----Original Message----- >> From: Shameerali Kolothum Thodi >> Sent: 30 April 2020 10:38 >> To: 'Auger Eric' ; Zhangfei Gao >> ; eric.auger.pro@gmail.com; >> iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org; >> kvm@vger.kernel.org; kvmarm@lists.cs.columbia.edu; will@kernel.org; >> joro@8bytes.org; maz@kernel.org; robin.murphy@arm.com >> Cc: jean-philippe@linaro.org; alex.williamson@redhat.com; >> jacob.jun.pan@linux.intel.com; yi.l.liu@intel.com; peter.maydell@linar= o.org; >> tn@semihalf.com; bbhushan2@marvell.com >> Subject: RE: [PATCH v11 00/13] SMMUv3 Nested Stage Setup (IOMMU part) >> >> Hi Eric, >> >>> -----Original Message----- >>> From: Auger Eric [mailto:eric.auger@redhat.com] >>> Sent: 16 April 2020 08:45 >>> To: Zhangfei Gao ; eric.auger.pro@gmail.com; >>> iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org; >>> kvm@vger.kernel.org; kvmarm@lists.cs.columbia.edu; will@kernel.org; >>> joro@8bytes.org; maz@kernel.org; robin.murphy@arm.com >>> Cc: jean-philippe@linaro.org; Shameerali Kolothum Thodi >>> ; alex.williamson@redhat.com; >>> jacob.jun.pan@linux.intel.com; yi.l.liu@intel.com; peter.maydell@lina= ro.org; >>> tn@semihalf.com; bbhushan2@marvell.com >>> Subject: Re: [PATCH v11 00/13] SMMUv3 Nested Stage Setup (IOMMU part) >>> >>> Hi Zhangfei, >>> >>> On 4/16/20 6:25 AM, Zhangfei Gao wrote: >>>> >>>> >>>> On 2020/4/14 =E4=B8=8B=E5=8D=8811:05, Eric Auger wrote: >>>>> This version fixes an issue observed by Shameer on an SMMU 3.2, >>>>> when moving from dual stage config to stage 1 only config. >>>>> The 2 high 64b of the STE now get reset. Otherwise, leaving the >>>>> S2TTB set may cause a C_BAD_STE error. >>>>> >>>>> This series can be found at: >>>>> https://github.com/eauger/linux/tree/v5.6-2stage-v11_10.1 >>>>> (including the VFIO part) >>>>> The QEMU fellow series still can be found at: >>>>> https://github.com/eauger/qemu/tree/v4.2.0-2stage-rfcv6 >>>>> >>>>> Users have expressed interest in that work and tested v9/v10: >>>>> - https://patchwork.kernel.org/cover/11039995/#23012381 >>>>> - https://patchwork.kernel.org/cover/11039995/#23197235 >>>>> >>>>> Background: >>>>> >>>>> This series brings the IOMMU part of HW nested paging support >>>>> in the SMMUv3. The VFIO part is submitted separately. >>>>> >>>>> 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). >>>>> >>>>> >>>> >>>> Thanks Eric >>>> >>>> Tested v11 on Hisilicon kunpeng920 board via hardware zip accelerato= r. >>>> 1. no-sva works, where guest app directly use physical address via i= octl. >>> Thank you for the testing. Glad it works for you. >>>> 2. vSVA still not work, same as v10, >>> Yes that's normal this series is not meant to support vSVM at this st= age. >>> >>> I intend to add the missing pieces during the next weeks. >> >> Thanks for that. I have made an attempt to add the vSVA based on >> your v10 + JPBs sva patches. The host kernel and Qemu changes can >> be found here[1][2]. >> >> This basically adds multiple pasid support on top of your changes. >> I have done some basic sanity testing and we have some initial success >> with the zip vf dev on our D06 platform. Please note that the STALL ev= ent is >> not yet supported though, but works fine if we mlock() guest usr mem. >=20 > I have added STALL support for our vSVA prototype and it seems to be > working(on our hardware). I have updated the kernel and qemu branches w= ith > the same[1][2]. I should warn you though that these are prototype code = and I am pretty > much re-using the VFIO_IOMMU_SET_PASID_TABLE interface for almost every= thing. > But thought of sharing, in case if it is useful somehow!. Thank you very much for your work. I intend to look at your additions by beginning of next week. Best Regards Eric >=20 > Thanks, > Shameer >=20 > [1]https://github.com/hisilicon/kernel-dev/commits/vsva-prototype-host-= v1 >=20 > [2]https://github.com/hisilicon/qemu/tree/v4.2.0-2stage-rfcv6-vsva-prot= otype-v1 >=20