[libc] Allocate fine-grained memory for the RPC host symbol

Summary:
This pointer has been causing issues. Allocating and reading from coarse
memory on the CPU is not guaranteed and varies depending on the kernel
version and support. Previously we attempted to pin the memory but this
caused unexpected failures. This should be a legal operation and work
around the problem as fine-grained memory should be always legal to
write to by both sides.
This commit is contained in:
Joseph Huber 2023-12-01 13:45:10 -06:00
parent 1a013b61dc
commit 9553e156cb

View File

@ -466,9 +466,10 @@ int load(int argc, char **argv, char **envp, void *image, size_t size,
void *rpc_client_host;
if (hsa_status_t err =
hsa_amd_memory_pool_allocate(coarsegrained_pool, sizeof(void *),
hsa_amd_memory_pool_allocate(finegrained_pool, sizeof(void *),
/*flags=*/0, &rpc_client_host))
handle_error(err);
hsa_amd_agents_allow_access(1, &dev_agent, nullptr, rpc_client_host);
void *rpc_client_dev;
if (hsa_status_t err = hsa_executable_symbol_get_info(