From: Tim Deegan Subject: Re: [PATCH v3] x86: allow 64-bit PV guest kernels to suppress user mode exposure of M2P Date: Thu, 30 Apr 2015 12:18:46 +0100 Message-ID: <20150430111846.GE13575@deinos.phlegethon.org> References: <553A6FCF0200007800075A0C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YnmUU-0001FC-4a for xen-devel@lists.xenproject.org; Thu, 30 Apr 2015 11:18:50 +0000 Content-Disposition: inline In-Reply-To: <553A6FCF0200007800075A0C@mail.emea.novell.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: Jan Beulich Cc: Ian Campbell , xen-devel , Keir Fraser , Ian Jackson , Andrew Cooper List-Id: xen-devel@lists.xenproject.org Hi, At 15:31 +0100 on 24 Apr (1429889471), Jan Beulich wrote: > --- 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); > > + if ( !shadow_mode_refcounts(d) && !is_pv_32on64_domain(d) && I think the right check here is !shadow_mode_external(d), i.e. that this l4e is a mapping of the M2P and not some guest-controlled mapping. > + !VM_ASSIST(d, m2p_strict) ) > + { > + /* zap_ro_mpt(mfn_x(sl4mfn)); */ > + sl4e[shadow_l4_table_offset(RO_MPT_VIRT_START)] = shadow_l4e_empty(); > + zap_ro_mpt(mfn_x(gl4mfn)); Here and below -- shouldn't the existing PV paths be taking care of zapping/filling the guest pagetable before we get here? It doesn't seem right for shadow pagetable code to be making this kind of change - especially in a mapping that's not actually "shadowed" per se. Cheers, Tim.