HYBRID: memory mapped IO
Hi Guys,
ich_force_enable_hpet() in linux wants to do mmio. It calls ioremap_pte_range to map phys addr to a VA. Xen then updates the PV dom0's L1 with requested io attributes. I'm trying to figure how to do this for PV in HVM container. I was hoping to update the EPT directly.
I was thinking of just doing guest_physmap_add_entry() but the mfn is not going to be valid. Is there any other code path that will let me do this?
Another possiblity would be handle_mmio().
thanks,
Mukesh
Quoted 6 lines · Mukesh Rathor
Hi Guys,
ich_force_enable_hpet()in linux wants to do mmio. It callsioremap_pte_rangeto map phys addr to a VA. Xen then updates the PV dom0's L1 with requested io attributes. I'm trying to figure how to do this for PV in HVM container. I was hoping to update the EPT directly.
This issue is going to come up with all the PCI devices too, isn't it? Dom0 is going to read/write the PCI config space and ioremap the memory of the device, memory that is not part of the EPT pagetables yet. This issue also happens every time an HVM guest tries to remap a memory region of a passed through PCI device.
In this case QEMU calls xc_domain_memory_mapping, that in Xen becomes XEN_DOMCTL_memory_mapping, that is implemented as set_mmio_p2m_entry. So maybe you just need to call set_mmio_p2m_entry.
Quoted 2 lines
I was thinking of just doing
guest_physmap_add_entry()but the mfn is not going to be valid. Is there any other code path that will let me do this?
Why the mfn is not going to be valid?
Shouldn't dom0 be able to find out exactly where the hpet is?
Quoted 1 line
Another possiblity would be
handle_mmio().
I would avoid that if possible.
Quoted 3 lines · On Wed, 15 Feb 2012 11:49:59 +0000 Stefano Stabellini…
In this case QEMU calls
xc_domain_memory_mapping, that in Xen becomesXEN_DOMCTL_memory_mapping, that is implemented asset_mmio_p2m_entry. So maybe you just need to callset_mmio_p2m_entry.
Exactly what I was looking for. I knew I had seen that somewhere :)...
thanks,
Mukesh