mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-03 12:05:13 +02:00
[ Upstream commit 074e40d9c2 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
#ifndef _XE_PT_H_
|
|
#define _XE_PT_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include "xe_pt_types.h"
|
|
|
|
struct dma_fence;
|
|
struct xe_bo;
|
|
struct xe_device;
|
|
struct xe_exec_queue;
|
|
struct xe_svm_range;
|
|
struct xe_sync_entry;
|
|
struct xe_tile;
|
|
struct xe_vm;
|
|
struct xe_vma;
|
|
struct xe_vma_ops;
|
|
|
|
/* Largest huge pte is currently 1GiB. May become device dependent. */
|
|
#define MAX_HUGEPTE_LEVEL 2
|
|
|
|
#define xe_pt_write(xe, map, idx, data) \
|
|
xe_map_wr(xe, map, (idx) * sizeof(u64), u64, data)
|
|
|
|
unsigned int xe_pt_shift(unsigned int level);
|
|
|
|
struct xe_pt *xe_pt_create(struct xe_vm *vm, struct xe_tile *tile,
|
|
unsigned int level);
|
|
|
|
void xe_pt_populate_empty(struct xe_tile *tile, struct xe_vm *vm,
|
|
struct xe_pt *pt);
|
|
|
|
void xe_pt_destroy(struct xe_pt *pt, u32 flags, struct llist_head *deferred);
|
|
|
|
void xe_pt_clear(struct xe_device *xe, struct xe_pt *pt);
|
|
|
|
int xe_pt_update_ops_prepare(struct xe_tile *tile, struct xe_vma_ops *vops);
|
|
struct dma_fence *xe_pt_update_ops_run(struct xe_tile *tile,
|
|
struct xe_vma_ops *vops);
|
|
void xe_pt_update_ops_fini(struct xe_tile *tile, struct xe_vma_ops *vops);
|
|
void xe_pt_update_ops_abort(struct xe_tile *tile, struct xe_vma_ops *vops);
|
|
|
|
bool xe_pt_zap_ptes(struct xe_tile *tile, struct xe_vma *vma);
|
|
|
|
#endif
|