quic/qbox
|
Handles the DMI regions at the QEMU instance level. More...
#include <dmi-manager.h>
Classes | |
class | DmiRegion |
a DMI region More... | |
class | DmiRegionAlias |
An alias to a DMI region. More... | |
class | QemuContainer |
Public Member Functions | |
void | get_region (const tlm::tlm_dmi &info, int fd=-1) |
This regions are added as subregions of the manager root memory region container. They can overlap, hence we use the priority mechanism provided by QEMU. | |
QemuInstanceDmiManager (qemu::LibQemu &inst) | |
QemuInstanceDmiManager (const QemuInstanceDmiManager &)=delete | |
QemuInstanceDmiManager (QemuInstanceDmiManager &&a)=delete | |
void | init () |
DmiRegionAlias::Ptr | get_new_region_alias (const tlm::tlm_dmi &info, int fd=-1) |
Create a new alias for the DMI region designated by info | |
Protected Types | |
using | DmiRegionMap = std::map< DmiRegion::Key, DmiRegion > |
Protected Attributes | |
qemu::LibQemu & | m_inst |
QemuContainer | m_root_container |
qemu::MemoryRegion | m_root |
The DMI manager maintains a "container" memory region as a root where "RAM" memory regions are added to as subregions. The subregions can overlap using the priority mechanism provided by QEMU. These "RAM" memory regions are transparent to clients of the DMI manager, and all aliases requested are built upon the root "container" memory region. | |
std::mutex | m_mutex |
DmiRegionMap | m_regions |
A copy of each RAM memory region is kept here. Another is stored in the m_root.m_subregions vector. To make sure a DmiRegion gets removed, remove it both from here and from the m_root.m_subregions . | |
Handles the DMI regions at the QEMU instance level.
This class handles the DMI regions at the level of a QEMU instance. For a given DMI region, we need to use a unique memory region (called the global memory region, in a sense that it is global to all the CPUs in the instance). Each CPU is then supposed to create an alias to this region to be able to access it. This is required to ensure QEMU sees this region as a unique piece of memory. Creating multiple regions mapping to the same host address leads QEMU into thinking that those are different data, and it won't properly invalidate corresponding TBs if CPUs do SMC (self modifying code).
NB this class's members should be called wil holding the QEMU IOTHREAD lock