From: Brendan Cully Subject: Re: trouble with the new mmap-batch interface Date: Wed, 20 Jan 2010 13:38:12 -0800 Message-ID: <20100120213812.GC4658@kremvax.cs.ubc.ca> References: <20100120070212.GB498@zanzibar.kublai.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zYM0uCDKw75PZbzx" Return-path: Content-Disposition: inline In-Reply-To: <20100120070212.GB498@zanzibar.kublai.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 19 January 2010 at 23:02, Brendan Cully wrote: > Hi all, > > I'm having some trouble with the new mmap-batch ioctl. With ioemu > revision a0066d "use new (replacement) mmap-batch ioctl" applied, my > HVM domain dies as soon as it is unpaused. The first suspicious line > in xm dmesg is > > (XEN) HVM3: - REP INSB across page boundaries ... Bad value at 0x005ffffc: saw 00000000 e > (XEN) HVM3: xpected ff000000 > (XEN) HVM3: Bad value at 0x00601000: saw 00000000 expected 000000ff > (XEN) HVM3: failed > > and the qemu log ends at > cirrus vga map change while on lfb mode > > If I revert to ioemu 3b531c "passthrough: fix a printf format > specifier" then the INSB test passes and the domain runs fine. > > I'm running 32-bit 2.6.18.8 dom0 (984:0bec29c94ce9), 32-bit HVM guest, > and 64-bit xen (Tue Jan 19 15:44:54 2010 +0000 20824:07f95839e431) > > It seems unlikely to me that this is actual breakage, but I've built > world a couple of times. Before I put printfs everywhere I thought I'd > ask if anyone else had seen this or had any ideas. The attached patch fixes ioemu for me. --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mapforeignbulk-prezeroerr.patch" # HG changeset patch # User Brendan Cully # Date 1264023273 28800 # Node ID fe58c98dd43f370b5461e3ad451b2520dd6b9e2e # Parent b0b41e735575ec6fc1d7d56f3cffa9246058881a xc_map_foreign_bulk: unconditionally prezero error array MMAPBATCH_V2 does not touch the array unless a mapping fails, so it is up to the caller to zero it before making the ioctl. Signed-off-by: Brendan Cully diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c --- a/tools/libxc/xc_linux.c +++ b/tools/libxc/xc_linux.c @@ -159,6 +159,9 @@ ioctlx.arr = arr; ioctlx.err = err; + if (num > 0) + memset(err, 0, sizeof(*err) * num); + rc = ioctl(xc_handle, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx); if ( rc < 0 && errno == ENOENT ) --zYM0uCDKw75PZbzx Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --zYM0uCDKw75PZbzx--