|
| SCP_LOGGER (()) |
|
MemTxResult | qemu_io_read (uint64_t addr, uint64_t *val, unsigned int size, MemTxAttrs attrs) |
|
MemTxResult | qemu_io_write (uint64_t addr, uint64_t val, unsigned int size, MemTxAttrs attrs) |
|
| QemuInitiatorSocket (const char *name, QemuInitiatorIface &initiator, QemuInstance &inst) |
|
void | init (qemu::Device &dev, const char *prop) |
|
void | end_of_simulation () |
|
void | qemu_map (qemu::MemoryListener &listener, uint64_t addr, uint64_t len) |
|
void | init_global (qemu::Device &dev) |
|
void | cancel_all () |
|
virtual tlm::tlm_sync_enum | nb_transport_bw (tlm::tlm_generic_payload &trans, tlm::tlm_phase &phase, sc_core::sc_time &t) |
|
virtual AliasesIterator | remove_alias (AliasesIterator it) |
|
virtual void | invalidate_direct_mem_ptr (sc_dt::uint64 start_range, sc_dt::uint64 end_range) |
|
virtual void | reset () |
|
|
void | init_payload (TlmPayload &trans, tlm::tlm_command command, uint64_t addr, uint64_t *val, unsigned int size) |
|
void | add_dmi_mr_alias (DmiRegionAlias::Ptr alias) |
|
void | del_dmi_mr_alias (const DmiRegionAlias::Ptr alias) |
|
void | dmi_translate (qemu::IOMMUMemoryRegion::IOMMUTLBEntry *te, std::shared_ptr< qemu::IOMMUMemoryRegion > iommumr, uint64_t base_addr, uint64_t addr, qemu::IOMMUMemoryRegion::IOMMUAccessFlags flags, int idx) |
| Use DMI data to set up a qemu IOMMU translate.
|
|
tlm::tlm_dmi | check_dmi_hint_locked (TlmPayload &trans) |
| Request a DMI region, ask the QEMU instance DMI manager for a DMI region alias for it and map it on the CPU address space.
|
|
void | check_qemu_mr_hint (TlmPayload &trans) |
|
void | do_regular_access (TlmPayload &trans) |
|
void | do_debug_access (TlmPayload &trans) |
|
void | do_direct_access (TlmPayload &trans) |
|
MemTxResult | qemu_io_access (tlm::tlm_command command, uint64_t addr, uint64_t *val, unsigned int size, MemTxAttrs attrs) |
|
template<
unsigned int BUSWIDTH = DEFAULT_TLM_BUSWIDTH>
class QemuInitiatorSocket< BUSWIDTH >
TLM-2.0 initiator socket specialisation for QEMU AddressSpace mapping.
This class is used to expose a QEMU AddressSpace object as a standard TLM-2.0 initiator socket. It creates a root memory region to map the whole address space, receives I/O accesses to it and forwards them as standard TLM-2.0 transactions.
Request a DMI region, ask the QEMU instance DMI manager for a DMI region alias for it and map it on the CPU address space.
- Parameters
-
trans | DMI allowed transation |
Ideal, the whole operation could be done on the SystemC thread for simplicity. Unfortunately, QEMU misbehaves if the memory region alias subregion is mapped on the root MR by another thread than the CPU thread. This is related to some internal QEMU code taking different paths depending on the current thread. Basically if the subregion add is not done on the CPU thread, the modification won't be visible immediately by the CPU so the next memory access may go through the I/O path again.
On the other hand we SHOULD do a bunch on the SystemC thread to ensure validity of the DMI region and thus the alias until the point where we effectively map the alias onto the root MR. This is why we first create the alias on the SystemC thread and return it to the CPU thread. Once we're back to the CPU thread, we lock the DMI manager again and check for the alias validity flag. If an invalidation happened in between, this flag will be false and we know we can throw the entire DMI request.
If the alias is valid after we took the lock, we can map it. If an invalidation must occur, it will be done after we release the lock.
- Note
- We choose to protect all such areas with a mutex, allowing us to process everything on the QEMU thread.
- See also
- QemuInstanceDmiManager for more information on why we need a global MR per DMI region.
- Note
- All DMI activity MUST happen from the CPU thread (from an MMIO read/write or 'safe work') For 7.2 this may need to be safe aync work ????????
-
Needs to be called with iothread locked as it will be doing several updates and we dont want multiple DMI's
- Returns
- The DMI descriptor for the corresponding DMI region - this is used to help construct memory maps only.