From: "Jan Beulich" Subject: Re: [PATCH 1/3] x86: tolerate running on EFI runtime services page tables in map_domain_page() Date: Thu, 23 Oct 2014 16:18:40 +0100 Message-ID: <54493870020000780004186A@mail.emea.novell.com> References: <54492111020000780004175B@mail.emea.novell.com> <5449226E020000780004176D@mail.emea.novell.com> <5449093F.6080500@citrix.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 1XhKA0-0005Ey-KY for xen-devel@lists.xenproject.org; Thu, 23 Oct 2014 15:18:44 +0000 In-Reply-To: <5449093F.6080500@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: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 23.10.14 at 15:57, wrote: > On 23/10/14 14:44, Jan Beulich wrote: >> --- a/xen/arch/x86/domain_page.c >> +++ b/xen/arch/x86/domain_page.c >> @@ -7,6 +7,7 @@ >> */ >> >> #include >> +#include >> #include >> #include >> #include >> @@ -37,11 +38,14 @@ static inline struct vcpu *mapcache_curr >> */ >> if ( unlikely(pagetable_is_null(v->arch.guest_table)) && is_pv_vcpu(v) ) >> { >> + unsigned long cr3; >> + > > This will need an __maybe_unused to compile in a non-debug build. Definitely not (and I actually build tested it also for that case). ASSERT() had got changed a (long) while ago to specifically allow for such cases. >> --- a/xen/arch/x86/efi/stub.c >> +++ b/xen/arch/x86/efi/stub.c >> @@ -9,6 +9,12 @@ const bool_t efi_enabled = 0; >> >> void __init efi_init_memory(void) { } >> >> +paddr_t efi_rs_page_table(void) >> +{ >> + BUG(); >> + return 0; > > Is the return strictly needed? The __builtin_unreachable() in BUG() > should prevent the compiler from complaining. It's not strictly needed, but is in line with the immediately following function. Jan