From: Tim Deegan Subject: Re: [PATCH 4.2] ix86: fix linear page table construction in alloc_l2_table() Date: Fri, 10 Jan 2014 18:02:08 +0100 Message-ID: <20140110170208.GA48471@deinos.phlegethon.org> References: <52D01D640200007800112739@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W1fTL-00070X-L4 for xen-devel@lists.xenproject.org; Fri, 10 Jan 2014 17:02:15 +0000 Content-Disposition: inline In-Reply-To: <52D01D640200007800112739@nat28.tlf.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: xen-devel , CHENG Yueqiang , Keir Fraser List-Id: xen-devel@lists.xenproject.org At 15:18 +0000 on 10 Jan (1389363524), Jan Beulich wrote: > Slot 0 got updated when slot 3 was meant. The mistake was hidden by > create_pae_xen_mappings() correcting things immediately afterwards > (i.e. before the new entries could get used the first time). > > Reported-by: CHENG Yueqiang > Signed-off-by: Jan Beulich Acked-by: Tim Deegan > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -1488,7 +1488,7 @@ static int alloc_l2_table(struct page_in > l2e_write(&pl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i], > l2e_from_page(perdomain_pt_page(d, i), > __PAGE_HYPERVISOR)); > - pl2e[l2_table_offset(LINEAR_PT_VIRT_START)] = > + pl2e[l2_table_offset(LINEAR_PT_VIRT_START) + 3] = > l2e_from_pfn(pfn, __PAGE_HYPERVISOR); > #else > memcpy(&pl2e[COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(d)], > > > > ix86: fix linear page table construction in alloc_l2_table() > > Slot 0 got updated when slot 3 was meant. The mistake was hidden by > create_pae_xen_mappings() correcting things immediately afterwards > (i.e. before the new entries could get used the first time). > > Reported-by: CHENG Yueqiang > Signed-off-by: Jan Beulich > > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -1488,7 +1488,7 @@ static int alloc_l2_table(struct page_in > l2e_write(&pl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i], > l2e_from_page(perdomain_pt_page(d, i), > __PAGE_HYPERVISOR)); > - pl2e[l2_table_offset(LINEAR_PT_VIRT_START)] = > + pl2e[l2_table_offset(LINEAR_PT_VIRT_START) + 3] = > l2e_from_pfn(pfn, __PAGE_HYPERVISOR); > #else > memcpy(&pl2e[COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(d)],