From patchwork Thu Oct 24 09:02:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 21245 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C5C2244EE for ; Thu, 24 Oct 2013 09:03:05 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id n5sf3742070ggj.11 for ; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Th2OZs/pQTX0sPUmwZrqIaXn8DmWJzNKlNJPhbxIgLo=; b=O1xXLiu5p5lVLGPZ5ZC+OvlX8E7fZZuKzUvVRmPvskuGKjnV04bR/j3kBd710s6IU7 9vmJrUFA3tk3XDPYUQynbqHip0EidMk2Q3ielAGK+YeD+m8sOl+KY6lPjR7JXGZb+MDm SXT26aLemhVCxKI3s200WIDUZfbbhgD1f+X/EoB7oaf5SLZ4o5C4hMwxlsyn22dP0uy0 uHOB4yWXN1fAucvdcJQe0cf+7xkSYkfcdthGatmB/zNR4waWV9xhxYwaeu3mQfHMCwT6 a8l0lw2IXY0RI39VJRRSkqpQKykRDqbLECYZ4jVUWqjOki3sAensE6aF19m5m8k3tXxu GcUA== X-Received: by 10.224.168.200 with SMTP id v8mr2045431qay.7.1382605385343; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.170 with SMTP id i10ls727288qej.74.gmail; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) X-Received: by 10.220.237.138 with SMTP id ko10mr19847vcb.44.1382605385236; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id v5si116630ves.42.2013.10.24.02.03.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 02:03:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id im17so1310599vcb.13 for ; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) X-Gm-Message-State: ALoCoQlmWtBv0BpKGfvtvFqvhkMciOtVKEbB0/0UAJPNRJVm2YxqRh2VMdgGBI5A8PBb/zwZhqOC X-Received: by 10.52.240.198 with SMTP id wc6mr18019vdc.54.1382605385118; Thu, 24 Oct 2013 02:03:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp374589vcz; Thu, 24 Oct 2013 02:03:04 -0700 (PDT) X-Received: by 10.180.39.212 with SMTP id r20mr1185594wik.13.1382605384247; Thu, 24 Oct 2013 02:03:04 -0700 (PDT) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx.google.com with ESMTPS id pm1si262387wjc.37.2013.10.24.02.03.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 02:03:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.179 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.179; Received: by mail-wi0-f179.google.com with SMTP id hm4so2176415wib.0 for ; Thu, 24 Oct 2013 02:03:03 -0700 (PDT) X-Received: by 10.180.211.111 with SMTP id nb15mr1135287wic.55.1382605383544; Thu, 24 Oct 2013 02:03:03 -0700 (PDT) Received: from laptop.eicc.co.uk (ed03490-ge-0-0-0.mgdfwr.lumison.net. [212.20.242.100]) by mx.google.com with ESMTPSA id fb4sm24947864wib.8.2013.10.24.02.03.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2013 02:03:02 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: ian.campbell@citrix.com, tim@xen.org, patches@linaro.org, stefano.stabellini@eu.citrix.com, Julien Grall Subject: [PATCH 2/3] xen/arm: p2m: add guest_physmap_add_page_rw Date: Thu, 24 Oct 2013 10:02:44 +0100 Message-Id: <1382605365-19244-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1382605365-19244-1-git-send-email-julien.grall@linaro.org> References: <1382605365-19244-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This function allows Xen to map memory read/write or read-only to the guest memory. Signed-off-by: Julien Grall --- xen/arch/arm/p2m.c | 11 +++++++++++ xen/include/asm-arm/p2m.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index fdbb07b..0c515e1 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -267,6 +267,17 @@ int guest_physmap_add_page(struct domain *d, mfn << PAGE_SHIFT, MATTR_MEM, 1); } +int guest_physmap_add_page_rw(struct domain *d, + unsigned long gpfn, + unsigned long mfn, + unsigned int page_order, + bool_t rw) +{ + return create_p2m_entries(d, INSERT, gpfn << PAGE_SHIFT, + (gpfn + (1 << page_order)) << PAGE_SHIFT, + mfn << PAGE_SHIFT, MATTR_MEM, rw); +} + void guest_physmap_remove_page(struct domain *d, unsigned long gpfn, unsigned long mfn, unsigned int page_order) diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index c660820..250f916 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -54,6 +54,11 @@ int guest_physmap_add_page(struct domain *d, unsigned long gfn, unsigned long mfn, unsigned int page_order); +int guest_physmap_add_page_rw(struct domain *d, + unsigned long gfn, + unsigned long mfn, + unsigned int page_order, + bool_t rw); void guest_physmap_remove_page(struct domain *d, unsigned long gpfn, unsigned long mfn, unsigned int page_order);