Skip to content

Commit 31f87ca

Browse files
committed
[+] Update: Remove legacy rebase functionality for GPU ring buffer map pointers, replacing it with a no-op placeholder for clarity in the nv_attach_impl class.
1 parent 2bf1866 commit 31f87ca

File tree

1 file changed

+2
-44
lines changed

1 file changed

+2
-44
lines changed

attach/nv_attach_impl/nv_attach_impl.cpp

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include "frida-gum.h"
66

77
#include "nvPTXCompiler.h"
8-
#include <bpftime_shm_internal.hpp>
9-
#include "bpf_map/gpu/nv_gpu_ringbuf_map.hpp"
108
#include "nv_attach_private_data.hpp"
119
#include "nv_attach_utils.hpp"
1210
#include "spdlog/spdlog.h"
@@ -135,7 +133,6 @@ int nv_attach_impl::create_attach_with_ebpf_callback(
135133

136134
hook_entries[id] = std::move(entry);
137135
this->map_basic_info = data.map_basic_info;
138-
this->rebase_gpu_ringbuf_map_buffers();
139136
this->shared_mem_ptr = data.comm_shared_mem;
140137
SPDLOG_INFO("Recorded pass {} for func {}",
141138
matched->executable_path.c_str(), func_name);
@@ -676,47 +673,8 @@ int nv_attach_impl::run_attach_entry_on_gpu(int attach_id, int run_count,
676673

677674
void nv_attach_impl::rebase_gpu_ringbuf_map_buffers()
678675
{
679-
if (!this->map_basic_info.has_value())
680-
return;
681-
auto manager = shm_holder.global_shared_memory.get_manager();
682-
if (!manager) {
683-
SPDLOG_WARN(
684-
"Unable to rebase GPU ringbuf pointers: handler manager missing");
685-
return;
686-
}
687-
auto &infos = *this->map_basic_info;
688-
const size_t limit = std::min(infos.size(), manager->size());
689-
for (size_t fd = 0; fd < limit; ++fd) {
690-
auto &info = infos[fd];
691-
if (!info.enabled ||
692-
info.map_type !=
693-
(int)bpf_map_type::BPF_MAP_TYPE_GPU_RINGBUF_MAP)
694-
continue;
695-
if (!manager->is_allocated(fd))
696-
continue;
697-
const auto &handler_variant = manager->get_handler(fd);
698-
if (!std::holds_alternative<bpf_map_handler>(handler_variant)) {
699-
SPDLOG_WARN(
700-
"Map info entry {} expected map handler but found different type",
701-
fd);
702-
continue;
703-
}
704-
const auto &handler =
705-
std::get<bpf_map_handler>(handler_variant);
706-
auto impl_opt = handler.try_get_nv_gpu_ringbuf_map_impl();
707-
if (!impl_opt) {
708-
SPDLOG_WARN(
709-
"Failed to obtain nv_gpu_ringbuf_map_impl for fd {} while rebasing pointers",
710-
fd);
711-
continue;
712-
}
713-
auto buffer_ptr = reinterpret_cast<void *>(
714-
static_cast<uintptr_t>(impl_opt.value()->get_gpu_mem_buffer()));
715-
info.extra_buffer = buffer_ptr;
716-
SPDLOG_DEBUG(
717-
"Rebased GPU ringbuf map fd {} extra_buffer to {:x}",
718-
fd, (uintptr_t)buffer_ptr);
719-
}
676+
SPDLOG_DEBUG(
677+
"nv_attach_impl::rebase_gpu_ringbuf_map_buffers is a no-op (legacy placeholder)");
720678
}
721679

722680
void nv_attach_impl::mirror_cuda_memcpy_to_symbol(

0 commit comments

Comments
 (0)