[PATCH v1 1/1] drm/xe/vf: Allow VF direct access to extended registers

Matt Roper matthew.d.roper at intel.com
Mon Dec 16 22:20:43 UTC 2024


On Fri, Dec 06, 2024 at 02:39:29PM +0100, Piórkowski, Piotr wrote:
> From: Piotr Piórkowski <piotr.piorkowski at intel.com>
> 
> While VF by default does not have access to regular registers except
> allowed ones, the rule is reversed for extended registers - VF has
> access to all except forbidden ones.
> So let's allow direct access for extended registers by default.

The plan is to delete the whole mmio_ext thing completely.  It really
never should have landed in the first place since it's not used anywhere
today, and we don't plan to ever use it in the future either now that
we've cleaned up the driver's register access design.

If platforms have separate register areas (either in the same iomap or
in a different iomap), then the proper implementation is so just create
a dedicated xe_mmio representing those, and then provide proper offsets
into that region.  If there are characteristics of the region as a whole
(i.e., registers for the new "Foo" IP unit can always be accessed from
SRIOV VF's), then that's the kind of thing we'll want to track as a flag
on the xe_mmio itself rather than the individual registers.


Matt

> 
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_mmio.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
> index a48f239cad1c..b6f64b78deda 100644
> --- a/drivers/gpu/drm/xe/xe_mmio.c
> +++ b/drivers/gpu/drm/xe/xe_mmio.c
> @@ -233,7 +233,7 @@ void xe_mmio_write32(struct xe_mmio *mmio, struct xe_reg reg, u32 val)
>  
>  	trace_xe_reg_rw(mmio, true, addr, val, sizeof(val));
>  
> -	if (!reg.vf && mmio->sriov_vf_gt)
> +	if (!reg.ext && !reg.vf && mmio->sriov_vf_gt)
>  		xe_gt_sriov_vf_write32(mmio->sriov_vf_gt, reg, val);
>  	else
>  		writel(val, mmio->regs + addr);
> @@ -247,7 +247,7 @@ u32 xe_mmio_read32(struct xe_mmio *mmio, struct xe_reg reg)
>  	/* Wa_15015404425 */
>  	mmio_flush_pending_writes(mmio);
>  
> -	if (!reg.vf && mmio->sriov_vf_gt)
> +	if (!reg.ext && !reg.vf && mmio->sriov_vf_gt)
>  		val = xe_gt_sriov_vf_read32(mmio->sriov_vf_gt, reg);
>  	else
>  		val = readl(mmio->regs + addr);
> -- 
> 2.34.1
> 

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


More information about the Intel-xe mailing list