Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: Assume large page size if VMA not yet bound
Date: Mon, 5 Feb 2024 18:23:14 -0500	[thread overview]
Message-ID: <ZcFt4oK10BuObd1r@intel.com> (raw)
In-Reply-To: <20240205231714.2956225-1-matthew.brost@intel.com>

On Mon, Feb 05, 2024 at 03:17:14PM -0800, Matthew Brost wrote:
> The calculation to determine max page size of a VMA during a REMAP
> operations assumes the VMA has been bound. This assumption is not true
> if the VMA is from an eariler operation in an array of binds. If a VMA
> has not been bound use the maximum page size which will ensure the
> previous / next REMAP operations are not incorrectly skipped.
> 
> Fixes: 8f33b4f054fc ("drm/xe: Avoid doing rebinds")
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_vm.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index 7e29b816c4d4..ed594fa2f8da 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -2200,8 +2200,10 @@ static u64 xe_vma_max_pte_size(struct xe_vma *vma)
>  		return SZ_1G;
>  	else if (vma->gpuva.flags & XE_VMA_PTE_2M)
>  		return SZ_2M;
> +	else if (vma->gpuva.flags & XE_VMA_PTE_4K)
> +		return SZ_4K;

I wonder if we should also have something like:
else if (vma->gpuva.flags & XE_VMA_PTE_1G)
     return SZ_1G;

drm_err("Something wrong with gpuva flags, using max known page anyway\n");
return SZ_1G;

but up to you...

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

>  
> -	return SZ_4K;
> +	return SZ_1G;	/* Uninitialized, used max size */
>  }
>  
>  static u64 xe_vma_set_pte_size(struct xe_vma *vma, u64 size)
> -- 
> 2.34.1
> 

  parent reply	other threads:[~2024-02-05 23:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 23:17 [PATCH] drm/xe: Assume large page size if VMA not yet bound Matthew Brost
2024-02-05 23:19 ` ✓ CI.Patch_applied: success for " Patchwork
2024-02-05 23:20 ` ✗ CI.checkpatch: warning " Patchwork
2024-02-05 23:20 ` ✓ CI.KUnit: success " Patchwork
2024-02-05 23:23 ` Rodrigo Vivi [this message]
2024-02-05 23:48   ` [PATCH] " Matthew Brost
2024-02-05 23:28 ` ✓ CI.Build: success for " Patchwork
2024-02-05 23:28 ` ✓ CI.Hooks: " Patchwork
2024-02-05 23:29 ` ✓ CI.checksparse: " Patchwork
2024-02-05 23:54 ` ✓ CI.BAT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZcFt4oK10BuObd1r@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox