Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1795337pxb; Wed, 9 Feb 2022 04:48:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJylPotANtsaJuI13/OJ0goS4gILT5yQp+FJF9kLyWFuW7IZzBRb3AhcoFxY+gOrI1fxOVoX X-Received: by 2002:a05:6a00:170e:: with SMTP id h14mr2205683pfc.80.1644410914666; Wed, 09 Feb 2022 04:48:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644410914; cv=none; d=google.com; s=arc-20160816; b=QZYAKtoJiHgktRFl8C2ca5B4T8hH7lTN/qK1N0QfrsU/fCBcj/h//BB7vmL2A70ol6 4oXVj7mMszDvX0fUnQtZOM7/lrIjD1pMVEP69OumqFqmrNV83Z+W3OSJdm/iYFxhqdLt odXmxkKX5+1qrpDzOyhZy4et8sP+yYk3VDnGhVcI8wgf0s68uY4/9ihSEhstQhFZPdSN x/PAMfKSXSoMFW+UcKE8Kw00tVHxE9Pe07gbswxquu4nFluUbtcxoVckLdbz0GH0WxK9 eLnn4FLeA53UjPafJjQyEaTXWZrFWPCF8P7IJNGGDC3NLh0yVej+LcYrbDrdsdyS3BmN HAkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vZOTjoHpjqdySNnpiSbzdf1U/pEBM5gwFP3r8yUfZck=; b=jTyXkbbw9P7dD0W40jbVYj5T9FI4YfrjNDlClsf0SIGBGdWRdSUJ/9TzBf4yF9oImB QCiLWUnrG3rbBX2STBuvgvhiWZF5BpWFLW3Vho83h/3cGGcogxI5GrKvVQC+tilHYcFj 5kx9rPajjATC6w3bwPP+ZlZ9lVqN5b5Hs6kj62CGqrE8x1lR8UdINVvJx88JGxySTZst ydHMlELTOlO7At+eRj22/0pekLtncJZPEwIR+er43XVEDthisX8/5d6Fhcxoo/XEymZb QTHGlDoSDn5EK12K937okB7L9wckMQQmSoGm/BEAR7+932x/FQvOWbvEv7lQTbBTqObF Qhlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j13si15781927pgk.413.2022.02.09.04.48.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:48:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 65A41E0A19B5; Wed, 9 Feb 2022 02:29:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237504AbiBIH2I (ORCPT + 99 others); Wed, 9 Feb 2022 02:28:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233163AbiBIH2F (ORCPT ); Wed, 9 Feb 2022 02:28:05 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B647FC0612C3 for ; Tue, 8 Feb 2022 23:28:09 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 10BB668AFE; Wed, 9 Feb 2022 08:28:06 +0100 (CET) Date: Wed, 9 Feb 2022 08:28:05 +0100 From: Christoph Hellwig To: Jani Nikula Cc: Zhi Wang , hch@lst.de, jgg@nvidia.com, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Joonas Lahtinen , Vivi Rodrigo , Zhenyu Wang , Zhi Wang , Terrence Xu Subject: Re: [PATCH v6 1/3] i915/gvt: Introduce the mmio table to support VFIO new mdev API Message-ID: <20220209072805.GA9050@lst.de> References: <20220208111151.13115-1-zhi.a.wang@intel.com> <871r0dqtjf.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871r0dqtjf.fsf@intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 08, 2022 at 05:15:00PM +0200, Jani Nikula wrote: > > #ifdef CONFIG_DRM_I915_GVT > > + > > +#define D_BDW (1 << 0) > > +#define D_SKL (1 << 1) > > +#define D_KBL (1 << 2) > > +#define D_BXT (1 << 3) > > +#define D_CFL (1 << 4) > > + > > +#define D_GEN9PLUS (D_SKL | D_KBL | D_BXT | D_CFL) > > +#define D_GEN8PLUS (D_BDW | D_SKL | D_KBL | D_BXT | D_CFL) > > + > > +#define D_SKL_PLUS (D_SKL | D_KBL | D_BXT | D_CFL) > > +#define D_BDW_PLUS (D_BDW | D_SKL | D_KBL | D_BXT | D_CFL) > > + > > +#define D_PRE_SKL (D_BDW) > > +#define D_ALL (D_BDW | D_SKL | D_KBL | D_BXT | D_CFL) > > If these really need to be in a header in i915/, I think they need to be > longer with some namespacing or something. I do wish these could be > hidden though. I think we could actually kill them off entirely. They are used as arguments to the macros that setup the mmio table. Thefunctions to build these tabls are already organized by families, so we'd need relatively few conditions to just build them the right way. There also are some runtime checks in the callbacks, but they seem entirely superflous as far as I can tell. Only the cmd parser is a bit messy. So maybe we could keep these constants just for the cmd parser inside of gvt for now (and clean that up later) and remove them entirely from the mmio table.