Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp441412pxb; Wed, 29 Sep 2021 02:32:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwF1ttdd9TrF0632ihlLCZ/kdMTY/FT+WQWWAxjCZ2zqyYISH4XWKS0n5DHRiQ/UtWqXxYi X-Received: by 2002:a05:6a00:708:b0:43b:80ba:99c8 with SMTP id 8-20020a056a00070800b0043b80ba99c8mr10040980pfl.51.1632907937051; Wed, 29 Sep 2021 02:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632907937; cv=none; d=google.com; s=arc-20160816; b=S57BUzMkZEg7aLhA+4tJyTPxUipqHo1AO4AfjfiXs7N46w5+wUlc5GRDJAHbqdnRew AD74mhINR0Ea5Gm5QnlIVpEFLFaa9KEdVqog+fa3o/NMKqp2Ln+kwsMj1zaT4PAHJm7h Z6oIR3dax89cE7Au6RXAtK0rJ4hRTgA60hfwkmtvbqPh0WCydwbk/HCCAienBxsP9Cux un3Ku3QzMvQytXugw+6+LcRmuG/Bzdim6NIj86ahtpRiGULP9ZrrKDRuUB7/2lzIyvXb 5IqmVceqv6eANb5BB5A7+J4W31q3KbRW88bKYrATA9OQ52HsNOMpBsjG4e6feYlbaMgj OrUQ== 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 :to:subject:cc; bh=rRZ8CJnsl3SDa5zZFqCcJIlpaGPHMePTlInNPiHmbfk=; b=WEcLCqO9/7MS1IAIHZ1LMg3n7yWF317Z+5CDrkH0xnSFafKi+RPFbyYgCdQzm0gwS+ IRmYkv+UCjIMdezD5Jp9xxkZtDcfkMpJ55O/PTVNkSOQ6PEpxNDmGf+gmIVRO514S8KL uU/B+WthrITifDf+dRX+9GwYO9e3iXdq/HvOVZ05GTOwT8vfbnk043RPSrnhWjZZeIw4 iZCIBtdfi2OLY2OFd3smLBLfKUwspMuHKWNsEN/sKduWqFdKsKq+813U+UQMyQSByA7h 3PjMlY7NsAkl8nxld78fzu4KeP9crOhh7VMxvfkp39WWEV7FeeFORqalDe9utuyI8nkY Qhig== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si2484944pgl.542.2021.09.29.02.32.01; Wed, 29 Sep 2021 02:32:17 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245066AbhI2JbH (ORCPT + 99 others); Wed, 29 Sep 2021 05:31:07 -0400 Received: from mga14.intel.com ([192.55.52.115]:51658 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbhI2JbF (ORCPT ); Wed, 29 Sep 2021 05:31:05 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10121"; a="224555793" X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="224555793" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 02:29:24 -0700 X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="563138185" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.210.53]) ([10.254.210.53]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 02:29:18 -0700 Cc: baolu.lu@linux.intel.com, alex.williamson@redhat.com, jgg@nvidia.com, hch@lst.de, jasowang@redhat.com, joro@8bytes.org, jean-philippe@linaro.org, kevin.tian@intel.com, parav@mellanox.com, lkml@metux.net, pbonzini@redhat.com, lushenming@huawei.com, eric.auger@redhat.com, corbet@lwn.net, ashok.raj@intel.com, yi.l.liu@linux.intel.com, jun.j.tian@intel.com, hao.wu@intel.com, dave.jiang@intel.com, jacob.jun.pan@linux.intel.com, kwankhede@nvidia.com, robin.murphy@arm.com, kvm@vger.kernel.org, iommu@lists.linux-foundation.org, dwmw2@infradead.org, linux-kernel@vger.kernel.org, nicolinc@nvidia.com Subject: Re: [RFC 04/20] iommu: Add iommu_device_get_info interface To: David Gibson , Liu Yi L References: <20210919063848.1476776-1-yi.l.liu@intel.com> <20210919063848.1476776-5-yi.l.liu@intel.com> <21cd618b-3ea6-dc89-cc79-e0927dece927@linux.intel.com> From: Lu Baolu Message-ID: Date: Wed, 29 Sep 2021 17:29:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <21cd618b-3ea6-dc89-cc79-e0927dece927@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/9/29 17:25, Lu Baolu wrote: > Hi David, > > On 2021/9/29 10:52, David Gibson wrote: >> On Sun, Sep 19, 2021 at 02:38:32PM +0800, Liu Yi L wrote: >>> From: Lu Baolu >>> >>> This provides an interface for upper layers to get the per-device iommu >>> attributes. >>> >>> ???? int iommu_device_get_info(struct device *dev, >>> ?????????????????????????????? enum iommu_devattr attr, void *data); >> That fact that this interface doesn't let you know how to size the >> data buffer, other than by just knowing the right size for each attr >> concerns me. >> > > We plan to address this by following the comments here. > > https://lore.kernel.org/linux-iommu/20210921161930.GP327412@nvidia.com/ And Christoph gave another option as well. https://lore.kernel.org/linux-iommu/20210922050746.GA12921@lst.de/ Best regards, baolu