Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1037120pxb; Sun, 11 Apr 2021 05:38:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsFlN1DvC75INqpdmI70wow4g4VX4+oxqzbEKJfTadMsDzoB4GmiJx93bJB9uJzFbuEYQ6 X-Received: by 2002:a17:906:ece1:: with SMTP id qt1mr7829793ejb.385.1618144732098; Sun, 11 Apr 2021 05:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618144732; cv=none; d=google.com; s=arc-20160816; b=GzZ+K5AOYf6ZRVs42lPPGnqxauA6SFStBfAHra/V+ouf6wajFD5CUQRnUfrGSDUAku FFuxAMAPwwFzHcoihIKcWN0TiWeLBpWZ1As3VG2+5LlaTfy+mvli3V1aIfHVsqnW8wQp fLi1tGK0HiC5nuXMYFkHVdRTLksuLrcdFQeM92hJWDHpMquo8ZDOGCwrNPmP15dpklMw UXuSZybEIV7Wmh0pDlZYwulSvbsJYpMWstDnxoqdimyRF0+V0z6p6vW6gKxsH4sZOvLY OXlzBHYx2mEi0Jtl5UqUAZebhu5Dwbc/PWnzLoHz3XCYh4vgE8iWhOUwfp0sW8IYOpEH 1x3Q== 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:dkim-signature; bh=Cd5a7MnBxaCycfDTV6DQTS58oQm03SFk+/qhnkSwHlw=; b=Mwx9tybCVI7uEQe7dD+N7CkKvqcLM+papG0YFPw9A61KBP+oHrfG6TdsX6U8SHnG2a qcn+4DD/g97jbtmb5JrgpXreQ78K1MKEbT+mBtTtPVAJW9TpnPTzhieJS6YfzpfnhNdD vkNr0dA/JykdN3g8P5tOTb4KUkD05g4eEQG35Rkq2cSJ4P7JCnptN5IB1acvPVDFLSdJ 5AZbZBLBoxjbHI7+WmvEkJ+8Zis65KT4fS1HZJaYrr03t7RFROdMPSnzAcixSYvy7bDw +7Lkou1Z075QtPbzUANMAM72Kl5x5dMwXxHZRbH0LwK5XgzrAqwJSGjVGb6Fiy3THHA+ Cd8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QVHabn0D; 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 y20si6622789edr.519.2021.04.11.05.38.27; Sun, 11 Apr 2021 05:38:52 -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=QVHabn0D; 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 S235306AbhDKMND (ORCPT + 99 others); Sun, 11 Apr 2021 08:13:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20612 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbhDKMNC (ORCPT ); Sun, 11 Apr 2021 08:13:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618143164; 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=Cd5a7MnBxaCycfDTV6DQTS58oQm03SFk+/qhnkSwHlw=; b=QVHabn0DDofRJgpGNX7RdoMqyc1zKlZ2/IyTgQ6BQFZ6wcAYpgxVfeout3oegXm/YgTBbb RmhZvl3Vy0osIfsyBlDC4COr8YJ+PXMU9uNrG6JiaOpW69bOEn8h1UV+Op81GcXIiDh6mP ClwNp5kbR7g+/ge2kZusapp9pLymGt4= 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-248-r9GIkX2eOQKuVWu8pninBQ-1; Sun, 11 Apr 2021 08:12:42 -0400 X-MC-Unique: r9GIkX2eOQKuVWu8pninBQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 141AD10053E6; Sun, 11 Apr 2021 12:12:40 +0000 (UTC) Received: from [10.36.112.22] (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 362465D6D3; Sun, 11 Apr 2021 12:12:29 +0000 (UTC) Subject: Re: [PATCH v12 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE To: Zenghui Yu Cc: 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, maz@kernel.org, robin.murphy@arm.com, joro@8bytes.org, alex.williamson@redhat.com, tn@semihalf.com, zhukeqian1@huawei.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, wangxingang5@huawei.com, jiangkunkun@huawei.com, jean-philippe@linaro.org, zhangfei.gao@linaro.org, zhangfei.gao@gmail.com, vivek.gautam@arm.com, shameerali.kolothum.thodi@huawei.com, nicoleotsuka@gmail.com, lushenming@huawei.com, vsethi@nvidia.com, wanghaibin.wang@huawei.com References: <20210223210625.604517-1-eric.auger@redhat.com> <20210223210625.604517-2-eric.auger@redhat.com> From: Auger Eric Message-ID: <513f8129-7ddc-f19f-e25a-e2a4b6cbe593@redhat.com> Date: Sun, 11 Apr 2021 14:12:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Zenghui, On 4/7/21 11:33 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 5:06, Eric Auger wrote: >> +/* >> + * VFIO_IOMMU_SET_PASID_TABLE - _IOWR(VFIO_TYPE, VFIO_BASE + 18, >> + *            struct vfio_iommu_type1_set_pasid_table) >> + * >> + * The SET operation passes a PASID table to the host while the >> + * UNSET operation detaches the one currently programmed. Setting >> + * a table while another is already programmed replaces the old table. > > It looks to me that this description doesn't match the IOMMU part. Yep that's misleanding. I replaced it by: It is allowed to "SET" the table several times without un-setting as long as the table config does not stay IOMMU_PASID_CONFIG_TRANSLATE. > > [v14,05/13] iommu/smmuv3: Implement attach/detach_pasid_table > > |    case IOMMU_PASID_CONFIG_TRANSLATE: > |        /* we do not support S1 <-> S1 transitions */ > |        if (smmu_domain->s1_cfg.set) > |            goto out; > > Maybe I've misread something? > > > Thanks, > Zenghui > Thanks Eric