580.65.06

This commit is contained in:
Maneet Singh
2025-08-04 11:15:02 -07:00
parent d890313300
commit 307159f262
1315 changed files with 477791 additions and 279973 deletions

View File

@@ -781,6 +781,33 @@ uvm_processor_id_t uvm_processor_mask_find_closest_id(uvm_va_space_t *va_space,
UVM_ID_IS_VALID(id); \
uvm_processor_mask_clear(mask, id), id = uvm_processor_mask_find_closest_id(va_space, mask, src))
static bool uvm_va_space_ats_supported(const uvm_va_space_t *va_space)
{
return atomic_read(&va_space->ats.state) == UVM_ATS_VA_SPACE_ATS_SUPPORTED;
}
static bool uvm_va_space_ats_unsupported(const uvm_va_space_t *va_space)
{
return atomic_read(&va_space->ats.state) == UVM_ATS_VA_SPACE_ATS_UNSUPPORTED;
}
static bool uvm_va_space_ats_unset(const uvm_va_space_t *va_space)
{
return atomic_read(&va_space->ats.state) == UVM_ATS_VA_SPACE_ATS_UNSET;
}
static bool uvm_va_space_ats_enabled(const uvm_va_space_t *va_space)
{
UVM_ASSERT(!uvm_va_space_ats_unset(va_space));
return g_uvm_global.ats.enabled && uvm_va_space_ats_supported(va_space);
}
static void uvm_va_space_ats_set(uvm_va_space_t *va_space, uvm_ats_va_space_state_t state)
{
UVM_ASSERT(state != UVM_ATS_VA_SPACE_ATS_UNSET);
atomic_set(&va_space->ats.state, state);
}
// Return the GPU whose memory corresponds to the given node_id
static uvm_gpu_t *uvm_va_space_find_gpu_with_memory_node_id(uvm_va_space_t *va_space, int node_id)
{
@@ -788,7 +815,7 @@ static uvm_gpu_t *uvm_va_space_find_gpu_with_memory_node_id(uvm_va_space_t *va_s
UVM_ASSERT(nv_numa_node_has_memory(node_id));
if (!g_uvm_global.ats.supported)
if (!uvm_va_space_ats_supported(va_space))
return NULL;
for_each_va_space_gpu(gpu, va_space) {
@@ -847,6 +874,8 @@ uvm_user_channel_t *uvm_gpu_va_space_get_user_channel(uvm_gpu_va_space_t *gpu_va
// present, just whether system + VA space support exists.
bool uvm_va_space_pageable_mem_access_supported(uvm_va_space_t *va_space);
bool uvm_va_space_pageable_mem_access_enabled(uvm_va_space_t *va_space);
NV_STATUS uvm_test_get_pageable_mem_access_type(UVM_TEST_GET_PAGEABLE_MEM_ACCESS_TYPE_PARAMS *params,
struct file *filp);
NV_STATUS uvm_test_enable_nvlink_peer_access(UVM_TEST_ENABLE_NVLINK_PEER_ACCESS_PARAMS *params, struct file *filp);
@@ -862,7 +891,7 @@ NV_STATUS uvm_test_va_space_allow_movable_allocations(UVM_TEST_VA_SPACE_ALLOW_MO
// (migrations, cache invalidates, etc.).
//
// Locking:
// - vma->vm_mm->mmap_lock must be held in at least read mode. Note, that
// - vmf->vma->vm_mm->mmap_lock must be held in at least read mode. Note, that
// might not be the same as current->mm->mmap_lock.
// Returns:
// VM_FAULT_NOPAGE: if page was faulted in OK
@@ -870,25 +899,21 @@ NV_STATUS uvm_test_va_space_allow_movable_allocations(UVM_TEST_VA_SPACE_ALLOW_MO
// VM_FAULT_OOM: if system memory wasn't available.
// VM_FAULT_SIGBUS: if a CPU mapping to fault_addr cannot be accessed,
// for example because it's within a range group which is non-migratable.
vm_fault_t uvm_va_space_cpu_fault_managed(uvm_va_space_t *va_space,
struct vm_area_struct *vma,
struct vm_fault *vmf);
vm_fault_t uvm_va_space_cpu_fault_managed(uvm_va_space_t *va_space, struct vm_fault *vmf);
// Handle a CPU fault in the given VA space for a HMM allocation,
// performing any operations necessary to establish a coherent CPU mapping
// (migrations, cache invalidates, etc.).
//
// Locking:
// - vma->vm_mm->mmap_lock must be held in at least read mode. Note, that
// - vmf->vma->vm_mm->mmap_lock must be held in at least read mode. Note, that
// might not be the same as current->mm->mmap_lock.
// Returns:
// VM_FAULT_NOPAGE: if page was faulted in OK
// (possibly or'ed with VM_FAULT_MAJOR if a migration was needed).
// VM_FAULT_OOM: if system memory wasn't available.
// VM_FAULT_SIGBUS: if a CPU mapping to fault_addr cannot be accessed.
vm_fault_t uvm_va_space_cpu_fault_hmm(uvm_va_space_t *va_space,
struct vm_area_struct *vma,
struct vm_fault *vmf);
vm_fault_t uvm_va_space_cpu_fault_hmm(uvm_va_space_t *va_space, struct vm_fault *vmf);
static bool uvm_va_space_has_integrated_gpu(uvm_va_space_t *va_space)
{