From: "Jan Beulich" Subject: Re: dom0 pvops crash Date: Tue, 26 Jan 2010 11:53:57 +0000 Message-ID: <4B5EE5E5020000780002C085@vpn.id2.novell.com> References: <4B5DF8E5.9040906@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4B5DF8E5.9040906@goop.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: "xen-devel@lists.xensource.com" , Ian Jackson , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> Jeremy Fitzhardinge 25.01.10 21:02 >>> >I'll need to refresh my memory for the precise details, but the basic=20 >problem is that there's a path in the pagefault code where the kernel=20 >breaks its own locking rules by kmapping a high pte page without = holding=20 >the pagetable lock. In the native case this is OK, but it breaks Xen=20 >because the pte page can be unpinned at that point, but can race with = it=20 >being pinned on another CPU.This can fail in several ways, depending = on=20 >the exact timing: the other CPU's pin could fail because of the = writable=20 >kmapping, or the writable kmap could fail because the page has since=20 >become pinned. > >The brute-force fix is to lock the pte page properly, but given that = its=20 >in the hot part of the pagefault path, and the unlocked access is=20 >presumably a performance enhancement, I don't think that will fly. Are you referring to the pte_offset_map() in gup_pte_range()? If so, would it really be that unacceptable to put a high-page-and-on-Xen check in there, returning 0 from the function to force using the slow path? Jan