qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* MMIO through IOMMU from a TCG processor
@ 2025-10-08 12:38 Mark Burton
  2025-10-09  8:43 ` Mark Cave-Ayland
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Burton @ 2025-10-08 12:38 UTC (permalink / raw)
  To: QEMU Developers, peterx, eric.auger, zhenzhong.duan,
	alejandro.j.jimenez, peter.maydell, jasowang, pbonzini, tjeznach,
	steven.sistare, clement.mathieu--drif, joao.m.martins,
	ean-philippe, jean-philippe, sarunkod, Phil Mathieu-Daudé

All, sorry for the wide CC, I’m trying to find somebody who understands this corder of the code…. This is perhaps a obscure, but I think it should work.
I am trying to access an MMIO region through an IOMMU, from TCG.
The IOMMU translation has provided an address space that is different from the CPU’s own address space.

In address_space_translate_for_iotlb the section is calculated using the address space provide by the IOMMU translation.
> d = flatview_to_dispatch(address_space_to_flatview(iotlb.target_as));
> 
Later, we come to do the actual access (via e.g. do_st_mmio_leN), and at this point we pick up the cpu’s address spaces in iotlb_to_section, which is different, and the recorded section therefore seems to be incorrect.

> CPUAddressSpace *cpuas = &cpu->cpu_ases[asidx];
> AddressSpaceDispatch *d = cpuas->memory_dispatch;
> int section_index = index & ~TARGET_PAGE_MASK;
> MemoryRegionSection *ret;
> 
> assert(section_index < d->map.sections_nb);
> ret = d->map.sections + section_index;

What I don’t fully understand is how this is supposed to work….?

Have I missed something obvious?

Cheers
Mark.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-10  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-08 12:38 MMIO through IOMMU from a TCG processor Mark Burton
2025-10-09  8:43 ` Mark Cave-Ayland
2025-10-09  9:10   ` Mark Burton
2025-10-09 18:07     ` Pierrick Bouvier
2025-10-10  8:53       ` Mark Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).