From patchwork Thu Dec 5 15:42:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 22073 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0942223FD0 for ; Thu, 5 Dec 2013 15:42:31 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ld13sf37218222vcb.1 for ; Thu, 05 Dec 2013 07:42:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=Ldjq3zATka3bd7PNUtuT0RUpXro5fsNAqJN9Eue0HXo=; b=BS/GsWfrmWJvNzFmc2KRRaK9wwJqrv+pcXI7JyYT+cmC01AFpwZ1LVt8/RdfHQQnkt LO8XgXgjkSAaiP0UsG7uTRxlnSmWXijuVfzVu5PcHV64YB5uUtSehw0sfn266nKiXM1g ZiWJqpJ3wAPlV9sKW8pmnTsyyvBYuoe3YvdJiNN7rFAIlDQ19ich7gTAkfFgRzfLlokn bo6QhShjgkw/+OexemkVpYy3B9cBTwGmHVYS6gBiBN0AQ3kt8plZ7dl/o4iIGMVRS+y7 J5uIek0vhZm5mEciNX8enNTo8zGEHf/Ccc+HeyUKC2+lCPj1Yyblfi5CruUdzzOt6GZx jYhA== X-Gm-Message-State: ALoCoQlReLkncu6SJ/XZM5BCCp6OThiO0Jo2dzl0vXr2tjTuPrS28LM0G8LljhdVBv9oBtGJ/fL5 X-Received: by 10.236.133.161 with SMTP id q21mr34613579yhi.18.1386258150835; Thu, 05 Dec 2013 07:42:30 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.48.105 with SMTP id k9ls750296qen.96.gmail; Thu, 05 Dec 2013 07:42:30 -0800 (PST) X-Received: by 10.52.157.232 with SMTP id wp8mr54087475vdb.4.1386258150721; Thu, 05 Dec 2013 07:42:30 -0800 (PST) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id mj10si34855367vcb.87.2013.12.05.07.42.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:42:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id if17so12971640vcb.39 for ; Thu, 05 Dec 2013 07:42:30 -0800 (PST) X-Received: by 10.52.160.130 with SMTP id xk2mr11910640vdb.24.1386258150538; Thu, 05 Dec 2013 07:42:30 -0800 (PST) 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 u4csp24835vcz; Thu, 5 Dec 2013 07:42:30 -0800 (PST) X-Received: by 10.194.78.77 with SMTP id z13mr62219254wjw.27.1386258149768; Thu, 05 Dec 2013 07:42:29 -0800 (PST) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by mx.google.com with ESMTPS id x7si28932931wjr.19.2013.12.05.07.42.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:42:29 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.48 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.48; Received: by mail-wg0-f48.google.com with SMTP id z12so16705736wgg.15 for ; Thu, 05 Dec 2013 07:42:29 -0800 (PST) X-Received: by 10.180.211.237 with SMTP id nf13mr12468272wic.55.1386258149323; Thu, 05 Dec 2013 07:42:29 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id w20sm7350575wia.5.2013.12.05.07.42.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2013 07:42:28 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, time@xen.org, stefano.stabellini@citrix.com, Julien Grall Subject: [PATCH 3/8] xen/arm: Implement p2m_type_t as an enum Date: Thu, 5 Dec 2013 15:42:06 +0000 Message-Id: <1386258131-755-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386258131-755-1-git-send-email-julien.grall@linaro.org> References: <1386258131-755-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.180 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: , Until now, Xen doesn't know the type of the page (ram, foreign page, mmio,...). Introduce p2m_type_t with basic types: - p2m_invalid: Nothing is mapped here - p2m_ram_rw: Normal read/write guest RAM - p2m_ram_ro: Read-only guest RAM - p2m_mmio_direct: Read/write mapping of device memory - p2m_map_foreign: RAM page from foreign guest Signed-off-by: Julien Grall --- xen/include/asm-arm/p2m.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index f079f00..b24f94a 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -20,6 +20,16 @@ struct p2m_domain { uint8_t vmid; }; +typedef enum { + p2m_invalid = 0, /* Nothing mapped here */ + p2m_ram_rw = 1, /* Normal read/write guest RAM */ + p2m_ram_ro = 2, /* Read-only; writes are silently dropped */ + p2m_mmio_direct = 3, /* Read/write mapping of genuine MMIO area */ + p2m_map_foreign = 4, /* Ram pages from foreign domain */ +} p2m_type_t; + +#define p2m_is_foreign(_t) ((_t) == p2m_map_foreign) + /* Initialise vmid allocator */ void p2m_vmid_allocator_init(void); @@ -72,7 +82,6 @@ p2m_pod_decrease_reservation(struct domain *d, unsigned int order); /* Look up a GFN and take a reference count on the backing page. */ -typedef int p2m_type_t; typedef unsigned int p2m_query_t; #define P2M_ALLOC (1u<<0) /* Populate PoD and paged-out entries */ #define P2M_UNSHARE (1u<<1) /* Break CoW sharing */ @@ -110,8 +119,6 @@ static inline int get_page_and_type(struct page_info *page, return rc; } -#define p2m_is_foreign(_t) (0) - #endif /* _XEN_P2M_H */ /*