|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH 4/9] xen/arm: p2m: Update IOMMU mapping whenever possible if page table is not shared
On 21/04/17 15:18, Oleksandr Tyshchenko wrote: On Wed, Apr 19, 2017 at 8:46 PM, Julien Grall <julien.grall@xxxxxxx> wrote:Hi Oleksandr,Hi, Julien Hi Oleksandr, On 15/03/17 20:05, Oleksandr Tyshchenko wrote:From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx> Update IOMMU mapping if the IOMMU doesn't share page table with the CPU. The best place to do so on ARM is p2m_set_entry(). Use mfn as an indicator of the required action. If mfn is valid call iommu_map_pages(), otherwise - iommu_unmap_pages().Can you explain in the commit message why you do this change in p2m_set_entry and not __p2m_set_entry?ok Yes sorry. Also, do you expect the IOMMU to support a page granularity bigger than the one supported by Xen? If not, we should probably have a check somewhere, to prevent potential security issue as we would map more than expected.At the moment I keep in mind IPMMU only. And it supports the same page granularity as the CPU (4K, 2M, 1G). Could you, please, explain what a proposed check should check? We should check that the smallest granularity supported by the IOMMU is inferior or equal to PAGE_SIZE. If not, then there will be more rework required in Xen to support correctly those IOMMUs. For instance, Xen PAGE_SIZE is currently 4KB. If the IOMMUs only support 64KB, then you will end up to map a bigger chunk than expected leading a guest device to access memory it should not access. Supporting such IOMMU will require much more work in Xen than this small changes. With the current solution we pass the whole memory block to the IOMMU code and the IOMMU driver should handle this properly. If we pass, for example 1,1 GB, but the IOMMU driver supports 4K pages only then it has to split the memory block into 4K pages and process them. The IOMMU driver will likely duplicate the same logic as in p2m_set_entry and today does not seem to be necessary. By that I mean splitting into smaller chunk. You may need to split again those chunks if the IOMMU does not support the granularity. But this is less likely on current hardware. My main concern is to make sure __p2m_get_entry works as expected with all the configurations. Currently, what you describe will require much more work than this series. I will be ok whether you rework __p2m_get_entry or not. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |