From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTIMW-0007Ld-N0 for qemu-devel@nongnu.org; Tue, 30 Oct 2012 16:24:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTIMV-0002EL-8E for qemu-devel@nongnu.org; Tue, 30 Oct 2012 16:24:36 -0400 Received: from ssl.dlhnet.de ([91.198.192.8]:58747 helo=ssl.dlh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTIMU-0002DL-Up for qemu-devel@nongnu.org; Tue, 30 Oct 2012 16:24:35 -0400 Message-ID: <5090377F.8030004@dlhnet.de> Date: Tue, 30 Oct 2012 21:24:31 +0100 From: Peter Lieven MIME-Version: 1.0 References: <508E8E21.6080406@dlhnet.de> <20121030083242.GC9918@stefanha-thinkpad.redhat.com> <508FF8B5.4070903@dlhnet.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Ubuntu/Debian Installer + Virtio-SCSI -> Bad ram pointer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: ronnie sahlberg , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" Am 30.10.2012 19:27, schrieb Stefan Hajnoczi: > On Tue, Oct 30, 2012 at 4:56 PM, Peter Lieven wrote: >> On 30.10.2012 09:32, Stefan Hajnoczi wrote: >>> On Mon, Oct 29, 2012 at 03:09:37PM +0100, Peter Lieven wrote: >>>> Hi, >>> Bug subject should be virtio-blk, not virtio-scsi. virtio-scsi is a >>> different virtio device type from virtoi-blk and is not present in the >>> backtrace you posted. >>> >>> Sounds pedantic but I want to make sure this gets chalked up against the >>> right device :). >>> >>>> If I try to Install Ubuntu 12.04 LTS / 12.10 64-bit on a virtio >>>> storage backend that supports iSCSI >>>> qemu-kvm crashes reliably with the following error: >>> Are you using vanilla qemu-kvm-1.2.0 or are there patches applied? >>> >>> Have you tried qemu-kvm.git/master? >>> >>> Have you tried a local raw disk image to check whether libiscsi is >>> involved? >>> >>>> Bad ram pointer 0x3039303620008000 >>>> >>>> This happens directly after the confirmation of the Timezone before >>>> the Disk is partitioned. >>>> >>>> If I specify -global virtio-blk-pci.scsi=off in the cmdline this >>>> does not happen. >>>> >>>> Here is a stack trace: >>>> >>>> Thread 1 (Thread 0x7ffff7fee700 (LWP 8226)): >>>> #0 0x00007ffff63c0a10 in abort () from /lib/x86_64-linux-gnu/libc.so.6 >>>> No symbol table info available. >>>> #1 >>>> 0x00005555557b751d in qemu_ram_addr_from_host_nofail ( >>>> ptr=0x3039303620008000) at /usr/src/qemu-kvm-1.2.0/exec.c:2835 >>>> ram_addr = 0 >>>> #2 >>>> 0x00005555557b9177 in cpu_physical_memory_unmap ( >>>> buffer=0x3039303620008000, len=4986663671065686081, is_write=1, >>>> access_len=1) at /usr/src/qemu-kvm-1.2.0/exec.c:3645 >>> buffer and len are ASCII junk. It appears to be hex digits and it's not >>> clear where they come from. >>> >>> It would be interesting to print *elem one stack frame up in #3 >>> virtqueue_fill() to show the iovecs and in/out counts. >> >> (gdb) print *elem > Great, thanks for providing this info: > >> $6 = {index = 3, out_num = 2, in_num = 4, in_addr = {1914920960, 1916656688, >> 2024130072, 2024130088, 0 , 4129, 93825009696000, >> 140737328183160, 0 }, out_addr = {2024130056, >> 2038414056, 0, 8256, 4128, 93824999311936, 0, 3, 0 , >> 12385, 93825009696000, 140737328183160, 0 }, > Up to here everything is fine. > >> in_sg = >> {{ >> iov_base = 0x3039303620008000, iov_len = 4986663671065686081}, { >> iov_base = 0x3830384533334635, iov_len = 3544389261899019573}, { > The fields are bogus, in_sg has been overwritten with ASCII data. > Unfortunately I don't see any hint of where this ASCII data came from > yet. > > The hdr fields you provided in stack frame #6 show that in_sg was > overwritten during or after the bdrv_ioctl() call. We pulled valid > data out of the vring and mapped buffers correctly. But something is > overwriting in_sg and when we complete the request we blow up due to > the bogus values. > > Please post your full qemu-kvm command-line. > > Please also post the exact qemu-kvm version you are using. I can see > it's based on qemu-kvm-1.2.0 but are there any patches applied (e.g. > distro packages may carry patches so the full package version > information would be useful)? Stefan, Ronnie, if I do remove the following patch from my cherry-picked patches its working again: iSCSI: We need to support SG_IO also from iscsi_ioctl() Peter