From: "Jan Beulich" Subject: [PATCH v3] x86: allow 64-bit PV guest kernels to suppress user mode exposure of M2P Date: Fri, 24 Apr 2015 15:31:11 +0100 Message-ID: <553A6FCF0200007800075A0C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartEBDF89BF.2__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YledN-0005Ma-7f for xen-devel@lists.xenproject.org; Fri, 24 Apr 2015 14:31:13 +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 Cc: Ian Campbell , Andrew Cooper , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartEBDF89BF.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Xen L4 entries being uniformly installed into any L4 table and 64-bit PV kernels running in ring 3 means that user mode was able to see the read-only M2P presented by Xen to the guests. While apparently not really representing an exploitable information leak, this still very certainly was never meant to be that way. Building on the fact that these guests already have separate kernel and user mode page tables we can allow guest kernels to tell Xen that they don't want user mode to see this table. We can't, however, do this by default: There is no ABI requirement that kernel and user mode page tables be separate. Therefore introduce a new VM-assist flag allowing the guest to control respective hypervisor behavior: - when not set, L4 tables get created with the respective slot blank, and whenever the L4 table gets used as a kernel one the missing mapping gets inserted, - when set, L4 tables get created with the respective slot initialized as before, and whenever the L4 table gets used as a user one the mapping gets zapped. Signed-off-by: Jan Beulich --- v3: Shadow mode changes re-written (to address the migration regression in v2). --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -339,7 +339,7 @@ static int setup_compat_l4(struct vcpu * =20 l4tab =3D __map_domain_page(pg); clear_page(l4tab); - init_guest_l4_table(l4tab, v->domain); + init_guest_l4_table(l4tab, v->domain, 1); unmap_domain_page(l4tab); =20 v->arch.guest_table =3D pagetable_from_page(pg); @@ -971,7 +971,11 @@ int arch_set_info_guest( case -EINTR: rc =3D -ERESTART; case -ERESTART: + break; case 0: + if ( !compat && !VM_ASSIST(d, m2p_strict) && + !paging_mode_refcounts(d) ) + fill_ro_mpt(cr3_gfn); break; default: if ( cr3_page =3D=3D current->arch.old_guest_table ) @@ -1006,7 +1010,10 @@ int arch_set_info_guest( default: if ( cr3_page =3D=3D current->arch.old_guest_table ) cr3_page =3D NULL; + break; case 0: + if ( VM_ASSIST(d, m2p_strict) ) + zap_ro_mpt(cr3_gfn); break; } } --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -1205,7 +1205,7 @@ int __init construct_dom0( l3start =3D __va(mpt_alloc); mpt_alloc +=3D PAGE_SIZE; } clear_page(l4tab); - init_guest_l4_table(l4tab, d); + init_guest_l4_table(l4tab, d, 0); v->arch.guest_table =3D pagetable_from_paddr(__pa(l4start)); if ( is_pv_32on64_domain(d) ) v->arch.guest_table_user =3D v->arch.guest_table; --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1380,7 +1380,8 @@ static int alloc_l3_table(struct page_in return rc > 0 ? 0 : rc; } =20 -void init_guest_l4_table(l4_pgentry_t l4tab[], const struct domain *d) +void init_guest_l4_table(l4_pgentry_t l4tab[], const struct domain *d, + bool_t zap_ro_mpt) { /* Xen private mappings. */ memcpy(&l4tab[ROOT_PAGETABLE_FIRST_XEN_SLOT], @@ -1395,6 +1396,25 @@ void init_guest_l4_table(l4_pgentry_t l4 l4e_from_pfn(domain_page_map_to_mfn(l4tab), __PAGE_HYPERVISOR); l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] =3D l4e_from_page(d->arch.perdomain_l3_pg, __PAGE_HYPERVISOR); + if ( zap_ro_mpt || is_pv_32on64_domain(d) || paging_mode_refcounts(d) = ) + l4tab[l4_table_offset(RO_MPT_VIRT_START)] =3D l4e_empty(); +} + +void fill_ro_mpt(unsigned long mfn) +{ + l4_pgentry_t *l4tab =3D map_domain_page(mfn); + + l4tab[l4_table_offset(RO_MPT_VIRT_START)] =3D + idle_pg_table[l4_table_offset(RO_MPT_VIRT_START)]; + unmap_domain_page(l4tab); +} + +void zap_ro_mpt(unsigned long mfn) +{ + l4_pgentry_t *l4tab =3D map_domain_page(mfn); + + l4tab[l4_table_offset(RO_MPT_VIRT_START)] =3D l4e_empty(); + unmap_domain_page(l4tab); } =20 static int alloc_l4_table(struct page_info *page) @@ -1444,7 +1464,7 @@ static int alloc_l4_table(struct page_in adjust_guest_l4e(pl4e[i], d); } =20 - init_guest_l4_table(pl4e, d); + init_guest_l4_table(pl4e, d, !VM_ASSIST(d, m2p_strict)); unmap_domain_page(pl4e); =20 return rc > 0 ? 0 : rc; @@ -2754,6 +2774,8 @@ int new_guest_cr3(unsigned long mfn) =20 invalidate_shadow_ldt(curr, 0); =20 + if ( !VM_ASSIST(d, m2p_strict) && !paging_mode_refcounts(d) ) + fill_ro_mpt(mfn); curr->arch.guest_table =3D pagetable_from_pfn(mfn); update_cr3(curr); =20 @@ -3111,6 +3133,8 @@ long do_mmuext_op( op.arg1.mfn); break; } + if ( VM_ASSIST(d, m2p_strict) && !paging_mode_refcounts(d)= ) + zap_ro_mpt(op.arg1.mfn); } =20 curr->arch.guest_table_user =3D pagetable_from_pfn(op.arg1.mfn= ); --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -1435,6 +1435,14 @@ void sh_install_xen_entries_in_l4(struct shadow_l4e_from_mfn(page_to_mfn(d->arch.perdomain_l3_pg), __PAGE_HYPERVISOR); =20 + if ( !shadow_mode_refcounts(d) && !is_pv_32on64_domain(d) && + !VM_ASSIST(d, m2p_strict) ) + { + /* zap_ro_mpt(mfn_x(sl4mfn)); */ + sl4e[shadow_l4_table_offset(RO_MPT_VIRT_START)] =3D shadow_l4e_emp= ty(); + zap_ro_mpt(mfn_x(gl4mfn)); + } + /* Shadow linear mapping for 4-level shadows. N.B. for 3-level * shadows on 64-bit xen, this linear mapping is later replaced by = the * monitor pagetable structure, which is built in make_monitor_table @@ -4071,6 +4079,22 @@ sh_update_cr3(struct vcpu *v, int do_loc if ( sh_remove_write_access(d, gmfn, 4, 0) !=3D 0 ) flush_tlb_mask(d->domain_dirty_cpumask); sh_set_toplevel_shadow(v, 0, gmfn, SH_type_l4_shadow); + if ( !shadow_mode_refcounts(d) && !is_pv_32on64_domain(d) ) + { + mfn_t smfn =3D pagetable_get_mfn(v->arch.shadow_table[0]); + + if ( !(v->arch.flags & TF_kernel_mode) && VM_ASSIST(d, m2p_strict)= ) + { + zap_ro_mpt(mfn_x(smfn)); + zap_ro_mpt(mfn_x(gmfn)); + } + else if ( (v->arch.flags & TF_kernel_mode) && + !VM_ASSIST(d, m2p_strict) ) + { + fill_ro_mpt(mfn_x(smfn)); + fill_ro_mpt(mfn_x(gmfn)); + } + } #else #error This should never happen #endif --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -480,7 +480,7 @@ static int setup_m2p_table(struct mem_ho l2_ro_mpt +=3D l2_table_offset(va); } =20 - /* NB. Cannot be GLOBAL as shadow_mode_translate reuses this = area. */ + /* NB. Cannot be GLOBAL: guest user mode should not see it. = */ l2e_write(l2_ro_mpt, l2e_from_pfn(mfn, /*_PAGE_GLOBAL|*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT)); } @@ -583,7 +583,7 @@ void __init paging_init(void) 0x77, 1UL << L3_PAGETABLE_SHIFT); =20 ASSERT(!l2_table_offset(va)); - /* NB. Cannot be GLOBAL as shadow_mode_translate reuses = this area. */ + /* NB. Cannot be GLOBAL: guest user mode should not see = it. */ l3e_write(&l3_ro_mpt[l3_table_offset(va)], l3e_from_page(l1_pg, /*_PAGE_GLOBAL|*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESEN= T)); @@ -621,7 +621,7 @@ void __init paging_init(void) l3e_from_page(l2_pg, __PAGE_HYPERVISOR | _PAGE_USER)= ); ASSERT(!l2_table_offset(va)); } - /* NB. Cannot be GLOBAL as shadow_mode_translate reuses this = area. */ + /* NB. Cannot be GLOBAL: guest user mode should not see it. */ if ( l1_pg ) l2e_write(l2_ro_mpt, l2e_from_page( l1_pg, /*_PAGE_GLOBAL|*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT= )); --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -346,7 +346,8 @@ extern unsigned long xen_phys_start; #define NATIVE_VM_ASSIST_VALID ((1UL << VMASST_TYPE_4gb_segments) = | \ (1UL << VMASST_TYPE_4gb_segments_notify)= | \ (1UL << VMASST_TYPE_writable_pagetables)= | \ - (1UL << VMASST_TYPE_pae_extended_cr3)) + (1UL << VMASST_TYPE_pae_extended_cr3) = | \ + (1UL << VMASST_TYPE_m2p_strict)) #define VM_ASSIST_VALID NATIVE_VM_ASSIST_VALID #define COMPAT_VM_ASSIST_VALID (NATIVE_VM_ASSIST_VALID & \ ((1UL << COMPAT_BITS_PER_LONG) - 1)) --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -318,7 +318,10 @@ static inline void *__page_to_virt(const int free_page_type(struct page_info *page, unsigned long type, int preemptible); =20 -void init_guest_l4_table(l4_pgentry_t[], const struct domain *); +void init_guest_l4_table(l4_pgentry_t[], const struct domain *, + bool_t zap_ro_mpt); +void fill_ro_mpt(unsigned long mfn); +void zap_ro_mpt(unsigned long mfn); =20 int is_iomem_page(unsigned long mfn); =20 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -486,6 +486,18 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t); /* x86/PAE guests: support PDPTs above 4GB. */ #define VMASST_TYPE_pae_extended_cr3 3 =20 +/* + * x86/64 guests: strictly hide M2P from user mode. + * This allows the guest to control respective hypervisor behavior: + * - when not set, L4 tables get created with the respective slot blank, + * and whenever the L4 table gets used as a kernel one the missing + * mapping gets inserted, + * - when set, L4 tables get created with the respective slot initialized + * as before, and whenever the L4 table gets used as a user one the + * mapping gets zapped. + */ +#define VMASST_TYPE_m2p_strict 32 + #if __XEN_INTERFACE_VERSION__ < 0x00040600 #define MAX_VMASST_TYPE 3 #endif --=__PartEBDF89BF.2__= Content-Type: text/plain; name="x86-m2p-strict.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-m2p-strict.patch" x86: allow 64-bit PV guest kernels to suppress user mode exposure of = M2P=0A=0AXen L4 entries being uniformly installed into any L4 table and = 64-bit=0APV kernels running in ring 3 means that user mode was able to see = the=0Aread-only M2P presented by Xen to the guests. While apparently = not=0Areally representing an exploitable information leak, this still = very=0Acertainly was never meant to be that way.=0A=0ABuilding on the fact = that these guests already have separate kernel and=0Auser mode page tables = we can allow guest kernels to tell Xen that they=0Adon't want user mode to = see this table. We can't, however, do this by=0Adefault: There is no ABI = requirement that kernel and user mode page=0Atables be separate. Therefore = introduce a new VM-assist flag allowing=0Athe guest to control respective = hypervisor behavior:=0A- when not set, L4 tables get created with the = respective slot blank,=0A and whenever the L4 table gets used as a kernel = one the missing=0A mapping gets inserted,=0A- when set, L4 tables get = created with the respective slot initialized=0A as before, and whenever = the L4 table gets used as a user one the=0A mapping gets zapped.=0A=0ASign= ed-off-by: Jan Beulich =0A---=0Av3: Shadow mode changes = re-written (to address the migration regression=0A in v2).=0A=0A--- = a/xen/arch/x86/domain.c=0A+++ b/xen/arch/x86/domain.c=0A@@ -339,7 +339,7 = @@ static int setup_compat_l4(struct vcpu *=0A =0A l4tab =3D __map_doma= in_page(pg);=0A clear_page(l4tab);=0A- init_guest_l4_table(l4tab, = v->domain);=0A+ init_guest_l4_table(l4tab, v->domain, 1);=0A = unmap_domain_page(l4tab);=0A =0A v->arch.guest_table =3D pagetable_from= _page(pg);=0A@@ -971,7 +971,11 @@ int arch_set_info_guest(=0A case = -EINTR:=0A rc =3D -ERESTART;=0A case -ERESTART:=0A+ = break;=0A case 0:=0A+ if ( !compat && !VM_ASSIST= (d, m2p_strict) &&=0A+ !paging_mode_refcounts(d) )=0A+ = fill_ro_mpt(cr3_gfn);=0A break;=0A = default:=0A if ( cr3_page =3D=3D current->arch.old_guest_table = )=0A@@ -1006,7 +1010,10 @@ int arch_set_info_guest(=0A = default:=0A if ( cr3_page =3D=3D current->arch.old_gues= t_table )=0A cr3_page =3D NULL;=0A+ = break;=0A case 0:=0A+ if ( = VM_ASSIST(d, m2p_strict) )=0A+ zap_ro_mpt(cr3_gfn);= =0A break;=0A }=0A }=0A--- = a/xen/arch/x86/domain_build.c=0A+++ b/xen/arch/x86/domain_build.c=0A@@ = -1205,7 +1205,7 @@ int __init construct_dom0(=0A l3start =3D = __va(mpt_alloc); mpt_alloc +=3D PAGE_SIZE;=0A }=0A clear_page(l4tab= );=0A- init_guest_l4_table(l4tab, d);=0A+ init_guest_l4_table(l4tab, = d, 0);=0A v->arch.guest_table =3D pagetable_from_paddr(__pa(l4start));= =0A if ( is_pv_32on64_domain(d) )=0A v->arch.guest_table_user = =3D v->arch.guest_table;=0A--- a/xen/arch/x86/mm.c=0A+++ b/xen/arch/x86/mm.= c=0A@@ -1380,7 +1380,8 @@ static int alloc_l3_table(struct page_in=0A = return rc > 0 ? 0 : rc;=0A }=0A =0A-void init_guest_l4_table(l4_pgentry_t = l4tab[], const struct domain *d)=0A+void init_guest_l4_table(l4_pgentry_t = l4tab[], const struct domain *d,=0A+ bool_t = zap_ro_mpt)=0A {=0A /* Xen private mappings. */=0A memcpy(&l4tab[RO= OT_PAGETABLE_FIRST_XEN_SLOT],=0A@@ -1395,6 +1396,25 @@ void init_guest_l4_t= able(l4_pgentry_t l4=0A l4e_from_pfn(domain_page_map_to_mfn(l4tab),= __PAGE_HYPERVISOR);=0A l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] = =3D=0A l4e_from_page(d->arch.perdomain_l3_pg, __PAGE_HYPERVISOR);= =0A+ if ( zap_ro_mpt || is_pv_32on64_domain(d) || paging_mode_refcounts(= d) )=0A+ l4tab[l4_table_offset(RO_MPT_VIRT_START)] =3D l4e_empty();= =0A+}=0A+=0A+void fill_ro_mpt(unsigned long mfn)=0A+{=0A+ l4_pgentry_t = *l4tab =3D map_domain_page(mfn);=0A+=0A+ l4tab[l4_table_offset(RO_MPT_VI= RT_START)] =3D=0A+ idle_pg_table[l4_table_offset(RO_MPT_VIRT_START)]= ;=0A+ unmap_domain_page(l4tab);=0A+}=0A+=0A+void zap_ro_mpt(unsigned = long mfn)=0A+{=0A+ l4_pgentry_t *l4tab =3D map_domain_page(mfn);=0A+=0A+= l4tab[l4_table_offset(RO_MPT_VIRT_START)] =3D l4e_empty();=0A+ = unmap_domain_page(l4tab);=0A }=0A =0A static int alloc_l4_table(struct = page_info *page)=0A@@ -1444,7 +1464,7 @@ static int alloc_l4_table(struct = page_in=0A adjust_guest_l4e(pl4e[i], d);=0A }=0A =0A- = init_guest_l4_table(pl4e, d);=0A+ init_guest_l4_table(pl4e, d, = !VM_ASSIST(d, m2p_strict));=0A unmap_domain_page(pl4e);=0A =0A = return rc > 0 ? 0 : rc;=0A@@ -2754,6 +2774,8 @@ int new_guest_cr3(unsigned = long mfn)=0A =0A invalidate_shadow_ldt(curr, 0);=0A =0A+ if ( = !VM_ASSIST(d, m2p_strict) && !paging_mode_refcounts(d) )=0A+ = fill_ro_mpt(mfn);=0A curr->arch.guest_table =3D pagetable_from_pfn(mfn)= ;=0A update_cr3(curr);=0A =0A@@ -3111,6 +3133,8 @@ long do_mmuext_op(= =0A op.arg1.mfn);=0A = break;=0A }=0A+ if ( VM_ASSIST(d, m2p_strict= ) && !paging_mode_refcounts(d) )=0A+ zap_ro_mpt(op.arg1.= mfn);=0A }=0A =0A curr->arch.guest_table_user =3D = pagetable_from_pfn(op.arg1.mfn);=0A--- a/xen/arch/x86/mm/shadow/multi.c=0A+= ++ b/xen/arch/x86/mm/shadow/multi.c=0A@@ -1435,6 +1435,14 @@ void = sh_install_xen_entries_in_l4(struct=0A shadow_l4e_from_mfn(page_to_= mfn(d->arch.perdomain_l3_pg),=0A __PAGE_HYPERVI= SOR);=0A =0A+ if ( !shadow_mode_refcounts(d) && !is_pv_32on64_domain(d) = &&=0A+ !VM_ASSIST(d, m2p_strict) )=0A+ {=0A+ /* = zap_ro_mpt(mfn_x(sl4mfn)); */=0A+ sl4e[shadow_l4_table_offset(RO_MPT= _VIRT_START)] =3D shadow_l4e_empty();=0A+ zap_ro_mpt(mfn_x(gl4mfn));= =0A+ }=0A+=0A /* Shadow linear mapping for 4-level shadows. N.B. = for 3-level=0A * shadows on 64-bit xen, this linear mapping is later = replaced by the=0A * monitor pagetable structure, which is built in = make_monitor_table=0A@@ -4071,6 +4079,22 @@ sh_update_cr3(struct vcpu *v, = int do_loc=0A if ( sh_remove_write_access(d, gmfn, 4, 0) !=3D 0 )=0A = flush_tlb_mask(d->domain_dirty_cpumask);=0A sh_set_toplevel_shado= w(v, 0, gmfn, SH_type_l4_shadow);=0A+ if ( !shadow_mode_refcounts(d) && = !is_pv_32on64_domain(d) )=0A+ {=0A+ mfn_t smfn =3D pagetable_get_= mfn(v->arch.shadow_table[0]);=0A+=0A+ if ( !(v->arch.flags & = TF_kernel_mode) && VM_ASSIST(d, m2p_strict) )=0A+ {=0A+ = zap_ro_mpt(mfn_x(smfn));=0A+ zap_ro_mpt(mfn_x(gmfn));=0A+ = }=0A+ else if ( (v->arch.flags & TF_kernel_mode) &&=0A+ = !VM_ASSIST(d, m2p_strict) )=0A+ {=0A+ fill_ro_mpt(m= fn_x(smfn));=0A+ fill_ro_mpt(mfn_x(gmfn));=0A+ }=0A+ = }=0A #else=0A #error This should never happen=0A #endif=0A--- a/xen/arch/x8= 6/x86_64/mm.c=0A+++ b/xen/arch/x86/x86_64/mm.c=0A@@ -480,7 +480,7 @@ = static int setup_m2p_table(struct mem_ho=0A l2_ro_mpt +=3D = l2_table_offset(va);=0A }=0A =0A- /* NB. Cannot be = GLOBAL as shadow_mode_translate reuses this area. */=0A+ /* NB. = Cannot be GLOBAL: guest user mode should not see it. */=0A = l2e_write(l2_ro_mpt, l2e_from_pfn(mfn,=0A /*_PAGE_GLOBAL= |*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT));=0A }=0A@@ -583,7 +583,7 = @@ void __init paging_init(void)=0A 0x77, 1UL << = L3_PAGETABLE_SHIFT);=0A =0A ASSERT(!l2_table_offset(va));= =0A- /* NB. Cannot be GLOBAL as shadow_mode_translate = reuses this area. */=0A+ /* NB. Cannot be GLOBAL: guest = user mode should not see it. */=0A l3e_write(&l3_ro_mpt[l3_= table_offset(va)],=0A l3e_from_page(l1_pg,=0A = /*_PAGE_GLOBAL|*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT));=0A@@ = -621,7 +621,7 @@ void __init paging_init(void)=0A = l3e_from_page(l2_pg, __PAGE_HYPERVISOR | _PAGE_USER));=0A = ASSERT(!l2_table_offset(va));=0A }=0A- /* NB. Cannot be = GLOBAL as shadow_mode_translate reuses this area. */=0A+ /* NB. = Cannot be GLOBAL: guest user mode should not see it. */=0A if ( = l1_pg )=0A l2e_write(l2_ro_mpt, l2e_from_page(=0A = l1_pg, /*_PAGE_GLOBAL|*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT));=0A--- = a/xen/include/asm-x86/config.h=0A+++ b/xen/include/asm-x86/config.h=0A@@ = -346,7 +346,8 @@ extern unsigned long xen_phys_start;=0A #define NATIVE_VM_= ASSIST_VALID ((1UL << VMASST_TYPE_4gb_segments) | \=0A = (1UL << VMASST_TYPE_4gb_segments_notify) | \=0A = (1UL << VMASST_TYPE_writable_pagetables) | = \=0A- (1UL << VMASST_TYPE_pae_extended_cr3= ))=0A+ (1UL << VMASST_TYPE_pae_extended_cr= 3) | \=0A+ (1UL << VMASST_TYPE_m2p_stri= ct))=0A #define VM_ASSIST_VALID NATIVE_VM_ASSIST_VALID=0A #define = COMPAT_VM_ASSIST_VALID (NATIVE_VM_ASSIST_VALID & \=0A = ((1UL << COMPAT_BITS_PER_LONG) - 1))=0A--- a/xen/include/asm= -x86/mm.h=0A+++ b/xen/include/asm-x86/mm.h=0A@@ -318,7 +318,10 @@ static = inline void *__page_to_virt(const=0A int free_page_type(struct page_info = *page, unsigned long type,=0A int preemptible);=0A = =0A-void init_guest_l4_table(l4_pgentry_t[], const struct domain *);=0A+voi= d init_guest_l4_table(l4_pgentry_t[], const struct domain *,=0A+ = bool_t zap_ro_mpt);=0A+void fill_ro_mpt(unsigned long = mfn);=0A+void zap_ro_mpt(unsigned long mfn);=0A =0A int is_iomem_page(unsig= ned long mfn);=0A =0A--- a/xen/include/public/xen.h=0A+++ b/xen/include/pub= lic/xen.h=0A@@ -486,6 +486,18 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);=0A = /* x86/PAE guests: support PDPTs above 4GB. */=0A #define VMASST_TYPE_pae_e= xtended_cr3 3=0A =0A+/*=0A+ * x86/64 guests: strictly hide M2P from = user mode.=0A+ * This allows the guest to control respective hypervisor = behavior:=0A+ * - when not set, L4 tables get created with the respective = slot blank,=0A+ * and whenever the L4 table gets used as a kernel one = the missing=0A+ * mapping gets inserted,=0A+ * - when set, L4 tables get = created with the respective slot initialized=0A+ * as before, and = whenever the L4 table gets used as a user one the=0A+ * mapping gets = zapped.=0A+ */=0A+#define VMASST_TYPE_m2p_strict 32=0A+=0A #if = __XEN_INTERFACE_VERSION__ < 0x00040600=0A #define MAX_VMASST_TYPE = 3=0A #endif=0A --=__PartEBDF89BF.2__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartEBDF89BF.2__=--