mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
Fix test_pci_bridge host fixture and EDU guest_build linker exports
This commit is contained in:
@ -600,11 +600,11 @@ int nv_rs_pci_bar1_write32(struct nv_rs_pci *p, u64 offset, u32 value)
|
||||
}
|
||||
int nv_rs_pci_bar1_wc_map(struct nv_rs_pci *p, u64 offset, u64 bytes)
|
||||
{
|
||||
int error = 0;
|
||||
if (!p || !bytes || ((offset | bytes) & 0xfff)) return -EINVAL;
|
||||
#if defined(NV_RS_PCI_TEST_EDU) || defined(NV_RS_PCI_HOST_FIXTURE)
|
||||
return -ENODEV;
|
||||
#else
|
||||
int error = 0;
|
||||
mutex_lock(&p->access);
|
||||
if (nv_rs_pci_is_removed(p)) error = -ENODEV;
|
||||
else if (p->bar1_wc) error = -EBUSY;
|
||||
|
||||
@ -201,3 +201,6 @@ static u32 readl(const void *address)
|
||||
#endif
|
||||
}
|
||||
static void writel(u32 value,void*address){mmio_writes++;assert(address>=(void*)mmio&&(char*)address<(char*)mmio+sizeof mmio);*(u32*)address=value;}
|
||||
static inline void writel_relaxed(u32 value, void *address) { writel(value, address); }
|
||||
static inline void iounmap(void *addr) { (void)addr; }
|
||||
static inline void wmb(void) {}
|
||||
|
||||
@ -51,7 +51,7 @@ fi
|
||||
"$RUSTC" $RUSTFLAGS --crate-name nv_rs_core --crate-type=rlib src/nvidia/src/lib.rs --extern nv_rs_abi="$OUT/libnv_rs_abi.rlib" -o "$OUT/libnv_rs_core.rlib"
|
||||
"$RUSTC" $RUSTFLAGS --crate-name vm_rust_backing --crate-type=staticlib -C lto=fat tests/vm/rust_backing.rs --extern nv_rs_abi="$OUT/libnv_rs_abi.rlib" --extern nv_rs_core="$OUT/libnv_rs_core.rlib" -L dependency="$OUT" -o "$OUT/libvm_rust_backing.a"
|
||||
python3 "$ROOT/tools/prepare_kernel_archive.py" "$OUT/libvm_rust_backing.a" "$OUT/libvm_rust_backing.kernel.a"
|
||||
ld -r --gc-sections --whole-archive "$OUT/libvm_rust_backing.kernel.a" --no-whole-archive -u vm_rust_backing -u vm_rust_backing_size -u vm_rust_backing_align -u vm_gpu_lease_size -u vm_gpu_lease_acquire -u vm_gpu_lease_ready -u vm_gpu_lease_drop -u vm_gpu_registers_size -u vm_gpu_registers_acquire -u vm_gpu_registers_read -u vm_gpu_registers_write -u vm_gpu_registers_drop -u vm_gpu_locked_size -u vm_gpu_locked_acquire -u vm_cold_msi_config -u vm_gpu_locked_read -u vm_gpu_locked_write -u vm_gpu_locked_drop -u vm_gpu_waited_acquire -u vm_native_memory -u vm_gpu_registry_probe -u vm_gpu_registry_removed -u vm_nano_timer -u vm_os_event -u vm_device_software -u vm_first_open_cpu_state -u vm_software_manager_init -u vm_software_manager_shutdown -u vm_nano_size -u vm_nano_hold -u vm_nano_removed -u vm_host_services -u vm_host_irq_services -u vm_thread_state -u nv_rs_gpu_state_size -u nv_rs_gpu_state_align -u nv_rs_gpu_prepare_owned -u nv_rs_gpu_set_probe_identity -u nv_rs_gpu_first_open -u nv_rs_gpu_registry_publish -u nv_rs_gpu_registry_retire -u nv_rs_gpu_mark_removed -u nv_rs_gpu_release_driver -u nv_rs_gpu_retry_cleanup -u nv_rs_gpu_retry_gp100_hbm_restore -u nv_rs_gpu_close -u nv_rs_sysmem_state_size -u nv_rs_sysmem_state_align -u nv_rs_sysmem_prepare -u nv_rs_sysmem_allocate -u nv_rs_sysmem_close -u nv_rs_rmapi_state_size -u nv_rs_rmapi_state_align -u nv_rs_rmapi_init -u nv_rs_rmapi_gpu_add -u nv_rs_rmapi_gpu_remove -u nv_rs_rmapi_gpu_minor -u nv_rs_rmapi_gpu_open -u nv_rs_rmapi_attach_register_count -u nv_rs_rmapi_attach_register -u nv_rs_rmapi_gpu_needs_registers -u nv_rs_rmapi_gpu_attach_registers -u nv_rs_rmapi_set_host_bridge -u nv_rs_rmapi_set_cpu_info -u nv_rs_rmapi_set_force_p2p -u nv_rs_rmapi_set_gsp_abi -u nv_rs_rmapi_set_driver_version -u nv_rs_rmapi_set_strict_version_check -u nv_rs_rmapi_get_driver_version -u nv_rs_rmapi_gpu_release -u nv_rs_rmapi_register_fd -u nv_rs_rmapi_prepare -u nv_rs_rmapi_nested_plan -u nv_rs_rmapi_execute -u nv_rs_rmapi_copy_fault -u nv_rs_rmapi_close -u nv_rs_rmapi_rc_recover_fault -u nv_rs_gpu_nice_set_policy -u nv_rs_gpu_nice_get_policy -u nv_rs_gpu_nice_refresh_fallbacks -u nv_rs_gpu_nice_get_row -u nv_rs_gpu_nice_active_count -u nv_rs_gpu_nice_has_tracked -u nv_rs_gpu_nice_list_pids -u nv_rs_gpu_nice_query_pid -u nv_rs_gpu_nice_preview_nice -u nv_rs_gpu_nice_set_pid -u nv_rs_gpu_nice_sync_pid -u nv_rs_gpu_nice_drain -u nv_rs_gpu_nice_desktop_comm -u nv_rs_gpu_nice_copy_custom_comms -u nv_rs_alloc_reg_can_admit -u nv_rs_alloc_reg_insert -u nv_rs_alloc_reg_find -u nv_rs_alloc_reg_retain -u nv_rs_alloc_reg_retain_ptr -u nv_rs_alloc_reg_mark_freed_and_put -u nv_rs_alloc_reg_put_ptr -u nv_rs_alloc_reg_for_each -u nv_rs_alloc_reg_total_pages -u nv_rs_alloc_reg_pop_any -u nv_rs_alloc_reg_release_storage -u nv_rs_dma_reg_find -u nv_rs_dma_reg_insert -u nv_rs_dma_reg_pop_for_alloc -u nv_rs_dma_reg_pop_for_dev -u nv_rs_file_map_insert_alloc -u nv_rs_file_map_insert_io -u nv_rs_file_map_get -u nv_rs_file_map_remove -u nv_rs_gpu_slot_activate -u nv_rs_gpu_slot_deactivate -u nv_rs_gpu_slot_is_live_gen -u nv_rs_gpu_slot_set_numa -u nv_rs_gpu_slot_validate_bar0 -u nv_rs_gpu_slot_validate_bar1 -u nv_rs_modeset_register_gpu -u nv_rs_modeset_unregister_gpu -u nv_rs_sysmem_pool_push -u nv_rs_sysmem_pool_pop -u nv_rs_sysmem_pool_pop_for_trim -u nv_rs_sysmem_pool_len -u nv_rs_sysmem_pool_release_storage -u nv_rs_sysmem_make_uncached -u nv_rs_sysmem_may_release -u nv_rs_pinned_area_bytes -u nv_rs_pinned_range_cache -u nv_rs_pinned_sources_add -o "$OUT/rust_backing.o_binary"
|
||||
ld -r --gc-sections --whole-archive "$OUT/libvm_rust_backing.kernel.a" --no-whole-archive -u vm_rust_backing -u vm_rust_backing_size -u vm_rust_backing_align -u vm_gpu_lease_size -u vm_gpu_lease_acquire -u vm_gpu_lease_ready -u vm_gpu_lease_drop -u vm_gpu_registers_size -u vm_gpu_registers_acquire -u vm_gpu_registers_read -u vm_gpu_registers_write -u vm_gpu_registers_drop -u vm_gpu_locked_size -u vm_gpu_locked_acquire -u vm_cold_msi_config -u vm_gpu_locked_read -u vm_gpu_locked_write -u vm_gpu_locked_drop -u vm_gpu_waited_acquire -u vm_native_memory -u vm_gpu_registry_probe -u vm_gpu_registry_removed -u vm_nano_timer -u vm_os_event -u vm_device_software -u vm_first_open_cpu_state -u vm_software_manager_init -u vm_software_manager_shutdown -u vm_nano_size -u vm_nano_hold -u vm_nano_removed -u vm_host_services -u vm_host_irq_services -u vm_thread_state -u nv_rs_gpu_state_size -u nv_rs_gpu_state_align -u nv_rs_gpu_prepare_owned -u nv_rs_gpu_set_probe_identity -u nv_rs_gpu_first_open -u nv_rs_gpu_registry_publish -u nv_rs_gpu_registry_retire -u nv_rs_gpu_mark_removed -u nv_rs_gpu_release_driver -u nv_rs_gpu_retry_cleanup -u nv_rs_gpu_retry_gp100_hbm_restore -u nv_rs_gpu_close -u nv_rs_sysmem_state_size -u nv_rs_sysmem_state_align -u nv_rs_sysmem_prepare -u nv_rs_sysmem_allocate -u nv_rs_sysmem_close -u nv_rs_rmapi_state_size -u nv_rs_rmapi_state_align -u nv_rs_rmapi_init -u nv_rs_rmapi_gpu_add -u nv_rs_rmapi_gpu_remove -u nv_rs_rmapi_gpu_minor -u nv_rs_rmapi_gpu_open -u nv_rs_rmapi_attach_register_count -u nv_rs_rmapi_attach_register -u nv_rs_rmapi_gpu_needs_registers -u nv_rs_rmapi_gpu_attach_registers -u nv_rs_rmapi_set_host_bridge -u nv_rs_rmapi_set_cpu_info -u nv_rs_rmapi_set_force_p2p -u nv_rs_rmapi_set_gsp_abi -u nv_rs_rmapi_set_driver_version -u nv_rs_rmapi_set_strict_version_check -u nv_rs_rmapi_get_driver_version -u nv_rs_rmapi_gpu_release -u nv_rs_rmapi_register_fd -u nv_rs_rmapi_prepare -u nv_rs_rmapi_nested_plan -u nv_rs_rmapi_execute -u nv_rs_rmapi_copy_fault -u nv_rs_rmapi_close -u nv_rs_rmapi_rc_recover_fault -u nv_rs_gpu_nice_set_policy -u nv_rs_gpu_nice_get_policy -u nv_rs_gpu_nice_refresh_fallbacks -u nv_rs_gpu_nice_get_row -u nv_rs_gpu_nice_active_count -u nv_rs_gpu_nice_has_tracked -u nv_rs_gpu_nice_list_pids -u nv_rs_gpu_nice_query_pid -u nv_rs_gpu_nice_preview_nice -u nv_rs_gpu_nice_set_pid -u nv_rs_gpu_nice_sync_pid -u nv_rs_gpu_nice_drain -u nv_rs_gpu_nice_desktop_comm -u nv_rs_gpu_nice_copy_custom_comms -u nv_rs_alloc_reg_can_admit -u nv_rs_alloc_reg_insert -u nv_rs_alloc_reg_find -u nv_rs_alloc_reg_retain -u nv_rs_alloc_reg_retain_ptr -u nv_rs_alloc_reg_mark_freed_and_put -u nv_rs_alloc_reg_put_ptr -u nv_rs_alloc_reg_for_each -u nv_rs_alloc_reg_total_pages -u nv_rs_alloc_reg_pop_any -u nv_rs_alloc_reg_release_storage -u nv_rs_dma_reg_find -u nv_rs_dma_reg_insert -u nv_rs_dma_reg_pop_for_alloc -u nv_rs_dma_reg_pop_for_dev -u nv_rs_file_map_insert_alloc -u nv_rs_file_map_insert_io -u nv_rs_file_map_insert_io_scatter -u nv_rs_file_map_get -u nv_rs_file_map_take -u nv_rs_file_map_remove -u nv_rs_gpu_slot_activate -u nv_rs_gpu_slot_deactivate -u nv_rs_gpu_slot_is_live_gen -u nv_rs_gpu_slot_set_numa -u nv_rs_gpu_slot_validate_bar0 -u nv_rs_gpu_slot_validate_bar1 -u nv_rs_modeset_register_gpu -u nv_rs_modeset_unregister_gpu -u nv_rs_sysmem_pool_push -u nv_rs_sysmem_pool_pop -u nv_rs_sysmem_pool_pop_for_trim -u nv_rs_sysmem_pool_len -u nv_rs_sysmem_pool_release_storage -u nv_rs_sysmem_make_uncached -u nv_rs_sysmem_may_release -u nv_rs_pinned_area_bytes -u nv_rs_pinned_range_cache -u nv_rs_pinned_sources_add -o "$OUT/rust_backing.o_binary"
|
||||
# --strip-debug: with -C lto=fat the object carries core's DWARF, which pahole cannot encode
|
||||
# when the kernel builds module BTF (same failure #42 fixed for the production module).
|
||||
objcopy --strip-debug --remove-section=.llvmbc --remove-section=.llvmcmd --remove-section=.eh_frame --remove-section=.eh_frame_hdr --remove-section=.gcc_except_table "$OUT/rust_backing.o_binary"
|
||||
|
||||
Reference in New Issue
Block a user