From: "Jan Beulich" Subject: Re: [PATCH] x86: Don't crash when mapping a page using EFI runtime page tables Date: Mon, 18 May 2015 10:12:43 +0100 Message-ID: <5559C92B020000780007AF6F@mail.emea.novell.com> References: <1431706091-32288-1-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1431706091-32288-1-git-send-email-ross.lagerwall@citrix.com> 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: Ross Lagerwall Cc: Andrew Cooper , Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 15.05.15 at 18:08, wrote: > --- a/xen/arch/x86/domain_page.c > +++ b/xen/arch/x86/domain_page.c > @@ -32,20 +32,25 @@ static inline struct vcpu *mapcache_current_vcpu(void) > return NULL; > > /* > + * When using efi runtime page tables, we have the equivalent of the idle > + * domain's page tables but current may point at another domain's VCPU. > + * Return NULL as though current is not properly set up yet. > + */ > + if ( efi_enabled && read_cr3() == efi_rs_page_table() ) > + return NULL; While I think this is an issue even without your change, it highlights that we need to sync updates to idle_pg_table[] into efi_l4_pgtable[] (particularly such done during memory hotplug, but I'd envision this to be done generically in virt_to_xen_l3e()) for this to work. Jan