[Intel-xe] [PATCH v6 1/5] drm/xe/pat: trim the xelp PAT table

Matt Roper matthew.d.roper at intel.com
Thu Sep 28 16:38:39 UTC 2023


On Thu, Sep 28, 2023 at 08:04:18AM -0500, Lucas De Marchi wrote:
> On Thu, Sep 28, 2023 at 11:05:39AM +0100, Matthew Auld wrote:
> > We don't seem to use the 4-7 pat indexes, even though they are defined
> > by the HW. In the next patch userspace will be able to directly set the
> > pat_index as part of vm_bind and we don't want to allow setting 4-7.
> > Simplest is to just ignore them here.
> 
> But why do we want to leave them in un-programmed state? Wouldn't it be
> more future-proof we we program them to something like UC?

By reducing the table here, we prevent these indices from being used by
the uapi, so it's impossible for userspace to ask for them.  PAT only
gets used through the uapi and can't be specified inside instructions
like MOCS can. 

Also, even if we did think there was some way for userspace to get
around us and accidentally utilize these, the hardware defaults are
already set the way we want (maximal caching).  Maximal caching is also
the strategy we use for uninitialized MOCS entries because the
expectation is that userspace is a bit less likely to see a regression
if unused entries become used in the future and switch from more cached
to less cached than they are if they change in the other direction.


Matt

> 
> Lucas De Marchi
> 
> > 
> > Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> > Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> > Cc: Pallavi Mishra <pallavi.mishra at intel.com>
> > Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> > Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_pat.c | 4 ----
> > 1 file changed, 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
> > index 869aee64641f..36b79d675e54 100644
> > --- a/drivers/gpu/drm/xe/xe_pat.c
> > +++ b/drivers/gpu/drm/xe/xe_pat.c
> > @@ -42,10 +42,6 @@ static const u32 xelp_pat_table[] = {
> > 	[1] = XELP_PAT_WC,
> > 	[2] = XELP_PAT_WT,
> > 	[3] = XELP_PAT_UC,
> > -	[4] = XELP_PAT_WB,
> > -	[5] = XELP_PAT_WB,
> > -	[6] = XELP_PAT_WB,
> > -	[7] = XELP_PAT_WB,
> > };
> > 
> > static const u32 xehpc_pat_table[] = {
> > -- 
> > 2.41.0
> > 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list