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=-6.8 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 98E54C32753 for ; Wed, 31 Jul 2019 15:47:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A3AE21849 for ; Wed, 31 Jul 2019 15:47:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730196AbfGaPrN (ORCPT ); Wed, 31 Jul 2019 11:47:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8701 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730177AbfGaPrM (ORCPT ); Wed, 31 Jul 2019 11:47:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 318DE2D1CE; Wed, 31 Jul 2019 15:47:12 +0000 (UTC) Received: from gondolin (dhcp-192-232.str.redhat.com [10.33.192.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F6E55C1B5; Wed, 31 Jul 2019 15:47:11 +0000 (UTC) Date: Wed, 31 Jul 2019 17:47:09 +0200 From: Cornelia Huck To: Alex Williamson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfio: re-arrange vfio region definitions Message-ID: <20190731174709.471126e6.cohuck@redhat.com> In-Reply-To: <20190717114956.16263-1-cohuck@redhat.com> References: <20190717114956.16263-1-cohuck@redhat.com> Organization: Red Hat GmbH 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 31 Jul 2019 15:47:12 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, 17 Jul 2019 13:49:56 +0200 Cornelia Huck wrote: > It is easy to miss already defined region types. Let's re-arrange > the definitions a bit and add more comments to make it hopefully > a bit clearer. > > No functional change. > > Signed-off-by: Cornelia Huck > --- > include/uapi/linux/vfio.h | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) Friendly ping :) > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index 8f10748dac79..d9bcf40240be 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -295,15 +295,23 @@ struct vfio_region_info_cap_type { > __u32 subtype; /* type specific */ > }; > > +/* > + * List of region types, global per bus driver. > + * If you introduce a new type, please add it here. > + */ > + > +/* PCI region type containing a PCI vendor part */ > #define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31) > #define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff) > +#define VFIO_REGION_TYPE_GFX (1) > +#define VFIO_REGION_TYPE_CCW (2) > > -/* 8086 Vendor sub-types */ > +/* 8086 vendor PCI sub-types */ > #define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1) > #define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2) > #define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3) > > -#define VFIO_REGION_TYPE_GFX (1) > +/* GFX sub-types */ > #define VFIO_REGION_SUBTYPE_GFX_EDID (1) > > /** > @@ -353,20 +361,17 @@ struct vfio_region_gfx_edid { > #define VFIO_DEVICE_GFX_LINK_STATE_DOWN 2 > }; > > -#define VFIO_REGION_TYPE_CCW (2) > /* ccw sub-types */ > #define VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD (1) > > +/* 10de vendor PCI sub-types */ > /* > - * 10de vendor sub-type > - * > * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space. > */ > #define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1) > > +/* 1014 vendor PCI sub-types*/ > /* > - * 1014 vendor sub-type > - * > * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU > * to do TLB invalidation on a GPU. > */