From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39E00C43219 for ; Fri, 26 Apr 2019 16:22:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B0A1206A3 for ; Fri, 26 Apr 2019 16:22:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbfDZQWy (ORCPT ); Fri, 26 Apr 2019 12:22:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59626 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbfDZQWy (ORCPT ); Fri, 26 Apr 2019 12:22:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A2B3309D071; Fri, 26 Apr 2019 16:22:54 +0000 (UTC) Received: from [10.36.116.17] (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D93A01001E87; Fri, 26 Apr 2019 16:22:47 +0000 (UTC) Subject: Re: [PATCH v2 17/19] iommu: Add max num of cache and granu types To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker Cc: Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Lu Baolu , Andriy Shevchenko References: <1556062279-64135-1-git-send-email-jacob.jun.pan@linux.intel.com> <1556062279-64135-18-git-send-email-jacob.jun.pan@linux.intel.com> From: Auger Eric Message-ID: Date: Fri, 26 Apr 2019 18:22:46 +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: <1556062279-64135-18-git-send-email-jacob.jun.pan@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 26 Apr 2019 16:22:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacob, On 4/24/19 1:31 AM, Jacob Pan wrote: > To convert to/from cache types and granularities between generic and > VT-d specific counterparts, a 2D arrary is used. Introduce the limits array > to help define the converstion array size. conversion > > Signed-off-by: Jacob Pan > --- > include/uapi/linux/iommu.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h > index 5c95905..2d8fac8 100644 > --- a/include/uapi/linux/iommu.h > +++ b/include/uapi/linux/iommu.h > @@ -197,6 +197,7 @@ struct iommu_inv_addr_info { > __u64 granule_size; > __u64 nb_granules; > }; > +#define NR_IOMMU_CACHE_INVAL_GRANU (3) > > /** > * First level/stage invalidation information > @@ -235,6 +236,7 @@ struct iommu_cache_invalidate_info { > struct iommu_inv_addr_info addr_info; > }; > }; > +#define NR_IOMMU_CACHE_TYPE (3) > /** > * struct gpasid_bind_data - Information about device and guest PASID binding > * @gcr3: Guest CR3 value from guest mm > Is it really something that needs to be exposed in the uapi? Thanks Eric