Added new RPCs to query global affinity space and physical CPU IDs from TOPO session.

This commit is contained in:
Michael Mueller
2024-03-11 14:24:17 +01:00
parent 79bdea2977
commit 6609ad03e6
3 changed files with 25 additions and 1 deletions

View File

@@ -46,4 +46,14 @@ struct Genode::Topo_session_client : Rpc_client<Topo_session>
{ {
call<Rpc_reconstruct>(affinity); call<Rpc_reconstruct>(affinity);
} }
unsigned phys_id(const Affinity::Location &loc) override
{
return call<Rpc_phys_id>(loc);
}
Affinity::Space const global_affinity_space() override
{
return call<Rpc_total_core_count>();
}
}; };

View File

@@ -50,11 +50,15 @@ struct Genode::Topo_session : Session
virtual Topology::Numa_region node_at_id(unsigned node_id) = 0; virtual Topology::Numa_region node_at_id(unsigned node_id) = 0;
virtual unsigned node_count() = 0; virtual unsigned node_count() = 0;
virtual void reconstruct(const Affinity) = 0; virtual void reconstruct(const Affinity) = 0;
virtual unsigned phys_id(Affinity::Location const &) = 0;
virtual Affinity::Space const global_affinity_space() = 0;
GENODE_RPC(Rpc_node_affinity, Topology::Numa_region, node_affinity_of, Affinity::Location const &); GENODE_RPC(Rpc_node_affinity, Topology::Numa_region, node_affinity_of, Affinity::Location const &);
GENODE_RPC(Rpc_node_id, Topology::Numa_region, node_at_id, unsigned); GENODE_RPC(Rpc_node_id, Topology::Numa_region, node_at_id, unsigned);
GENODE_RPC(Rpc_node_count, unsigned, node_count); GENODE_RPC(Rpc_node_count, unsigned, node_count);
GENODE_RPC(Rpc_reconstruct, void, reconstruct, Affinity); GENODE_RPC(Rpc_reconstruct, void, reconstruct, Affinity);
GENODE_RPC(Rpc_phys_id, unsigned, phys_id, Affinity::Location const &);
GENODE_RPC(Rpc_total_core_count, Affinity::Space const, global_affinity_space);
GENODE_RPC_INTERFACE(Rpc_node_affinity, Rpc_node_id, Rpc_node_count, Rpc_reconstruct); GENODE_RPC_INTERFACE(Rpc_node_affinity, Rpc_node_id, Rpc_node_count, Rpc_reconstruct, Rpc_phys_id, Rpc_total_core_count);
}; };

View File

@@ -73,4 +73,14 @@ class Genode::Topo_session_component : public Session_object<Topo_session>
_affinity = affinity; _affinity = affinity;
construct(); construct();
} }
unsigned phys_id(const Affinity::Location &loc) override
{
return platform_specific().kernel_cpu_id(loc);
}
Affinity::Space const global_affinity_space() override
{
return platform_specific().affinity_space();
}
}; };