1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
This commit is contained in:
Pascal Bauer 2024-09-06 13:28:11 +02:00 committed by Niklas Eiling
parent 6c1a70d44f
commit 7e53452767

View file

@ -55,9 +55,12 @@ void PlatformCard::connectVFIOtoIps(
driver.attach(device);
}
// VFIO Setup
// VFIO Device Setup
std::vector<std::pair<std::shared_ptr<ip::Core>,
std::shared_ptr<kernel::vfio::Device>>>
vfio_ip_pair;
for (auto pair : device_ip_pair) {
auto device = pair.second;
auto [ip, device] = pair;
// Attach group to container
const int iommu_group = device.iommu_group().value();
@ -74,6 +77,14 @@ void PlatformCard::connectVFIOtoIps(
// Add as member
this->vfio_devices.push_back(vfio_device);
// Add return value
vfio_ip_pair.push_back({ip, vfio_device});
}
// Memory Graph
for (auto pair : vfio_ip_pair) {
auto [ip, vfio_device] = pair;
// Map vfio device memory to process
const void *mapping = vfio_device->regionMap(0);
if (mapping == MAP_FAILED) {
@ -90,7 +101,6 @@ void PlatformCard::connectVFIOtoIps(
"process to vfio", srcVertexId, targetVertexId);
logger->debug("create edge from process to {}", vfio_device->getName());
auto ip = pair.first;
// Connect vfio vertex to Reg vertex
connect(vfio_device->getName(), ip);
}