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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 14539C432BE for ; Fri, 27 Aug 2021 05:42:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E219660E0B for ; Fri, 27 Aug 2021 05:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234024AbhH0Fm7 (ORCPT ); Fri, 27 Aug 2021 01:42:59 -0400 Received: from verein.lst.de ([213.95.11.211]:32853 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbhH0Fm7 (ORCPT ); Fri, 27 Aug 2021 01:42:59 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C46696736F; Fri, 27 Aug 2021 07:42:07 +0200 (CEST) Date: Fri, 27 Aug 2021 07:42:07 +0200 From: Christoph Hellwig To: "Tian, Kevin" Cc: Alex Williamson , Christoph Hellwig , Diana Craciun , Cornelia Huck , Kirti Wankhede , Eric Auger , Jason Gunthorpe , "kvm@vger.kernel.org" , Jason Gunthorpe Subject: Re: [PATCH 07/14] vfio: simplify iommu group allocation for mediated devices Message-ID: <20210827054207.GA21797@lst.de> References: <20210826133424.3362-1-hch@lst.de> <20210826133424.3362-8-hch@lst.de> <20210826165921.3736f766.alex.williamson@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Aug 27, 2021 at 02:17:14AM +0000, Tian, Kevin wrote: > > flags suggests to me a bit field, but we can't have EMULATED|NOIOMMU. > > Should this be an enum iommu_type? > > > > and I wonder whether we should also define a type (VFIO_IOMMU) > for the remaining groups which are backed by IOMMU. This can be > set implicitly when the caller doesn't specify a specific type when > creating the group. It's not checked in any place now, but it might > be helpful for readability and diagnostic purpose? or change the > name to noiommu_flags then no confusion on its scope... If we move to a type field we should definitively define a value for the normal case as well. The advantage of the flags is that we can also use it for other needs it it arises. An emum OTOH would be easier to follow.