From owner-freebsd-current@FreeBSD.ORG Tue Feb 23 22:04:08 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B19E1065781; Tue, 23 Feb 2010 22:04:08 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ew0-f228.google.com (mail-ew0-f228.google.com [209.85.219.228]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7938FC14; Tue, 23 Feb 2010 22:04:07 +0000 (UTC) Received: by ewy28 with SMTP id 28so16469ewy.33 for ; Tue, 23 Feb 2010 14:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=8l85eDSkJNqACJisjKkFrUPA44pWiX1VikJEXPH62q8=; b=KEbcV9zn7FBFpnaSCx3sIfCf9MKsJnPsHB/4e6vBKsrmanKZgZE91YrvwCos3q+QFR 0PKK5IBD/a3eApAc9aefRVv0ws221/Looea2i7cRomadAqIaHCbG09yOBDdxDQ3IceeT b6s/jHNwPbXpG9nJrrZPB8CyGWFtPFjm6p2DA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MTJH7/lsgsqI3C72e0e5qUv1StZHZh6uvVTM5dqwAGdWBeJs+VEbVU+yRG3AYb65M9 iV/RQn0vSn3+3SpiiFZUuwxpIdE4RTR5VLNuTooNLDlYdpKupZbFRI6Kp+Ywbi+PMJJY sW7vLijk6hB6VspxOLZBesRk15rwJxav6pxZE= MIME-Version: 1.0 Received: by 10.213.109.152 with SMTP id j24mr1363540ebp.25.1266962643712; Tue, 23 Feb 2010 14:04:03 -0800 (PST) In-Reply-To: <201002231603.36500.jhb@freebsd.org> References: <747dc8f31002220835g481b0baeqb1d6df32a79b7da2@mail.gmail.com> <201002231401.22852.jhb@freebsd.org> <179b97fb1002231236l3924a264u87380c83c1484e50@mail.gmail.com> <201002231603.36500.jhb@freebsd.org> Date: Tue, 23 Feb 2010 16:04:03 -0600 Message-ID: <179b97fb1002231404x1b5fce88v1d76450cc70473a1@mail.gmail.com> From: Brandon Gooch To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: ZFS boot problems with memory > 1MB X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 22:04:08 -0000 On Tue, Feb 23, 2010 at 3:03 PM, John Baldwin wrote: > On Tuesday 23 February 2010 3:36:19 pm Brandon Gooch wrote: >> On Tue, Feb 23, 2010 at 1:01 PM, John Baldwin wrote: >> > On Tuesday 23 February 2010 12:36:31 pm Brandon Gooch wrote: >> >> On Tue, Feb 23, 2010 at 10:24 AM, John Baldwin wrot= e: >> >> > On Tuesday 23 February 2010 10:28:49 am Brandon Gooch wrote: >> >> >> On Tue, Feb 23, 2010 at 7:29 AM, Andriy Gapon wr= ote: >> >> >> > on 23/02/2010 13:18 Renato Botelho said the following: >> >> >> >> On Mon, Feb 22, 2010 at 7:35 PM, Chris Hedley >> >> >> >> wrote: >> >> >> > [snip] >> >> >> >>> Do you have USB legacy support enabled in your BIOS? =A0I'm no= t sure > if >> >> >> >>> there's an option for the loader to use USB devices natively, = but > the BIOS's >> >> >> >>> legacy option where it provides AT/PS2 emulation is probably t= he > easiest way >> >> >> >>> to get the keyboard working. >> >> >> >> >> >> >> >> Yes, I do, but it seems to be a regression on FreeBSD itself, I= had > this problem >> >> >> >> in the past and I checked the same things i need to check in th= e > past again and >> >> >> >> everything is fine. >> >> >> > >> >> >> > A more precise way to state that would be "a regression in FreeB= SD > boot/loader". >> >> >> > I think that you are referring to the issue that was fixed by > r189017. >> >> >> > It might be worthwhile investigating what was done in that revis= ion > and what >> >> >> > happened in sys/boot code since then. >> >> >> > >> >> >> > One possibility is that your BIOS uses memory above 1MB for USB > emulation, but >> >> >> > doesn't mark that memory as used in system memory map. =A0In tha= t case > that memory >> >> >> > could be overwritten by the loader. =A0If that's true then the b= lame > is on the BIOS. >> >> >> > =A0Alternatively, our code might be parsing the system memory ma= p > incorrectly. >> >> >> > But I am just making wild guesses here. >> >> >> > >> >> >> >> >> >> I don't know if it is at all related, but this commit has caused >> >> >> problems for me booting at least one of my machines: >> >> >> >> >> >> > http://svn.freebsd.org/viewvc/base/head/sys/boot/i386/zfsboot/zfsboot.c?r= 1=3D199714&r2=3D200309 >> >> >> >> >> >> Commit message: >> >> >> >> >> >> Revision 200309 - (view) (annotate) - [select for diffs] >> >> >> Modified Wed Dec 9 20:36:56 2009 UTC (2 months, 2 weeks ago) by jh= b >> >> >> File length: 24893 byte(s) >> >> >> Diff to previous 199714 >> >> >> - Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to >> >> >> =A0 safely allocate a heap region above 1MB. =A0This enables > {gpt,}zfsboot() >> >> >> =A0 to allocate much larger buffers than before. >> >> >> - Use a larger buffer (1MB instead of 128K) for temporary ZFS buff= ers. > =A0This >> >> >> =A0 allows more reliable reading of compressed files in a raidz/ra= idz2 > pool. >> >> >> >> >> >> Submitted by: Matt Reimer =A0mattjreimer of gmail >> >> >> MFC after: =A0 =A01 week >> >> > >> >> > Starting a new thread, which problems are you seeing with this chan= ge? > =A0ZFS is >> >> > a good bit more memory hungry than UFS, so it really needs to use h= igh > memory >> >> > for its heap. =A0Also, I wonder if you still have problems if you u= se the > older >> >> > zfsboot with the newer zfsloader? =A0Finally, you need to use diskl= abel - > B or >> >> > some such to update the zfsboot bits for this change to take effect= . >> >> > >> >> > -- >> >> > John Baldwin >> >> > >> >> >> >> I filed a PR so it wouldn't fall through the cracks: >> >> >> >> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D144234 >> >> >> >> I guess I tried a combination of various revisions of bootstrap code >> >> and loaders when I first encountered the issue. It was when I wrote a >> >> recent gptzfsboot to the geom that I saw the symptoms: >> >> >> >> error 1 lba 48 >> >> error 1 lba 1 >> >> No ZFS pools located, can't boot >> >> >> >> I just wound up using sys/boot/i386/zfsboot/zfsboot.c revision 199714 >> >> to build a working gptzfsboot on another system and wrote that to the >> >> disk to get the machine operational. >> > >> > Try this: >> > >> > Index: zfsboot.c >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- zfsboot.c =A0 (revision 204207) >> > +++ zfsboot.c =A0 (working copy) >> > @@ -467,6 +467,7 @@ >> > =A0static inline void >> > =A0putc(int c) >> > =A0{ >> > + =A0 =A0v86.ctl =3D 0; >> > =A0 =A0 v86.addr =3D 0x10; >> > =A0 =A0 v86.eax =3D 0xe00 | (c & 0xff); >> > =A0 =A0 v86.ebx =3D 0x7; >> > @@ -617,6 +618,8 @@ >> > =A0 =A0 off_t off; >> > =A0 =A0 struct dsk *dsk; >> > >> > + =A0 =A0dmadat =3D (void *)(roundup2(__base + (int32_t)&_end, 0x10000= ) - > __base); >> > + >> > =A0 =A0 bios_getmem(); >> > >> > =A0 =A0 if (high_heap_size > 0) { >> > @@ -627,9 +630,6 @@ >> > =A0 =A0 =A0 =A0heap_end =3D (char *) PTOV(bios_basemem); >> > =A0 =A0 } >> > >> > - =A0 =A0dmadat =3D (void *)(roundup2(__base + (int32_t)&_end, 0x10000= ) - > __base); >> > - =A0 =A0v86.ctl =3D V86_FLAGS; >> > - >> > =A0 =A0 dsk =3D malloc(sizeof(struct dsk)); >> > =A0 =A0 dsk->drive =3D *(uint8_t *)PTOV(ARGS); >> > =A0 =A0 dsk->type =3D dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; >> > @@ -1157,6 +1157,7 @@ >> > =A0 =A0 =A0* when no such key is pressed in reality. As far as I can t= ell, >> > =A0 =A0 =A0* this only happens shortly after a reboot. >> > =A0 =A0 =A0*/ >> > + =A0 =A0v86.ctl =3D V86_FLAGS; >> > =A0 =A0 v86.addr =3D 0x16; >> > =A0 =A0 v86.eax =3D fn << 8; >> > =A0 =A0 v86int(); >> > >> > -- >> > John Baldwin >> > >> >> It still breaks: >> >> error 1 lba 48 >> error 1 lba 1 >> No ZFS pools located, can't boot > > Ok. =A0Can you add a printf to zfsboot.c to print out dsk->start in the c= ase > that you get an error? =A0error 1 means that the BIOS thinks it got a bad > parameter, presumably in the disk packet. =A0If you wanted to be ambitiou= s, just > print out all of the fields in the packet when it fails. > > -- > John Baldwin > Adding printf statements to drvread(): printf("dsk->xxx: %u\n", dsk->xxx): Output: error 1 lba 48 dsk->drive: 0 dsk->type: 0 dsk->unit: 0 dsk->slice: 0 dsk->part: 0 dsk->init: 0 dsk->start: 978673664 error 1 lba 1 dsk->drive: 0 dsk->type: 0 dsk->unit: 0 dsk->slice: 0 dsk->part: 0 dsk->init: 0 dsk->start: 0 No ZFS pools located, can't boot -Brandon