From owner-svn-src-all@freebsd.org Sat Aug 4 08:54:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D596010633CB; Sat, 4 Aug 2018 08:54:26 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31CDB8C277; Sat, 4 Aug 2018 08:54:26 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from odin.corp.delphij.net (unknown [IPv6:2601:646:8882:37a:3dd6:e226:c80f:febd]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 1CD8F2A5F5; Sat, 4 Aug 2018 01:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=m7e2; t=1533372865; x=1533387265; bh=ZbwStxn5JA4TQUdoOyzI8pedb+YjMcY1K2vNzaT9yHo=; h=Reply-To:To:References:From:Subject:Date:In-Reply-To; b=GA7ul4sF+wPmU4YBoWmWVf+p3Kn7HnjRSHxdZoCVl5ofMsLLs8xRoxlpdpkXGyOk3 VGrmox/cqs4YxmmbqDFhsgVYl6Jf0mqeZbDzURV7xiisoeqL/8PeG3aOWho2qHG6gn syXTVpxS5SVCAIXzeELNfhm3AgMaAz9yOscPmg1AiJc88g+alhvOGQ6tPj1tKEkbB2 EOSbWxBmiSys2A993s1AX9Vj8WuRYRDF4Wbepb3+4tuNJfm2QmwrfFB/jgC3TShsyK 8btmgFDRp8IbYimMH+JjiV+9FPD9s6GvsfOEJieQFDRet/B1V5hcRvXkq4nj4qUVa4 iB5lshkl+10tA== Reply-To: d@delphij.net To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, tsoome@freebsd.org References: <201808031911.w73JB0WK025164@repo.freebsd.org> From: Xin Li Openpgp: preference=signencrypt Autocrypt: addr=delphij@delphij.net; prefer-encrypt=mutual; keydata= xsFNBFJNzwQBEACuPNSJjL/AD8oHFuG72vtx5P7Q6dpiEbFABgw/IohS65yDZDd3qFH9ssQv AsFafwB/ofsk6t7dx6zIC05dv5qjhGIOKSJxFC4U1HAot9+QpeUG+8boTKZiiycrMruItj2U JANlv+gN5h0mAsL5f9eNzhRM43kdjN8cQnBIujhO54Derjnrnqz6cQtoonV6SvvVJZUQGxHK 5R1XYJ6wiTuvoEuRYnNObJmPFWZyYOaGZz0qqD6Qe1BhkZuRzv2bZxwJc3Raap/GF6Pm9J/c hlYHUmm2QLaXvmoP8WNosNjla1fup0tgYQE+7MTtHFVxmVj9ZTihN3rEL5IkeEKjQAqcpe1n Db8X2o4K262LRpFl8WtVMW2TfN5Avpj+knZMl3tkYGvYK/nfadCr6Af4co9mkhX6QYgkerg2 mXEGaQzSD/omnsxHCfqMgdphaX3B3eoY2Fv36BMpjSdHmm0rmwqjqZaqlZn89vQ/I6ATvLyx JsdHwTbrj57audl/RKC+OpREOJPaVULp1L+9zdBXslILO8MJaT6YEw1T29bEj5jvLm03Y4rF u/YTruHcMPpsGbpJckDKiy6ISAbMtPvz7/KR91xPHS6KExGiIakIX9xpIXIDKgq+ecEWwkFK PogoKqO6K0/GYkTRoKdXGzsILvIurtbPqSFqWzbRIyNOa82jowARAQABzRZYaW4gTGkgPGRA ZGVscGhpai5uZXQ+wsF9BBMBCgAnBQJTQvBFAhsjBQkJZgGABQsJCAcDBRUKCQgLBRYCAwEA Ah4BAheAAAoJEJW2GBstM+nsha4P/2Roa/REjZLZlIG1TKOxEDqmwc3fynX4w2g7/FXA7f7Z YO5N4vnnnQdJbDZDt4TJtiP1NHH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GZTNiz73tKYVdkKaQVyo8QJFLCNLnUulrQ5wXwteYPg6mrpBxu9VqgDrMp7eB T2kaZ4GRBoMWXXPYSIEe5PM5hhNCsSUfqrKj34UZPijPe+HiWoFJ4S5vIpzutiae11Ctki7u XzeLAhOJQB2raraIqDlFP9I9Zj9JOAZhmiKSEWKfOooCNxQYGiUdPrdYnAe+m7FXRomjF0OO gSepNIESt2gOEIbE5cMxQ0gAueNJc58eHCjWhsNJIwARAQABwsFlBBgBCgAPBQJSTc8EAhsM BQkJZgGAAAoJEJW2GBstM+nsh8EP/1sxZpkJelu+smmqaqdrGHlNrFVLOmeN5yr2IGHBUbmF htjr7fVoU8T0mUnlUU724aKPla4nWhMb4NMu+VxRRFGaT2TYpyR6VIxaStycyUdMGjdXV0Pz TGmxFXhNZXKEITXH9sIxuONBp1czl4AgwN7AAl1MKyV13AaLIyajs58mYmuXtyFn/O+4lxh5 nl2Fa3L9YkL9O7QU2p6WAnDky+L3PgUWp1AzJGfYlLZ8XXCi+KK+pnta+f9yKHt/Oqd/s7OC W4mXgFkBrfuSZZofa4eZckh5u0yBYW3OnEJhClgxRbuOhyYwqQr5oxPrQtjtbMiBzbrOkHhy NnrVCFd9EqlojREGDefHo3V+ZlUOc6OoN3CAYnNa2uLEOm5DCuqOE4z5atBCih5EyITPp7JP J2disEP6ddipcilqbnJdP+TyRQwSv5qRNy8cHahD1Cg9XJJHiC3qr+W3eOtqPkJxhU5biPEr 7dljaLS1Ij771brzqO/x5zW1L9py7muXzYBsW8+keKj8LOYs2242KgjI5Og9YhIJGBFBNddQ wxKBKQpytKQOiXwjhk4Nj77U796bsCd/jIS0r0ZUKBEptPyKso7ncfrm163aEmSaDUkiIjyp 9CEOVT87D+VAVh9PyLGP1niQzWEWFSK36tRGZlF0odP1ZB6wub9zq2DxFouSjHgH Subject: Re: svn commit: r337271 - head/stand/i386/libi386 Message-ID: <87cc3ae5-cbef-0d04-071e-cb7f7a410ce8@delphij.net> Date: Sat, 4 Aug 2018 01:54:22 -0700 User-Agent: Thunderbird MIME-Version: 1.0 In-Reply-To: <201808031911.w73JB0WK025164@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sLvrY7cl1RRdAnsYccFihl14kpNsTv5Fa" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2018 08:54:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sLvrY7cl1RRdAnsYccFihl14kpNsTv5Fa Content-Type: multipart/mixed; boundary="ZGRV3EdwnFbod01qzj7SedSQINKX01EmT"; protected-headers="v1" From: Xin Li Reply-To: d@delphij.net To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, tsoome@freebsd.org Message-ID: <87cc3ae5-cbef-0d04-071e-cb7f7a410ce8@delphij.net> Subject: Re: svn commit: r337271 - head/stand/i386/libi386 References: <201808031911.w73JB0WK025164@repo.freebsd.org> In-Reply-To: <201808031911.w73JB0WK025164@repo.freebsd.org> --ZGRV3EdwnFbod01qzj7SedSQINKX01EmT Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, Cy, On 8/3/18 12:11, Cy Schubert wrote: > Author: cy > Date: Fri Aug 3 19:11:00 2018 > New Revision: 337271 > URL: https://svnweb.freebsd.org/changeset/base/337271 >=20 > Log: > Some drives report a geometry that is inconsisetent with the total > number of sectors reported through the BIOS. Cylinders * heads * > sectors may not necessarily be equal to the total number of sectors > reported through int13h function 48h. > =20 > An example of this is when a Mediasonic HD3-U2B PATA to USB enclosure= > with a 80 GB disk is attached. Loader hangs at line 506 of > stand/i386/libi386/biosdisk.c while attempting to read sectors beyond= > the end of the disk, sector 156906855. I discovered that the Mediason= ic > enclosure was reporting the disk with 9767 cylinders, 255 heads, 63 > sectors/track. That's 156906855 sectors. However camcontrol and > Windows 10 both report report the disk having 156301488 sectors, not > the calculated value. At line 280 biosdisk.c sets the sectors to the > higher of either bd->bd_sectors or the total calculated at line 276 > (156906855) instead of the lower and correct value of 156301488 repor= ted > by int 13h 48h. > =20 > This was tested on all three of my Mediasonic HD3-U2B PATA to USB > enclosures. > =20 > Instead of using the higher of bd_sectors (returned by int13h) or the= > calculated value, this patch uses the lower and safer of the values. > =20 > Reviewed by: tsoome@ > Differential Revision: https://reviews.freebsd.org/D16577 >=20 > Modified: > head/stand/i386/libi386/biosdisk.c >=20 > Modified: head/stand/i386/libi386/biosdisk.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/stand/i386/libi386/biosdisk.c Fri Aug 3 18:52:51 2018 (r33727= 0) > +++ head/stand/i386/libi386/biosdisk.c Fri Aug 3 19:11:00 2018 (r33727= 1) > @@ -275,7 +275,7 @@ bd_int13probe(struct bdinfo *bd) > =20 > total =3D (uint64_t)params.cylinders * > params.heads * params.sectors_per_track; > - if (bd->bd_sectors < total) > + if (bd->bd_sectors > total) > bd->bd_sectors =3D total; > =20 > ret =3D 1; >=20 This broke loader on my system, but I think your reasoning was valid so I took a deeper look and discovered that on my system, INT 13h, function 48h would give zeros in EDD parameters' CHS fields. With that, the calculated CHS based total would be 0, and your change would cause bd_sectors be zeroed. Could you please let me know if https://reviews.freebsd.org/D16588 makes sense to you? (I'm not 100% certain if I have followed the code). It allowed my Asrock C2750D4I based board to boot from ZFS. Cheers, --ZGRV3EdwnFbod01qzj7SedSQINKX01EmT-- --sLvrY7cl1RRdAnsYccFihl14kpNsTv5Fa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJbZWnAAAoJEJW2GBstM+nstZkQAImlL2dAeCmOkNZ903AKK1pa YuDbZowlg3P+GC3OtWjHVzf4YDbWY1JQUS0IGqfmOUIAX/2J/MaQGZl9hk2kbc9p 6aJtt6a3H7PVVX8qyzi27eNrwUpZhaI4DA7aXE3i3ZeeUtHvlN0L1xOqT9x8vpcH qAn7XHFaR841PvhgGoySx/T6EGKIRHy9la8+6TVoIyZJbJ7QTVg6jgxA0swa3Kow ZWCj0ANQEG2beNHdUmqZqSGaVLPtGW9AGxLkxGc79a0WfYgk0BJkH40OVnucx+3v M9sFN0RBCsQVzIuwIEkq1PFbLLR3k61jqSGO9ctj3+1AxvXgQnpM/QPF+Mse51HE 0xN/EMw/ZI7xZySaycX+alpSxMWEXA5TBDBJ9UsnNhLt6J/E1LrNXKDTyjE2jNyw JMLNVpq1Lwm3wa6RrWrRVL//7GNphrksy3IHBHq+LtVa//BNrO/EfRIn+4SijbFn k9WFgXXouUvEl1zBH3DYzCYH08YdIjo1PjhZTSAdaJn8DT/VsFnOuuYDUgNEE11K fc69d+xG2AhhfQL1AYjKFcMfKQEuf+J9csbP3HjZfeltsiTLAuAcZq0A9dK/hTjW yd55Pm+3xqOALh6+OR4s47PlxPFWn5pFlKiSxJPhIwDgLmxmrA4Ao0as7/VjF+pD DLlqJzgYRP41sfPEXM6j =6FnU -----END PGP SIGNATURE----- --sLvrY7cl1RRdAnsYccFihl14kpNsTv5Fa--