From: Elena Ufimtseva Subject: [PATCH RFC 2/5] p2m: introduce misc type p2m_sys_rw for mmio rw mappings Date: Fri, 13 Feb 2015 13:51:36 -0500 Message-ID: <20150213185133.GA12728@elena.ufimtseva> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline 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.xen.org Cc: kevin.tian@intel.com, tim@xen.org, jbeulich@suse.com, yang.z.zhang@intel.com, boris.ostrovsky@oracle.com, roger.pau@citrix.com List-Id: xen-devel@lists.xenproject.org Introduce p2m type p2m_sys_rw as a preparation for the following patch. It used to provide correct flags for mapping special memory ranges that specified in dom0_iommu_rwmem command line. See comment in the following patch for detailed explanation. Signed-off-by: Elena Ufimtseva --- xen/arch/x86/mm/p2m-ept.c | 1 + xen/include/asm-x86/p2m.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index c2d7720..d7d8ad1 100644 --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -117,6 +117,7 @@ static void ept_p2m_type_to_flags(ept_entry_t *entry, p2m_type_t type, p2m_acces entry->r = entry->w = entry->x = 0; break; case p2m_ram_rw: + case p2m_sys_rw: entry->r = entry->w = entry->x = 1; break; case p2m_mmio_direct: diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index e93c551..a95521d 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -73,6 +73,7 @@ typedef enum { p2m_ram_broken = 13, /* Broken page, access cause domain crash */ p2m_map_foreign = 14, /* ram pages from foreign domain */ p2m_mmio_write_dm = 15, /* Read-only; writes go to the device model */ + p2m_sys_rw = 16, /* Read/write mapping of user specified RAM */ } p2m_type_t; /* Modifiers to the query */ @@ -718,6 +719,7 @@ static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt) case p2m_grant_map_rw: case p2m_ram_logdirty: case p2m_map_foreign: + case p2m_sys_rw: flags = IOMMUF_readable | IOMMUF_writable; break; case p2m_ram_ro: -- 1.7.10.4