From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: xen.git branch reorg / success with 2.6.30-rc3 pv_ops dom0 Date: Tue, 9 Jun 2009 17:53:11 +0300 Message-ID: <20090609145311.GO24960@edu.joroinen.fi> References: <1244217948.27370.213.camel@zakaz.uk.xensource.com> <1244218353.27370.216.camel@zakaz.uk.xensource.com> <20090605181925.GC24960@edu.joroinen.fi> <1244475935.27370.309.camel@zakaz.uk.xensource.com> <1244476858.27370.325.camel@zakaz.uk.xensource.com> <20090608161329.GG24960@edu.joroinen.fi> <1244477865.27370.329.camel@zakaz.uk.xensource.com> <20090608162146.GH24960@edu.joroinen.fi> <20090608170543.GJ24960@edu.joroinen.fi> <20090608191141.GL24960@edu.joroinen.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <20090608191141.GL24960@edu.joroinen.fi> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: Jeremy Fitzhardinge , Xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, Jun 08, 2009 at 10:11:41PM +0300, Pasi K=E4rkk=E4inen wrote: > On Mon, Jun 08, 2009 at 08:05:43PM +0300, Pasi K=E4rkk=E4inen wrote: > > On Mon, Jun 08, 2009 at 07:21:46PM +0300, Pasi K=E4rkk=E4inen wrote: > > > On Mon, Jun 08, 2009 at 05:17:45PM +0100, Ian Campbell wrote: > > > > On Mon, 2009-06-08 at 12:13 -0400, Pasi K=E4rkk=E4inen wrote: > > > > > On Mon, Jun 08, 2009 at 05:00:58PM +0100, Ian Campbell wrote: > > > > > > On Mon, 2009-06-08 at 11:45 -0400, Ian Campbell wrote: > > > > > > >=20 > > > > > > > > L4 at e1822000 is pinned contains L2 at e1977228 which po= ints at an > > > > > > > L1 > > > > > > > > which is unpinned low mem address 0x8bf8000 > > > > > > >=20 > > > > > > > OK so I think that is interesting. A pinned L4 referencing = an unpinned > > > > > > > L1 isn't supposed to happen, I don't think (Jeremy?). > > > > > >=20 > > > > > > Interesting: > > > > > >=20 > > > > > > pte_t *page_check_address(struct page *page, struct m= m_struct *mm, > > > > > > [...] > > > > > > pte =3D pte_offset_map(pmd, address); /* A */ > > > > > > /* Make a quick check before getting the lock */ > > > > > > if (!sync && !pte_present(*pte)) { > > > > > > pte_unmap(pte); > > > > > > return NULL; > > > > > > } > > > > > > =20 > > > > > > ptl =3D pte_lockptr(mm, pmd); > > > > > > spin_lock(ptl); > > > > > > [...] > > > > > > =20 > > > > > > So at point A we make a new mapping of a PTE without yet hold= ing the > > > > > > corresponding PTE lock and this is precisely the point at whi= ch things > > > > > > start to go wrong for us... (coincidence? I think not ;-)) > > > > > >=20 > > > > > > I wonder how this interacts with the logic in > > > > > > arch/x86/xen/mmu.c:xen_pin_page() which holds the lock while = waiting for > > > > > > the (deferred) pin multicall to occur? Hmm, no this is about = the > > > > > > PagePinned flag on the struct page which is out of date WRT t= he actual > > > > > > pinned status as Xen sees it -- we update the PagePinned flag= early in > > > > > > xen_pin_page() long before Xen the pin hypercall so this wind= ow is the > > > > > > other way round to what would be needed to trigger this bug. > > > > > >=20 > > > > > > On the other hand xen_unpin_page() looks like it sets up some= thing > > > > > > roughly like what we need for this issue to trigger. > > > > > >=20 > > > > > > Pasi in additional to my other mad hack could you try this: > > > > > >=20 > > > > >=20 > > > > > Ok.. do you want me to try first without this patch? Or should = I cancel my > > > > > kernel compilation and apply this aswell? :) > > > >=20 > > > > Can you try the first patch first then add this one please. > > > >=20 > > >=20 > > > Ok. Will do. > > >=20 > > > I was already starting to feel like 'maybe my hardware is broken' b= ut now that > > > code looks like it might be an actual bug :) > > >=20 > > > Let's see. > > >=20 > >=20 > > Crash with only the first patch applied: > > http://pasik.reaktio.net/xen/pv_ops-dom0-debug/pv_ops-dom0-log-05-wit= h-highpte-no-swap-with-debug3.txt > >=20 > > Now I'll try with the second one included aswell.. > >=20 >=20 > And here's one with the second patch applied aswell: > http://pasik.reaktio.net/xen/pv_ops-dom0-debug/pv_ops-dom0-log-06-with-= highpte-no-swap-with-debug4.txt >=20 > Seems to be different.. Xen is not complaining anymore.. >=20 And here's one with only the second patch applied: http://pasik.reaktio.net/xen/pv_ops-dom0-debug/pv_ops-dom0-log-07-with-hi= ghpte-no-swap-with-debug5.txt Now Xen is complaining again.. does that sound correct? -- Pasi