From: Julien Grall Subject: [RFC 0/3] xen/arm: Support XENMEM_exchange Date: Thu, 17 Dec 2015 16:31:56 +0000 Message-ID: <1450369919-22989-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a9bUm-00037W-H5 for xen-devel@lists.xenproject.org; Thu, 17 Dec 2015 16:33:36 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Keir Fraser , ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, Andrew Cooper , Julien Grall , Stefano Stabellini , Jan Beulich List-Id: xen-devel@lists.xenproject.org Hi all, Currently XENMEM_exchange is not supported on ARM because the steal_page is left unimplemented. However, even if steal_page is implemented, the hypercall can't work for ARM because: - Direct mapped domain is not supported - ARM doesn't have a M2P and therefore usage of mfn_to_gmfn is invalid I'm not sure how to fix properly the latter hence the RFC. mfn_to_gmfn is used in few places in the tree, however the implementation for ARM is completely wrong (see xen/include/asm-arm/mm.h): #define mfn_to_gmfn(_d, mfn) (mfn) All the guest but DOM0, which is direct mapped, don't have mfn == gfn. I think implementing a M2P for ARM is not option because it will only be used in few places and we don't have much virtual address space left for ARM32. So I would rather drop the mfn_to_gmfn call from common code. I've looked at reworking XENMEM_exchange to avoid mfn_to_gmfn. My idea would be to allocate a temporary array to store the GFN between the two loops. However, the array would be quite large (the max default is 18 on ARM), so I don't know if it's acceptable. Anyone have a better solution? Regards, Cc: Ian Campbell Cc: Stefano Stabellini Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper Julien Grall (3): xen/common: memory: Introduce check_range_domain_direct_mapped xen/common: memory: Add support for direct mapped domain in XEMEM_exchange xen/common: memory: Move steal_page in common code xen/arch/arm/mm.c | 6 -- xen/arch/x86/mm.c | 51 ------------- xen/common/memory.c | 195 +++++++++++++++++++++++++++++++---------------- xen/common/page_alloc.c | 51 +++++++++++++ xen/include/asm-arm/mm.h | 4 +- xen/include/asm-x86/mm.h | 2 - xen/include/xen/mm.h | 3 + 7 files changed, 186 insertions(+), 126 deletions(-) -- 2.1.4