WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH REPOST] pv-grub: Fix for incorrect dom->p2m_host[

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH REPOST] pv-grub: Fix for incorrect dom->p2m_host[] list initialization
From: Daniel Kiper <dkiper@xxxxxxxxxxxx>
Date: Tue, 26 Apr 2011 16:34:36 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Daniel Kiper <dkiper@xxxxxxxxxxxx>, stefano.stabellini@xxxxxxxxxxxxx
Delivery-date: Tue, 26 Apr 2011 07:40:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110426134242.GA26275@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110422212545.GA22846@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110426134242.GA26275@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Tue, Apr 26, 2011 at 09:42:42AM -0400, Konrad Rzeszutek Wilk wrote:
> On Fri, Apr 22, 2011 at 11:25:45PM +0200, Daniel Kiper wrote:
> > Added missed Signed-off-by line.
> >
> > After a lot of debugging and long reading of Linux Kernel and Xen code
> > finally I killed deeply hidden bug in pv-grub. Details below.
> > Additionally, I am CC'ing this e-mail to LKML because this issue
> > looks like Linux Kernel problem, however, it is not.
> >
> > This patch applies to Xen Ver. 4.0, Xen Ver. 4.1 and unstable tree.
> >
> > # HG changeset patch
> > # User dkiper@xxxxxxxxxxxx
> > # Date 1303474763 -7200
> > # Node ID b33bf24be129b7b9cd2248460beb1298088c6af5
> > # Parent  dbf2ddf652dc3dd927447e79ef4bc586de55d708
> > Introduction of Linux Kernel git commit 
> > ceefccc93932b920a8ec6f35f596db05202a12fe
> > (x86: default CONFIG_PHYSICAL_START and CONFIG_PHYSICAL_ALIGN to 16 MB) 
> > revealed
> > deeply hidden bug in pv-grub. During kernel load stage dom->p2m_host[] list 
> > has
> > been incorrectly initialized.
> >
> > At the beginning of kernel load stage dom->p2m_host[] list is populated with
> > current pfn->mfn layout. Later during memory allocation (memory is allocated
> > page by page in kexec_allocate()) page order is changed to establish linear
> > layout in new domain. It is done by exchanging subsequent mfns with newly
> > allocated mfns. dom->p2m_host[] list is indexed by currently requested pfn
> > (it is incremented from 0) and pfn of newly allocated paged. If pfn of newly
> > allocated page is less than currently requested pfn then relevant earlier
> > allocated mfn is overwritten which leads to domain crash later. This patch
> > fix that issue. If pfn of newly allocated page is less then currently
> > requested pfn then relevant pfn/mfn pair is properly calculated and usual
> > exchange occurs later.
>
> Nice! I presume this fixes the issue you had at the Xen Hack-O-Thon with
> your guest right?

Yes, it does. It was very difficult to discover because that
issue overlapped with other memory management issues which
were coming out last time. Currently, I am working on time
optimized version of that patch.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel