From owner-freebsd-stable@FreeBSD.ORG Tue Jun 21 09:51:26 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F0E0106564A; Tue, 21 Jun 2011 09:51:26 +0000 (UTC) (envelope-from hlh@restart.be) Received: from tignes.restart.be (tignes.restart.be [IPv6:2001:41d0:2:56bf:0:1::]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE1B8FC12; Tue, 21 Jun 2011 09:51:25 +0000 (UTC) Received: from restart.be (avoriaz.tunnel.bel [IPv6:2001:41d0:2:56bf:1:ffff::]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.restart.be", Issuer "CA master" (verified OK)) by tignes.restart.be (Postfix) with ESMTPS id 92BEE148A0; Tue, 21 Jun 2011 11:51:24 +0200 (CEST) Received: from morzine.restart.bel (morzine.restart.be [IPv6:2001:41d0:2:56bf:1:2::]) (authenticated bits=0) by restart.be (8.14.5/8.14.5) with ESMTP id p5L9pMpi015012; Tue, 21 Jun 2011 11:51:23 +0200 (CEST) (envelope-from hlh@restart.be) X-DKIM: Sendmail DKIM Filter v2.8.3 restart.be p5L9pMpi015012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=restart.be; s=avoriaz; t=1308649883; bh=G9GjlDDEkrooZ61qNQfKBBK4y2PNZOoPyJsU9aN2CXk=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=c0EbDbqN8TN4kj5lI03NtYSSv8Ke3zP4tN+FowsUnyRwwNTm6WyC19z0d2ymH0/iI hvGADV0fqlAQanw7/6uWQ== X-DomainKeys: Sendmail DomainKeys Filter v1.0.2 restart.be p5L9pMpi015012 DomainKey-Signature: a=rsa-sha1; s=avoriaz; d=restart.be; c=nofws; q=dns; h=message-id:date:from:organization:user-agent:mime-version:to:cc: subject:references:in-reply-to:content-type:content-transfer-encoding; b=QNRhYPBEE2YrZe+dXwD3brUMSIR7JuVu4B7Z9/xSFKLfbZ6deTVfnP5d2BAFRYf97 uzWDbMoj4TMaiiTh3+7IA== Message-ID: <4E00699A.7010403@restart.be> Date: Tue, 21 Jun 2011 11:51:22 +0200 From: Henri Hennebert Organization: RestartSoft User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.17) Gecko/20110616 Thunderbird/3.1.10 MIME-Version: 1.0 To: John Baldwin References: <201106171337.39104.jhb@freebsd.org> <4DFC6A07.7090607@restart.be> <201106200951.47449.jhb@freebsd.org> In-Reply-To: <201106200951.47449.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: ZFS boot inside on the second partition inside a slice X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 09:51:26 -0000 On 06/20/2011 15:51, John Baldwin wrote: > On Saturday, June 18, 2011 5:04:07 am Henri Hennebert wrote: >> On 06/17/2011 19:37, John Baldwin wrote: >>> On Friday, June 17, 2011 1:06:22 pm Henri Hennebert wrote: >>>> On 06/16/2011 19:35, John Baldwin wrote: >>>>> On Thursday, June 16, 2011 8:45:41 am Zhihao Yuan wrote: >>>>>> Exactly. The MFCed ZFSv28 is different from any patch maintained by >>>>>> mm@. Maybe some untested changes involved. >>>>> >>>>> Can you try reverting this change: >>>>> >>>>> Author: jhb >>>>> Date: Thu Apr 28 17:44:24 2011 >>>>> New Revision: 221177 >>>>> URL: http://svn.freebsd.org/changeset/base/221177 >>>>> >>>>> Log: >>>>> Due to space constraints, the UFS boot2 and boot1 use an evil hack where >>>>> boot2 calls back into boot1 to perform disk reads. The ZFS MBR boot blocks >>>>> do not have the same space constraints, so remove this hack for ZFS. >>>>> While here, remove commented out code to support C/H/S addressing from >>>>> zfsldr. The ZFS and GPT bootstraps always just use EDD LBA addressing. >>>>> >>>>> MFC after: 2 weeks >>>>> >>>>> Modified: >>>>> head/sys/boot/i386/boot2/Makefile >>>>> head/sys/boot/i386/common/drv.c >>>>> head/sys/boot/i386/zfsboot/Makefile >>>>> head/sys/boot/i386/zfsboot/zfsldr.S >>>>> >>>> I try with this revision (221177) reverted to no avail: >>>> same error - 'read error' >>> >>> Hmm, ok. No other ideas off the top of my head. >>> >> I make the same test under virtualbox and get: >> >> A critical error has occurred while running the virtual machine and the >> machine execution has been stopped. >> >> I attach VBox.log. >> >> PS - the message 'ZFS: supported version 28' comes from my patch: >> >> Index: sys/boot/zfs/zfsimpl.c >> =================================================================== >> --- sys/boot/zfs/zfsimpl.c (revision 212549) >> +++ sys/boot/zfs/zfsimpl.c (working copy) >> @@ -61,6 +61,8 @@ >> STAILQ_INIT(&zfs_vdevs); >> STAILQ_INIT(&zfs_pools); >> >> + printf("ZFS: supported version %u\n", (unsigned) SPA_VERSION); >> + >> zfs_temp_buf = malloc(TEMP_SIZE); >> zfs_temp_end = zfs_temp_buf + TEMP_SIZE; >> zfs_temp_ptr = zfs_temp_buf; > > Hmm, can you add printfs and narrow down where the hang happens (or which > reads are failing)? The VBOX log seems to make no sense. It shows the > CPU trying to call into the BIOS from within protected mode in the loader > but that shouldn't ever happen (note a cs of 0x2b (which is the loader's > %cs selector) but an eip that looks like a cs:ip of a BIOS routine). > I just try to put printf but I get only 'Read error' without any of my printf. Previously event my printf in zfs_init don't show up on the console of my netbook. Under VBox it was printed. Maybe printf is not allowed so soon in zfsboot ? For the record, I write the bootcode with this 2 commands after booting with mfsbsd (from mm@) and fetching zfsboot in /tmp: dd if=/tmp/zfsboot of=/dev/ad0s2a bs=512 count=1 dd if=/tmp/zfsboot of=/dev/ad0s2a bs=512 skip=1 seek=1024 My debugging patch in zfsboot.c: [root@morzine zfsboot]# svn diff zfsboot.c Index: zfsboot.c =================================================================== --- zfsboot.c (revision 223081) +++ zfsboot.c (working copy) @@ -447,10 +447,16 @@ off_t off; struct dsk *dsk; + printf("==>trying to boot\n"); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + printf("==>about to call bios_getmem()\n"); + bios_getmem(); + printf("==>bios_getmem() completed\n"); + if (high_heap_size > 0) { heap_end = PTOV(high_heap_base + high_heap_size); heap_next = PTOV(high_heap_base); @@ -482,6 +488,8 @@ autoboot = 1; + printf("==>about to call zfs_init()\n"); + zfs_init(); /* Henri