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_HELO_NONE,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 1FC5AC04AAF for ; Thu, 16 May 2019 18:31:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBB5820818 for ; Thu, 16 May 2019 18:31:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728776AbfEPSbN (ORCPT ); Thu, 16 May 2019 14:31:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40866 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbfEPSbM (ORCPT ); Thu, 16 May 2019 14:31:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1DD5317914E; Thu, 16 May 2019 18:31:04 +0000 (UTC) Received: from x1.home (ovpn-117-92.phx2.redhat.com [10.3.117.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E2715D9CC; Thu, 16 May 2019 18:31:00 +0000 (UTC) Date: Thu, 16 May 2019 12:31:00 -0600 From: Alex Williamson To: Pierre Morel Cc: sebott@linux.vnet.ibm.com, gerald.schaefer@de.ibm.com, pasic@linux.vnet.ibm.com, borntraeger@de.ibm.com, walling@linux.ibm.com, linux-s390@vger.kernel.org, iommu@lists.linux-foundation.org, joro@8bytes.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Subject: Re: [PATCH 2/4] vfio: vfio_iommu_type1: Define VFIO_IOMMU_INFO_CAPABILITIES Message-ID: <20190516123100.529f06be@x1.home> In-Reply-To: <1557476555-20256-3-git-send-email-pmorel@linux.ibm.com> References: <1557476555-20256-1-git-send-email-pmorel@linux.ibm.com> <1557476555-20256-3-git-send-email-pmorel@linux.ibm.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 16 May 2019 18:31:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 May 2019 10:22:33 +0200 Pierre Morel wrote: > To use the VFIO_IOMMU_GET_INFO to retrieve IOMMU specific information, > we define a new flag VFIO_IOMMU_INFO_CAPABILITIES in the > vfio_iommu_type1_info structure and the associated capability > information block. > > Signed-off-by: Pierre Morel > --- > include/uapi/linux/vfio.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index 8f10748..8f68e0f 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -715,6 +715,16 @@ struct vfio_iommu_type1_info { > __u32 flags; > #define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */ > __u64 iova_pgsizes; /* Bitmap of supported page sizes */ > +#define VFIO_IOMMU_INFO_CAPABILITIES (1 << 1) /* support capabilities info */ > + __u64 cap_offset; /* Offset within info struct of first cap */ > +}; > + > +#define VFIO_IOMMU_INFO_CAP_QFN 1 > +#define VFIO_IOMMU_INFO_CAP_QGRP 2 Descriptions? > + > +struct vfio_iommu_type1_info_block { > + struct vfio_info_cap_header header; > + __u32 data[]; > }; > > #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) This is just a blob of data, what's the API? How do we revision it? How does the user know how to interpret it? Dumping kernel internal structures out to userspace like this is not acceptable, define a user API. Thanks, Alex