From: Ed White Subject: [PATCH 07/11] x86/altp2m: introduce p2m_ram_rw_ve type. Date: Fri, 9 Jan 2015 13:26:37 -0800 Message-ID: <1420838801-11704-8-git-send-email-edmund.h.white@intel.com> References: <1420838801-11704-1-git-send-email-edmund.h.white@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1420838801-11704-1-git-send-email-edmund.h.white@intel.com> 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: keir@xen.org, ian.campbell@citrix.com, tim@xen.org, ian.jackson@eu.citrix.com, Ed White , jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org This is treated exactly like p2m_ram_rw, except that suppress_ve is not set in the EPTE. Signed-off-by: Ed White --- xen/arch/x86/mm/p2m-ept.c | 3 ++- xen/include/asm-x86/p2m.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index 255b681..d227cbb 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_ram_rw_ve: entry->r = entry->w = entry->x = 1; break; case p2m_mmio_direct: @@ -771,7 +772,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, } if ( cpu_has_vmx_virt_exceptions ) - new_entry.suppress_ve = 1; + new_entry.suppress_ve = (p2mt != p2m_ram_rw_ve); rc = atomic_write_ept_entry(ept_entry, new_entry, target); if ( unlikely(rc) ) diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index 9fb5ba0..68a5f80 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -72,6 +72,7 @@ typedef enum { p2m_ram_shared = 12, /* Shared or sharable memory */ p2m_ram_broken = 13, /* Broken page, access cause domain crash */ p2m_map_foreign = 14, /* ram pages from foreign domain */ + p2m_ram_rw_ve = 15, /* Same as p2m_ram_rw, but used to allow #VE */ } p2m_type_t; /* Modifiers to the query */ @@ -84,6 +85,7 @@ typedef unsigned int p2m_query_t; /* RAM types, which map to real machine frames */ #define P2M_RAM_TYPES (p2m_to_mask(p2m_ram_rw) \ + | p2m_to_mask(p2m_ram_rw_ve) \ | p2m_to_mask(p2m_ram_logdirty) \ | p2m_to_mask(p2m_ram_ro) \ | p2m_to_mask(p2m_ram_paging_out) \ -- 1.9.1