Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp87469pxb; Tue, 21 Sep 2021 19:37:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq5EVFTXQ6a7scHu2ui4BqbhFW3Dotqz3rCyUv/LNjoSM5tjSSE/LrTBWf/scH/N626nB6 X-Received: by 2002:a02:cd18:: with SMTP id g24mr2719618jaq.134.1632278235313; Tue, 21 Sep 2021 19:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632278235; cv=none; d=google.com; s=arc-20160816; b=xpiytRamRr2XlNsiq8AmXg2I/vAeORAQMpGWIlbAJ3wu5lb3UYKoGrqgE8DXR24W4j Xcl4pQX4yQAc7FhBoSQgV2AkGfRCkrTJriOn31fF+ys7u7cee/iNhJy14E/kxCXMu9l9 mtaqoD7GPgxlxJB3xdf4DJdSt0UemZBQ7f5/OGHIxUmwZ4AI1BQk5cz7LOlMQOHMU34Y VNVLF4NVwhdj6O5602lCLiKYbX8OzcXxXii4KJRs3z36vxPovsIrDUWRzL8Dgd1G2ZE7 xunwGSfbXBz5Rmf/SU1+CzStx/Q/aXG0cf9Yje9r5J0C/2zbY/kCnpZGrNESczI1aaRF dfMQ== 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=Cyp/ptXqTi/5PS4ug351X3TlTfeGdgZNDn7DZuQqaGc=; b=Ea0ojTQ2RO/YZPqZVcF8TGF/G0+k1yOzjtoaKXIYU9KYXvJU8y32iaqR/vm9OApbyM 2cGTJKeApJjLVOwrDyvL+bgkDpWaZ+BWl7L6xUjQLjJsym0haHs/JLImmtwYLEA2sC8A t2K3XZwcZ6MzusQcOT2AO9W6IIejLjwhhzIKzUbHhC3weymRQU57Bn8uKUZSMJ9Y8t14 6WDpM85oo77DuySAM/lwsWmDbW0uRKy6Ae3XCk26Rebg83RFjM/8L7twJM54vSVoRPnz Gs70WcGp0mJVHw2CjDs1bcZFAcQrBkzkvHzKmbIhVOJcQnLqRd6c04Ago5ANE7nZUTQ7 UXMw== 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 x13si1030341ilg.76.2021.09.21.19.37.02; Tue, 21 Sep 2021 19:37:15 -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 S229644AbhIVCgp (ORCPT + 99 others); Tue, 21 Sep 2021 22:36:45 -0400 Received: from mga07.intel.com ([134.134.136.100]:40920 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229466AbhIVCgo (ORCPT ); Tue, 21 Sep 2021 22:36:44 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="287173362" X-IronPort-AV: E=Sophos;i="5.85,312,1624345200"; d="scan'208";a="287173362" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2021 19:35:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,312,1624345200"; d="scan'208";a="533533519" Received: from allen-box.sh.intel.com (HELO [10.239.159.118]) ([10.239.159.118]) by fmsmga004.fm.intel.com with ESMTP; 21 Sep 2021 19:35:09 -0700 Cc: baolu.lu@linux.intel.com, alex.williamson@redhat.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, david@gibson.dropbear.id.au, nicolinc@nvidia.com Subject: Re: [RFC 04/20] iommu: Add iommu_device_get_info interface To: Jason Gunthorpe , Liu Yi L References: <20210919063848.1476776-1-yi.l.liu@intel.com> <20210919063848.1476776-5-yi.l.liu@intel.com> <20210921161930.GP327412@nvidia.com> From: Lu Baolu Message-ID: Date: Wed, 22 Sep 2021 10:31:47 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210921161930.GP327412@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, On 9/22/21 12:19 AM, Jason Gunthorpe 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); > > Can't we use properly typed ops and functions here instead of a void > *data? > > get_snoop() > get_page_size() > get_addr_width() Yeah! Above are more friendly to the upper layer callers. > > ? > > Jason > Best regards, baolu