]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commit
xen/swiotlb: Add support for 64KB page granularity xen-64k-v5
authorJulien Grall <julien.grall@citrix.com>
Wed, 9 Sep 2015 14:18:45 +0000 (15:18 +0100)
committerJulien Grall <julien.grall@citrix.com>
Wed, 30 Sep 2015 10:47:48 +0000 (11:47 +0100)
commit197f37c42a38d98baa97a02cd137587d8746b8e8
tree779b94820220b6fd3f8475d5a57e370fd33bee36
parent3e563504e65305450d31c3ba9a15ca2e01699968
xen/swiotlb: Add support for 64KB page granularity

Swiotlb is used on ARM64 to support DMA on platform where devices are
not protected by an SMMU. Furthermore it's only enabled for DOM0.

While Xen is always using 4KB page granularity in the stage-2 page table,
Linux ARM64 may either use 4KB or 64KB. This means that a Linux page
can be spanned accross multiple Xen page.

The Swiotlb code has to validate that the buffer used for DMA is
physically contiguous in the memory. As a Linux page can't be shared
between local memory and foreign page by design (the balloon code always
removing entirely a Linux page), the changes in the code are very
minimal because we only need to check the first Xen PFN.

Note that it may be possible to optimize the function
check_page_physically_contiguous to avoid looping over every Xen PFN
for local memory. Although I will let this optimization for a follow-up.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
    Changes in v5:
        - Patch was previously sent separately
        - Add Stefano's reviewed-by
arch/arm/include/asm/xen/page-coherent.h
arch/arm/xen/mm.c
drivers/xen/swiotlb-xen.c