mirror of
https://github.com/torvalds/linux.git
synced 2026-04-24 17:42:27 -04:00
Clear root PT entry and invalidate entire VM's address space when closing the VM. Will prevent the GPU from accessing any of the VM's memory after closing. v2: - s/vma/vm in kernel doc (CI) - Don't nuke migration VM as this occur at driver unload (CI) v3: - Rebase and pull into SVM series (Thomas) - Wait for pending binds (Thomas) v5: - Remove xe_gt_tlb_invalidation_fence_fini in error case (Matt Auld) - Drop local migration bool (Thomas) v7: - Add drm_dev_enter/exit protecting invalidation (CI, Matt Auld) Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250306012657.3505757-12-matthew.brost@intel.com
43 lines
1.2 KiB
C
43 lines
1.2 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2023 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_GT_TLB_INVALIDATION_H_
|
|
#define _XE_GT_TLB_INVALIDATION_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include "xe_gt_tlb_invalidation_types.h"
|
|
|
|
struct xe_gt;
|
|
struct xe_guc;
|
|
struct xe_vm;
|
|
struct xe_vma;
|
|
|
|
int xe_gt_tlb_invalidation_init_early(struct xe_gt *gt);
|
|
|
|
void xe_gt_tlb_invalidation_reset(struct xe_gt *gt);
|
|
int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt);
|
|
int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,
|
|
struct xe_gt_tlb_invalidation_fence *fence,
|
|
struct xe_vma *vma);
|
|
void xe_gt_tlb_invalidation_vm(struct xe_gt *gt, struct xe_vm *vm);
|
|
int xe_gt_tlb_invalidation_range(struct xe_gt *gt,
|
|
struct xe_gt_tlb_invalidation_fence *fence,
|
|
u64 start, u64 end, u32 asid);
|
|
int xe_guc_tlb_invalidation_done_handler(struct xe_guc *guc, u32 *msg, u32 len);
|
|
|
|
void xe_gt_tlb_invalidation_fence_init(struct xe_gt *gt,
|
|
struct xe_gt_tlb_invalidation_fence *fence,
|
|
bool stack);
|
|
void xe_gt_tlb_invalidation_fence_signal(struct xe_gt_tlb_invalidation_fence *fence);
|
|
|
|
static inline void
|
|
xe_gt_tlb_invalidation_fence_wait(struct xe_gt_tlb_invalidation_fence *fence)
|
|
{
|
|
dma_fence_wait(&fence->base, false);
|
|
}
|
|
|
|
#endif /* _XE_GT_TLB_INVALIDATION_ */
|