From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [Xen-devel] Fwd: NetBSD xl core-dump not working... Memory fault (core dumped) Date: Tue, 10 Dec 2013 10:41:58 +0000 Message-ID: <52A6EFF6.3030408@citrix.com> References: <52770EED.9090804@gmx.de> <52781C27.2040508@gmail.com> <1383820189.26213.152.camel@kazak.uk.xensource.com> <1383906558.3189.81.camel@kazak.uk.xensource.com> <5281F953.2060101@citrix.com> <1384250453.1883.37.camel@kazak.uk.xensource.com> <5281FE63.2060503@citrix.com> <5283730B.2020900@citrix.com> <529E1F9F.5040501@gmail.com> <6035A0D088A63A46850C3988ED045A4B66BFFA30@BITCOM1.int.sbss.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <6035A0D088A63A46850C3988ED045A4B66BFFA30@BITCOM1.int.sbss.com.au> Sender: port-xen-owner@NetBSD.org To: James Harper Cc: "Mike C." , =?ISO-8859-1?Q?Roger_Pau_Monn?= =?ISO-8859-1?Q?=E9?= , Ian Campbell , "xen-devel@lists.xensource.com" , "port-xen@netbsd.org" List-Id: xen-devel@lists.xenproject.org On 10/12/13 08:21, James Harper wrote: > I've been working with Mike on this today. After he re-applied the patch (something must have gone wrong initially), an ioctl error is repeated constantly instead of SIGSEGV: > > xc: error: xc_map_foreign_range: ioctl failed (14 = Bad address): Internal error > > I dumped out some of the variables though, and: > > nr_memory_map = 1 > pfn_start = 0, pfn_end = 1048575 > > this equates to 4GB of pfn's to be dumped on a vm with mem/maxmem = 256MB... is there code that skips empty pages? If not, that seems to be the explanation for the errors. > > James xc_map_foreign_range is completely broken as far as errors go. The privcmd driver ends up doing: if ( HYPERVISOR_mmu_update(foo,bar) < 0 ) return -EFAULT; Your best bet here is intercepting this and finding the real error. privcmd (and evenchn and gnttab) devices are generally broken as far as errors go, because it is impossible to distinguish between a kernel error and a Xen error. In someones copious free time, (possibly mine if I ever get any) a brand new set of ioctls on each of the Xen devices would not go amis. ~Andrew