Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Arvind Yadav <arvind.yadav@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	<himal.prasad.ghimiray@intel.com>,
	<thomas.hellstrom@linux.intel.com>
Subject: Re: [RFC v2 1/7] drm/xe/vm: Track CPU_AUTORESET state in xe_vma
Date: Wed, 29 Apr 2026 21:07:24 -0700	[thread overview]
Message-ID: <afLVfDml8ozfA6Te@gsse-cloud1.jf.intel.com> (raw)
In-Reply-To: <20260406085830.1118431-2-arvind.yadav@intel.com>

On Mon, Apr 06, 2026 at 02:28:24PM +0530, Arvind Yadav wrote:
> Track MADVISE_AUTORESET CPU-only state in struct xe_vma with a dedicated
> cpu_autoreset_active bool.
> 
> Add XE_VMA_CPU_AUTORESET_ACTIVE as a pipeline-only bit to carry this
> state through MAP/REMAP operations. Runtime state lives in
> xe_vma.cpu_autoreset_active rather than vma->gpuva.flags.
> 
> The state is set at bind time and cleared on the first successful GPU
> fault.
> 
> v2:
>   - Move runtime state from gpuva.flags to xe_vma bool. (Matt)
>   - Keep XE_VMA_CPU_AUTORESET_ACTIVE pipeline-only. (Matt)
> 
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_vm.h       |  5 +++++
>  drivers/gpu/drm/xe/xe_vm_types.h | 10 ++++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.h b/drivers/gpu/drm/xe/xe_vm.h
> index c5b900f38ded..bdf42083da86 100644
> --- a/drivers/gpu/drm/xe/xe_vm.h
> +++ b/drivers/gpu/drm/xe/xe_vm.h
> @@ -181,6 +181,11 @@ static inline bool xe_vma_is_userptr(struct xe_vma *vma)
>  		!xe_vma_is_cpu_addr_mirror(vma);
>  }
>  

Kernel doc

> +static inline bool xe_vma_has_cpu_autoreset_active(const struct xe_vma *vma)
> +{

	lockdep_assert_held(&vm->lock);

?

Matt

> +	return vma->cpu_autoreset_active;
> +}
> +
>  struct xe_vma *xe_vm_find_vma_by_addr(struct xe_vm *vm, u64 page_addr);
>  
>  int xe_vma_need_vram_for_atomic(struct xe_device *xe, struct xe_vma *vma, bool is_atomic);
> diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h
> index a94827d7fbec..6a19ecca5518 100644
> --- a/drivers/gpu/drm/xe/xe_vm_types.h
> +++ b/drivers/gpu/drm/xe/xe_vm_types.h
> @@ -52,6 +52,8 @@ struct xe_vm_pgtable_update_op;
>  #define XE_VMA_DUMPABLE		(DRM_GPUVA_USERBITS << 8)
>  #define XE_VMA_SYSTEM_ALLOCATOR	(DRM_GPUVA_USERBITS << 9)
>  #define XE_VMA_MADV_AUTORESET	(DRM_GPUVA_USERBITS << 10)
> +/* Pipeline-only bit used to carry cpu_autoreset_active through MAP/REMAP. */
> +#define XE_VMA_CPU_AUTORESET_ACTIVE	(DRM_GPUVA_USERBITS << 11)
>  
>  /**
>   * struct xe_vma_mem_attr - memory attributes associated with vma
> @@ -157,6 +159,14 @@ struct xe_vma {
>  	/** @tile_staged: bind is staged for this VMA */
>  	u8 tile_staged;
>  
> +	/**
> +	 * @cpu_autoreset_active: CPU mirror VMA is still CPU-only.
> +	 *
> +	 * Set at bind time and cleared on the first successful GPU fault.
> +	 * Protected by vm->lock.
> +	 */
> +	bool cpu_autoreset_active;
> +
>  	/**
>  	 * @skip_invalidation: Used in madvise to avoid invalidation
>  	 * if mem attributes doesn't change
> -- 
> 2.43.0
> 

  reply	other threads:[~2026-04-30  4:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06  8:58 [RFC v2 0/7] drm/xe/svm: Add MMU notifier-based madvise autoreset on munmap Arvind Yadav
2026-04-06  8:58 ` [RFC v2 1/7] drm/xe/vm: Track CPU_AUTORESET state in xe_vma Arvind Yadav
2026-04-30  4:07   ` Matthew Brost [this message]
2026-04-06  8:58 ` [RFC v2 2/7] drm/xe/vm: Preserve cpu_autoreset_active across GPUVA operations Arvind Yadav
2026-04-30  4:29   ` Matthew Brost
2026-04-06  8:58 ` [RFC v2 3/7] drm/xe/svm: Clear CPU_AUTORESET_ACTIVE on first GPU fault Arvind Yadav
2026-04-30  4:26   ` Matthew Brost
2026-04-06  8:58 ` [RFC v2 4/7] drm/xe/vm: Add madvise autoreset interval notifier worker infrastructure Arvind Yadav
2026-04-06  8:58 ` [RFC v2 5/7] drm/xe/vm: Deactivate madvise notifier on GPU touch Arvind Yadav
2026-04-06  8:58 ` [RFC v2 6/7] drm/xe/vm: Wire MADVISE_AUTORESET notifiers into VM lifecycle Arvind Yadav
2026-04-06  8:58 ` [RFC v2 7/7] drm/xe/svm: Correct memory attribute reset for partial unmap Arvind Yadav
2026-04-30  5:02   ` Matthew Brost
2026-04-30  5:08     ` Matthew Brost
2026-04-06  9:04 ` ✗ CI.checkpatch: warning for drm/xe/svm: Add MMU notifier-based madvise autoreset on munmap (rev2) Patchwork
2026-04-06  9:06 ` ✓ CI.KUnit: success " Patchwork
2026-04-06  9:54 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-06 12:36 ` ✓ Xe.CI.FULL: " 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=afLVfDml8ozfA6Te@gsse-cloud1.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=arvind.yadav@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=thomas.hellstrom@linux.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