From owner-freebsd-current@freebsd.org Sun Nov 27 01:39:40 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 698B9C585C7 for ; Sun, 27 Nov 2016 01:39:40 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0053.outbound.protection.outlook.com [207.46.100.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 095069A0; Sun, 27 Nov 2016 01:39:38 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM (10.169.141.138) by YQBPR01MB0178.CANPRD01.PROD.OUTLOOK.COM (10.169.141.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Sat, 26 Nov 2016 23:06:27 +0000 Received: from YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM ([10.169.141.138]) by YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM ([10.169.141.138]) with mapi id 15.01.0747.015; Sat, 26 Nov 2016 23:06:27 +0000 From: Rick Macklem To: Alan Somers , Konstantin Belousov CC: FreeBSD CURRENT Subject: Re: NFSv4 performance degradation with 12.0-CURRENT client Thread-Topic: NFSv4 performance degradation with 12.0-CURRENT client Thread-Index: AQHSRhIPtzL8Jj0C/0q6PJtKKLQgMaDn2GqAgAA8DvaAAGR2gIAAPUCRgACtAACAAEDk+4AAF32AgACCDYCAAaeOTQ== Date: Sat, 26 Nov 2016 23:06:26 +0000 Message-ID: References: <20161124090811.GO54029@kib.kiev.ua> <20161125084106.GX54029@kib.kiev.ua> <20161125135725.GD54029@kib.kiev.ua>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-office365-filtering-correlation-id: 0aa07be5-c1ec-41d3-fabc-08d41650d99e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:YQBPR01MB0178; x-microsoft-exchange-diagnostics: 1; YQBPR01MB0178; 7:v+QPOK1mKkaUxL8IEG2PH190ssXzFN7f2zknEwFbINQj2UW4ljmSRM8M2Qp8w+J+JzuTPMWfYTm8zy/EWlNXlr/4dAStHomPRjYp98vswkosp/eHmFxmPYPAmfOKpZ7vJyjSLWmZgHEDpOiUXgz2SF5h11mrXc9ZVIVz3Ye5AdGeGsUpNMbgr1Eppjvocn9VK+pUcK/akJEJ7rBxC+cwowioxy20i2ED0VhmJbxFUqiAGgrZxDV9Fin4I/th0/lGq91jrfg69KVSAv4uhsforanOTYK4kiuIhRuCLgnZmWG2V7xcLkqVDV3cNWaYOpk/a2Ihl+wWJUTy4ozSSzLQKrjAgOCcGzyfnhWQEt6dRTQ4DDpeYAEZ8K9j88pyaOWmbtr7ZrKKJFekP7+YfnoiOEau8knjbQGBYxlO/SLV2vHEvnag0CmWuByaNjUZdI3GQBMkJOHcZSNyz+6LdK8SQQ== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6060326)(6040361)(6045199)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(6061324)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(2016111802025)(6043046); SRVR:YQBPR01MB0178; BCL:0; PCL:0; RULEID:; SRVR:YQBPR01MB0178; x-forefront-prvs: 0138CD935C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(189002)(24454002)(199003)(86362001)(68736007)(97736004)(81166006)(3660700001)(81156014)(9686002)(3280700002)(8676002)(105586002)(5001770100001)(33656002)(93886004)(189998001)(5660300001)(76176999)(102836003)(38730400001)(39060400001)(39450400002)(92566002)(50986999)(122556002)(8936002)(305945005)(77096006)(39400400001)(229853002)(39380400001)(39410400001)(7696004)(2900100001)(6506003)(101416001)(2950100002)(2906002)(4326007)(74482002)(54356999)(106116001)(7846002)(106356001)(74316002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR01MB0178; H:YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Nov 2016 23:06:26.8060 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR01MB0178 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 01:39:40 -0000 Alan Somers wrote: [stuff snipped] >Mounting nullfs with the nocache option, ad kib suggested, fixed the >problem. Also, applying kib's patch and then mounting nullfs with >default options also fixed the problem. Here is the nfsstat output >for "ls -al" when using kib's patch. Notice the client has far fewer >opens: I did a quick test which confirmed that the opens get closed when the "noca= che" option is used on the nullfs mount as well. Kostik, I think your patch is a good idea and you can consider it reviewed = by me if you'd like. I also did a quick test wth unionfs and it did not accumulate opens, so it = doesn't seem to suffer from this problem. (It does have issues, as noted by the BUG= S section of the mount_unionfs man page.) rick From owner-freebsd-current@freebsd.org Sun Nov 27 03:31:49 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3205C567C4 for ; Sun, 27 Nov 2016 03:31:49 +0000 (UTC) (envelope-from null@pozo.com) Received: from pozo.com (pozo.com [50.197.129.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "pozo.com", Issuer "pozo.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 627C1F0; Sun, 27 Nov 2016 03:31:49 +0000 (UTC) (envelope-from null@pozo.com) Received: from octo.pozo.com (octo.pozo.com [192.168.0.2]) (authenticated bits=128) by pozo.com (8.15.2/8.15.2) with ESMTPA id uAR3MCfp063887; Sat, 26 Nov 2016 19:22:12 -0800 (PST) (envelope-from null@pozo.com) From: Manfred Antar Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: syslogd dumps core on amd64 cuurent Message-Id: <66A941B1-CB9E-4022-B966-52C7EB662E89@pozo.com> Date: Sat, 26 Nov 2016 19:22:12 -0800 To: freebsd-current@freebsd.org, Baptiste Daroussin X-Mailer: Apple Mail (2.3251) X-Spam-Status: No, score=-102.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, USER_IN_WHITELIST autolearn=ham autolearn_force=no version=3.4.1, No X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on pozo.com X-pozocom-MailScanner-Information: Please contact the ISP for more information X-pozocom-MailScanner-ID: uAR3MCfp063887 X-pozocom-MailScanner: Found to be clean X-pozocom-MailScanner-From: null@pozo.com X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 03:31:49 -0000 Todays change to syslogd.c causes it to dump core on starting: (syslogd)5014}/etc/rc.d/syslogd stop Stopping syslogd. Waiting for PIDS: 731. (syslogd)5015}make install install -s -o root -g wheel -m 555 syslogd /usr/sbin/syslogd install -o root -g wheel -m 444 syslog.conf.5.gz /usr/share/man/man5/ install -o root -g wheel -m 444 syslogd.8.gz /usr/share/man/man8/ (syslogd)5016}/etc/rc.d/syslogd start Starting syslogd. syslogd: child pid 21052 exited on signal 4 (core dumped) /etc/rc.d/syslogd: WARNING: failed to start syslogd (syslogd)5017} the change was to the file syslogd.c : --- syslogd.c 2016-11-26 19:14:55.086134000 -0800 +++ syslogd.c.new 2016-11-26 07:58:53.382705000 -0800 @@ -1835,6 +1835,7 @@ free((char *)f); } Files = NULL; + *nextp = NULL; /* open the configuration file */ if ((cf = fopen(ConfFile, "r")) == NULL) { From owner-freebsd-current@freebsd.org Sun Nov 27 05:18:00 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30BA9C583E4 for ; Sun, 27 Nov 2016 05:18:00 +0000 (UTC) (envelope-from null@pozo.com) Received: from pozo.com (pozo.com [50.197.129.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "pozo.com", Issuer "pozo.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C3F50E6A; Sun, 27 Nov 2016 05:17:59 +0000 (UTC) (envelope-from null@pozo.com) Received: from octo.pozo.com (octo.pozo.com [192.168.0.2]) (authenticated bits=128) by pozo.com (8.15.2/8.15.2) with ESMTPA id uAR5Hsf2028940; Sat, 26 Nov 2016 21:17:54 -0800 (PST) (envelope-from null@pozo.com) From: Manfred Antar Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: syslogd dumps core on amd64 cuurent - working now Message-Id: Date: Sat, 26 Nov 2016 21:17:53 -0800 To: freebsd-current@freebsd.org, Baptiste Daroussin X-Mailer: Apple Mail (2.3251) X-Spam-Status: No, score=-102.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, USER_IN_WHITELIST autolearn=ham autolearn_force=no version=3.4.1, No X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on pozo.com X-pozocom-MailScanner-Information: Please contact the ISP for more information X-pozocom-MailScanner-ID: uAR5Hsf2028940 X-pozocom-MailScanner: Found to be clean X-pozocom-MailScanner-From: null@pozo.com X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 05:18:00 -0000 I rebuilt world and it is working now From owner-freebsd-current@freebsd.org Sun Nov 27 11:46:46 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82515C589D7 for ; Sun, 27 Nov 2016 11:46:46 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 65B7CF46 for ; Sun, 27 Nov 2016 11:46:46 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: by mailman.ysv.freebsd.org (Postfix) id 623D5C589D6; Sun, 27 Nov 2016 11:46:46 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60187C589D5 for ; Sun, 27 Nov 2016 11:46:46 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0C3BF45; Sun, 27 Nov 2016 11:46:44 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from thor.walstatt.dynvpn.de ([92.225.34.14]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LtJ5T-1cqJy33z0F-012sex; Sun, 27 Nov 2016 12:46:37 +0100 Date: Sun, 27 Nov 2016 12:46:31 +0100 From: "O. Hartmann" To: John Baldwin Cc: current@freebsd.org Subject: Re: Please test EARLY_AP_STARTUP Message-ID: <20161127124631.1e4f1fb0@thor.walstatt.dynvpn.de> In-Reply-To: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/eIRlBuYrefrJmtsNWEQCL9q"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:xDO5CYeTJc3LWGOnuOVCmNJsal6qHHCW1D6moGpop6oZtqBapw/ Y0wyH1qWOFDe3e3qGFIkqFlN84NDqGKuORrp1D3GCwKhOXglGxsYje37d9SGNwU4a0iUx3+ mxoeWHTZrC4kMI5P5XQhKWJlD/2dFM/fcgjhHTHrD+d7z8DSgcFy1JXWZByweTiUZOXmFxT 7lN+SNLGBN36GU0TadaiQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:mh8mehERQDA=:Dwdlj/BTiBaDXTrqIeTSLX tpDGDUGo9UixNH22awvGwrvqBsZu89yxgjJnMveYophyYH7eoN4HI+oDvwjPMYupmP4LmFeQk gDEMJfb+KdsE2kV7kBzYgBvF3LqVpzaSp5R8hyW24j8rYiManIb3T6h3YvERaaf/129fuecii ZT9r0QLChEkg6I5967/gNN6LtCWkOxRayic2fLPXlSTOjfUpmmXQt63vKTtksoSuTzrfbVcPf 62JkJeO1XIhIkWndnoONDTsHlfhfTk6oNESppDLdgHoOiFX6op+QmXlSfZQcGYM1FcNUdmmNf Ahap+M0E8N4ZnYoDid/RR/zxC57BuiTwFM8fnlHHRmF3GT65Ogt1vN+mdy3DRE1mZL9jXYhz9 IyLEAdTCQzIID6TvjtytN2cZGzKNyVln7kR9HsgB7Aj8X5jP7Od1679JTtn4bk5TRzNCQTj95 /gDN+dPaDdpcHipZ4zyWi1BM0r12DuzufDBTY8l/cYdY6TFZruACmUjUHfW6I9WiBx+wYLrIR okzZKZKwo20Tl3ykUNNUHM/AItnxS+wg5+PNvdH05z2CwVfnXNCz0Z8Kq0beOJroWpTf3yLUH KF8nyljxj72NLtUhfQ/d8ASR1CCx9z8wMzsNUPHIxfCCS5Vv9Rj0DFKdvOr5ydrc/RSH+JmHo jw5WkFfvgTclm8OETIvnM2CMmPP5TH7Qkpd/I+xrfXp28MvupXZ9dqGOjJXkJlArYNsyl9xOP DO+b/ncxcFMnUqmzEIBAbs5UdcQSW0waDHumZInM1AXJPUW5bMSGGLnQtLY= X-Mailman-Approved-At: Sun, 27 Nov 2016 12:35:50 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 11:46:46 -0000 --Sig_/eIRlBuYrefrJmtsNWEQCL9q Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Fri, 25 Nov 2016 10:20:36 -0800 John Baldwin schrieb: > I plan to enable EARLY_AP_STARTUP on x86 in a week on HEAD. Some folks > have been testing it for the last week or so which has exposed some=20 > additional things to fix. I think I've resolved most of those in one > way or another, but it will make things smoother if other folks can > start testing this over the next few days before it is enabled by default. >=20 > (To enable, add 'options EARLY_AP_STARTUP' to your kernel config.) >=20 > Note that non-x86 platforms should eventually adopt this, but I don't > think any of them are ready yet. >=20 I tried. I use three boxes, all running most recent CURRENT. Only one box d= oes work and boot with the option mentioned above in the kernel. The other two don't, th= ey stop at printing something about HPET timer initialisation and stop - forever. I did not digg deeper into it, but there is something strange: Both failing boxes have CPUs with two cores, four threads. One is a noteboo= k with an Haswell 4200M, the other is a i3-3220. The i3-3220 box has a motherboard ASROCK Z77-Pro4 (UEFI on this crap is not= working), 8 GB RAM (2x 4GB), lates firmware from 2013.=20 The working box has an ASROCK Z77-Pro4 M (mini ATX size mobo), 16 GB RAM (2= x 8GB), but a 4 core/8 thread XEON IvyBridge E3-1245 V2. The firmare is the latest, from = 2013. The box is running well with the option EARLY_AP_STARTUP set.=20 At a first glance it looks like the failure is dependend on the CPU count ;= -) I have also a small PCengine APU 2C4, AMD Jaguar CPU with 4 core/4 threads which is abo= ut to be tested also with the most recent CURRENT and the option in question set - but it t= akes time. Just for the record, my apologizes if someone feels disturbed from naive ob= servations. Kind regards, oh --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/eIRlBuYrefrJmtsNWEQCL9q Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWDrHlwAKCRDS528fyFhY lHj1Af4r9LX/SFMfm2WcXtn/KbOX5icSgwJHrR2u4796ydR47OcjNtRRlgkLZQMn yDgtAKPyUlgysqfCd+aHM18ZywmsAf94P2FLh7T4pRPaC90mGEQ649dzD7noSuC+ ocEdFx9xrO8Kt7HKO/Tu+wheUtS5jMvs23tYVXtHMBaZU7O6cSEq =hvnj -----END PGP SIGNATURE----- --Sig_/eIRlBuYrefrJmtsNWEQCL9q-- From owner-freebsd-current@freebsd.org Sun Nov 27 14:06:53 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC53C55E08 for ; Sun, 27 Nov 2016 14:06:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81894931; Sun, 27 Nov 2016 14:06:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uARE6kf5082876 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 27 Nov 2016 16:06:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uARE6kf5082876 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uARE6k4l082875; Sun, 27 Nov 2016 16:06:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 27 Nov 2016 16:06:46 +0200 From: Konstantin Belousov To: Rick Macklem Cc: Alan Somers , FreeBSD CURRENT Subject: Re: NFSv4 performance degradation with 12.0-CURRENT client Message-ID: <20161127140646.GL54029@kib.kiev.ua> References: <20161124090811.GO54029@kib.kiev.ua> <20161125084106.GX54029@kib.kiev.ua> <20161125135725.GD54029@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 14:06:54 -0000 On Sat, Nov 26, 2016 at 11:19:19PM +0000, Rick Macklem wrote: > Konstantin Belousov wrote: > [stuff snipped] > >I thought that the issue was in tracking any opens and mmaps, but from this > >reply it is not that clear. Do you need callback when all opens and mmaps > >have ended, or only opens and mmaps for write ? If later, we already have > >a suitable mechanism VOP_ADD_WRITECOUNT(). > > Not quite. The NFSv4 client needs to Close the NFSv4 Open after all I/O on > the file has been done. This applies to both reads and writes. > Since mmap'd files can generate I/O after the VOP_CLOSE(), the NFSv4 client > can't do the NFSv4 Close in VOP_CLOSE(). > Since it can't do it then, it waits until VOP_INACTIVE() to do the NFSv4 Close. > > This might be improved by: > - A flag that indicates that an open file descriptor has been mmap()d, which > VOP_CLOSE() could check to decide if it can do the NFSv4 Close. > (ie. It could do the NFSv4 Close if the file descriptor hasn't been mmap()d.) > - If the system knows when mmap()d I/O is done (the process has terminated?), > it could do a VOP_MMAP_IO_DONE() and the NFSv4 client would do the NFSv4 Close > in it. > --> I don't know if this is feasible and I suspect if it could be done, that it would > usually happen just before VOP_INACTIVE(). { This case of nullfs caching was an > exception, I think? } > > Does this clarify it? rick Thank you, yes, it clarifies the things, and makes it clear that my idea is not feasible. It is not hard to count number of mappings for the vnode object, but I do not want to do this by straight-forward addition of the counter to the vnode or vm object, since that would significantly increase amount of memory used by VFS. From owner-freebsd-current@freebsd.org Sun Nov 27 14:47:40 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59921C56E0D for ; Sun, 27 Nov 2016 14:47:40 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 437E41A1 for ; Sun, 27 Nov 2016 14:47:40 +0000 (UTC) (envelope-from jhs@berklix.com) Received: by mailman.ysv.freebsd.org (Postfix) id 3FFBAC56E0C; Sun, 27 Nov 2016 14:47:40 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F98FC56E0B for ; Sun, 27 Nov 2016 14:47:40 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB57D1A0 for ; Sun, 27 Nov 2016 14:47:39 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (p5083C3BA.dip0.t-ipconnect.de [80.131.195.186]) (authenticated bits=128) by land.berklix.org (8.15.2/8.15.2) with ESMTPA id uARElZOL013917 for ; Sun, 27 Nov 2016 14:47:36 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id uARElVZi064908 for ; Sun, 27 Nov 2016 15:47:31 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id uARElJNS088687 for ; Sun, 27 Nov 2016 15:47:31 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <201611271447.uARElJNS088687@fire.js.berklix.net> cc: current@freebsd.org Subject: Re: boot fails on Table SSDT at 0x... From: "Julian H. Stacey" Organization: http://berklix.eu BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ In-reply-to: Your message "Sat, 26 Nov 2016 18:57:06 +0100." <201611261757.uAQHv6rm078055@fire.js.berklix.net> Date: Sun, 27 Nov 2016 15:47:19 +0100 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 14:47:40 -0000 "Julian H. Stacey" wrote: > Hi current@FreeBSD.org > I was running > FreeBSD lapr.js.berklix.net 12.0-CURRENT FreeBSD 12.0-CURRENT > #12753: Tue Nov 22 23:31:24 CET 2016 > jhs@lapr.js.berklix.net:/data/release/12.0-CURRENT/usr/src/sys/amd64/compile/LAPR.small > amd64 > I updated to > .ctm_status src-cur 12757 > .svn_revision 309126 > did a make world, built a new custom kernel with same config as before & now > laptop boot fails after > Table SSDT at 0x... > ACPI: No SRAT table found > > I took a pic of frozen screen, & I have svn here, I need to research > & provide more info to whoever ? so this just initial info to whoever's > working in the area. Debug suggestions & syntax welcome. I'll build > a generic kernel next. > > If I may be slow responding, sorry, DSL modem problems here too, hence > getting an initial error report out while I can. A generic kernel boots OK. A 2nd build of custom config fails to boot. Table 'ASPT' at 0x937e2000 Table 'SSDT' at 0x937e1000 Table 'SSDT' at 0x937e0000 Table 'SSDT' at 0x937df000 ACPI: No SRAT table found cd /sys/amd64/conf ; diff -c JENERIC.small LAPR.small *** JENERIC.small Sun Nov 27 15:09:47 2016 --- LAPR.small Sun Nov 27 15:09:48 2016 *************** *** 1,15 **** cpu HAMMER ! ident JHS_Generic makeoptions DEBUG=-g makeoptions WITH_CTF=1 options SCHED_ULE options PREEMPTION options INET - options INET6 - options IPSEC options TCP_OFFLOAD options TCP_HHOOK - options SCTP options FFS options SOFTUPDATES options UFS_ACL --- 1,12 ---- cpu HAMMER ! ident JHS_Lapr makeoptions DEBUG=-g makeoptions WITH_CTF=1 options SCHED_ULE options PREEMPTION options INET options TCP_OFFLOAD options TCP_HHOOK options FFS options SOFTUPDATES options UFS_ACL *************** *** 23,33 **** --- 20,32 ---- options NFS_ROOT options MSDOSFS options CD9660 + options UDF options PROCFS options PSEUDOFS options GEOM_PART_GPT options GEOM_RAID options GEOM_LABEL + options GEOM_BDE options COMPAT_FREEBSD32 options COMPAT_FREEBSD4 options COMPAT_FREEBSD5 *************** *** 71,76 **** --- 70,78 ---- options SMP options DEVICE_NUMA device cpufreq + options IPFIREWALL + options IPFIREWALL_VERBOSE + options IPDIVERT device acpi options ACPI_DMAR device pci *************** *** 81,134 **** device ata device mvs device siis - device ahc - options AHC_REG_PRETTY_PRINT - device ahd - options AHD_REG_PRETTY_PRINT - device esp - device hptiop - device isp - device mpt - device mps - device mpr - device sym - device trm - device adv - device adw - device aic - device bt - device isci device scbus - device ch device da - device sa device cd device pass device ses - device amr - device arcmsr - device ciss - device dpt - device hptmv - device hptnr - device hptrr - device hpt27xx - device iir - device ips - device mly - device twa - device tws - device aac - device aacp - device aacraid - device ida - device mfi - device mlx - device mrsas - device pmspcv - device twe - device nvme - device nvd device atkbdc device atkbd device psm --- 83,93 ---- *************** *** 150,202 **** device ppbus device lpt device ppi - device puc device bxe - device de - device em - device igb - device ix - device ixv - device ixl - device ixlv - device le - device ti - device txp - device vx device miibus - device ae - device age - device alc - device ale - device bce - device bfe - device bge - device cas - device dc - device et - device fxp - device gem - device hme - device jme - device lge - device msk - device nfe - device nge - device pcn - device re - device rl - device sf - device sge - device sis - device sk - device ste - device stge - device tl - device tx - device vge - device vr - device wb - device xl device wlan options IEEE80211_DEBUG options IEEE80211_AMPDU_AGE --- 109,116 ---- *************** *** 221,226 **** --- 135,143 ---- device ral device wi device wpi + device bge + device sound + device "snd_hda" device loop device random device padlock_rng *************** *** 234,253 **** device bpf options USB_DEBUG device uhci - device ohci device ehci device xhci device usb device ukbd device umass - device sound - device snd_cmi - device snd_csa - device snd_emu10kx - device snd_es137x - device snd_hda - device snd_ich - device snd_via8233 device mmc device mmcsd device sdhci --- 151,162 ---- device bpf options USB_DEBUG device uhci device ehci device xhci device usb + device urndis device ukbd device umass device mmc device mmcsd device sdhci *************** *** 261,265 **** options XENHVM device xenpci device vmx - device netmap device crypto --- 170,175 ---- options XENHVM device xenpci device vmx device crypto + device coretemp + options EXT2FS Cheers, Julian -- Julian Stacey, BSD Linux Unix Sys Eng Consultant Munich Reply below, Prefix '> '. Plain text, No .doc, base64, HTML, quoted-printable. http://berklix.eu/brexit/#stolen_votes From owner-freebsd-current@freebsd.org Sun Nov 27 16:31:09 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60FF8C58F86 for ; Sun, 27 Nov 2016 16:31:09 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6B56DE for ; Sun, 27 Nov 2016 16:31:09 +0000 (UTC) (envelope-from jhs@berklix.com) Received: by mailman.ysv.freebsd.org (Postfix) id 4AB71C58F85; Sun, 27 Nov 2016 16:31:09 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A500C58F84 for ; Sun, 27 Nov 2016 16:31:09 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49E46DC for ; Sun, 27 Nov 2016 16:31:08 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (p5083C55C.dip0.t-ipconnect.de [80.131.197.92]) (authenticated bits=128) by land.berklix.org (8.15.2/8.15.2) with ESMTPA id uARGV4fh017638 for ; Sun, 27 Nov 2016 16:31:05 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id uARF7Fmv066235 for ; Sun, 27 Nov 2016 16:07:15 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id uARF73wR088756 for ; Sun, 27 Nov 2016 16:07:15 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <201611271507.uARF73wR088756@fire.js.berklix.net> cc: current@freebsd.org Subject: Re: boot fails on Table SSDT at 0x... From: "Julian H. Stacey" Organization: http://berklix.eu BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ In-reply-to: Your message "Sun, 27 Nov 2016 15:47:19 +0100." Date: Sun, 27 Nov 2016 16:07:03 +0100 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 16:31:09 -0000 "Julian H. Stacey" wrote: > "Julian H. Stacey" wrote: > > Hi current@FreeBSD.org > > I was running > > FreeBSD lapr.js.berklix.net 12.0-CURRENT FreeBSD 12.0-CURRENT > > #12753: Tue Nov 22 23:31:24 CET 2016 > > jhs@lapr.js.berklix.net:/data/release/12.0-CURRENT/usr/src/sys/amd64/compile/LAPR.small > > amd64 > > I updated to > > .ctm_status src-cur 12757 > > .svn_revision 309126 > > did a make world, built a new custom kernel with same config as before & now > > laptop boot fails after > > Table SSDT at 0x... > > ACPI: No SRAT table found > > > > I took a pic of frozen screen, & I have svn here, I need to research > > & provide more info to whoever ? so this just initial info to whoever's > > working in the area. Debug suggestions & syntax welcome. I'll build > > a generic kernel next. > > > > If I may be slow responding, sorry, DSL modem problems here too, hence > > getting an initial error report out while I can. > > A generic kernel boots OK. > A 2nd build of custom config fails to boot. > Table 'ASPT' at 0x937e2000 > Table 'SSDT' at 0x937e1000 > Table 'SSDT' at 0x937e0000 > Table 'SSDT' at 0x937df000 > ACPI: No SRAT table found > > cd /sys/amd64/conf ; diff -c JENERIC.small LAPR.small > *** JENERIC.small Sun Nov 27 15:09:47 2016 > --- LAPR.small Sun Nov 27 15:09:48 2016 > *************** > *** 1,15 **** > cpu HAMMER > ! ident JHS_Generic > makeoptions DEBUG=-g > makeoptions WITH_CTF=1 > options SCHED_ULE > options PREEMPTION > options INET > - options INET6 > - options IPSEC > options TCP_OFFLOAD > options TCP_HHOOK > - options SCTP > options FFS > options SOFTUPDATES > options UFS_ACL > --- 1,12 ---- > cpu HAMMER > ! ident JHS_Lapr > makeoptions DEBUG=-g > makeoptions WITH_CTF=1 > options SCHED_ULE > options PREEMPTION > options INET > options TCP_OFFLOAD > options TCP_HHOOK > options FFS > options SOFTUPDATES > options UFS_ACL > *************** > *** 23,33 **** > --- 20,32 ---- > options NFS_ROOT > options MSDOSFS > options CD9660 > + options UDF > options PROCFS > options PSEUDOFS > options GEOM_PART_GPT > options GEOM_RAID > options GEOM_LABEL > + options GEOM_BDE > options COMPAT_FREEBSD32 > options COMPAT_FREEBSD4 > options COMPAT_FREEBSD5 > *************** > *** 71,76 **** > --- 70,78 ---- > options SMP > options DEVICE_NUMA > device cpufreq > + options IPFIREWALL > + options IPFIREWALL_VERBOSE > + options IPDIVERT > device acpi > options ACPI_DMAR > device pci > *************** > *** 81,134 **** > device ata > device mvs > device siis > - device ahc > - options AHC_REG_PRETTY_PRINT > - device ahd > - options AHD_REG_PRETTY_PRINT > - device esp > - device hptiop > - device isp > - device mpt > - device mps > - device mpr > - device sym > - device trm > - device adv > - device adw > - device aic > - device bt > - device isci > device scbus > - device ch > device da > - device sa > device cd > device pass > device ses > - device amr > - device arcmsr > - device ciss > - device dpt > - device hptmv > - device hptnr > - device hptrr > - device hpt27xx > - device iir > - device ips > - device mly > - device twa > - device tws > - device aac > - device aacp > - device aacraid > - device ida > - device mfi > - device mlx > - device mrsas > - device pmspcv > - device twe > - device nvme > - device nvd > device atkbdc > device atkbd > device psm > --- 83,93 ---- > *************** > *** 150,202 **** > device ppbus > device lpt > device ppi > - device puc > device bxe > - device de > - device em > - device igb > - device ix > - device ixv > - device ixl > - device ixlv > - device le > - device ti > - device txp > - device vx > device miibus > - device ae > - device age > - device alc > - device ale > - device bce > - device bfe > - device bge > - device cas > - device dc > - device et > - device fxp > - device gem > - device hme > - device jme > - device lge > - device msk > - device nfe > - device nge > - device pcn > - device re > - device rl > - device sf > - device sge > - device sis > - device sk > - device ste > - device stge > - device tl > - device tx > - device vge > - device vr > - device wb > - device xl > device wlan > options IEEE80211_DEBUG > options IEEE80211_AMPDU_AGE > --- 109,116 ---- > *************** > *** 221,226 **** > --- 135,143 ---- > device ral > device wi > device wpi > + device bge > + device sound > + device "snd_hda" > device loop > device random > device padlock_rng > *************** > *** 234,253 **** > device bpf > options USB_DEBUG > device uhci > - device ohci > device ehci > device xhci > device usb > device ukbd > device umass > - device sound > - device snd_cmi > - device snd_csa > - device snd_emu10kx > - device snd_es137x > - device snd_hda > - device snd_ich > - device snd_via8233 > device mmc > device mmcsd > device sdhci > --- 151,162 ---- > device bpf > options USB_DEBUG > device uhci > device ehci > device xhci > device usb > + device urndis > device ukbd > device umass > device mmc > device mmcsd > device sdhci > *************** > *** 261,265 **** > options XENHVM > device xenpci > device vmx > - device netmap > device crypto > --- 170,175 ---- > options XENHVM > device xenpci > device vmx > device crypto > + device coretemp > + options EXT2FS > The boot fail is between SRAT & PPIM, using src from svn 12757, as shown by dmesg on svn 12757 based generic kernel : ---- Table 'FACP' at 0x937fc000 Table 'ASF!' at 0x937fd000 Table 'HPET' at 0x937fb000 Table 'APIC' at 0x937fa000 APIC: Found table at 0x937fa000 APIC: Using the MADT enumerator. MADT: Found CPU APIC ID 0 ACPI ID 1: enabled SMP: Added CPU 0 (AP) MADT: Found CPU APIC ID 1 ACPI ID 2: enabled SMP: Added CPU 1 (AP) MADT: Found CPU APIC ID 4 ACPI ID 3: enabled SMP: Added CPU 4 (AP) MADT: Found CPU APIC ID 5 ACPI ID 4: enabled SMP: Added CPU 5 (AP) MADT: Found CPU APIC ID 0 ACPI ID 5: disabled MADT: Found CPU APIC ID 0 ACPI ID 6: disabled MADT: Found CPU APIC ID 0 ACPI ID 7: disabled MADT: Found CPU APIC ID 0 ACPI ID 8: disabled Copyright (c) 1992-2016 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #12757: Sun Nov 27 13:54:37 CET 2016 jhs@lapr.js.berklix.net:/data/release/12.0-CURRENT/usr/src/sys/amd64/compile/GENERIC amd64 FreeBSD clang version 3.9.0 (tags/RELEASE_390/final 280324) (based on LLVM 3.9.0) WARNING: WITNESS option enabled, expect reduced performance. Table 'FACP' at 0x937fc000 Table 'ASF!' at 0x937fd000 Table 'HPET' at 0x937fb000 Table 'APIC' at 0x937fa000 Table 'MCFG' at 0x937f9000 Table 'SLIC' at 0x937e9000 Table 'BOOT' at 0x937e6000 Table 'ASPT' at 0x937e2000 Table 'SSDT' at 0x937e1000 Table 'SSDT' at 0x937e0000 Table 'SSDT' at 0x937df000 ACPI: No SRAT table found PPIM 0: PA=0xa0000, VA=0xffffffff82410000, size=0x10000, mode=0 VT(vga): resolution 640x480 Preloaded elf kernel "/boot/kernel.old/kernel" at 0xffffffff82217000. Calibrating TSC clock ... TSC clock: 2128430512 Hz CPU: Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz (2128.43-MHz K8-class CPU) Origin="GenuineIntel" Id=0x20652 Family=0x6 Model=0x25 Stepping=2 Features=0xbfebfbff Features2=0x98e3bd AMD Features=0x28100800 AMD Features2=0x1 VT-x: Basic Features=0xda0400 Pin-Based Controls=0x7f Primary Processor Controls=0xfff9fffe Secondary Processor Controls=0xff Exit Controls=0xda0400 Entry Controls=0xda0400 ---- Cheers, Julian -- Julian Stacey, BSD Linux Unix Sys Eng Consultant Munich Reply below, Prefix '> '. Plain text, No .doc, base64, HTML, quoted-printable. http://berklix.eu/brexit/#stolen_votes From owner-freebsd-current@freebsd.org Sun Nov 27 17:19:11 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13005C590B5 for ; Sun, 27 Nov 2016 17:19:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id F35C483C for ; Sun, 27 Nov 2016 17:19:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id EFEB3C590B4; Sun, 27 Nov 2016 17:19:10 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDEB5C590B3 for ; Sun, 27 Nov 2016 17:19:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2A7E83A for ; Sun, 27 Nov 2016 17:19:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id E92D610A729; Sun, 27 Nov 2016 12:19:01 -0500 (EST) From: John Baldwin To: "O. Hartmann" Cc: current@freebsd.org Subject: Re: Please test EARLY_AP_STARTUP Date: Sun, 27 Nov 2016 09:18:46 -0800 Message-ID: <2030105.iquFVMheHd@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20161127124631.1e4f1fb0@thor.walstatt.dynvpn.de> References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> <20161127124631.1e4f1fb0@thor.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sun, 27 Nov 2016 12:19:02 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 17:19:11 -0000 On Sunday, November 27, 2016 12:46:31 PM O. Hartmann wrote: > Am Fri, 25 Nov 2016 10:20:36 -0800 > John Baldwin schrieb: > > > I plan to enable EARLY_AP_STARTUP on x86 in a week on HEAD. Some folks > > have been testing it for the last week or so which has exposed some > > additional things to fix. I think I've resolved most of those in one > > way or another, but it will make things smoother if other folks can > > start testing this over the next few days before it is enabled by default. > > > > (To enable, add 'options EARLY_AP_STARTUP' to your kernel config.) > > > > Note that non-x86 platforms should eventually adopt this, but I don't > > think any of them are ready yet. > > > > I tried. I use three boxes, all running most recent CURRENT. Only one box does work and > boot with the option mentioned above in the kernel. The other two don't, they stop at > printing something about HPET timer initialisation and stop - forever. > > I did not digg deeper into it, but there is something strange: > > Both failing boxes have CPUs with two cores, four threads. One is a notebook with an > Haswell 4200M, the other is a i3-3220. > > The i3-3220 box has a motherboard ASROCK Z77-Pro4 (UEFI on this crap is not working), 8 > GB RAM (2x 4GB), lates firmware from 2013. > > The working box has an ASROCK Z77-Pro4 M (mini ATX size mobo), 16 GB RAM (2x 8GB), but a > 4 core/8 thread XEON IvyBridge E3-1245 V2. The firmare is the latest, from 2013. The box > is running well with the option EARLY_AP_STARTUP set. > > At a first glance it looks like the failure is dependend on the CPU count ;-) I have also > a small PCengine APU 2C4, AMD Jaguar CPU with 4 core/4 threads which is about to be tested > also with the most recent CURRENT and the option in question set - but it takes time. > > Just for the record, my apologizes if someone feels disturbed from naive observations. Some things to help debug: - See if you can break into the debugger via Ctrl-Alt-Esc. If so, please grab the output of 'ps' and 'tr 0' from DDB. - Boot with SMP disabled (kern.smp.disabled=1). This isn't a permament solution but can help narrow down the issue. - Compile a kernel with KTR, KTR_COMPILE=KTR_PROC, KTR_VERBOSE, and KTR_MASK=KTR_PROC (all are options) and boot. Hopefully it stops printing lines when it hangs rather than spinning forever. If so, grab a screen shot (or console serial log) when it hangs. -- John Baldwin From owner-freebsd-current@freebsd.org Sun Nov 27 17:43:14 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17FD5C59B0B for ; Sun, 27 Nov 2016 17:43:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E6445100E for ; Sun, 27 Nov 2016 17:43:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id E55B1C59B09; Sun, 27 Nov 2016 17:43:13 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5110C59B08 for ; Sun, 27 Nov 2016 17:43:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD702100C for ; Sun, 27 Nov 2016 17:43:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x235.google.com with SMTP id m5so57506798ioe.3 for ; Sun, 27 Nov 2016 09:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ApylgUVfI9kp9TLVj2p0rKergb1c73YW3Xp7361ZPYk=; b=qCdzM0h5v+UDusG8jeVftQnKlU1lYaJe0RQzBl72kYR6qNYMIu5JuDC/ndJQEV+oQX GHtq+YFXzUGvlPy6/HaYNQnViVbaztjOVp/rIH9e2laVzyiE5oXCOtk5PyOHrvdC3IVC QnO73i5clSGYGbU7JkI1HpaWi/IqpbkrSPhcAqL9MqmDsIEMHiF84VDMawBCj4DC7cIB vs4WAK/TwjGgQxM3R4z1w5Coc/hebfh0J3oNiVBYhaTaOajPFPklK3XXNBcFeRpGMowc oDNCZGml65G+6zLrsM0Be3f+50cuydL0jMXrW2vJ+ZiTizj2dPlUl12us6XUjubjUgH8 pwYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ApylgUVfI9kp9TLVj2p0rKergb1c73YW3Xp7361ZPYk=; b=d83qc9usKZuHxuEl9xrhU42QkSepmEnN5msPKpjGlZEEkefHmvLahM1kEz1ghS5lVp RGVqnL7rMBkR8FYsWD/IUWRqwDSvw/TVvWYrngdyyPt5RU8TveqJRYr4N7Vk3yd3yKiT e4F9i4nW2BRDV1/rl0ytR5rgWDt0KMLOyEgEtVzx47bD+PrYJ52PUihvA+HfF35Ps5CQ cZOTIV8iFiTx+lwWATZ3P+JQOEtJZChhU9PT80qP9z56GSCTNVl/CudxB7nH92h5X709 47z2TfTqMEDsXq8XiD7H23ZA25swD8271j+K8o32+7MhWOeO4T/GiJg7Bk/002KDRrhE 1HTw== X-Gm-Message-State: AKaTC00KtLQcjWW0DbOme7DthZFaD8PcgxWclRS/Oq+nfsMR/zzZsn7hoRb7DjahoF0WRMrIw7piLGoQ/46MAg== X-Received: by 10.36.43.193 with SMTP id h184mr14868669ita.29.1480268593143; Sun, 27 Nov 2016 09:43:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Sun, 27 Nov 2016 09:43:12 -0800 (PST) In-Reply-To: <20161126215916.GK99742@zxy.spb.ru> References: <20161126092124.GM57876@zxy.spb.ru> <20161126173753.GH99742@zxy.spb.ru> <20161126183943.GI99742@zxy.spb.ru> <20161126215139.GJ99742@zxy.spb.ru> <20161126215916.GK99742@zxy.spb.ru> From: Adrian Chadd Date: Sun, 27 Nov 2016 09:43:12 -0800 Message-ID: Subject: Re: Enabling NUMA in BIOS stop booting FreeBSD To: Slawa Olhovchenkov Cc: "current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Nov 2016 17:43:14 -0000 On 26 November 2016 at 13:59, Slawa Olhovchenkov wrote: > On Sat, Nov 26, 2016 at 01:55:14PM -0800, Adrian Chadd wrote: > >> ok, hm. then i don' know offhand, not without putting in printf debugging. :) > > I am not expert in this code, I am need you patches for printf debugging. heh, sorry, I'm too busy atm to help out more with this. My day job doesn't involve FreeBSD at all and I have 802.11ac to get off the ground. Someone else will have to help figure this out :( -adrian From owner-freebsd-current@freebsd.org Mon Nov 28 02:34:58 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1498C59B40 for ; Mon, 28 Nov 2016 02:34:58 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-34.reflexion.net [208.70.210.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 762CC1F75 for ; Mon, 28 Nov 2016 02:34:57 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 17772 invoked from network); 28 Nov 2016 02:34:41 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 28 Nov 2016 02:34:41 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.20.0) with SMTP; Sun, 27 Nov 2016 21:35:03 -0500 (EST) Received: (qmail 1460 invoked from network); 28 Nov 2016 02:35:03 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 28 Nov 2016 02:35:03 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 047DBEC9011; Sun, 27 Nov 2016 18:34:55 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309144 - in head: lib/libipsec sys/net sys/netipsec [-r309174 does not fix everything] Message-Id: <938D4472-267F-4CDA-A6BA-6A62A1AB054F@dsl-only.net> Date: Sun, 27 Nov 2016 18:34:55 -0800 Cc: FreeBSD Current To: svn-src-head@freebsd.org, rakuco@FreeBSD.org, fabien.thomas@stormshield.eu, Ed Maste X-Mailer: Apple Mail (2.3251) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 02:34:58 -0000 key_debug.c is not the only place with problems : The below is based on my experience with head -r309179. First what someone else reported: > On Fri, Nov 25, 2016 at 05:34:51PM +0100, O. Hartmann wrote:=20 > > Recent sources do not build kernel due to:=20 > >=20 > > [...]=20 > > Building /usr/obj/usr/src/sys/SB21X1/ipsec_mbuf.o=20 > > In file included from /usr/src/sys/netipsec/ipsec_mbuf.c:43:=20 > > In file included from /usr/src/sys/netipsec/ipsec.h:46:=20 > > In file included from /usr/src/sys/netipsec/keydb.h:38:=20 > > /usr/src/sys/sys/mutex.h:367:2: error: LOCK_DEBUG not defined, = include =20 > > before #error LOCK_DEBUG not defined, include = before=20 > > ^=20 > > /usr/src/sys/sys/mutex.h:369:5: error: 'LOCK_DEBUG' is not defined, = evaluates to 0=20 > > [-Werror,-Wundef] #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE)=20 > > ^=20 > > 2 errors generated.=20 > > *** Error code 1=20 (From: = https://lists.freebsd.org/pipermail/freebsd-current/2016-November/063920.h= tml ) I ran into the same thing in the same place. Like O. Hartmann I followed the compiler's advice to work around the problem. That allowed my buildworld buildkernel to complete. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-current@freebsd.org Mon Nov 28 03:50:36 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4A6C59136; Mon, 28 Nov 2016 03:50:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D440B7A; Mon, 28 Nov 2016 03:50:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f172.google.com with SMTP id m5so71829291ioe.3; Sun, 27 Nov 2016 19:50:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=6D7MdErKWIS8YX53UbGOJO7/tAw7xrZ+89sKBkAP7Mc=; b=MREqDc6DAzy4ytZMH3wW1PEFn/hT1ebgFcegzcbsWp88P00EntPiiCG7uY8O77XWSM 1GKX2uPfz/d3BcVgow0UaMZ2Y6XfBH7p4QO2pTvx32usTbI10JsvXEfyjATAQviqwbTD J113xmSkgGcR9hkuTJ5m2f2uCWvxeKZJXMUsyyPGLJ8nbck8gOS41Tuk4wz0G038aiYY ZmaRQXr71DtRIeJcHtdIHSByI4p02FT8ylhM3BKL+inYJrLIJuv8ocZdXXXfkfnRNWKu ClpfmiunP8NzMiu4LOZ5sm+Aqpv4wsncNSBqLT85DMus4al09A/vSiyfOdbeSwlxK+O7 fp+g== X-Gm-Message-State: AKaTC0360YiRw/QLkpj8emZBUNfk1+NBVdOCNGgypSVeFfMvRHTuNRrdBKsxEXaRwQ0qdw== X-Received: by 10.36.189.201 with SMTP id x192mr16166203ite.114.1480303185909; Sun, 27 Nov 2016 19:19:45 -0800 (PST) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id g185sm8615596ith.14.2016.11.27.19.19.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 19:19:45 -0800 (PST) Received: by mail-io0-f181.google.com with SMTP id m5so71035335ioe.3; Sun, 27 Nov 2016 19:19:45 -0800 (PST) X-Received: by 10.36.7.71 with SMTP id f68mr12877353itf.104.1480303185205; Sun, 27 Nov 2016 19:19:45 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.109.68 with HTTP; Sun, 27 Nov 2016 19:19:44 -0800 (PST) In-Reply-To: <938D4472-267F-4CDA-A6BA-6A62A1AB054F@dsl-only.net> References: <938D4472-267F-4CDA-A6BA-6A62A1AB054F@dsl-only.net> From: Conrad Meyer Date: Sun, 27 Nov 2016 19:19:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309144 - in head: lib/libipsec sys/net sys/netipsec [-r309174 does not fix everything] To: Mark Millard Cc: svn-src-head@freebsd.org, rakuco@freebsd.org, fabien.thomas@stormshield.eu, Ed Maste , FreeBSD Current Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 03:50:36 -0000 Hi Mark, I believe this was addressed by Scott Long in r309201. r309174 (an incomplete fix for the same problem) can probably be reverted. Best, Conrad On Sun, Nov 27, 2016 at 6:34 PM, Mark Millard wrote: > key_debug.c is not the only place with problems : The below is > based on my experience with head -r309179. First what someone > else reported: > >> On Fri, Nov 25, 2016 at 05:34:51PM +0100, O. Hartmann wrote: >> > Recent sources do not build kernel due to: >> > >> > [...] >> > Building /usr/obj/usr/src/sys/SB21X1/ipsec_mbuf.o >> > In file included from /usr/src/sys/netipsec/ipsec_mbuf.c:43: >> > In file included from /usr/src/sys/netipsec/ipsec.h:46: >> > In file included from /usr/src/sys/netipsec/keydb.h:38: >> > /usr/src/sys/sys/mutex.h:367:2: error: LOCK_DEBUG not defined, include >> > before #error LOCK_DEBUG not defined, include before >> > ^ >> > /usr/src/sys/sys/mutex.h:369:5: error: 'LOCK_DEBUG' is not defined, evaluates to 0 >> > [-Werror,-Wundef] #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE) >> > ^ >> > 2 errors generated. >> > *** Error code 1 > (From: https://lists.freebsd.org/pipermail/freebsd-current/2016-November/063920.html ) > > I ran into the same thing in the same place. > > Like O. Hartmann I followed the compiler's advice to work around > the problem. That allowed my buildworld buildkernel to complete. > > > === > Mark Millard > markmi at dsl-only.net > > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" From owner-freebsd-current@freebsd.org Mon Nov 28 04:39:29 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA18AC59F56 for ; Mon, 28 Nov 2016 04:39:29 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: from mail.hs.ntnu.edu.tw (mail.hs.ntnu.edu.tw [140.131.149.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8A01383 for ; Mon, 28 Nov 2016 04:39:28 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: by mail.hs.ntnu.edu.tw (Postfix, from userid 800) id 518A11C6471; Mon, 28 Nov 2016 12:33:51 +0800 (CST) Received: from [140.113.215.9] (IP-215-9.cs.nctu.edu.tw [140.113.215.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: iblis@hs.ntnu.edu.tw) by mail.hs.ntnu.edu.tw (Postfix) with ESMTPSA id 35B171C644A for ; Mon, 28 Nov 2016 12:33:51 +0800 (CST) From: iblis Subject: r308432: Capsicumized `basename` make zsh prompt broken To: FreeBSD Current Message-ID: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> Date: Mon, 28 Nov 2016 12:33:50 +0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.497480, version=1.2.4 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 04:39:29 -0000 Hi, Here is a minimal config of zsh prompt invoking `basename`: ``` └─[iblis@abeing]% cat /home/ib-test/.zshenv function set_prompt { prompt="$(basename $HOME) >" } function zle-line-init zle-keymap-select { set_prompt zle reset-prompt } zle -N zle-line-init zle -N zle-keymap-select set_prompt ``` and launching zsh will get something like this: ``` └─[iblis@abeing]% sudo su ib-test ib-test >basename: capsicum: Bad file descriptor > >basename: capsicum: Bad file descriptor > ``` To be honest, I have no idea about what casper/caspicum is. I just changed the `basename.c` and zsh work again. Index: basename.c =================================================================== --- basename.c (revision 309213) +++ basename.c (working copy) @@ -65,7 +65,7 @@ setlocale(LC_ALL, ""); - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (cap_enter() < 0 && errno != ENOSYS) err(1, "capsicum"); aflag = 0; Any idea? -- Iblis Lin From owner-freebsd-current@freebsd.org Mon Nov 28 05:02:29 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E53CCC59575 for ; Mon, 28 Nov 2016 05:02:29 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B217B12C8 for ; Mon, 28 Nov 2016 05:02:29 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f172.google.com with SMTP id a124so211495149ioe.2 for ; Sun, 27 Nov 2016 21:02:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=+P+kbf5KyL+tlJIGic4MkLUz8nKZ4WqFyu39ewv/V+A=; b=bSpMb6jc4vu+MzTRvijIYJcGxoUROWToWmqd9rDn1laUvUwLTVQskZB/pHzgBca80a 0/cfbdc3UIpHxW/N85bRTDirY8zhQWi0xH727gWX7m5dz7vtXMz8N0MNf/wkh+4tRWq2 HuA+7VNbXeFkQnfepxN5PnckoU51AkUwKnYO9vLlOQ8ev9pHSRDCJ9Bu4XtNYCcKpNC1 Q1QCmpuoUSnpOwaH9QySfmAjhHSRbTRspnaXr57iq2/pZZl1mmTTLN4kGWgeXIM1OuFM zKm7/kcsB/oI3d9HaL+a92p0WhRq5wf+qUq+YCZ1Wa46MHpgxZwoeGcGOpVkPjUlBo+W GTPA== X-Gm-Message-State: AKaTC02KaQV6WmnmAqzZeDZVjsQVq04OuZuUa0hsdOCscfdAbnYjEhaex1mC77Qxy8Vypw== X-Received: by 10.36.25.211 with SMTP id b202mr16451669itb.77.1480308942831; Sun, 27 Nov 2016 20:55:42 -0800 (PST) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com. [209.85.223.177]) by smtp.gmail.com with ESMTPSA id v74sm19374993ioi.2.2016.11.27.20.55.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 20:55:42 -0800 (PST) Received: by mail-io0-f177.google.com with SMTP id m5so73480290ioe.3 for ; Sun, 27 Nov 2016 20:55:42 -0800 (PST) X-Received: by 10.36.7.71 with SMTP id f68mr13058262itf.104.1480308942411; Sun, 27 Nov 2016 20:55:42 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.109.68 with HTTP; Sun, 27 Nov 2016 20:55:42 -0800 (PST) In-Reply-To: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> From: Conrad Meyer Date: Sun, 27 Nov 2016 20:55:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken To: iblis Cc: FreeBSD Current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 05:02:30 -0000 Hi Iblis, I see no such problem running 'basename $HOME' in a normal shell environmen= t: > $ basename $HOME > cmeyer I suppose in your use, perhaps stdin is already closed? I think this is a limitation of caph_limit_stdio() in general. Can you try instead: function set_prompt { prompt=3D"$(basename $HOME < /dev/null) >" } And see if it resolves the issue? Thanks, Conrad On Sun, Nov 27, 2016 at 8:33 PM, iblis wrote: > Hi, > Here is a minimal config of zsh prompt invoking `basename`: > ``` > =E2=94=94=E2=94=80[iblis@abeing]% cat /home/ib-test/.zshenv > > function set_prompt { > prompt=3D"$(basename $HOME) >" > } > > function zle-line-init zle-keymap-select { > set_prompt > zle reset-prompt > } > > zle -N zle-line-init > zle -N zle-keymap-select > > set_prompt > ``` > > and launching zsh will get something like this: > > ``` > =E2=94=94=E2=94=80[iblis@abeing]% sudo su ib-test > > ib-test >basename: capsicum: Bad file descriptor >> >>basename: capsicum: Bad file descriptor >> > ``` > > > To be honest, I have no idea about what casper/caspicum is. I just change= d > the `basename.c` and zsh work again. > > Index: basename.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 > --- basename.c (revision 309213) > +++ basename.c (working copy) > @@ -65,7 +65,7 @@ > > setlocale(LC_ALL, ""); > > - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno !=3D ENOSYS)) > + if (cap_enter() < 0 && errno !=3D ENOSYS) > err(1, "capsicum"); > > aflag =3D 0; > > > Any idea? > > -- > Iblis Lin > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= " From owner-freebsd-current@freebsd.org Mon Nov 28 06:35:09 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1DF1C58031 for ; Mon, 28 Nov 2016 06:35:09 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id D3AD51A50 for ; Mon, 28 Nov 2016 06:35:09 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id D01FAC5802F; Mon, 28 Nov 2016 06:35:09 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFC35C5802E for ; Mon, 28 Nov 2016 06:35:09 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x235.google.com (mail-ua0-x235.google.com [IPv6:2607:f8b0:400c:c08::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C46E1A4F; Mon, 28 Nov 2016 06:35:09 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x235.google.com with SMTP id 51so133152869uai.1; Sun, 27 Nov 2016 22:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Doe3qEWF0QUlL0OjD8BYFIV6hKWtPZOWHMwOzMLv47Q=; b=dcX1/LHTzMSHOLiO9gEj/bBzNpNDoPMd4YmltnLTAKImF8d2GVDtWkr/K83NY2x0uA S5RBisGMwoXe0CHYm0G3CbCQzhLzp5Zz+Qr3CZueSKIvp7m5C54KXHTdRA3kbjv8N2mP OgnBg2BHf+N8Mg7t8wOA3CAIaFLXDpjQ4hch8aoov2tw2TaqYc0eXxU8G/UUbHBzL/mx S6AdrIVDUps9NtPKiss6MwQYeKIAyjI0SkqtoS8H3FvrGvJtwx4xCW8X1J8yQuk8K5UT 93ZGAY4UHKWDmUSp8oFvIYtjgfM1l9mw/lmXuJ0ZAyQD4LPyNIINpvQC+F0HagSD0zL8 4umQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Doe3qEWF0QUlL0OjD8BYFIV6hKWtPZOWHMwOzMLv47Q=; b=VkSxKkatsaT3m4eN6+fv3+/qrA0SA6us+YuVZj8yNm7Qj0zNTAw0n03KeK1KBaXSLV Rj/JdQkota64EiTdtqGHW1KESwdzvnvqCKJ1VK3afgP+px+KwsgHUvrHYTatmHr0lakU aSPooSue5AuO6Ky/cYHHFNcT5M+XfszTrWEPSDThWBzPYD+TYqbcxElSko7RtQjCKgDE 81jnyBjg3HGtQl64eZfx/25pIep1ki3EkdXQERCOT6hPtNm8stGC4N/TpNsMeUIVMvSq RNd9LMOGg5B2lpqXh62QOTFSZ72uSg6hXRx/kUWLGcraTCRmpG+SQZmfxo09Ji6aREKk tu7g== X-Gm-Message-State: AKaTC00mItj8mcqWFFOO8yO+bFFZ1h7qg0z3zlsJ5cQPLyZN89B2r4ANwvGi2IYFOmgiI/RHbmM1ZKi1o85PXA== X-Received: by 10.159.55.168 with SMTP id q37mr15234186uaq.63.1480314908401; Sun, 27 Nov 2016 22:35:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.36.247 with HTTP; Sun, 27 Nov 2016 22:35:07 -0800 (PST) In-Reply-To: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 14:35:07 +0800 Message-ID: Subject: Re: Please test EARLY_AP_STARTUP To: John Baldwin Cc: "freebsd-current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 06:35:10 -0000 Hi John, fdc seems to cause panic on Hyper-V: https://people.freebsd.org/~sephe/fdc_panic.png I then commented out device fdc, and I fixed one panic on Hyper-V here: https://reviews.freebsd.org/D8656 After fdc is disabled and hyperv/storvsc is fixed, it seems to boot fine, except a long delay (28~30seconds) here: .... Timecounters tick every 1.000 msec ----- 28 ~ 30 seconds delay ----- vlan: initialized, using hash tables with chaining .... I have the bootverbose dmesg here: https://people.freebsd.org/~sephe/dmesg_earlyap.txt I booted 10 times, only one boot does not suffer this 30 seconds delay. It sounds like some races to me. Any hints? Thanks, sephe On Sat, Nov 26, 2016 at 2:20 AM, John Baldwin wrote: > I plan to enable EARLY_AP_STARTUP on x86 in a week on HEAD. Some folks > have been testing it for the last week or so which has exposed some > additional things to fix. I think I've resolved most of those in one > way or another, but it will make things smoother if other folks can > start testing this over the next few days before it is enabled by default. > > (To enable, add 'options EARLY_AP_STARTUP' to your kernel config.) > > Note that non-x86 platforms should eventually adopt this, but I don't > think any of them are ready yet. > > -- > John Baldwin > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" -- Tomorrow Will Never Die From owner-freebsd-current@freebsd.org Mon Nov 28 06:40:56 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51A8DC582E2 for ; Mon, 28 Nov 2016 06:40:56 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: from mail.hs.ntnu.edu.tw (mail.hs.ntnu.edu.tw [140.131.149.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CFDD107D; Mon, 28 Nov 2016 06:40:55 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: by mail.hs.ntnu.edu.tw (Postfix, from userid 800) id 364F71C6450; Mon, 28 Nov 2016 14:40:46 +0800 (CST) Received: from [140.113.215.9] (IP-215-9.cs.nctu.edu.tw [140.113.215.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: iblis@hs.ntnu.edu.tw) by mail.hs.ntnu.edu.tw (Postfix) with ESMTPSA id 15B761C647B; Mon, 28 Nov 2016 14:40:46 +0800 (CST) Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken To: cem@freebsd.org References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> Cc: FreeBSD Current From: iblis Message-ID: Date: Mon, 28 Nov 2016 14:40:45 +0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.499948, version=1.2.4 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 06:40:56 -0000 Hi Conrad, Thanks for your reply. I revert the basename.c and `< /dev/null` do the trick! I'm also curious that will `caph_limit_stdio` break lots of program work with some shell scripts? -- Iblis Lin On 11/28/2016 12:55, Conrad Meyer wrote: > Hi Iblis, > > I see no such problem running 'basename $HOME' in a normal shell environment: > >> $ basename $HOME >> cmeyer > > I suppose in your use, perhaps stdin is already closed? I think this > is a limitation of caph_limit_stdio() in general. > > Can you try instead: > > function set_prompt { > prompt="$(basename $HOME < /dev/null) >" > } > > And see if it resolves the issue? > > Thanks, > Conrad > > On Sun, Nov 27, 2016 at 8:33 PM, iblis wrote: >> Hi, >> Here is a minimal config of zsh prompt invoking `basename`: >> ``` >> └─[iblis@abeing]% cat /home/ib-test/.zshenv >> >> function set_prompt { >> prompt="$(basename $HOME) >" >> } >> >> function zle-line-init zle-keymap-select { >> set_prompt >> zle reset-prompt >> } >> >> zle -N zle-line-init >> zle -N zle-keymap-select >> >> set_prompt >> ``` >> >> and launching zsh will get something like this: >> >> ``` >> └─[iblis@abeing]% sudo su ib-test >> >> ib-test >basename: capsicum: Bad file descriptor >>> >>> basename: capsicum: Bad file descriptor >>> >> ``` >> >> >> To be honest, I have no idea about what casper/caspicum is. I just changed >> the `basename.c` and zsh work again. >> >> Index: basename.c >> =================================================================== >> --- basename.c (revision 309213) >> +++ basename.c (working copy) >> @@ -65,7 +65,7 @@ >> >> setlocale(LC_ALL, ""); >> >> - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) >> + if (cap_enter() < 0 && errno != ENOSYS) >> err(1, "capsicum"); >> >> aflag = 0; >> >> >> Any idea? >> >> -- >> Iblis Lin >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > From owner-freebsd-current@freebsd.org Mon Nov 28 07:08:43 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D8AC58B3A for ; Mon, 28 Nov 2016 07:08:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1A0103A for ; Mon, 28 Nov 2016 07:08:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f177.google.com with SMTP id c21so210115252ioj.1 for ; Sun, 27 Nov 2016 23:08:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=th90qFeBV3RoUFRl1lrqWeM3I6OEIFcMelBuLa0M51k=; b=iZaF5+UALd89NGxfJQZw36rkDm+8kcPpGYchXWuG1iWPj9aW6kLNz8/mZIBTQ3dRrc KsR7gmTrs4p1EumHtyanJxNbMJJZjB419hG3EXQkzI7re31zQWt5eTx82ur8MNxz22Hx vJsBAvbOnUoafUPjuVytoYpaQJMpGdLKIkUnAmMt6Gx9GGk0LEJq2IoBLBbgWMB/bg3v tSF0yde9kkXhEhsGbgZTUUmIzXRqXzVQiJRX2sIM+4S9ub61nhtHdeU1zVeo+f8BZ/12 UjrT+CBoYnfI4EbVfAmSogALzlXNvkz/KPm/gi73VQ0sw8Wu/9HEKARm5l2KBUHJmZ7Z rnEQ== X-Gm-Message-State: AKaTC02Ai0zNvsrk2VH1gc67hMzSnSxbW3+bdYzJ1TgToElaJC9erDeaIyBDjn9zWP5CgQ== X-Received: by 10.36.228.204 with SMTP id o195mr17368991ith.102.1480316915968; Sun, 27 Nov 2016 23:08:35 -0800 (PST) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com. [209.85.223.174]) by smtp.gmail.com with ESMTPSA id x74sm8794769ita.22.2016.11.27.23.08.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 23:08:35 -0800 (PST) Received: by mail-io0-f174.google.com with SMTP id j65so215413342iof.0 for ; Sun, 27 Nov 2016 23:08:35 -0800 (PST) X-Received: by 10.107.16.170 with SMTP id 42mr16702536ioq.93.1480316915543; Sun, 27 Nov 2016 23:08:35 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.109.68 with HTTP; Sun, 27 Nov 2016 23:08:35 -0800 (PST) In-Reply-To: References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> From: Conrad Meyer Date: Sun, 27 Nov 2016 23:08:35 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken To: iblis Cc: FreeBSD Current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 07:08:43 -0000 Hi Iblis, Yes, I think caph_limit_stdio will break many similar programs in similar use. I think we'll need to change that behavior. Something like this: https://reviews.freebsd.org/D8657 Best, Conrad On Sun, Nov 27, 2016 at 10:40 PM, iblis wrote: > Hi Conrad, > Thanks for your reply. > > I revert the basename.c and `< /dev/null` do the trick! > I'm also curious that will `caph_limit_stdio` break lots of program wo= rk > with some shell scripts? > > -- > Iblis Lin > > > On 11/28/2016 12:55, Conrad Meyer wrote: >> >> Hi Iblis, >> >> I see no such problem running 'basename $HOME' in a normal shell >> environment: >> >>> $ basename $HOME >>> cmeyer >> >> >> I suppose in your use, perhaps stdin is already closed? I think this >> is a limitation of caph_limit_stdio() in general. >> >> Can you try instead: >> >> function set_prompt { >> prompt=3D"$(basename $HOME < /dev/null) >" >> } >> >> And see if it resolves the issue? >> >> Thanks, >> Conrad >> >> On Sun, Nov 27, 2016 at 8:33 PM, iblis wrote: >>> >>> Hi, >>> Here is a minimal config of zsh prompt invoking `basename`: >>> ``` >>> =E2=94=94=E2=94=80[iblis@abeing]% cat /home/ib-test/.zshenv >>> >>> function set_prompt { >>> prompt=3D"$(basename $HOME) >" >>> } >>> >>> function zle-line-init zle-keymap-select { >>> set_prompt >>> zle reset-prompt >>> } >>> >>> zle -N zle-line-init >>> zle -N zle-keymap-select >>> >>> set_prompt >>> ``` >>> >>> and launching zsh will get something like this: >>> >>> ``` >>> =E2=94=94=E2=94=80[iblis@abeing]% sudo su ib-test >>> >>> ib-test >basename: capsicum: Bad file descriptor >>>> >>>> >>>> basename: capsicum: Bad file descriptor >>>> >>> ``` >>> >>> >>> To be honest, I have no idea about what casper/caspicum is. I just >>> changed >>> the `basename.c` and zsh work again. >>> >>> Index: basename.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 >>> --- basename.c (revision 309213) >>> +++ basename.c (working copy) >>> @@ -65,7 +65,7 @@ >>> >>> setlocale(LC_ALL, ""); >>> >>> - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno !=3D ENOSYS)) >>> + if (cap_enter() < 0 && errno !=3D ENOSYS) >>> err(1, "capsicum"); >>> >>> aflag =3D 0; >>> >>> >>> Any idea? >>> >>> -- >>> Iblis Lin >>> _______________________________________________ >>> freebsd-current@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-current >>> To unsubscribe, send any mail to >>> "freebsd-current-unsubscribe@freebsd.org" >> >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.or= g" >> > From owner-freebsd-current@freebsd.org Mon Nov 28 07:12:11 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C428FC58D2A for ; Mon, 28 Nov 2016 07:12:11 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4F791304; Mon, 28 Nov 2016 07:12:10 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 234EDBB56; Mon, 28 Nov 2016 07:05:56 +0000 (UTC) Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken To: freebsd-current@freebsd.org References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> Cc: Baptiste Daroussin From: Allan Jude Message-ID: Date: Mon, 28 Nov 2016 02:05:49 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wr5EnQSJdRkUlxwLM0rPagQEVdgPdDi0K" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 07:12:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Wr5EnQSJdRkUlxwLM0rPagQEVdgPdDi0K Content-Type: multipart/mixed; boundary="NMtugp0P3ek0nEiDHEHR4rrCTEitcPv8X"; protected-headers="v1" From: Allan Jude To: freebsd-current@freebsd.org Cc: Baptiste Daroussin Message-ID: Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> In-Reply-To: --NMtugp0P3ek0nEiDHEHR4rrCTEitcPv8X Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-11-27 23:55, Conrad Meyer wrote: > Hi Iblis, >=20 > I see no such problem running 'basename $HOME' in a normal shell enviro= nment: >=20 >> $ basename $HOME >> cmeyer >=20 > I suppose in your use, perhaps stdin is already closed? I think this > is a limitation of caph_limit_stdio() in general. >=20 > Can you try instead: >=20 > function set_prompt { > prompt=3D"$(basename $HOME < /dev/null) >" > } >=20 > And see if it resolves the issue? >=20 > Thanks, > Conrad >=20 > On Sun, Nov 27, 2016 at 8:33 PM, iblis wrote: >> Hi, >> Here is a minimal config of zsh prompt invoking `basename`: >> ``` >> =E2=94=94=E2=94=80[iblis@abeing]% cat /home/ib-test/.zshenv >> >> function set_prompt { >> prompt=3D"$(basename $HOME) >" >> } >> >> function zle-line-init zle-keymap-select { >> set_prompt >> zle reset-prompt >> } >> >> zle -N zle-line-init >> zle -N zle-keymap-select >> >> set_prompt >> ``` >> >> and launching zsh will get something like this: >> >> ``` >> =E2=94=94=E2=94=80[iblis@abeing]% sudo su ib-test >> >> ib-test >basename: capsicum: Bad file descriptor >>> >>> basename: capsicum: Bad file descriptor >>> >> ``` >> >> >> To be honest, I have no idea about what casper/caspicum is. I just cha= nged >> the `basename.c` and zsh work again. >> >> Index: basename.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 >> --- basename.c (revision 309213) >> +++ basename.c (working copy) >> @@ -65,7 +65,7 @@ >> >> setlocale(LC_ALL, ""); >> >> - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno !=3D ENOSYS)= ) >> + if (cap_enter() < 0 && errno !=3D ENOSYS) >> err(1, "capsicum"); >> >> aflag =3D 0; >> >> >> Any idea? >> >> -- >> Iblis Lin >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.= org" > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o= rg" >=20 IIRC, bapt@ specifically mentioned this case in the review for caph_limit_stdio() or one of the reviews that lead to the creation of the helpers. --=20 Allan Jude --NMtugp0P3ek0nEiDHEHR4rrCTEitcPv8X-- --Wr5EnQSJdRkUlxwLM0rPagQEVdgPdDi0K Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (MingW32) iQIcBAEBAgAGBQJYO9dRAAoJEBmVNT4SmAt+MaEP/1luhDEW5/SRh/4KIF1gtawi eVS8UuSb9K3+jAlpboBOZNcRKnNaGXyfgBWcp+cLjt5jDCeCt1HL7UZDtNGSFOX0 xN2hvH3wGuy+81p1776kJ84cGKdsbMCWhuBrR+XZSQLwMhyI2/Z/VqqFSA/ss5SM /KVVz9WGyrai7rmmUBbmejn1uZ2wgDpiv5Xiondg0NrI5pNQNimLuqzKvi59qMD1 ztO5i+v8/bmwgYStTPH/4tF6eaImohCamGeVHoNJ3/2Zdsv9748/YGc+q561by84 hlRZeSG3KGE0OwDOns4gDiClmX18rQg/2aNvGSmdLSY0Xf64IRtH7Bp2HSeUVjdq cnw5WWAifPwEOwRPNdC0olttESRGNr2W8VJ2MCvKFzy0DhPRcZE560+YFc/72J8H saQ3trssIS7iKkm79iVrJjlp9ChFkPBx8BDn/9fMnvcZWd4ewelxx/95fAN1hl3o QOVO5Zm7ZX6I7iSHjVddEtm+lS+EsFrchNxcjUJ3tvzYMynpLt9QyAoEYGRiMJ8O x4duS5l9cxVzTo1ipd5/1gsf4DDzCd0/O2pEm/PFNJvOLO2CC2IuF4KAXpzBdeQk wi+pbbih3KIxilJ2IHRsbt7N8TkCnxEqxOpJYH4EUuiGbuiqy/q+t9frciwt8hW8 Owr6GZdqh67HmA6foi8S =MzNS -----END PGP SIGNATURE----- --Wr5EnQSJdRkUlxwLM0rPagQEVdgPdDi0K-- From owner-freebsd-current@freebsd.org Mon Nov 28 07:21:25 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81E36C5900D for ; Mon, 28 Nov 2016 07:21:25 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wj0-x233.google.com (mail-wj0-x233.google.com [IPv6:2a00:1450:400c:c01::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 220221C61; Mon, 28 Nov 2016 07:21:25 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wj0-x233.google.com with SMTP id v7so107294973wjy.2; Sun, 27 Nov 2016 23:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sQRiy94TGVUFSRErmGOhLMTadN9Jg9unSCSXKUEsghA=; b=DQYWm+VvWT1OHGSbXnRK9+bA8IXZE502lVbFmT1Z7zp0KoojTEE5vXt0NbYR3D/Dv2 37bxOEJH3hX57m4i5QPq8r2ICh29xLze8mMSH+XgKSCIETM94avzn8MNK5cam8uq7eN9 588w5KWhMnVyI7ZaN0mxVrnaGD00PKRpfxkhxe1rNwRxO3K5YuhOGw7oYgJL9+2vHkWi eymRplctwML0nH1axF4nD0bFC5XUTXz3hUMBcD3F5q3/n7PkdlQi7NPf6EsJqklNCk7e R6NP/VnYWZrzmTmAUHWrBIpO9+oDdRaROyvD70ix1qx8leO08zbxtpLoYzZzrt9Wcj68 sK8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=sQRiy94TGVUFSRErmGOhLMTadN9Jg9unSCSXKUEsghA=; b=fVBpABXZo6zMHhtQIk1MUfMUTSnu7uurLqmZVWeMbla0XtGvs7WYdfv6w/M1CXSaO1 iTZ9yxFfOThU8tE3pi3h70+2QGhYYzEoIOxvR0upEejFWtFY1G1QuIyYm0l7ywI2aUZv RtbVaR13KduWU/NP1zNQ+lvG/Mo57ruu4s+R4Iqi5bRIdBtrlT6h87d3SpE08K7i+nj5 s3+xIEmXdwSOhiM1L6HpaiYGxQ1/Y7TTjvxTaiXprGBO9r2GgnhwmYDC0qf4L5ccfZu/ yoX1tFzEsGvVFYRDeAb4+fWAMUkjXFBqET79tr7+8tuk9bXBbNfk2AGfOX/ozUFJhYF2 rkMA== X-Gm-Message-State: AKaTC02w9m2u37Ih6rpt6gbGQGD5uquD4/IBRaGas027xWYUIO5ICMZpMZxgBzx3cTNvLA== X-Received: by 10.194.146.228 with SMTP id tf4mr17462529wjb.183.1480317682857; Sun, 27 Nov 2016 23:21:22 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id t82sm27335969wmd.17.2016.11.27.23.21.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 23:21:21 -0800 (PST) Sender: Baptiste Daroussin Date: Mon, 28 Nov 2016 08:21:21 +0100 From: Baptiste Daroussin To: Allan Jude Cc: freebsd-current@freebsd.org Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken Message-ID: <20161128072121.aqxppnkkoakaex4l@ivaldir.etoilebsd.net> References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p6l6suqkeflbziyd" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 07:21:25 -0000 --p6l6suqkeflbziyd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 28, 2016 at 02:05:49AM -0500, Allan Jude wrote: > On 2016-11-27 23:55, Conrad Meyer wrote: > > Hi Iblis, > >=20 > > I see no such problem running 'basename $HOME' in a normal shell enviro= nment: > >=20 > >> $ basename $HOME > >> cmeyer > >=20 > > I suppose in your use, perhaps stdin is already closed? I think this > > is a limitation of caph_limit_stdio() in general. > >=20 > > Can you try instead: > >=20 > > function set_prompt { > > prompt=3D"$(basename $HOME < /dev/null) >" > > } > >=20 > > And see if it resolves the issue? > >=20 > > Thanks, > > Conrad > >=20 > > On Sun, Nov 27, 2016 at 8:33 PM, iblis wrote: > >> Hi, > >> Here is a minimal config of zsh prompt invoking `basename`: > >> ``` > >> =E2=94=94=E2=94=80[iblis@abeing]% cat /home/ib-test/.zshenv > >> > >> function set_prompt { > >> prompt=3D"$(basename $HOME) >" > >> } > >> > >> function zle-line-init zle-keymap-select { > >> set_prompt > >> zle reset-prompt > >> } > >> > >> zle -N zle-line-init > >> zle -N zle-keymap-select > >> > >> set_prompt > >> ``` > >> > >> and launching zsh will get something like this: > >> > >> ``` > >> =E2=94=94=E2=94=80[iblis@abeing]% sudo su ib-test > >> > >> ib-test >basename: capsicum: Bad file descriptor > >>> > >>> basename: capsicum: Bad file descriptor > >>> > >> ``` > >> > >> > >> To be honest, I have no idea about what casper/caspicum is. I just cha= nged > >> the `basename.c` and zsh work again. > >> > >> Index: basename.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 > >> --- basename.c (revision 309213) > >> +++ basename.c (working copy) > >> @@ -65,7 +65,7 @@ > >> > >> setlocale(LC_ALL, ""); > >> > >> - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno !=3D ENOSYS)) > >> + if (cap_enter() < 0 && errno !=3D ENOSYS) > >> err(1, "capsicum"); > >> > >> aflag =3D 0; > >> > >> > >> Any idea? > >> > >> -- > >> Iblis Lin > >> _______________________________________________ > >> freebsd-current@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/freebsd-current > >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.= org" > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o= rg" > >=20 >=20 > IIRC, bapt@ specifically mentioned this case in the review for > caph_limit_stdio() or one of the reviews that lead to the creation of > the helpers. I mention this is the review of the cap_helpers themselves. I still think caph_limit_stdio should grow a flag for testing that. I figured out the iss= ue based on one of the conversion to capsicum by Conrad on I don't remember wh= ich tool. Bapt --p6l6suqkeflbziyd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlg72u0ACgkQY4mL3PG3 PlozixAA34m45hL7LH+Nmz6/Sp5Vuz8tvlPNZKendQVWHfwFa6thf0190zOB0ZPk vjBu3hrx6QuAblQE9UDdunFfITKwPc+Z9AIPfiXBN95DA/oaUtnQPkyzIIDChVzy 3U3Iw/67XhkpAeKR82+EQs58maArYWvCg0JLizR2Ej/YDn6R0NYWhGww/iD+k2nE CBL93aOyObsa6NcgFBoheo2ZrumrVktSBi7jFwSm1gp36l56lFuZ92J8dHdn3OeW XpMapx4GFAPGRMgFiwArOs+p7RQC7qVPVnUmQwHMEwjN+EVv5UrAJxei0i6g0dUZ jZng4pIDrBYcHZDBhg/QZQFSCdslkRQP/FoIKa7+kPJHQYC9R0AjnyfavW8PDkPf XI23a8j45BgAskAh9Eb/a1Qop2l1eDnr0de4GMTMOalYOMYOroNq72XkEwk2FQfu L7AT105Lgs3fUQ86O82rKpYkk4Fvghj8SkxYzDVeqahHAeUYkgGoEOBUv41aYrSb hFF+8toO+0rwBPNPMHadPCe/rxrO4AX9/Pd5iPFQppCOvUGG2EuNuyzqfS6FD1IF kn0LMD5cTcsqVLP4COHLQrlTGSyj97TrYtRbaRMREuEidhTxNn+Sb6//Nuj/0k+8 qaHMERL6oazL7ckan1g0buyhZva/V/UZPTzy9pnAhxK7ndOJcQM= =Ml+V -----END PGP SIGNATURE----- --p6l6suqkeflbziyd-- From owner-freebsd-current@freebsd.org Mon Nov 28 08:49:32 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F28B5C57FD0 for ; Mon, 28 Nov 2016 08:49:32 +0000 (UTC) (envelope-from kiri@kx.openedu.org) Received: from kx.openedu.org (flets-sg1027.kamome.or.jp [202.216.24.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8731C0C; Mon, 28 Nov 2016 08:49:31 +0000 (UTC) (envelope-from kiri@kx.openedu.org) Received: from kx.openedu.org (kx.openedu.org [103.15.187.19]) by kx.openedu.org (8.14.5/8.14.5) with ESMTP id uAS8nO6p020945; Mon, 28 Nov 2016 17:49:24 +0900 (JST) (envelope-from kiri@kx.openedu.org) Message-Id: <201611280849.uAS8nO6p020945@kx.openedu.org> Date: Mon, 28 Nov 2016 17:49:24 +0900 From: KIRIYAMA Kazuhiko To: Allan Jude Cc: freebsd-current@freebsd.org Subject: Re: fatal: Fssh_packet_write_poll: Connection from xxx.xxx.xx.xx port yyyyy: Permission denied In-Reply-To: <201611230824.uAN8OWbR096300@kx.openedu.org> References: <201611220737.uAM7bMSY072062@kx.openedu.org> <2b9b6473-fc17-3aad-ee1a-4c20b340ec00@freebsd.org> <201611230824.uAN8OWbR096300@kx.openedu.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.6 MULE XEmacs/21.4 (patch 22) (Instant Classic) (amd64--freebsd) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 08:49:33 -0000 At Wed, 23 Nov 2016 17:24:32 +0900, my wrote: > > At Tue, 22 Nov 2016 10:47:17 -0500, > Allan Jude wrote: > > > > [1 Re: fatal: Fssh_packet_write_poll: Connection from xxx.xxx.xx.xx port yyyyy: Permission denied ] > > [1.1 ] > > On 2016-11-22 02:37, KIRIYAMA Kazuhiko wrote: > > > Hi, all > > > > > > I've updated to HEAD(r308871) at 2 days ago, and also ports > > > too(r426562). Then all stuffs including applications have > > > been updated and tried to slogin to this host,but can't > > > connect with the message `userauth_pubkey: key type ssh-dss > > > not in PubkeyAcceptedKeyTypes [preauth]' in > > > /var/log/auth.log. I found new OpenSSH-7.* has not been > > > supported DSA and to connect from client with old ssh(lower > > > than OpenSSH-7.0),set `ssh-dss' or some values set to > > > relevant variables in /etc/ssh/sshd_config. According to [1] > > > and [2] I've set these variables as below: > > > > > > PubkeyAcceptedKeyTypes=+ssh-dss > > > HostKeyAlgorithms=+ssh-dss > > > KexAlgorithms=+diffie-hellman-group-exchange-sha256 > > > > > > and successfully slogined: > > > > > > > snip > > > > > > > > And with the message `fatal: Fssh_packet_write_poll: > > > Connection from xxx.xxx.xx.xx port yyyyy: Permission denied' > > > in /var/log/auth.log: I've tried to between *same* version(r308871) with RSA,but failed to the same message: admin@kx:~ % scp /jails/backup/hosts/201606020717/vm/wrk/* bhy:/vm/images freebsd-10r.img 0% 0 0.0KB/s --:-- ETAFssh_packet_write_poll: Connection to xxx.xxx.xx.xx port yyyyy: Permission denied lost connection admin@kx:~ % I found whole filesystem looks like set NFSv4 ACLs. Is this right? admin@kx:~ % getfacl / # file: / # owner: root # group: wheel owner@:rwxp--aARWcCos:-------:allow group@:r-x---a-R-c--s:-------:allow everyone@:r-x---a-R-c--s:-------:allow admin@kx:~ % getfacl /tmp # file: /tmp # owner: root # group: wheel owner@:rwxp--aARWcCos:-------:allow group@:rwxp--a-R-c--s:-------:allow everyone@:rwxp--a-R-c--s:-------:allow admin@kx:~ % getfacl /var/tmp # file: /var/tmp # owner: root # group: wheel owner@:rwxp--aARWcCos:-------:allow group@:rwxp--a-R-c--s:-------:allow everyone@:rwxp--a-R-c--s:-------:allow admin@kx:~ % --- KIRIYAMA Kazuhiko From owner-freebsd-current@freebsd.org Mon Nov 28 16:34:59 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCFFC5AEE0 for ; Mon, 28 Nov 2016 16:34:59 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F20B41733 for ; Mon, 28 Nov 2016 16:34:58 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x229.google.com with SMTP id o141so100636208lff.1 for ; Mon, 28 Nov 2016 08:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=2L5RMjFxfK0mTAynuOzq9qPMcuLFT+yLwsbHQEL2pM8=; b=DsZC0w2CgycjTxHLrYZoIeHhxvJneLD/pGRbaVakKZHX8Viezv76k4kC7bvWbQ6UMj y15inVV7gv8C4CqZMbkMXFyOlEPBC40aXbZaeVOHg3BSp1j+RBx00u1ywirTn+6/lCLy zo8gCp/E7KuOQsnmLmIqlL6Ui/ECFn+eA6Y1Xn+DVpmSRoATRdEdiP4TUuxScf1KgHSr XghdhbJGS+y1GxVMs9A1MS4DqXEe04JdXOBt9FVwiyhvYPZPNWHTtDEawBKWTcSxLGcA WBhbN1Sxe9OpnL8TN+rsizqSd7HxeSRuUtxjiqP+d268T1O2HPbXhb9+xJ1oJio1qezz hKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2L5RMjFxfK0mTAynuOzq9qPMcuLFT+yLwsbHQEL2pM8=; b=HRSMbKfjpCSM+w7U597FkkHLyUjdSB+zY56QWySXBhdjzpS4p/s7RnkNR2yW66SOiG 8rJGpDt0H/Vq7G+oVdBcdjaC5guXdi0dZtpAZ18p1Qgf1HOz1Lex/p2Qi+goN28l+++N Lf5h82/RjO4Acif9eUwTkmT8I763xqAVmG82lJBIczkKivYf7ncHIsADeVGQbSJOzKoV wgAo3jTlpInNlrs4BeyNyfjcWT1Y+iQBRSqFVYof0TFiwa0Ibg1DJQuib17xHoMgJawK 6I89AjNm8+IRoWQU+W2+rFvkrE/444EGAB8owboPmCie47XEiAiHVoFTqOMpWdh7dahw FMjA== X-Gm-Message-State: AKaTC01evY5LC39nwLwswuN5fC0QxFYGPEtdM7ujD1JjHafemp6eYsHc1+V7fCZNPhm6qg== X-Received: by 10.25.99.27 with SMTP id x27mr7311339lfb.128.1480350897103; Mon, 28 Nov 2016 08:34:57 -0800 (PST) Received: from spectre.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id 23sm13087577ljf.48.2016.11.28.08.34.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 08:34:56 -0800 (PST) Sender: Alexander Motin Subject: Re: DeLock 10x SATA AHCI controller not working properly To: Daniel Engberg , freebsd-current@freebsd.org References: <647b12994e3304115f6d3a8fabab3ef4@pyret.net> <3ce99ae1-3ae3-aa72-6048-70bd81252f65@FreeBSD.org> Cc: cipher_nl@hotmail.com From: Alexander Motin Message-ID: <35eb5677-d521-d4c2-d18a-768b7d291b40@FreeBSD.org> Date: Mon, 28 Nov 2016 18:34:54 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <3ce99ae1-3ae3-aa72-6048-70bd81252f65@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 16:34:59 -0000 I've made some experiments with the card sample I've got and indeed found the problem. I believe it is a bug in the ASMedia ASM1062 chip firmware that wasn't triggered on other OSes. I've just committed small patch to FreeBSD HEAD at r309251 to workaround the problem. With this patch on very quick tests card seems working properly. On 08.11.2016 07:42, Alexander Motin wrote: > As I have told before, this card is from completely different price > segment then proper SAS/SATA HBAs. For its $80 it is not promised to be > reliable. But in case anything can be done, I'll try to take a look on > it in couple weeks when I get one and return home. > > On 07.11.2016 16:19, Daniel Engberg wrote: >> I discussed this card briefly with Alexander Motin (@mav) back in 2015, >> https://forums.freebsd.org/threads/50411/page-2#post-282648 . >> I've CCed him for suggestions. >> >> https://lists.freebsd.org/pipermail/freebsd-current/2016-October/063668.html -- Alexander Motin From owner-freebsd-current@freebsd.org Mon Nov 28 17:52:50 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6C2C5A982; Mon, 28 Nov 2016 17:52:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDBE91705; Mon, 28 Nov 2016 17:52:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id EEADD10A8F0; Mon, 28 Nov 2016 12:52:42 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Cc: "Julian H. Stacey" , current@freebsd.org Subject: Re: boot fails on Table SSDT at 0x... Date: Mon, 28 Nov 2016 09:36:14 -0800 Message-ID: <1692166.apQIxhLLTz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201611271507.uARF73wR088756@fire.js.berklix.net> References: <201611271507.uARF73wR088756@fire.js.berklix.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 28 Nov 2016 12:52:43 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 17:52:51 -0000 On Sunday, November 27, 2016 04:07:03 PM Julian H. Stacey wrote: > "Julian H. Stacey" wrote: > > "Julian H. Stacey" wrote: > > > Hi current@FreeBSD.org > > > I was running > > > FreeBSD lapr.js.berklix.net 12.0-CURRENT FreeBSD 12.0-CURRENT > > > #12753: Tue Nov 22 23:31:24 CET 2016 > > > jhs@lapr.js.berklix.net:/data/release/12.0-CURRENT/usr/src/sys/amd64/compile/LAPR.small > > > amd64 > > > I updated to > > > .ctm_status src-cur 12757 > > > .svn_revision 309126 > > > did a make world, built a new custom kernel with same config as before & now > > > laptop boot fails after > > > Table SSDT at 0x... > > > ACPI: No SRAT table found > > > > > > I took a pic of frozen screen, & I have svn here, I need to research > > > & provide more info to whoever ? so this just initial info to whoever's > > > working in the area. Debug suggestions & syntax welcome. I'll build > > > a generic kernel next. > > > > > > If I may be slow responding, sorry, DSL modem problems here too, hence > > > getting an initial error report out while I can. > > > > A generic kernel boots OK. > > A 2nd build of custom config fails to boot. > > Table 'ASPT' at 0x937e2000 > > Table 'SSDT' at 0x937e1000 > > Table 'SSDT' at 0x937e0000 > > Table 'SSDT' at 0x937df000 > > ACPI: No SRAT table found > > > > cd /sys/amd64/conf ; diff -c JENERIC.small LAPR.small > > *** JENERIC.small Sun Nov 27 15:09:47 2016 > > --- LAPR.small Sun Nov 27 15:09:48 2016 > > *************** > > *** 1,15 **** > > cpu HAMMER > > ! ident JHS_Generic > > makeoptions DEBUG=-g > > makeoptions WITH_CTF=1 > > options SCHED_ULE > > options PREEMPTION > > options INET > > - options INET6 > > - options IPSEC > > options TCP_OFFLOAD > > options TCP_HHOOK > > - options SCTP > > options FFS > > options SOFTUPDATES > > options UFS_ACL > > --- 1,12 ---- > > cpu HAMMER > > ! ident JHS_Lapr > > makeoptions DEBUG=-g > > makeoptions WITH_CTF=1 > > options SCHED_ULE > > options PREEMPTION > > options INET > > options TCP_OFFLOAD > > options TCP_HHOOK > > options FFS > > options SOFTUPDATES > > options UFS_ACL > > *************** > > *** 23,33 **** > > --- 20,32 ---- > > options NFS_ROOT > > options MSDOSFS > > options CD9660 > > + options UDF > > options PROCFS > > options PSEUDOFS > > options GEOM_PART_GPT > > options GEOM_RAID > > options GEOM_LABEL > > + options GEOM_BDE > > options COMPAT_FREEBSD32 > > options COMPAT_FREEBSD4 > > options COMPAT_FREEBSD5 > > *************** > > *** 71,76 **** > > --- 70,78 ---- > > options SMP > > options DEVICE_NUMA > > device cpufreq > > + options IPFIREWALL > > + options IPFIREWALL_VERBOSE > > + options IPDIVERT > > device acpi > > options ACPI_DMAR > > device pci > > *************** > > *** 81,134 **** > > device ata > > device mvs > > device siis > > - device ahc > > - options AHC_REG_PRETTY_PRINT > > - device ahd > > - options AHD_REG_PRETTY_PRINT > > - device esp > > - device hptiop > > - device isp > > - device mpt > > - device mps > > - device mpr > > - device sym > > - device trm > > - device adv > > - device adw > > - device aic > > - device bt > > - device isci > > device scbus > > - device ch > > device da > > - device sa > > device cd > > device pass > > device ses > > - device amr > > - device arcmsr > > - device ciss > > - device dpt > > - device hptmv > > - device hptnr > > - device hptrr > > - device hpt27xx > > - device iir > > - device ips > > - device mly > > - device twa > > - device tws > > - device aac > > - device aacp > > - device aacraid > > - device ida > > - device mfi > > - device mlx > > - device mrsas > > - device pmspcv > > - device twe > > - device nvme > > - device nvd > > device atkbdc > > device atkbd > > device psm > > --- 83,93 ---- > > *************** > > *** 150,202 **** > > device ppbus > > device lpt > > device ppi > > - device puc > > device bxe > > - device de > > - device em > > - device igb > > - device ix > > - device ixv > > - device ixl > > - device ixlv > > - device le > > - device ti > > - device txp > > - device vx > > device miibus > > - device ae > > - device age > > - device alc > > - device ale > > - device bce > > - device bfe > > - device bge > > - device cas > > - device dc > > - device et > > - device fxp > > - device gem > > - device hme > > - device jme > > - device lge > > - device msk > > - device nfe > > - device nge > > - device pcn > > - device re > > - device rl > > - device sf > > - device sge > > - device sis > > - device sk > > - device ste > > - device stge > > - device tl > > - device tx > > - device vge > > - device vr > > - device wb > > - device xl > > device wlan > > options IEEE80211_DEBUG > > options IEEE80211_AMPDU_AGE > > --- 109,116 ---- > > *************** > > *** 221,226 **** > > --- 135,143 ---- > > device ral > > device wi > > device wpi > > + device bge > > + device sound > > + device "snd_hda" > > device loop > > device random > > device padlock_rng > > *************** > > *** 234,253 **** > > device bpf > > options USB_DEBUG > > device uhci > > - device ohci > > device ehci > > device xhci > > device usb > > device ukbd > > device umass > > - device sound > > - device snd_cmi > > - device snd_csa > > - device snd_emu10kx > > - device snd_es137x > > - device snd_hda > > - device snd_ich > > - device snd_via8233 > > device mmc > > device mmcsd > > device sdhci > > --- 151,162 ---- > > device bpf > > options USB_DEBUG > > device uhci > > device ehci > > device xhci > > device usb > > + device urndis > > device ukbd > > device umass > > device mmc > > device mmcsd > > device sdhci > > *************** > > *** 261,265 **** > > options XENHVM > > device xenpci > > device vmx > > - device netmap > > device crypto > > --- 170,175 ---- > > options XENHVM > > device xenpci > > device vmx > > device crypto > > + device coretemp > > + options EXT2FS > > > > The boot fail is between SRAT & PPIM, using src from svn 12757, > as shown by dmesg on svn 12757 based generic kernel : Does it panic or hang? -- John Baldwin From owner-freebsd-current@freebsd.org Mon Nov 28 18:08:15 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2CDBC5ADB4 for ; Mon, 28 Nov 2016 18:08:15 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id BDC021286 for ; Mon, 28 Nov 2016 18:08:15 +0000 (UTC) (envelope-from jhs@berklix.com) Received: by mailman.ysv.freebsd.org (Postfix) id B9EFDC5ADB3; Mon, 28 Nov 2016 18:08:15 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B969CC5ADB2; Mon, 28 Nov 2016 18:08:15 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 680741285; Mon, 28 Nov 2016 18:08:14 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (p5B227353.dip0.t-ipconnect.de [91.34.115.83]) (authenticated bits=128) by land.berklix.org (8.15.2/8.15.2) with ESMTPA id uASI8Ao3084568; Mon, 28 Nov 2016 18:08:10 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id uASI874M072657; Mon, 28 Nov 2016 19:08:07 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id uASI7tsP040646; Mon, 28 Nov 2016 19:08:07 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <201611281808.uASI7tsP040646@fire.js.berklix.net> To: John Baldwin cc: freebsd-current@freebsd.org, current@freebsd.org Subject: Re: boot fails on Table SSDT at 0x... From: "Julian H. Stacey" Organization: http://berklix.eu BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ In-reply-to: Your message "Mon, 28 Nov 2016 09:36:14 -0800." <1692166.apQIxhLLTz@ralph.baldwin.cx> Date: Mon, 28 Nov 2016 19:07:55 +0100 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 18:08:15 -0000 Hi, Reference: > From: John Baldwin > Date: Mon, 28 Nov 2016 09:36:14 -0800 John Baldwin wrote: > On Sunday, November 27, 2016 04:07:03 PM Julian H. Stacey wrote: > > "Julian H. Stacey" wrote: > > > "Julian H. Stacey" wrote: > > > > Hi current@FreeBSD.org > > > > I was running > > > > FreeBSD lapr.js.berklix.net 12.0-CURRENT FreeBSD 12.0-CURRENT > > > > #12753: Tue Nov 22 23:31:24 CET 2016 > > > > jhs@lapr.js.berklix.net:/data/release/12.0-CURRENT/usr/src/sys/amd64/compile/LAPR.small > > > > amd64 > > > > I updated to > > > > .ctm_status src-cur 12757 > > > > .svn_revision 309126 > > > > did a make world, built a new custom kernel with same config as before & now > > > > laptop boot fails after > > > > Table SSDT at 0x... > > > > ACPI: No SRAT table found > > > > > > > > I took a pic of frozen screen, & I have svn here, I need to research > > > > & provide more info to whoever ? so this just initial info to whoever's > > > > working in the area. Debug suggestions & syntax welcome. I'll build > > > > a generic kernel next. > > > > > > > > If I may be slow responding, sorry, DSL modem problems here too, hence > > > > getting an initial error report out while I can. > > > > > > A generic kernel boots OK. > > > A 2nd build of custom config fails to boot. > > > Table 'ASPT' at 0x937e2000 > > > Table 'SSDT' at 0x937e1000 > > > Table 'SSDT' at 0x937e0000 > > > Table 'SSDT' at 0x937df000 > > > ACPI: No SRAT table found > > > > > > cd /sys/amd64/conf ; diff -c JENERIC.small LAPR.small > > > *** JENERIC.small Sun Nov 27 15:09:47 2016 > > > --- LAPR.small Sun Nov 27 15:09:48 2016 > > > *************** > > > *** 1,15 **** > > > cpu HAMMER > > > ! ident JHS_Generic > > > makeoptions DEBUG=-g > > > makeoptions WITH_CTF=1 > > > options SCHED_ULE > > > options PREEMPTION > > > options INET > > > - options INET6 > > > - options IPSEC > > > options TCP_OFFLOAD > > > options TCP_HHOOK > > > - options SCTP > > > options FFS > > > options SOFTUPDATES > > > options UFS_ACL > > > --- 1,12 ---- > > > cpu HAMMER > > > ! ident JHS_Lapr > > > makeoptions DEBUG=-g > > > makeoptions WITH_CTF=1 > > > options SCHED_ULE > > > options PREEMPTION > > > options INET > > > options TCP_OFFLOAD > > > options TCP_HHOOK > > > options FFS > > > options SOFTUPDATES > > > options UFS_ACL > > > *************** > > > *** 23,33 **** > > > --- 20,32 ---- > > > options NFS_ROOT > > > options MSDOSFS > > > options CD9660 > > > + options UDF > > > options PROCFS > > > options PSEUDOFS > > > options GEOM_PART_GPT > > > options GEOM_RAID > > > options GEOM_LABEL > > > + options GEOM_BDE > > > options COMPAT_FREEBSD32 > > > options COMPAT_FREEBSD4 > > > options COMPAT_FREEBSD5 > > > *************** > > > *** 71,76 **** > > > --- 70,78 ---- > > > options SMP > > > options DEVICE_NUMA > > > device cpufreq > > > + options IPFIREWALL > > > + options IPFIREWALL_VERBOSE > > > + options IPDIVERT > > > device acpi > > > options ACPI_DMAR > > > device pci > > > *************** > > > *** 81,134 **** > > > device ata > > > device mvs > > > device siis > > > - device ahc > > > - options AHC_REG_PRETTY_PRINT > > > - device ahd > > > - options AHD_REG_PRETTY_PRINT > > > - device esp > > > - device hptiop > > > - device isp > > > - device mpt > > > - device mps > > > - device mpr > > > - device sym > > > - device trm > > > - device adv > > > - device adw > > > - device aic > > > - device bt > > > - device isci > > > device scbus > > > - device ch > > > device da > > > - device sa > > > device cd > > > device pass > > > device ses > > > - device amr > > > - device arcmsr > > > - device ciss > > > - device dpt > > > - device hptmv > > > - device hptnr > > > - device hptrr > > > - device hpt27xx > > > - device iir > > > - device ips > > > - device mly > > > - device twa > > > - device tws > > > - device aac > > > - device aacp > > > - device aacraid > > > - device ida > > > - device mfi > > > - device mlx > > > - device mrsas > > > - device pmspcv > > > - device twe > > > - device nvme > > > - device nvd > > > device atkbdc > > > device atkbd > > > device psm > > > --- 83,93 ---- > > > *************** > > > *** 150,202 **** > > > device ppbus > > > device lpt > > > device ppi > > > - device puc > > > device bxe > > > - device de > > > - device em > > > - device igb > > > - device ix > > > - device ixv > > > - device ixl > > > - device ixlv > > > - device le > > > - device ti > > > - device txp > > > - device vx > > > device miibus > > > - device ae > > > - device age > > > - device alc > > > - device ale > > > - device bce > > > - device bfe > > > - device bge > > > - device cas > > > - device dc > > > - device et > > > - device fxp > > > - device gem > > > - device hme > > > - device jme > > > - device lge > > > - device msk > > > - device nfe > > > - device nge > > > - device pcn > > > - device re > > > - device rl > > > - device sf > > > - device sge > > > - device sis > > > - device sk > > > - device ste > > > - device stge > > > - device tl > > > - device tx > > > - device vge > > > - device vr > > > - device wb > > > - device xl > > > device wlan > > > options IEEE80211_DEBUG > > > options IEEE80211_AMPDU_AGE > > > --- 109,116 ---- > > > *************** > > > *** 221,226 **** > > > --- 135,143 ---- > > > device ral > > > device wi > > > device wpi > > > + device bge > > > + device sound > > > + device "snd_hda" > > > device loop > > > device random > > > device padlock_rng > > > *************** > > > *** 234,253 **** > > > device bpf > > > options USB_DEBUG > > > device uhci > > > - device ohci > > > device ehci > > > device xhci > > > device usb > > > device ukbd > > > device umass > > > - device sound > > > - device snd_cmi > > > - device snd_csa > > > - device snd_emu10kx > > > - device snd_es137x > > > - device snd_hda > > > - device snd_ich > > > - device snd_via8233 > > > device mmc > > > device mmcsd > > > device sdhci > > > --- 151,162 ---- > > > device bpf > > > options USB_DEBUG > > > device uhci > > > device ehci > > > device xhci > > > device usb > > > + device urndis > > > device ukbd > > > device umass > > > device mmc > > > device mmcsd > > > device sdhci > > > *************** > > > *** 261,265 **** > > > options XENHVM > > > device xenpci > > > device vmx > > > - device netmap > > > device crypto > > > --- 170,175 ---- > > > options XENHVM > > > device xenpci > > > device vmx > > > device crypto > > > + device coretemp > > > + options EXT2FS > > > > > > > The boot fail is between SRAT & PPIM, using src from svn 12757, > > as shown by dmesg on svn 12757 based generic kernel : > > Does it panic or hang? Thanks for the Q. John, It hangs. I'm refining down which line of the custom config triggers the hang & will post when Ive found it. Cheers, Julian -- Julian Stacey, BSD Linux Unix Sys Eng Consultant Munich Reply below, Prefix '> '. Plain text, No .doc, base64, HTML, quoted-printable. http://berklix.eu/brexit/#stolen_votes From owner-freebsd-current@freebsd.org Mon Nov 28 18:27:56 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B4B3C59600 for ; Mon, 28 Nov 2016 18:27:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 770FC139F for ; Mon, 28 Nov 2016 18:27:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 73BC1C595FF; Mon, 28 Nov 2016 18:27:56 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C8AC595FE for ; Mon, 28 Nov 2016 18:27:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45A0F139D for ; Mon, 28 Nov 2016 18:27:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 407C910A80C; Mon, 28 Nov 2016 13:27:54 -0500 (EST) From: John Baldwin To: Sepherosa Ziehau Cc: "freebsd-current@freebsd.org" Subject: Re: Please test EARLY_AP_STARTUP Date: Mon, 28 Nov 2016 10:27:40 -0800 Message-ID: <5196546.NF2ntCjvkx@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 28 Nov 2016 13:27:54 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 18:27:56 -0000 On Monday, November 28, 2016 02:35:07 PM Sepherosa Ziehau wrote: > Hi John, > > fdc seems to cause panic on Hyper-V: > https://people.freebsd.org/~sephe/fdc_panic.png You shouldn't get this panic in latest HEAD (post-r309148). > I then commented out device fdc, and I fixed one panic on Hyper-V here: > https://reviews.freebsd.org/D8656 Replied to the review. > After fdc is disabled and hyperv/storvsc is fixed, it seems to boot > fine, except a long delay (28~30seconds) here: > .... > Timecounters tick every 1.000 msec > ----- > 28 ~ 30 seconds delay > ----- > vlan: initialized, using hash tables with chaining > .... > > I have the bootverbose dmesg here: > https://people.freebsd.org/~sephe/dmesg_earlyap.txt > > I booted 10 times, only one boot does not suffer this 30 seconds > delay. It sounds like some races to me. Any hints? It is likely a race as we start running things sooner now, yes. Can you break into DDB during the hang and see what thread0 is waiting on? If it is in the interrupt hooks you can use 'show conifhk' in DDB to see the list of pending interrupt hooks. That provides a list of candidate drivers to inspect (e.g. stack traces of relevant kthreads) for what is actually waiting (and what it is waiting on) -- John Baldwin From owner-freebsd-current@freebsd.org Mon Nov 28 19:43:37 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02A40C5ACF9 for ; Mon, 28 Nov 2016 19:43:37 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id D72FB1FF3 for ; Mon, 28 Nov 2016 19:43:36 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id D3A51C5ACF8; Mon, 28 Nov 2016 19:43:36 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15E7C5ACF7 for ; Mon, 28 Nov 2016 19:43:36 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wj0-x233.google.com (mail-wj0-x233.google.com [IPv6:2a00:1450:400c:c01::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7A51FF2 for ; Mon, 28 Nov 2016 19:43:36 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wj0-x233.google.com with SMTP id v7so125795136wjy.2 for ; Mon, 28 Nov 2016 11:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fyPcI8BlYMBvzblbiBgeTZeBp807wQFP1TGnMSvVbKc=; b=ew8CJ0M7azCiE2pMIILQOGjeN+ywkpyHZiOk8/e/U3Q4TEeDxNASBypv97mFE4u/87 UK2n6fOT8MyNS9fT25FKuPxqX/anQQqd7nw617kPpDAicjdUDPj6LfMB6jhwSzDb6YzY cEGBnD+1pg5gEMqNBa1JFn8UILte/akMtqp9bx+viyxBwD2WfCWqMN6PyOPqLzVhdx6N UBK8dkDmrBCj8Ev6aEFHcm+jaYlroqz4H7QXNOdwcfmWq53+nlEKNqh3hzKa1CX342Ro OJB46W+sJJI1M4UdkfmjKK3osxJ7cPQO2Tm/4JrjcNeZCyJSBb9MJnevD+ZkVaKirCoX HJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fyPcI8BlYMBvzblbiBgeTZeBp807wQFP1TGnMSvVbKc=; b=QOIV+NT28m+MW1cDXJ8VLTUq7DeuezV+r+sXHDuoe4CzhlpwqHssMXAYnOHqOuImRe 0yUA/nanVU9e7QPPqiGky9oriAIrAv3c6UILjiA8bDsQEI2BvRakJOxjZHJ2N2X6J/ap MagUIZw3paLIU1M2GkGgXU/x3iesFSln1S9ICxzkNNNyPXqeB9+JwyrE3qviLBxT4+p8 IOTRss5gd5VVU1QAmo8y59JuaJ0Zxf12D811zJZSZtwN5sY9s7hRiqOPeQ+1kjpO2ePs 4g7NtI0/vQhtsiYmLducHjjbRBUsFZN6fZdqHrwDLNJckAAcwJwGn4Uv4N1SPY6eizGZ H5Ng== X-Gm-Message-State: AKaTC03ryei6fiVCUrlyYCm6v9793Ciue2QKQsT7fXMgf10G0FdacDcf49Rz8NoY4W6ORJiRXbaTxb5u4OILLkYb X-Received: by 10.194.84.6 with SMTP id u6mr20109052wjy.185.1480362214765; Mon, 28 Nov 2016 11:43:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.232.68 with HTTP; Mon, 28 Nov 2016 11:43:34 -0800 (PST) In-Reply-To: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> From: Oliver Pinter Date: Mon, 28 Nov 2016 20:43:34 +0100 Message-ID: Subject: Re: Please test EARLY_AP_STARTUP To: John Baldwin Cc: current@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Nov 2016 19:43:37 -0000 On 11/25/16, John Baldwin wrote: > I plan to enable EARLY_AP_STARTUP on x86 in a week on HEAD. Some folks > have been testing it for the last week or so which has exposed some > additional things to fix. I think I've resolved most of those in one > way or another, but it will make things smoother if other folks can > start testing this over the next few days before it is enabled by default. > > (To enable, add 'options EARLY_AP_STARTUP' to your kernel config.) Working fine with HardenedBSD's HARDENEDBSD kernel config + EARLY_AP_STARTUP (it's a FreeBSD's GENERIC + some additional HardenedBSD specific stuff) on Gigabyte GA-87N-Wifi board + i5-4670 + 3x HDD + Ati VGA. > > Note that non-x86 platforms should eventually adopt this, but I don't > think any of them are ready yet. > > -- > John Baldwin > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > From owner-freebsd-current@freebsd.org Tue Nov 29 11:05:24 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AA46C596C4 for ; Tue, 29 Nov 2016 11:05:24 +0000 (UTC) (envelope-from AWilcox@Wilcox-Tech.com) Received: from mail.wilcox-tech.com (mail.foxkit.us [45.32.83.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.wilcox-tech.com", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8764018EA for ; Tue, 29 Nov 2016 11:05:23 +0000 (UTC) (envelope-from AWilcox@Wilcox-Tech.com) Received: (qmail 29936 invoked from network); 23 Nov 2016 18:11:54 -0000 Received: from ip68-13-242-69.ok.ok.cox.net (HELO ?10.1.1.57?) (awilcox@wilcox-tech.com@68.13.242.69) by mail.foxkit.us with ESMTPA; 23 Nov 2016 18:11:54 -0000 Subject: Re: Optimising generated rules for SAT solving (5/12 are duplicates) To: freebsd-current@freebsd.org References: <20150414200459.GE39658@ivaldir.etoilebsd.net> <20150421103454.GR1394@zxy.spb.ru> <5593D0AE.2010205@selasky.org> <416359ce-1dcd-1160-5c56-f120a0f6358f@selasky.org> <20160627115533.gqvdsmtzwnvrrfuo@ivaldir.etoilebsd.net> <0671148b-d7cd-f8ad-906d-a0baa1b98cf5@selasky.org> From: "A. Wilcox" Message-ID: <5835DBDE.8010409@Wilcox-Tech.com> Date: Wed, 23 Nov 2016 12:11:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w4PtONbM2piogfoE6xcA6rgxwgQJ7XLnM" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 29 Nov 2016 11:05:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --w4PtONbM2piogfoE6xcA6rgxwgQJ7XLnM Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 23/11/16 10:47, Ed Schouten wrote: > 2016-11-23 17:41 GMT+01:00 Hans Petter Selasky : >> GitHub wouldn't allow me to make a .diff attachment. >=20 > But there's absolutely no need for doing that in the first place! :-) >=20 > 1. Go to https://github.com/freebsd/pkg > 2. Click 'Fork' on the top right. This will probably create a > https://github.com/hselasky/pkg > 3. Check out that repository using git(1), create a separate branch > and commit the changes to the SAT solver. > 4. Go to https://github.com/hselasky/pkg and click on 'New pull request= '. > 5. Fill in the form. >=20 Or you could just, I don't know, email the diff as a patch using git send-email like normal people instead of using GitHub's walled garden. That way, people without GitHub accounts can still comment on it. Just my 2=A2. --arw --=20 A. Wilcox (awilfox) Open-source programmer (C, C++, Python) https://code.foxkit.us/u/awilfox/ --w4PtONbM2piogfoE6xcA6rgxwgQJ7XLnM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYNdveAAoJEMspy1GSK50U/WYP/2hx87Wrr22kV9UJmM2q8cd0 RHxaZxK0O51JxHL0x/09/5f+f6U0EFhipiIQOIuevtue6tkgZnTA+3Luj5LmUvZp 4DjdDsvbIUjAj8rVnzMVgSIl2tK/jpoiekxny/t9O8ogj40b+7t923Hawzku/m7H d0Hpo1rD6IJfWd1dOagQFlQ+jNhEFtHo60EjGfpNB3q7ah35G11iuZh/djbBje1K XNt7WNPU45/DdUehsesaPSH8O04V4WAZrP81HsnRFsSbTcwuHi+Es5sJ6lABDUMu e+iFzOkHt8ijsS+L2TvPxFOFmPXkGCR4Xhh/mTwgOcOfAFF/sunZ8p+ettB7OARF kEGQNA6CET4kWkp/PgtfZBaiYE40ZLn3jYqOYUBsNBT7jjIKMxQTg4Y9+W6OP/vn JRpx+9eBT5fXYTS4j1Xg8dJBo+KTn+Q4+i1K18Ab/1VCSIBm9FcZzmL2uWV9j1qV ujACt9sZ1oYrDXIK3YDwA+t9j6MtBatXt6rjc08YXTSUyX3ZRB5wYnDOerw0THFx cIgWmTAvSEwd5I8RAwXqQk4pfs4jhNZBsKPHx65E5lIXFLR4y/Ly/NilLVUh+k/a dg1PSXu4dX2Decvp11pR12C9Dzo7oBGFce1do0mJIuvJTuftDz4byIupiGP3C67+ aDRuWvDs9n6mXhjZK5OZ =nFKt -----END PGP SIGNATURE----- --w4PtONbM2piogfoE6xcA6rgxwgQJ7XLnM-- From owner-freebsd-current@freebsd.org Tue Nov 29 11:13:20 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE541C59D5A for ; Tue, 29 Nov 2016 11:13:20 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAA251F24 for ; Tue, 29 Nov 2016 11:13:20 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.1.65] (host81-157-245-13.range81-157.btcentralplus.com [81.157.245.13]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id uATBA4Y3063190 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Nov 2016 11:10:07 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host host81-157-245-13.range81-157.btcentralplus.com [81.157.245.13] claimed to be [192.168.1.65] Content-Type: multipart/signed; boundary="Apple-Mail=_4A1BB679-377C-4384-9CE6-97E7E25323CF"; protocol="application/pkcs7-signature"; micalg=sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Optimising generated rules for SAT solving (5/12 are duplicates) From: David Chisnall In-Reply-To: <5835DBDE.8010409@Wilcox-Tech.com> Date: Tue, 29 Nov 2016 11:09:57 +0000 Cc: freebsd-current@freebsd.org Message-Id: References: <20150414200459.GE39658@ivaldir.etoilebsd.net> <20150421103454.GR1394@zxy.spb.ru> <5593D0AE.2010205@selasky.org> <416359ce-1dcd-1160-5c56-f120a0f6358f@selasky.org> <20160627115533.gqvdsmtzwnvrrfuo@ivaldir.etoilebsd.net> <0671148b-d7cd-f8ad-906d-a0baa1b98cf5@selasky.org> <5835DBDE.8010409@Wilcox-Tech.com> To: "A. Wilcox" X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 29 Nov 2016 11:13:20 -0000 --Apple-Mail=_4A1BB679-377C-4384-9CE6-97E7E25323CF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 23 Nov 2016, at 18:11, A. Wilcox wrote: >=20 > Or you could just, I don't know, email the diff as a patch using git > send-email like normal people instead of using GitHub's walled garden. > That way, people without GitHub accounts can still comment on it. GitHub pull requests are branches in the recipient=92s git repo. Anyone = can see the patch without logging in, either via the web interface or by = pulling the relevant branch. If you want to send comments via email = based on this copy of the patch, then that=92s up to you, though = personally I=92d much prefer the GitHub code review interface to = anything email based. David --Apple-Mail=_4A1BB679-377C-4384-9CE6-97E7E25323CF Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIK5jCCBPww ggPkoAMCAQICECJrrb9nBol9MHok/UZg/AYwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBh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b20gTHRkLjEpMCcGA1UECxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx IzAhBgNVBAMTGlN0YXJ0Q29tIENsYXNzIDEgQ2xpZW50IENBAhAia62/ZwaJfTB6JP1GYPwGMA0G CSqGSIb3DQEBAQUABIIBALB4zO/AWcjJqUdK6nxkiXBu0mBbXC4vRtt1PnymoT9CFITBOcfSEI2B vyvzwT8o75v4WOwqGhU8T/Flq5pMtrl0/RXM8q+jsaRH0+ZLfvL/qonhXROjuz8WFuB8pQ4CT8QC ShkOE0HfDEJSqoJ0cdjhpx+QLUJtkOa+jTxeX+mN7r3igrxSiNwMHwUml8OBo9QszAnox9k4hmR/ onwQIrwAwbqLfJypNMqbq11eQeTYa1Q4gboX1Fn2GFzFOhXa2m9JXV4gyBhur+ULrW5bIJ/AfXRg BcsH+MO4uI5tKX5Y01KgqBsHgrb430LFhefBZ4JzsUMlw2LOyLUPpUggwnkAAAAAAAA= --Apple-Mail=_4A1BB679-377C-4384-9CE6-97E7E25323CF-- From owner-freebsd-current@freebsd.org Tue Nov 29 22:49:57 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D280C5C86B for ; Tue, 29 Nov 2016 22:49:57 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B37611AB6; Tue, 29 Nov 2016 22:49:55 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (pD9FE9AFB.dip0.t-ipconnect.de [217.254.154.251]) (authenticated bits=128) by land.berklix.org (8.15.2/8.15.2) with ESMTPA id uATMnlhJ045348; Tue, 29 Nov 2016 22:49:47 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id uATMniZd077580; Tue, 29 Nov 2016 23:49:44 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id uATMnWGj087462; Tue, 29 Nov 2016 23:49:44 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <201611292249.uATMnWGj087462@fire.js.berklix.net> To: freebsd-current@freebsd.org Subject: Re: boot fails on Table SSDT at 0x... From: "Julian H. Stacey" Organization: http://berklix.eu BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ In-reply-to: Your message "Mon, 28 Nov 2016 19:07:55 +0100." <201611281808.uASI7tsP040646@fire.js.berklix.net> Date: Tue, 29 Nov 2016 23:49:32 +0100 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 29 Nov 2016 22:49:57 -0000 > Thanks for the Q. John, > It hangs. > I'm refining down which line of the custom config triggers the hang > & will post when Ive found it. Sorry, after lots of kernel variants & reboots I failed to get it to hang on boot. Eventually with same src/ I reverted to original bad config. Even that wouldn't hang on boot, so I've given up ! :-/ Cheers, Julian -- Julian Stacey, BSD Linux Unix Sys Eng Consultant Munich Reply below, Prefix '> '. Plain text, No .doc, base64, HTML, quoted-printable. http://berklix.eu/brexit/#stolen_votes From owner-freebsd-current@freebsd.org Tue Nov 29 23:24:06 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C29C5C7AC for ; Tue, 29 Nov 2016 23:24:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B2091410 for ; Tue, 29 Nov 2016 23:24:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D133E10AA27; Tue, 29 Nov 2016 18:24:03 -0500 (EST) From: John Baldwin To: "Julian H. Stacey" Cc: freebsd-current@freebsd.org Subject: Re: boot fails on Table SSDT at 0x... Date: Tue, 29 Nov 2016 15:24 -0800 Message-ID: <4385251.XWNjh4rSHY@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201611292249.uATMnWGj087462@fire.js.berklix.net> References: <201611292249.uATMnWGj087462@fire.js.berklix.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 29 Nov 2016 18:24:03 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 29 Nov 2016 23:24:06 -0000 On Tuesday, November 29, 2016 11:49:32 PM Julian H. Stacey wrote: > > Thanks for the Q. John, > > It hangs. > > I'm refining down which line of the custom config triggers the hang > > & will post when Ive found it. > > Sorry, after lots of kernel variants & reboots I failed to get it > to hang on boot. Eventually with same src/ I reverted to original > bad config. Even that wouldn't hang on boot, so I've given up ! :-/ Perhaps a stale .o wasn't being recompiled? None of your kernel option changes seemed to be related, so I suspect it was something oddball like that. -- John Baldwin From owner-freebsd-current@freebsd.org Tue Nov 29 23:33:20 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48616C5CBA7 for ; Tue, 29 Nov 2016 23:33:20 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF0421963; Tue, 29 Nov 2016 23:33:19 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (p5083CD56.dip0.t-ipconnect.de [80.131.205.86]) (authenticated bits=128) by land.berklix.org (8.15.2/8.15.2) with ESMTPA id uATNXG8B047043; Tue, 29 Nov 2016 23:33:16 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id uATNXC3Q077776; Wed, 30 Nov 2016 00:33:12 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id uATNX17s087830; Wed, 30 Nov 2016 00:33:13 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <201611292333.uATNX17s087830@fire.js.berklix.net> To: John Baldwin cc: freebsd-current@freebsd.org Subject: Re: boot fails on Table SSDT at 0x... From: "Julian H. Stacey" Organization: http://berklix.eu BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ In-reply-to: Your message "Tue, 29 Nov 2016 15:24:00 -0800." <4385251.XWNjh4rSHY@ralph.baldwin.cx> Date: Wed, 30 Nov 2016 00:33:01 +0100 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 29 Nov 2016 23:33:20 -0000 John Baldwin wrote: > On Tuesday, November 29, 2016 11:49:32 PM Julian H. Stacey wrote: > > > Thanks for the Q. John, > > > It hangs. > > > I'm refining down which line of the custom config triggers the hang > > > & will post when Ive found it. > > > > Sorry, after lots of kernel variants & reboots I failed to get it > > to hang on boot. Eventually with same src/ I reverted to original > > bad config. Even that wouldn't hang on boot, so I've given up ! :-/ > > Perhaps a stale .o wasn't being recompiled? None of your kernel option > changes seemed to be related, so I suspect it was something oddball like that. Yes, good guess, (I'd even wondered about bad sectors, heat etc, not ntpd as all local FS .. ). PS at least it got me to review my config, drop & adopt some options, & get all in the same order as GENERIC. Thanks! Cheers, Julian -- Julian Stacey, BSD Linux Unix Sys Eng Consultant Munich Reply below, Prefix '> '. Plain text, No .doc, base64, HTML, quoted-printable. http://berklix.eu/brexit/#stolen_votes From owner-freebsd-current@freebsd.org Wed Nov 30 01:59:29 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 978D8C5C658 for ; Wed, 30 Nov 2016 01:59:29 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 7877A1A51 for ; Wed, 30 Nov 2016 01:59:29 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 74BFEC5C657; Wed, 30 Nov 2016 01:59:29 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7464EC5C656 for ; Wed, 30 Nov 2016 01:59:29 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x233.google.com (mail-ua0-x233.google.com [IPv6:2607:f8b0:400c:c08::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FEC81A50; Wed, 30 Nov 2016 01:59:29 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x233.google.com with SMTP id 12so198778526uas.2; Tue, 29 Nov 2016 17:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kmo99RtiWecDjd1khG7kI4Mr46lrDmfqfb1AfHQtTz0=; b=umY3WJYIHxihMOOxwGrtLSa/teCAXJ2PrBtga9T3wKaM+LlM07RrKfj/+VWeqNAq1l +zGsnVc3J16vKKd26+6qRI5Y8HouRndnMQMUkBZQ1eFHJ5KwO1KswGbsBHQ/hKx0bL47 EylXXtADGbDRWz4xOBh0+R4TRffyGPcrlqxxaEtptG/JK6TnEUZruHylxCuYs88LVMSL aUgJkyh2y9LaiUqjQxpAVEnQNA4WnkvAV4udOpVKuyTSTjtFe9HFiu6Et9wY87FGtxZL Yqn2sppf5Gl7sPc+2dutUaOsGiDEi9MKUck75Hr8ZOkmX9+4sffyld3k8r2fHGexff+q pO6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kmo99RtiWecDjd1khG7kI4Mr46lrDmfqfb1AfHQtTz0=; b=iND+Er1vpWHlccTTYwH49mxYTAkCV222g2TXNpLhq1YQhHVgudhDUbRQN/m8qiYTZ2 P1hi9PZ8rt18L0OkAQ5pPUuQMhGhsrQYwoIWHc75nsTnyr8PXtI3D7MEZz6651sXc7Ks lcOn6dTufV+22rDxB3fsEUBL6SFABAS/X9Y06MmVIDh0dumGDRTxUdhDgvY1PRmbYGcS c7T7j+RKYq1JTyxU+95HLhChJ2HWisnnQwsHUNS5YA3BfTkaT0LhZyqe2v23nivStMip VVp1CwTmoeADqjh8HgOXQ5NrSfPh8Y1unLOA9Xh4zcagjfzuUfVUS1tu1KOVSddHLZV6 Zj3A== X-Gm-Message-State: AKaTC00V2o9xUSp/Ew+GAayEpF/7Vqbtve2tRPiPAWBY+yWG8DoZVvIFDmvEB9UW39ilhHB0mba27omRRPBSqg== X-Received: by 10.159.49.11 with SMTP id m11mr24118889uab.178.1480471167931; Tue, 29 Nov 2016 17:59:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.5.198 with HTTP; Tue, 29 Nov 2016 17:59:27 -0800 (PST) In-Reply-To: <5196546.NF2ntCjvkx@ralph.baldwin.cx> References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> <5196546.NF2ntCjvkx@ralph.baldwin.cx> From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 09:59:27 +0800 Message-ID: Subject: Re: Please test EARLY_AP_STARTUP To: John Baldwin Cc: "freebsd-current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 01:59:29 -0000 On Tue, Nov 29, 2016 at 2:27 AM, John Baldwin wrote: > On Monday, November 28, 2016 02:35:07 PM Sepherosa Ziehau wrote: >> Hi John, >> >> fdc seems to cause panic on Hyper-V: >> https://people.freebsd.org/~sephe/fdc_panic.png > > You shouldn't get this panic in latest HEAD (post-r309148). The base of my kernel tree is ~20 days old :) > >> I then commented out device fdc, and I fixed one panic on Hyper-V here: >> https://reviews.freebsd.org/D8656 > > Replied to the review. > >> After fdc is disabled and hyperv/storvsc is fixed, it seems to boot >> fine, except a long delay (28~30seconds) here: >> .... >> Timecounters tick every 1.000 msec >> ----- >> 28 ~ 30 seconds delay >> ----- >> vlan: initialized, using hash tables with chaining >> .... >> >> I have the bootverbose dmesg here: >> https://people.freebsd.org/~sephe/dmesg_earlyap.txt >> >> I booted 10 times, only one boot does not suffer this 30 seconds >> delay. It sounds like some races to me. Any hints? > > It is likely a race as we start running things sooner now, yes. Can you > break into DDB during the hang and see what thread0 is waiting on? If > it is in the interrupt hooks you can use 'show conifhk' in DDB to see the > list of pending interrupt hooks. That provides a list of candidate drivers > to inspect (e.g. stack traces of relevant kthreads) for what is actually > waiting (and what it is waiting on) Just tried, but I failed to break into DDB during the 30 seconds delay. DDB was entered after the 30 seconds delay, though I press the break key when the delay started. Thanks, sephe -- Tomorrow Will Never Die From owner-freebsd-current@freebsd.org Wed Nov 30 09:27:50 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA27AC5AC39 for ; Wed, 30 Nov 2016 09:27:50 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0A91D80 for ; Wed, 30 Nov 2016 09:27:49 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.walstatt.dynvpn.de ([78.52.71.117]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lug4m-1ctyoc2M6a-00zrzs for ; Wed, 30 Nov 2016 10:22:34 +0100 Date: Wed, 30 Nov 2016 10:22:28 +0100 From: "O. Hartmann" To: FreeBSD CURRENT Subject: CURRENT: pkg broken on r309320 Message-ID: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/SXo14/vnfNElyMssXYjMPmD"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:XR3Lxmb2vcL7PztqtFv5QuYy72C3cS/vO5//xfbBQ/nma5cYOaa ByI4VVKtJcCW1J5or84Lnf62ieu9+N+gxAP8FYF7tYwnBD9Nh6oOpjbpmbx/R/ZmRa19IdP XwtIMy+Vpwj48uX//Ht2LpDyVrI1C6/rxB1ruY/A4gyYk8UEboNYXsl407E4cyOnf2eIdnR J+2a2zOpNyS38zVx/s4iw== X-UI-Out-Filterresults: notjunk:1;V01:K0:y21avgdaEDA=:Ieirg3NntBTmu6gG5Jggub FS9YAWxgZNMynhMZ2kdHQ7gpIbwUDCRiFaCo6NV5+AgBYn2qPMmjy+69MkxAcWKnS2UVaIiaa gV5txQFq6QMfY0WGq1RgZnx/tl1HCCABiuy6LjMAHsCmDRrawsw0Zh/Soh8o8EZcVIU1/wxeY 6SqHnRQ9qiruPlw3y6prLnKVMyscpzb7aUBG1HeS83CPC5XqGuoxNNpYAgnwsAoZMxl5YHSbv 1u70AXM6uIdwu3Tk7CN0JcetgMcOXZh4q45wX+Gs3gPwSeUTLdjH45VMXwhQ1oV9XEsUYORwq z7CrAdCJPB7k+bu9feTOJrddsEcj2eIE65DXcMxEaxMAoIN9p2Pw1/KkU8w9rbVD6N79XCkQg ZN6DZmQPNJw3hAEVn5oiaq8WL29b9akxjE1yZc+ubYIhCGIegXIvDg/5Fel1fyKdcZKYz72K3 F7Sh5l13ABTmpIC7BJHb4AOICumWyRCM43ZMtEV3j3Q2HZqxB62yI5FkLUMl/ZlOJgR5MJ0jV T4vS6KmqkwAJLskCs+U5tOpIzxEDy+ZAvHL4KxhYaIgNSkUMWsWhPycPA66x3V0h+A8eJIdmx NSgpbaIRDqan7+d5fZxhABoHu6leegIfVIdkNY2qmP2OWNfCq+qi7Uqfr2CbOZLGrmqB+oZ4X HFyDSNJz/TvPu/+4AGUwZcf6wkRDzv5D3SNCraFmtXGFrI5PCOPpVC+SZQIjE6zgg3kr1hUHw ogHGNoGPLaCNok/duDteG4xg9lv8MhrNigFTdxjaRYFq7JW0hgXRQmIlHJw= X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 09:27:51 -0000 --Sig_/SXo14/vnfNElyMssXYjMPmD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Running CURRENT, r309320 and try to update ports. After the port has been b= uild, pkg fails to install the port quitting with: pkg: illegal option -- i DBG(1)[67562]> pkg initialized pkg: unknown command: /usr/ports/www/libwww/work/stage For more information on available commands and options see 'pkg help'. *** Error code 64 Stop. make: stopped in /usr/ports/www/libwww Seems there has been introduced a bug since rr309298 Kind regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/SXo14/vnfNElyMssXYjMPmD Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWD6aVAAKCRDS528fyFhY lIW+Af9MPFsrvsB5JMhJjXHqy0KwqdhDRfdSfMDQ2OjepfY8UM4Ry4ovXSUbXFSJ VVFad1ffhCjHIxxEU+8ytXcTHQSAAf40gaXf4139CbKV4HGwg0RvPxYoGzITu5I3 NxNAj3+YGAXx2yUOS9rtG1HzHx8tLGViXLXtZX8AU/CO5DRFYnO4 =uUQu -----END PGP SIGNATURE----- --Sig_/SXo14/vnfNElyMssXYjMPmD-- From owner-freebsd-current@freebsd.org Wed Nov 30 10:14:22 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E8CC5D9DE for ; Wed, 30 Nov 2016 10:14:22 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58273188F for ; Wed, 30 Nov 2016 10:14:21 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id g23so264485579wme.1 for ; Wed, 30 Nov 2016 02:14:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NR8O3DTRHTaJ7/3TUj/+u9WbM8CCcYFidt7oi1U86Mg=; b=X/yy3SfcxETsMss906OvYZ4Zd6qGv+VyxqmPiVporvKyi0WjpdeF2Z7PX2mYPFXpbG 3exChnaDN99oSmJY+CDPzCdDDyYx/oVeuAmdLFOelY5JiEk293YNt8NQhgub8/Pa4Vf7 8CJ2yYV410diAP9P+CezGmhYNkk3T7WaJUDqjAxCuLUjAG7GGCH4CBDCukLnFe/ijLXs Z+6ar0ewemKsnkUM3VvEqTIBUaGIF9vcz2U921a6tNvEknqp7oINIX9caQESZmp7OqJn IJg/RfBt7iREdQON/e+6j2vaTnDTCSEqm+R3/8PTppxx+5QQLNfoJcwqUixXxQpKaOra JIww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=NR8O3DTRHTaJ7/3TUj/+u9WbM8CCcYFidt7oi1U86Mg=; b=G6E9BaTMVuAIVyZzxZgFXotLB/ZpQXzv44VPB3WXkfTbKtAzHKRn2BciC4igUBtrFD TZUwk6ThJiVMjoW4yCU6yo898XSz68PzMd1/QPH03Wh6b48x734azBcg2uC9Rd+2LBNg fScwTyi11yQvc6hmudasFEQ9KKA0yVjq+VaQK6r8J6Rn3RTJvEOjhLZsELi8JMBK9rSs eYqSmofF2KAazMG+keE1RAe2ue2iDX5E7esCvb2K7xGZi+lMmEaD12umq6BkDNAQDICa fF/Idne8zrhbX0IFJCOe9Lish2UMnvQBktGoBLFweO/gnu1SAYVBW1DCtIJ52hJwxhln +w6w== X-Gm-Message-State: AKaTC00gAM+I1kXGWlduIrHYQjUiUeheNlK+zQuMCbtv+SJ/cQEo0Wnb8TT4UwhrNaq0VA== X-Received: by 10.28.66.194 with SMTP id k63mr30055306wmi.140.1480500859528; Wed, 30 Nov 2016 02:14:19 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id p144sm7200157wme.23.2016.11.30.02.14.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 02:14:18 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 30 Nov 2016 11:14:17 +0100 From: Baptiste Daroussin To: "O. Hartmann" Cc: FreeBSD CURRENT Subject: Re: CURRENT: pkg broken on r309320 Message-ID: <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7hqhm5qg33yokscf" Content-Disposition: inline In-Reply-To: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 10:14:22 -0000 --7hqhm5qg33yokscf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 30, 2016 at 10:22:28AM +0100, O. Hartmann wrote: > Running CURRENT, r309320 and try to update ports. After the port has been= build, pkg > fails to install the port quitting with: >=20 > pkg: illegal option -- i > DBG(1)[67562]> pkg initialized > pkg: unknown command: /usr/ports/www/libwww/work/stage >=20 > For more information on available commands and options see 'pkg help'. > *** Error code 64 >=20 > Stop. > make: stopped in /usr/ports/www/libwww >=20 > Seems there has been introduced a bug since rr309298 >=20 > Kind regards, > Oliver revert r309314 the issue is there: The ports tree defines PKG_CMD as pkg register but now bsd.own.mk predefine= s it to simply pkg. There is a collision there. Best regards, Bapt --7hqhm5qg33yokscf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlg+pncACgkQY4mL3PG3 PlqdhRAA3Hc407uG0aGAByCnJQhJTJnCL9lCQ9DHy+0gUXIgxd6eFAnNfW/qA3nn NlGre6LyOK2gXsQ6pZGlKFuOxI1krrWboDWGif1hLOtRqb/snepqJYnMoDV9s8Le hGhfaUwoqZm9R7hCAk+fIclahI/2M275LhHMqv4qnU3Pt2DXqP+/OrHJbJ2jOtMc xa9zG+i40t7GqGXORAWFWrkf9N+Kd1XXRzpFyTtjA0gfF//C40Pf163pxs92+BZb yLX3cvfTyKyT/K0R+WRJwHoeU3CRba2BspE/fEhvtgouqihMI9TqUPkcFdNXfUNC P26c/Wk2hAqaCBdOcsH0ViB27CBXKN5aAgCk65FtAZzaDXKwU7W1Kw8PwwhOIP6h /sxW7MtN6+UlGutdGgGbeIlldb7/a7FOhrrj9mVHihpykDM/MqDa6+yzXgZ1Jf8n 9kgX3z8PlVzeO736EoUEkgPwwQp74i8+CwsplTXoqR4qf6kbdLCT0965EEb453Gy cGn4FL3dfPbZqd5LczghePNzqvnib5zySO4rS1l3bzmGkx3ppM2h8jZ6vM6TfpE6 Qq2gXDxeogAHaLednhpkWPJQSOAf+2B34TiASVTRUZXmgyBE5f5gh9joocs6ADMV MCW5lBwgYrvbEuHtcY0gPFuau5I6JLWmH/9GJWbLtB03qru8jP4= =Mh2n -----END PGP SIGNATURE----- --7hqhm5qg33yokscf-- From owner-freebsd-current@freebsd.org Wed Nov 30 12:10:46 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A973DC5B7BA for ; Wed, 30 Nov 2016 12:10:46 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6512D1F72 for ; Wed, 30 Nov 2016 12:10:46 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from host-4-75.office.adestra.com (unknown [85.199.232.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 3224E24E3 for ; Wed, 30 Nov 2016 12:10:38 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/3224E24E3; dkim=none; dkim-atps=neutral Subject: Re: CURRENT: pkg broken on r309320 To: freebsd-current@freebsd.org References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> From: Matthew Seaman Message-ID: <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> Date: Wed, 30 Nov 2016 12:10:31 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="310mB0XSq4OPeJNmfe6oM6CFwtD1pB2cF" X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,RCVD_IN_RP_RNBL, RDNS_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 12:10:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --310mB0XSq4OPeJNmfe6oM6CFwtD1pB2cF Content-Type: multipart/mixed; boundary="7TjIJ5cBS8r2FEiGgj4n1VwdgDNnfm1oO"; protected-headers="v1" From: Matthew Seaman To: freebsd-current@freebsd.org Message-ID: <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> Subject: Re: CURRENT: pkg broken on r309320 References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> In-Reply-To: <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> --7TjIJ5cBS8r2FEiGgj4n1VwdgDNnfm1oO Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016/11/30 10:14, Baptiste Daroussin wrote: > revert r309314 the issue is there: >=20 > The ports tree defines PKG_CMD as pkg register but now bsd.own.mk prede= fines it > to simply pkg. >=20 > There is a collision there. >=20 Pointy hat to me. I'll revert that commit. Matthew --7TjIJ5cBS8r2FEiGgj4n1VwdgDNnfm1oO-- --310mB0XSq4OPeJNmfe6oM6CFwtD1pB2cF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJYPsG9XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnp4gQAJsTcJ/XtbFDcl7B5mXzlc0t O+gXcut3SSAzGPz2+dSeM/t4/HT5J0gmhSCd0gq/tepZRFr7xpLaEhEdkZVBIx9/ K1YRBP8LSFhlTByxZw96KY1EqTG2ypEA+PznVndTCEIXzx/7/S04Kr8TRqUUiI6s 3xMTXbGBV0xhi4VRFcA5HmH04eYtd7G2o0OmjrimDsDtBlLjzlZGedRh3b3s2x5T 4bhnmQ97rUYuvw9c8PLhkPWoXkBXyHL+CjtH2skxBTZjAr4tWdHVbCHXMbamjnx+ 87l5/KyDDkdiD9nVXPXITJtRGoHjcjXQAed5TZJ4ez1Ha9EmY7CgJOiJqkUefuCl I07vaM6uoLCegDEoE3XhY0fBIz6doGeMBL3q/2wR2AS1KlfE/8bI8W+SpGSQwuo/ pTbeeEvh2uWyrzLIqavplN8uUVvmiwjxsYLNWWE8/f+1+XKV3dp6lK4brA9Wsi25 k5WKaI44UACySbA/JLBU7B2Q3/klS1zM1t1OTUmLuCDf5hjARXfHRE5BwnghO2wP R65tEoWjt9T8KB0o23HeoJHpmJAVUV0YSdt2duzdyPY1ATnDfPqUkp/dP8fUPrEK xCyCrXOBCIZYssWWcMMui5g46VDwGvIvUqqmzkEZJtawcd/uHZaX/LZ8pukPzn1H +/uPMkAp2GUTO07Cke09 =XbMc -----END PGP SIGNATURE----- --310mB0XSq4OPeJNmfe6oM6CFwtD1pB2cF-- From owner-freebsd-current@freebsd.org Wed Nov 30 12:14:13 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48095C5BAA9 for ; Wed, 30 Nov 2016 12:14:13 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wj0-x22a.google.com (mail-wj0-x22a.google.com [IPv6:2a00:1450:400c:c01::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD89514E3; Wed, 30 Nov 2016 12:14:12 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wj0-x22a.google.com with SMTP id v7so171983488wjy.2; Wed, 30 Nov 2016 04:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8TGwhoSiUr5cmUwxVPw1X4wuj1LXHD12bne8Tv/vIZk=; b=A2xL94w5ZIZwwlbXY+9QyM9+CvjwaaTxY1auPnMkMVUzqNYDPilwTZYE1pwYXdD9r4 fA67KCrRUBguDCzA5V5WeUMUclsqMyn41qgSIiZ+4gk3jm+nzPvgOTaWwiIGIDoHm0jK /5J949lmwCCzJPvEpR0uBlUbBO4zecD3T3EuDXExCKPb/N//Uw6CeGCfLnYq/weLeDh+ qhWMh1e4fvB3qryCx2ja4IHKiGLGy+QdfGmb/Uaev5Z7tvc8ImOzESweGmTlGWwX6/vf vB0afLTfV2KHiyzJG3X6+5yden7rVsFRkJuL8KFcObhX7M6Vb+TXUTuVjsILSSeb7bCU J6sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=8TGwhoSiUr5cmUwxVPw1X4wuj1LXHD12bne8Tv/vIZk=; b=F57L2ey8WGTmYKpSzY9O0KFeU2ZmOu6ZwDVeP7m06SWXf+4uiRp/jFGTGaWLwlZAfK nkR/8w/LQXMS8nX0mZD6tfIuAeBkF92DMBFFEJwHgKRti8lBKwk68Fm/0tzxE62mQmox Cqg2KTu9rqqvrpUWr33dfgplP3gaeH4tytUug4bnLU0SgAQb+MjyfasVP1FKvc3xlcK5 EZapPl4pngmoesGDs51emWkdUjxLp+1cn1fwcIH1BMO1xdL82v+wxpo9SuCovQMl/O+C IDrd/LtuBWzzR+zt0ZyOBrinEE4717tws8APlRbU+2+MyqlGv4+ySSUEL5YJkon8IdAC LQJg== X-Gm-Message-State: AKaTC00efubpmEGq+srqQ5DMjZd2ZJyFTWsWTQW8bPgp095pNt3b9BGV+pjcxRK0NhZ6GQ== X-Received: by 10.194.163.234 with SMTP id yl10mr33248065wjb.112.1480508050242; Wed, 30 Nov 2016 04:14:10 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id e6sm72663182wjw.33.2016.11.30.04.14.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 04:14:09 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 30 Nov 2016 13:14:08 +0100 From: Baptiste Daroussin To: Matthew Seaman Cc: freebsd-current@freebsd.org Subject: Re: CURRENT: pkg broken on r309320 Message-ID: <20161130121408.edigpqp2n4sxmlub@ivaldir.etoilebsd.net> References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="v5e2xshxqyr5yfqy" Content-Disposition: inline In-Reply-To: <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 12:14:13 -0000 --v5e2xshxqyr5yfqy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 30, 2016 at 12:10:31PM +0000, Matthew Seaman wrote: > On 2016/11/30 10:14, Baptiste Daroussin wrote: > > revert r309314 the issue is there: > >=20 > > The ports tree defines PKG_CMD as pkg register but now bsd.own.mk prede= fines it > > to simply pkg. > >=20 > > There is a collision there. > >=20 >=20 > Pointy hat to me. I'll revert that commit. >=20 > Matthew >=20 I have proposed https://reviews.freebsd.org/D8677 instead which make sense = and does not require your to modify bsd.own.mk Best regards, Bapt --v5e2xshxqyr5yfqy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlg+wowACgkQY4mL3PG3 PlrIZA/+L4Vq8zymqKBvLFCxnKr/vCAxe6KxQ+8mDrmMzphVu2CSaYlpqV9cyVPL FoXvLEIHDiGEPzDsBz1Ti20xcUUD+rJDDwUqFBSsOxJmqELeGCVSctVqGkANYLBK +2L0K01bZdUfHZY+YchPu57y0c0BI4Lps3GxDj9um8bqzga3+9LHHP1OSdmPDv+y 0PEqZ3lrT5NzJNqNEOSTYkNsyoEj1WvfHxHhyxh7tGW5X2EBEQbRsIo3NQ7+8CeV 8c7mA/p2KyylOc9x3NG0egT6oNlzapvvTVLv9dhHZo9uZEKa8wiTn/RfuBxbtGUx /K4itONnnBF88lsu1m+EJBpXNM0HRmMSgW3VhcoyUDO9XqL1nMd+RPjCC/ImWPND mU5c2NJR71MaWCrNIbP10BgMHi6XleOajid/5cLe1WnmAXCP3Wnm7aYZ7Ti7iKJF 8rWjUuSmAkEEeZv21mAumxoWr85Px2ScLTt2ooIJaQo42znChAqVEkPxCpbinaJq X11MZRcgvGhkmKLiXDbVd3SO8CqdyeeFUdRpL7aOGpG7fdOjT3eEc6+kaHA2UIZe YrUFADDMISAeyQ4MNhZ9R3ZBBw90u43Yobf51U8RGwIdwUcV1zuy+gLZIrNsCBS1 /mko6IYCVan7ZdTqmIEFcGccSNJgzYzNUAyRY0luCOkKOgEN5T0= =WO/w -----END PGP SIGNATURE----- --v5e2xshxqyr5yfqy-- From owner-freebsd-current@freebsd.org Wed Nov 30 12:18:19 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5028C5BDDB for ; Wed, 30 Nov 2016 12:18:19 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58E881A82; Wed, 30 Nov 2016 12:18:19 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from host-4-75.office.adestra.com (unknown [85.199.232.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id EE59A24FB; Wed, 30 Nov 2016 12:18:15 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/EE59A24FB; dkim=none; dkim-atps=neutral Subject: Re: CURRENT: pkg broken on r309320 To: Baptiste Daroussin References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> <20161130121408.edigpqp2n4sxmlub@ivaldir.etoilebsd.net> Cc: freebsd-current@freebsd.org From: Matthew Seaman Message-ID: <3f56cda2-a78e-1ecd-43ad-15f0e84e119b@FreeBSD.org> Date: Wed, 30 Nov 2016 12:18:14 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161130121408.edigpqp2n4sxmlub@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eXtoisO9lPrBGDdOJDStqdmsEC2aWeMjw" X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,RCVD_IN_RP_RNBL, RDNS_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 12:18:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eXtoisO9lPrBGDdOJDStqdmsEC2aWeMjw Content-Type: multipart/mixed; boundary="4Ci0DOrF59FVhmh3kBiGObDvPtCRVRhm0"; protected-headers="v1" From: Matthew Seaman To: Baptiste Daroussin Cc: freebsd-current@freebsd.org Message-ID: <3f56cda2-a78e-1ecd-43ad-15f0e84e119b@FreeBSD.org> Subject: Re: CURRENT: pkg broken on r309320 References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> <20161130121408.edigpqp2n4sxmlub@ivaldir.etoilebsd.net> In-Reply-To: <20161130121408.edigpqp2n4sxmlub@ivaldir.etoilebsd.net> --4Ci0DOrF59FVhmh3kBiGObDvPtCRVRhm0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016/11/30 12:14, Baptiste Daroussin wrote: > On Wed, Nov 30, 2016 at 12:10:31PM +0000, Matthew Seaman wrote: >> On 2016/11/30 10:14, Baptiste Daroussin wrote: >>> revert r309314 the issue is there: >>> >>> The ports tree defines PKG_CMD as pkg register but now bsd.own.mk pre= defines it >>> to simply pkg. >>> >>> There is a collision there. >>> >> >> Pointy hat to me. I'll revert that commit. >> >> Matthew >> >=20 > I have proposed https://reviews.freebsd.org/D8677 instead which make se= nse and > does not require your to modify bsd.own.mk OK, I'll wait and see what the outcome of D8677 is. Cheers, Matthew --4Ci0DOrF59FVhmh3kBiGObDvPtCRVRhm0-- --eXtoisO9lPrBGDdOJDStqdmsEC2aWeMjw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJYPsOHXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTndo8P/iqkoD17YKkQiIt7e0xpxzjj uTj+suxzoF4vX6DVsyCffIcyK9eVjVdOJZ0eHPnndELDHWh6rcxOKjUg7axbUuQh +QTdNjF7Jc2/XnsHNGRoCB640mtELlj8+8g970cW+DlXDABwAGNf9rsQlSXffpKt H59r6jKjkQSYiZHHm7ORVnzM6jp6b61F6XKsKPKVPZeAhCdzQZMDUUqxOjiZlE7D FNOHj+NAM1YTBN1+XkdZftdqJe+J59WysPFS9G4aK48Wo9tEQmvzydmgfKyJ4Hp+ UQycrQdLay1D7n/I1smTF3jvWidwm8507ls6pL/z4Ck57/do2GRd6XI7H3zaZ2bZ KqlMJGrDYIBP3liM4Pt6TlLtnxSImMbw4NECrz2hb70KcjVeYe4FO//U2PdHapbg S/rLsR01rZe+ncS0UihT7s0pKG+otcTi+OMAwuLgAPvM+9JhuxvjS5BoO1vYQZ01 uWgeLJDtANtzwqvHBM6b9qf4inuUYLH1raS45ut9TBvgcSRKEnryVNK0Xrb6Knag oJX2tQhsjV2UspDsTavWwpmEfV7j6r7hOU8m6BAtB5tP2Fx1WsWhOJlOichSmfLf XdVVzvyZMa/ZFs1kJXau6HlnX8OfYHTqbNRf/5VF1RUQ6WClNiY87drGvxPAIjNj wn6ga02i2gQsGZO9jy0m =Vi5R -----END PGP SIGNATURE----- --eXtoisO9lPrBGDdOJDStqdmsEC2aWeMjw-- From owner-freebsd-current@freebsd.org Wed Nov 30 20:46:49 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 485E4C5EA3A for ; Wed, 30 Nov 2016 20:46:49 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C0351DD6; Wed, 30 Nov 2016 20:46:47 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from hermann ([78.52.71.117]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LyVcA-1coIDw3xCw-015tq5; Wed, 30 Nov 2016 21:46:39 +0100 Date: Wed, 30 Nov 2016 21:46:37 +0100 From: "Hartmann, O." To: Matthew Seaman Cc: freebsd-current@freebsd.org Subject: Re: CURRENT: pkg broken on r309320 Message-ID: <20161130214632.440e5bf4@hermann> In-Reply-To: <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> Organization: walstatt.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:gXZUzjjNPb3ANw2LHUYDEcbJJfRGpXhtewMHgu2Z+2pqfVQ+Cqm Gg5MxQfyQiToMGmYORz/PMNd5kZkm4SQ52L/1NDkTOPyVJGtl7z0y95W/XN/W+26xYpIuYU sWGvs5RKIL4jqxKoHzbx+vAkNxGn8ca51rKm8qHQ/lrRiujOcm/h5rkONp5fV6Lt3e6zEMv Q0yjL8mS5GrGIzr8mAfiw== X-UI-Out-Filterresults: notjunk:1;V01:K0:OYlGyGSw4Uo=:bBrHmVNfKeN3EkKkiWTyJg UaMAV7+WQ9xJwpQ0MKX3lIgz2ozVAhkO7nKuQ2CFAmAVG4vSevoxL4WleZi7/pS5AtJnkU9a3 /VaC4xOrQBS8kNEvNW9Mc4I61Jwg4cBlJgxxt/2aQSxcUiaHnd59pJbq5UBOqSZmiZ0yUYdMO VK0xKqNrCMWO/0QhIX1uXIZLLIOxKnkybewP4XrRAXyMZQ7mFEZF/pLA7r7E+dhruK14+4G2W zTEgS+m2VdiJuv8Vb7uvwxka3DcyIckvJrfuaSbtgQWRNLpJHYbMHsfEACRgjlDKrFu9wVy4n mD8b6BnwCBtLvhFbNb1Qg07mEjL7+izHot0Y+x0UTWzQx0Pc6IPocZubEPlUVUmEFnW7055AT ZAV2oa9VJZrnzRoT/UXAd1uFxGS1wZ3rl3jyzsPjFuRekWTW39LjLwzFVyUl3omQ3h3yNe6++ jmEeHRu/NS5hEmmLMMfIj6XMKhtLML1r9gyYErtPrKwgJyoloxoGjqBCjbYfxhQ+EXqxiDzs/ VmQOcjUxn1I2k0avCokcqQaMHGYh+KSOWGgT/76vAoGGN6Y+tXx56eCDNs7DA6kYyJc+PYr4U jGMPrLWAV5VC7SnA+Hqe4THztQgii6aYcJHFNvN6zZuMwOC0D9HlA+BEQV1VQh/Kn+kZAVWE6 85woaLPMsc/WH7WOGjk+n24sZ7MV/wEv2fBTfcHRNfCUxOavt9thb5A/v+HQb4y4ppHYfvLBC X0KaioCBs+WEGl53sWSoC99aycL3nrV9WNN8rw2TAHeqV3jFJMrxd9JCSSucTUq2G9dBtj42u r9B2SHT X-Mailman-Approved-At: Wed, 30 Nov 2016 21:53:46 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 20:46:49 -0000 On Wed, 30 Nov 2016 12:10:31 +0000 Matthew Seaman wrote: > On 2016/11/30 10:14, Baptiste Daroussin wrote: > > revert r309314 the issue is there: > > > > The ports tree defines PKG_CMD as pkg register but now bsd.own.mk > > predefines it to simply pkg. > > > > There is a collision there. > > > > Pointy hat to me. I'll revert that commit. > > Matthew > > I'm now on re09332. The problem still persists. It is serious, no packages can be installed and kernel building fails due to modules set to be rebuild every time kernel is built in /etc/src.conf. Unfortunately, building kernel AND having x11/nvidia-driver being built every time kernel is build, makes the port x11/nvidia-driver vanish. It is reported installed (check via pkg info), but there are no binaries! This is a serious situation. Thanks in advance, Oliver From owner-freebsd-current@freebsd.org Wed Nov 30 22:03:12 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44724C5E525 for ; Wed, 30 Nov 2016 22:03:12 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED2351711 for ; Wed, 30 Nov 2016 22:03:11 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id uAUM39eP044951; Wed, 30 Nov 2016 22:03:09 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id uAUM39gl044950; Wed, 30 Nov 2016 14:03:09 -0800 (PST) (envelope-from david) Date: Wed, 30 Nov 2016 14:03:09 -0800 From: David Wolfskill To: "Hartmann, O." Cc: freebsd-current@freebsd.org Subject: Re: CURRENT: pkg broken on r309320 Message-ID: <20161130220309.GV1277@albert.catwhisker.org> Mail-Followup-To: David Wolfskill , "Hartmann, O." , freebsd-current@freebsd.org References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> <20161130214632.440e5bf4@hermann> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1nR+rbHAiJEL631A" Content-Disposition: inline In-Reply-To: <20161130214632.440e5bf4@hermann> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 30 Nov 2016 22:03:12 -0000 --1nR+rbHAiJEL631A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 30, 2016 at 09:46:37PM +0100, Hartmann, O. wrote: > ... > I'm now on re09332. The problem still persists. It is serious, no > packages can be installed and kernel building fails due to modules set > to be rebuild every time kernel is built in /etc/src.conf. >=20 > Unfortunately, building kernel AND having x11/nvidia-driver being built > every time kernel is build, makes the port x11/nvidia-driver vanish. It > is reported installed (check via pkg info), but there are no binaries! >=20 > This is a serious situation. >=20 > Thanks in advance, >=20 > Oliver This also bit me (@r309324), building the kmod for nvidia-driver-340. So I applied the patch from https://reviews.freebsd.org/D8677, and tried again -- worked. Peace, david --=20 David H. Wolfskill david@catwhisker.org Ref. 08 Nov 2016, let's see if the "winners" actually deliver on their slog= ans. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --1nR+rbHAiJEL631A Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJYP0ydXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDQ0I3Q0VGOTE3QTgwMUY0MzA2NEQ3N0Ix NTM5Q0M0MEEwNDlFRTE3AAoJEBU5zECgSe4XzqgH/iagJ2PcvhNtP2aJ3B8vFac9 JIT1lTOI67NWCOmlmrBI/NFpB2HO8/OdC5Ec/Ol52kTtsWUzYL3GFkvNKb2iQ8y8 BlNANqtrXKnyyKEKPMaWf3rr5KF3tas+2/4/iKE5xrvsvl1NBtRKHxTs8uxHvv4w KJrZ2Od9kyNhEBznBV3DQPaWXu4JVfx2EwuBV/Po9CPRIM2G4hVdYpbLlf/lcAVR fpXett7rGScfzaOuD/AL4QnhOQhMVTf4ynqma0beepxmRAXs2/uFXACUkX4I/TtK VsKPNjVULuKHYhFpNj5Ppz6YUuuN74MUbyI7m2CwkkSEXnAUOu998AUUvOgzVps= =ZjPQ -----END PGP SIGNATURE----- --1nR+rbHAiJEL631A-- From owner-freebsd-current@freebsd.org Thu Dec 1 05:53:31 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B64C61E33 for ; Thu, 1 Dec 2016 05:53:31 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 796041873 for ; Thu, 1 Dec 2016 05:53:31 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 78C71C61E2F; Thu, 1 Dec 2016 05:53:31 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 786F4C61E2D for ; Thu, 1 Dec 2016 05:53:31 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x232.google.com (mail-ua0-x232.google.com [IPv6:2607:f8b0:400c:c08::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32DF71870; Thu, 1 Dec 2016 05:53:31 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x232.google.com with SMTP id 51so237499297uai.1; Wed, 30 Nov 2016 21:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xwQZm19FX/K5iW14t6/PTscYROZZphALqvTRiw/KfDY=; b=M4hp/vOFI0o1oeJ1/xEVzRPDD/8n/5e5TGyozyrMNObDuqxymuhoRRp7NnE0XE/qBj 0J2AqbYmcwxSxUyiOkzQ/AQqzvITxVBr+b4AEoZ+l7jpa7ZWL6NVrMAngO4XsqFo1GjY +hKSnbCawNQ/eS3uCJIsv/5RviPjPDvyiWU2x/MjxvNI1spfI0HbUYzPorHnDIPzYUqF jd/NXVIFpGKBQdIy5ChZJIaW2aVvsZyLTPRACfOKugiO4/nE2y1QbKJPvEMWGwViDl07 KlsA2Xu2VLdub38G1JLUB0Cq8oqhrHfLZCdDj3YxJTmeKVoD3gUyLrdv1CsEkFkGOH5G ECUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xwQZm19FX/K5iW14t6/PTscYROZZphALqvTRiw/KfDY=; b=m+axzd4JZyBLOgs0bz2uM582yk+jpfnSpQNkpiaLKe407YQgU2mtNC0Dff+9+K6NqJ WX55zzrbwut83ALdJssZNmRvYT8J3CxgSB2X2aFkzMIUkOi4OQJAZ1zLoGKInFjgTqn6 jkAuF7YhSTuStsRC+BmW2eF8dhAfv2zLfogMBDX0/ULbntQG0JfcG27WhLRcw9yqf+6M JISkTN7IdHvGirpMSkbMnozRG/ORQ6CnOLkv9R34AFglORMdQta1/rZgMByfFs2UYWNn 1zPfGXgLX6LC6jt0X0G4cIWfVVtMI/ZC0D5yoVr4QmLpEXMMOjeZaISXQOCDcl09sdPT sjcw== X-Gm-Message-State: AKaTC00oT9ljCc4NkpcNEX5F/Xz/OUBB8UgmNWzHsWhEaEtlV6w/g9D1yOg186J+RZHO7wInoPa7oSFQEaoG0w== X-Received: by 10.176.65.167 with SMTP id 36mr17302744uap.175.1480571610016; Wed, 30 Nov 2016 21:53:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.5.198 with HTTP; Wed, 30 Nov 2016 21:53:29 -0800 (PST) In-Reply-To: References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> <5196546.NF2ntCjvkx@ralph.baldwin.cx> From: Sepherosa Ziehau Date: Thu, 1 Dec 2016 13:53:29 +0800 Message-ID: Subject: Re: Please test EARLY_AP_STARTUP To: John Baldwin Cc: "freebsd-current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 05:53:31 -0000 On Wed, Nov 30, 2016 at 9:59 AM, Sepherosa Ziehau wrote: > On Tue, Nov 29, 2016 at 2:27 AM, John Baldwin wrote: >> On Monday, November 28, 2016 02:35:07 PM Sepherosa Ziehau wrote: >>> Hi John, >>> >>> fdc seems to cause panic on Hyper-V: >>> https://people.freebsd.org/~sephe/fdc_panic.png >> >> You shouldn't get this panic in latest HEAD (post-r309148). > > > The base of my kernel tree is ~20 days old :) > > >> >>> I then commented out device fdc, and I fixed one panic on Hyper-V here: >>> https://reviews.freebsd.org/D8656 >> >> Replied to the review. >> >>> After fdc is disabled and hyperv/storvsc is fixed, it seems to boot >>> fine, except a long delay (28~30seconds) here: >>> .... >>> Timecounters tick every 1.000 msec >>> ----- >>> 28 ~ 30 seconds delay >>> ----- >>> vlan: initialized, using hash tables with chaining >>> .... >>> >>> I have the bootverbose dmesg here: >>> https://people.freebsd.org/~sephe/dmesg_earlyap.txt >>> >>> I booted 10 times, only one boot does not suffer this 30 seconds >>> delay. It sounds like some races to me. Any hints? >> >> It is likely a race as we start running things sooner now, yes. Can you >> break into DDB during the hang and see what thread0 is waiting on? If >> it is in the interrupt hooks you can use 'show conifhk' in DDB to see the >> list of pending interrupt hooks. That provides a list of candidate drivers >> to inspect (e.g. stack traces of relevant kthreads) for what is actually >> waiting (and what it is waiting on) > > Just tried, but I failed to break into DDB during the 30 seconds > delay. DDB was entered after the 30 seconds delay, though I press the > break key when the delay started. I tried add VERBOSE_SYSINIT option in order to get a rough location of this delay, but the system boots just fine w/ VERBOSE_SYSINIT option, sigh. Thanks, sephe -- Tomorrow Will Never Die From owner-freebsd-current@freebsd.org Thu Dec 1 16:01:34 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56801C6044D for ; Thu, 1 Dec 2016 16:01:34 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF2971D19; Thu, 1 Dec 2016 16:01:33 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from thor.walstatt.dynvpn.de ([78.52.132.35]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LxLcc-1ck8qO3WN0-016zEE; Thu, 01 Dec 2016 17:01:30 +0100 Date: Thu, 1 Dec 2016 17:01:24 +0100 From: "O. Hartmann" To: Matthew Seaman Cc: Baptiste Daroussin , freebsd-current@freebsd.org Subject: Re: CURRENT: pkg broken on r309320 Message-ID: <20161201170124.2b6b834c@thor.walstatt.dynvpn.de> In-Reply-To: <3f56cda2-a78e-1ecd-43ad-15f0e84e119b@FreeBSD.org> References: <20161130102228.1b1a0e2b@thor.walstatt.dynvpn.de> <20161130101417.j5vhtouigrdxle4b@ivaldir.etoilebsd.net> <8552d873-d5be-ce5d-3497-08fd3a147a3d@FreeBSD.org> <20161130121408.edigpqp2n4sxmlub@ivaldir.etoilebsd.net> <3f56cda2-a78e-1ecd-43ad-15f0e84e119b@FreeBSD.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/25i4QiBojsv+CWJ4Z6=H9ay"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:Ny8AErLwCU4j4LAA0HTuIeVZpK/1SK9d70e5pIvx2ZfLQhM1pTm jhSVL7/hRm727OkDiZvPCMag/sXynh89u3Ig/YYk+nAyLECXCSolQW1EBKPdfbTlMRLzkRF 44U3+csU3m8tPmZmw/fvQ8h1V5j7ueu05Y4ybEfYTe17C97xMP5c2VIS6d3PxI5E9r7ob5D DUV1v8mourzKtWtt5gKKQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:HD5cMXmqUGQ=:5uVg3l/z3bu+8pB5oWf2q4 9/XJPMkwXDI9bWst+glrihVuwS3KehaOaYRCPtopRurfZrIoUSt3z/Zg1lsNi2GOZRUW1h6D8 fpMsVb0Mm8/KoxU7T22tJSL8EjKjg9yJ62/VtNR64j2mFycWZb9qeGvRSMhTGnnK81Vt6HTA8 qB5w5szf5Lzj1CCOwE7OD4HLh4n0tPGs9/g09tYTSCakAxbyN9rgML6cSzzWvmZAcPkTgF+cC QYtlR8KmmrgXUs6fvqpE0taig9VPqRJQKq6KuNHrKJbbA0trXpcX95hflDlnIAm39cZ4CsLps GYo41hxdC85O26rVMFRGjP03CT8qbOKlfAfC0jHqysvyQy2WIhCvzN8fYsucHHH1RWq8//BFs 5015g/TkxX334Os9fIwe76/WXmjNpWXhL7nx/EjeBGUGj6PCzaGHlO0hlfMxHveLGLV2W8p1X vntVaSsqf2F+CLi23D3uBKyKwSkjfvV1iKQJwsObJaFL9CTeH7eMmIy72TPNkOpZHV4Yj1gzz kaO8QM3XNDJz8rw9rtCThY6qpe4RuMSALQ4pXQBAk+6DiAAaIsVNAj3nX5AEI3ecDX8DPsXGH 8062vUhIF9JgVJxI5FUFDvI6w65t0UYbOBkn8y3FsWC/8FnLgH6DL3h5po5cShD9d3x5gqV0j iXfUlaCkrmVGqi216PQeIvQmtmPNRdvpSjj9xVGVudKApGepC4FUubSg++1Jyx+rsfd2KKzuv 2xubDzOE6J3wqfHOhJiN1wMDYz2DDNFUi0puce6bAK7vK27tBEH5o0D6nPQ= X-Mailman-Approved-At: Thu, 01 Dec 2016 17:02:06 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 16:01:34 -0000 --Sig_/25i4QiBojsv+CWJ4Z6=H9ay Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Am Wed, 30 Nov 2016 12:18:14 +0000 Matthew Seaman schrieb: > On 2016/11/30 12:14, Baptiste Daroussin wrote: > > On Wed, Nov 30, 2016 at 12:10:31PM +0000, Matthew Seaman wrote: =20 > >> On 2016/11/30 10:14, Baptiste Daroussin wrote: =20 > >>> revert r309314 the issue is there: > >>> > >>> The ports tree defines PKG_CMD as pkg register but now bsd.own.mk pre= defines it > >>> to simply pkg. > >>> > >>> There is a collision there. > >>> =20 > >> > >> Pointy hat to me. I'll revert that commit. > >> > >> Matthew > >> =20 > >=20 > > I have proposed https://reviews.freebsd.org/D8677 instead which make se= nse and > > does not require your to modify bsd.own.mk =20 >=20 > OK, I'll wait and see what the outcome of D8677 is. >=20 > Cheers, >=20 > Matthew >=20 >=20 >=20 Hello. It seems to be fixed - or do I err? Anyway, thank you. most recent CURRENT and most recent ports seem to cooper= ate again. Kind regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =DCbermittlung meiner Daten f=FCr Werbezwecke oder f=FCr die Markt- oder Meinungsforschung (=A7 28 Abs. 4 BDS= G). --Sig_/25i4QiBojsv+CWJ4Z6=H9ay Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWEBJVAAKCRDS528fyFhY lFKPAf9opKAV9hq8YJULSIOaokVKC2JesZaCSGlEax+0quZfAhFDFNzK52mSvcMp 0Yb79t5KKC8ou4ll/5CXG7u8S0W9AfsF6cQGZSI1R0x2Boa+IwRWWtjAhzALyGRT UNCOVEd+qweYXY7G7x9YLOe2UenZhU7tJxBeFxGhnRU1I36Ees29 =lmG+ -----END PGP SIGNATURE----- --Sig_/25i4QiBojsv+CWJ4Z6=H9ay-- From owner-freebsd-current@freebsd.org Thu Dec 1 17:30:34 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 518DBC6092B for ; Thu, 1 Dec 2016 17:30:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C70B19B8 for ; Thu, 1 Dec 2016 17:30:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f180.google.com with SMTP id j65so435780532iof.0 for ; Thu, 01 Dec 2016 09:30:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=akRohK1LxhUyGmL80a++v4kd184UPypix+4KG5DEdZ0=; b=j4VgTadxrt9u/cn4xWl+rUKVIvauYpB01DBWcAhCA80DgKdIr5yHmjQjwzxqGv+T4Y fH/eUXBfB3BndK2f2/2Rh77kw/Ie+nCWthqTJ0hM7rmExiseMx4LY7VE5v9JQKAiNqSG oMnNE0ZSKxTfnDPKSFAFCafU+ZbnxOW8XpxpHNmADtiDtiIcArzMzfQ9SmkyC3CzEc5H 4cc37PM0VEpdtIEPdLNQ3doD39EeeTXkyCJrlL/MnV4r1djFTI2zkFo+5Rt7ayj8EwDJ cFL26PWnwbjOAtCi7BzknpQNP0puLttCYBp3qgqC8Bm82xu+TepVdu7ftFfn/y2cAG/V Vq5A== X-Gm-Message-State: AKaTC02xOifeB9Y1jSPCYwxNJwcMx+0oYkUppyQKonqctewBtEiRjzAb+3LFrHkH5AE3kw== X-Received: by 10.107.167.5 with SMTP id q5mr31143579ioe.75.1480613426936; Thu, 01 Dec 2016 09:30:26 -0800 (PST) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com. [209.85.223.174]) by smtp.gmail.com with ESMTPSA id a23sm4748666itb.11.2016.12.01.09.30.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 09:30:26 -0800 (PST) Received: by mail-io0-f174.google.com with SMTP id j65so435779971iof.0 for ; Thu, 01 Dec 2016 09:30:26 -0800 (PST) X-Received: by 10.107.140.65 with SMTP id o62mr33391395iod.17.1480613426515; Thu, 01 Dec 2016 09:30:26 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.15.203 with HTTP; Thu, 1 Dec 2016 09:30:26 -0800 (PST) In-Reply-To: References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> From: Conrad Meyer Date: Thu, 1 Dec 2016 09:30:26 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken To: iblis Cc: FreeBSD Current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 17:30:34 -0000 Hello Iblis, Please try reinstalling libcapsicum after r309366, rebuilding basename, and then removing the stdout kludge from your shell script. Let me know if there's still a problem! Thanks, Conrad On Sun, Nov 27, 2016 at 11:08 PM, Conrad Meyer wrote: > Hi Iblis, > > Yes, I think caph_limit_stdio will break many similar programs in > similar use. I think we'll need to change that behavior. Something > like this: > > https://reviews.freebsd.org/D8657 > > Best, > Conrad > > On Sun, Nov 27, 2016 at 10:40 PM, iblis wrote: >> Hi Conrad, >> Thanks for your reply. >> >> I revert the basename.c and `< /dev/null` do the trick! >> I'm also curious that will `caph_limit_stdio` break lots of program w= ork >> with some shell scripts? >> >> -- >> Iblis Lin >> >> >> On 11/28/2016 12:55, Conrad Meyer wrote: >>> >>> Hi Iblis, >>> >>> I see no such problem running 'basename $HOME' in a normal shell >>> environment: >>> >>>> $ basename $HOME >>>> cmeyer >>> >>> >>> I suppose in your use, perhaps stdin is already closed? I think this >>> is a limitation of caph_limit_stdio() in general. >>> >>> Can you try instead: >>> >>> function set_prompt { >>> prompt=3D"$(basename $HOME < /dev/null) >" >>> } >>> >>> And see if it resolves the issue? >>> >>> Thanks, >>> Conrad >>> >>> On Sun, Nov 27, 2016 at 8:33 PM, iblis wrote: >>>> >>>> Hi, >>>> Here is a minimal config of zsh prompt invoking `basename`: >>>> ``` >>>> =E2=94=94=E2=94=80[iblis@abeing]% cat /home/ib-test/.zshenv >>>> >>>> function set_prompt { >>>> prompt=3D"$(basename $HOME) >" >>>> } >>>> >>>> function zle-line-init zle-keymap-select { >>>> set_prompt >>>> zle reset-prompt >>>> } >>>> >>>> zle -N zle-line-init >>>> zle -N zle-keymap-select >>>> >>>> set_prompt >>>> ``` >>>> >>>> and launching zsh will get something like this: >>>> >>>> ``` >>>> =E2=94=94=E2=94=80[iblis@abeing]% sudo su ib-test >>>> >>>> ib-test >basename: capsicum: Bad file descriptor >>>>> >>>>> >>>>> basename: capsicum: Bad file descriptor >>>>> >>>> ``` >>>> >>>> >>>> To be honest, I have no idea about what casper/caspicum is. I just >>>> changed >>>> the `basename.c` and zsh work again. >>>> >>>> Index: basename.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 >>>> --- basename.c (revision 309213) >>>> +++ basename.c (working copy) >>>> @@ -65,7 +65,7 @@ >>>> >>>> setlocale(LC_ALL, ""); >>>> >>>> - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno !=3D ENOSYS)= ) >>>> + if (cap_enter() < 0 && errno !=3D ENOSYS) >>>> err(1, "capsicum"); >>>> >>>> aflag =3D 0; >>>> >>>> >>>> Any idea? >>>> >>>> -- >>>> Iblis Lin >>>> _______________________________________________ >>>> freebsd-current@freebsd.org mailing list >>>> https://lists.freebsd.org/mailman/listinfo/freebsd-current >>>> To unsubscribe, send any mail to >>>> "freebsd-current-unsubscribe@freebsd.org" >>> >>> _______________________________________________ >>> freebsd-current@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-current >>> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o= rg" >>> >> From owner-freebsd-current@freebsd.org Thu Dec 1 18:56:00 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 608AFC619DF for ; Thu, 1 Dec 2016 18:56:00 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: from mail.hs.ntnu.edu.tw (mail.hs.ntnu.edu.tw [140.131.149.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06E751AD9; Thu, 1 Dec 2016 18:55:59 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: by mail.hs.ntnu.edu.tw (Postfix, from userid 800) id D0F0D1C6474; Fri, 2 Dec 2016 02:55:46 +0800 (CST) Received: from mail.hs.ntnu.edu.tw (localhost [127.0.0.1]) (Authenticated sender: iblis@hs.ntnu.edu.tw) by mail.hs.ntnu.edu.tw (Postfix) with ESMTPA id 9A2551C6450; Fri, 2 Dec 2016 02:55:46 +0800 (CST) Received: from 140-113-138-96.Dorm12.NCTU.edu.tw ([140.113.138.96]) by mail.hs.ntnu.edu.tw with HTTP (HTTP/1.1 POST); Fri, 02 Dec 2016 02:55:46 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 02 Dec 2016 02:55:46 +0800 From: Iblis Lin To: cem@freebsd.org Cc: FreeBSD Current Subject: Re: r308432: Capsicumized `basename` make zsh prompt broken In-Reply-To: References: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> Message-ID: User-Agent: HSNU Mail X-Bogosity: Ham, tests=bogofilter, spamicity=0.499958, version=1.2.4 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 18:56:00 -0000 Tnx a lot! The new `basename` works fine now. --- Iblis Lin Conrad Meyer 於 2016-12-02 01:30 寫到: > Hello Iblis, > > Please try reinstalling libcapsicum after r309366, rebuilding > basename, and then removing the stdout kludge from your shell script. > Let me know if there's still a problem! > > Thanks, > Conrad > > On Sun, Nov 27, 2016 at 11:08 PM, Conrad Meyer wrote: > Hi Iblis, > > Yes, I think caph_limit_stdio will break many similar programs in > similar use. I think we'll need to change that behavior. Something > like this: > > https://reviews.freebsd.org/D8657 > > Best, > Conrad > > On Sun, Nov 27, 2016 at 10:40 PM, iblis wrote: > Hi Conrad, > Thanks for your reply. > > I revert the basename.c and `< /dev/null` do the trick! > I'm also curious that will `caph_limit_stdio` break lots of program > work > with some shell scripts? > > -- > Iblis Lin > > On 11/28/2016 12:55, Conrad Meyer wrote: > Hi Iblis, > > I see no such problem running 'basename $HOME' in a normal shell > environment: > > $ basename $HOME > cmeyer > > I suppose in your use, perhaps stdin is already closed? I think this > is a limitation of caph_limit_stdio() in general. > > Can you try instead: > > function set_prompt { > prompt="$(basename $HOME < /dev/null) >" > } > > And see if it resolves the issue? > > Thanks, > Conrad > > On Sun, Nov 27, 2016 at 8:33 PM, iblis wrote: > Hi, > Here is a minimal config of zsh prompt invoking `basename`: > ``` > └─[iblis@abeing]% cat /home/ib-test/.zshenv > > function set_prompt { > prompt="$(basename $HOME) >" > } > > function zle-line-init zle-keymap-select { > set_prompt > zle reset-prompt > } > > zle -N zle-line-init > zle -N zle-keymap-select > > set_prompt > ``` > > and launching zsh will get something like this: > > ``` > └─[iblis@abeing]% sudo su ib-test > > ib-test >basename: capsicum: Bad file descriptor > > basename: capsicum: Bad file descriptor > ``` > > To be honest, I have no idea about what casper/caspicum is. I just > changed > the `basename.c` and zsh work again. > > Index: basename.c > =================================================================== > --- basename.c (revision 309213) > +++ basename.c (working copy) > @@ -65,7 +65,7 @@ > > setlocale(LC_ALL, ""); > > - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) > + if (cap_enter() < 0 && errno != ENOSYS) > err(1, "capsicum"); > > aflag = 0; > > Any idea? > > -- > Iblis Lin > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" _______________________________________________ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" From owner-freebsd-current@freebsd.org Thu Dec 1 20:28:17 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2147DC61C25 for ; Thu, 1 Dec 2016 20:28:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC781F09 for ; Thu, 1 Dec 2016 20:28:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 0C2A0C61C24; Thu, 1 Dec 2016 20:28:17 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BC98C61C23 for ; Thu, 1 Dec 2016 20:28:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE6341F08 for ; Thu, 1 Dec 2016 20:28:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id B2AEF10AA28; Thu, 1 Dec 2016 15:28:07 -0500 (EST) From: John Baldwin To: Sepherosa Ziehau Cc: "freebsd-current@freebsd.org" Subject: Re: Please test EARLY_AP_STARTUP Date: Thu, 01 Dec 2016 09:49:24 -0800 Message-ID: <2914745.0k996KCSkq@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 01 Dec 2016 15:28:07 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 20:28:17 -0000 On Thursday, December 01, 2016 01:53:29 PM Sepherosa Ziehau wrote: > On Wed, Nov 30, 2016 at 9:59 AM, Sepherosa Ziehau wrote: > >>> After fdc is disabled and hyperv/storvsc is fixed, it seems to boot > >>> fine, except a long delay (28~30seconds) here: > >>> .... > >>> Timecounters tick every 1.000 msec > >>> ----- > >>> 28 ~ 30 seconds delay > >>> ----- > >>> vlan: initialized, using hash tables with chaining > >>> .... > >>> > >>> I have the bootverbose dmesg here: > >>> https://people.freebsd.org/~sephe/dmesg_earlyap.txt > >>> > >>> I booted 10 times, only one boot does not suffer this 30 seconds > >>> delay. It sounds like some races to me. Any hints? > >> > >> It is likely a race as we start running things sooner now, yes. Can you > >> break into DDB during the hang and see what thread0 is waiting on? If > >> it is in the interrupt hooks you can use 'show conifhk' in DDB to see the > >> list of pending interrupt hooks. That provides a list of candidate drivers > >> to inspect (e.g. stack traces of relevant kthreads) for what is actually > >> waiting (and what it is waiting on) > > > > Just tried, but I failed to break into DDB during the 30 seconds > > delay. DDB was entered after the 30 seconds delay, though I press the > > break key when the delay started. > > I tried add VERBOSE_SYSINIT option in order to get a rough location of > this delay, but the system boots just fine w/ VERBOSE_SYSINIT option, > sigh. You could add KTR_PROC tracing and use 'show ktr' in DDB when you break in after the 30 second delay to see what it was doing during the delay perhaps? -- John Baldwin From owner-freebsd-current@freebsd.org Thu Dec 1 22:25:12 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A3CFC61F9B; Thu, 1 Dec 2016 22:25:12 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFDC1489; Thu, 1 Dec 2016 22:25:12 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1480631105944299.9977268712636; Thu, 1 Dec 2016 14:25:05 -0800 (PST) Date: Thu, 01 Dec 2016 14:25:05 -0800 From: Matthew Macy To: "freebsd-x11@freebsd.org" , "freebsd-current@freebsd.org" Message-ID: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> In-Reply-To: Subject: drm-next update and longer term plans MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 22:25:12 -0000 I imagine that for most users the state of graphics support for post-Haswell hardware is a bit of a black box so I'm sending out this note to let users know what they can and cannot expect. Wayland has actually become a reality for some. Talk to Johannes Lundberg if you're interested in tracking that. The i915 (Intel integrated GPUs) driver is currently best supported by the drm-next-4.7 branch. Broadwell and Skylake support is complete and some support came in late in the cycle for Kaby Lake. I can still consistently lock up the kernel in the later stages of the piglit test suite, there is no backlight support, and suspend/resume do not work on Skylake. The drm-next branch is integrated with upstream up through Linux 4.8-rc5 and thus has complete support for Kaby Lake, but there is a lockup in i915 that occurs some time within an hour of startx. This takes too long for it to have shown up in my limited integration smoke testing. The amdgpu driver is, in terms of KPI dependencies - as far as I can tell - a strict superset of the radeon driver. For example, when I tested my one older card that uses the radeon driver it manifested the same ttm bugs as amdgpu did at that time. Thus, when amdgpu reaches a complete working state I expect radeon to largely "just" work. As of this past Sunday amdgpu with the amdgpu DDX works with 2D, supports external monitors - selecting the appropriate resolution on a per display basis, and backlight works. It will also typically panic in ttm within ~90 minutes of startx. Although this is huge progress over panicking within 30s of startx (which was the case as of Saturday) or not starting at all due to bugs in the libdrm port a few weeks prior, it's obviously not something I encourage anyone to use. My primary motivation for starting with the work is being able to to train DNNs/RNNs and other model types using Theano/Caffe/Tensorflow/BidMach etc GPU accelerated whilst still running FreeBSD. The Radeon Open Compute stack holds out the promise of doing that without using the closed source CUDA stack on top of the Linux ABI emulation - which would inevitably be opaque and fragile. My plan is to keep on fixing bugs and tracking upstream until the first long term branch after ROC support has been integrated in to Linux mainline. I have no exact knowledge of when exactly that will be (AMD doesn't have sufficient developer resources to make any concrete guarantees) but think it should happen by the summer of 2017. I would like to think that by that time the i915, amdgpu, and radeon will be feature complete and at least as stable as the drm2 support currently in tree. I need to weigh my soft commitment to make long-term DRM support happen with paid work and other activities which are much more important to me long term. Thus I've currently committed to spending every Sunday fixing bugs in the drm-next branches. Amdgpu is both more important to me and has gotten much less attention than i915. Thus I will be devoting my efforts to it in the near term. I'd very much welcome efforts by others to triage the issues in i915. Many people ask when drm-next will be available on 11. I am not a committer and thus have no direct say in that. However, if you are a motivated individual with kernel knowledge you should contact Adrian Chadd. There are a few places where I was not able to provide proper linuxkpi semantics without making (mostly quite modest) changes to sys/kern. There is a general reluctance by some core developers to make changes to accommodate Linux. It is possible that, with additional effort, the linuxkpi can both be complete enough to avoid needing to port the graphics drivers to FreeBSD (something clearly shown by past efforts to be unsustainable) and not need to make any kernel changes. If you would like to help with that, let Adrian know. In the meantime, TrueOS will continue to use my development branches for the benefit of users with newer hardware. -M From owner-freebsd-current@freebsd.org Thu Dec 1 22:39:54 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A69E1C6140E for ; Thu, 1 Dec 2016 22:39:54 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D24E1C10 for ; Thu, 1 Dec 2016 22:39:54 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x22d.google.com with SMTP id w33so235410113qtc.3 for ; Thu, 01 Dec 2016 14:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KbhMfzUGUagoA9HJzb08d1TLBduNqjQuEqnQ2jx2suY=; b=ZzUSPTw+0dTTp+1SGmndejwUC3FxNvBlbw/KsvfOlsjIIt5Em1BuX3SJBhxhKzczfC 3ut73LauWzOzQcO9xvBG3FXDjFWy1wNwJIMQg6GokFnKvyCD2eqVU2yLfiX0PRtgfHVW NYPsotIbwwRDF2vPlFF5CcP9XcfQYjrWSnoLRA9ND9icwoajxs0Oy2PcT7iSEVFY8U3H 1OFgLo2e+5bRq6MXJiR8EZb85pyolbsR2Hw7bE7gitgM3sfkRrSlw3lBXUkmBqiEIZXE yRa+DwEyvKS7zzgtsyHzrDmKdUCZlrt7t1P3DwG5Q0AriwqI0YtPZU86aL8FrQ1OF2J7 awWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KbhMfzUGUagoA9HJzb08d1TLBduNqjQuEqnQ2jx2suY=; b=d4kGmR3M2kpeq85vd/jQP9T1IFWitpxt5BcLwJerQQw7TtZrkVCEaWJrJi4Drkeiuw 7fP4stZIKX6ra64phF3D021QDJQLid/Z/SwO8hA4xLeQxkQcQLqTE/lasau5yMwj846Z 8wQ7m4Om2NuScLGZQ9ScOMmyxzfDJ4P+Gpo+Ae8BbNivRt1MJi+6plQi0LOX3G1BFo9w fdmHUL6iFWGOj4bmc/++DExd/D2pptZPY6//wS17OTI+MKwL1xSQvfYlZzyBvOrj8L8m XC4YWJRD3y1YCRJtWt7FT49X8mFBfrdCbphMYxKiIsVpFpUvrtLafxaAAFUVv3heQoAT YRrg== X-Gm-Message-State: AKaTC007oS6OS1+EntYDFO0xyfFH0LOkI7Llbe3AuqvkGlcg3Bwo8DmH3PmHp0+iaW6r6fDQ X-Received: by 10.200.36.171 with SMTP id s40mr34405166qts.142.1480631993302; Thu, 01 Dec 2016 14:39:53 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id e141sm1187351qka.22.2016.12.01.14.39.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Dec 2016 14:39:52 -0800 (PST) Date: Thu, 1 Dec 2016 17:39:50 -0500 From: Shawn Webb To: Matthew Macy Cc: "freebsd-x11@freebsd.org" , "freebsd-current@freebsd.org" Subject: Re: drm-next update and longer term plans Message-ID: <20161201223950.GC83929@mutt-hardenedbsd> References: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JWEK1jqKZ6MHAcjA" Content-Disposition: inline In-Reply-To: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 22:39:54 -0000 --JWEK1jqKZ6MHAcjA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 01, 2016 at 02:25:05PM -0800, Matthew Macy wrote: > I imagine that for most users the state of graphics support for post-Hasw= ell hardware is a bit of a black box so I'm sending out this note to let us= ers know what they can and cannot expect.=20 >=20 > Wayland has actually become a reality for some. Talk to Johannes Lundberg= if you're interested in tracking that.=20 >=20 > The i915 (Intel integrated GPUs) driver is currently best supported by th= e drm-next-4.7 branch. Broadwell and Skylake support is complete and some s= upport came in late in the cycle for Kaby Lake. I can still consistently lo= ck up the kernel in the later stages of the piglit test suite, there is no = backlight support, and suspend/resume do not work on Skylake. The drm-next = branch is integrated with upstream up through Linux 4.8-rc5 and thus has co= mplete support for Kaby Lake, but there is a lockup in i915 that occurs som= e time within an hour of startx. This takes too long for it to have shown u= p in my limited integration smoke testing.=20 >=20 > The amdgpu driver is, in terms of KPI dependencies - as far as I can tell= - a strict superset of the radeon driver. For example, when I tested my on= e older card that uses the radeon driver it manifested the same ttm bugs as= amdgpu did at that time. Thus, when amdgpu reaches a complete working stat= e I expect radeon to largely "just" work. As of this past Sunday amdgpu wit= h the amdgpu DDX works with 2D, supports external monitors - selecting the = appropriate resolution on a per display basis, and backlight works. It will= also typically panic in ttm within ~90 minutes of startx. Although this is= huge progress over panicking within 30s of startx (which was the case as o= f Saturday) or not starting at all due to bugs in the libdrm port a few wee= ks prior, it's obviously not something I encourage anyone to use.=20 >=20 > My primary motivation for starting with the work is being able to to trai= n DNNs/RNNs and other model types using Theano/Caffe/Tensorflow/BidMach etc= GPU accelerated whilst still running FreeBSD. The Radeon Open Compute stac= k holds out the promise of doing that without using the closed source CUDA = stack on top of the Linux ABI emulation - which would inevitably be opaque = and fragile. My plan is to keep on fixing bugs and tracking upstream until = the first long term branch after ROC support has been integrated in to Linu= x mainline. I have no exact knowledge of when exactly that will be (AMD doe= sn't have sufficient developer resources to make any concrete guarantees) b= ut think it should happen by the summer of 2017. I would like to think that= by that time the i915, amdgpu, and radeon will be feature complete and at = least as stable as the drm2 support currently in tree.=20 >=20 > I need to weigh my soft commitment to make long-term DRM support happen w= ith paid work and other activities which are much more important to me long= term. Thus I've currently committed to spending every Sunday fixing bugs i= n the drm-next branches. Amdgpu is both more important to me and has gotten= much less attention than i915. Thus I will be devoting my efforts to it in= the near term. I'd very much welcome efforts by others to triage the issue= s in i915.=20 >=20 > Many people ask when drm-next will be available on 11. I am not a committ= er and thus have no direct say in that. However, if you are a motivated ind= ividual with kernel knowledge you should contact Adrian Chadd. There are a = few places where I was not able to provide proper linuxkpi semantics withou= t making (mostly quite modest) changes to sys/kern. There is a general relu= ctance by some core developers to make changes to accommodate Linux. It is = possible that, with additional effort, the linuxkpi can both be complete en= ough to avoid needing to port the graphics drivers to FreeBSD (something cl= early shown by past efforts to be unsustainable) and not need to make any k= ernel changes. If you would like to help with that, let Adrian know. In the= meantime, TrueOS will continue to use my development branches for the bene= fit of users with newer hardware.=20 Hey Matt, Thank you so much for your hard work. It's very much appreciated. Everyone would be stuck on the VESA driver with all its crappiness if it weren't for the efforts you and your team have put in. Since I make it a point to eat my own dogfood, it has been a pleasure running a HardenedBSD-flavored version of your drm-next-4.7 bits. I'm able to run HardenedBSD on my work-issued laptop instead of CentOS. Thank you for saving me from that. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --JWEK1jqKZ6MHAcjA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYQKazAAoJEGqEZY9SRW7uMFcP/0vrGHHShF+3/yTXdvV9S6Nv jCbW/clDHGe1SOP+jK6imu93niTai/4MYxIaOYdI4Q4mPGX6gRoMyvXEEY1HJDG+ hXSB93O/TNenJ+5tPEXUXlS+X/80CKGhnFYYWkoYweMsaRMizRciqd847vAa3oop Ruy7zrB+3UD+3ZYrRNVskix50xNBaa9PpcNFNvUODo5VssFIyL6iCh4db/ipOEWo NUenYxU8oZkFLHgtxzO6L8cSMo4/vzjEH6y350PTNwC9520x9ztC7NdkWmW5LZ0y o1VO3ChgBu6WEg3mhExVOkEtIc7I7M6qEfZRZKyoM5ZB4S+hJKd9ypZFH2iPj332 wKY0EJD0fgSo8Lx+TdXek/2148l9wWvbK5PMewhAJ8/gMTTM8hwz+gEWok+TUirF 1rQn5pOSe9S/H6JJaCkreg/uoH2jd23jWb64xDfyttITtcgDjgQ7lDmrElSLkQRi IUi/8VQXaUEIoJmjfTg2Bgh9wJIDT8TBmecnUlQjk2n7LtX4etVrM2jent59Qj0/ zbb2dHKhi0Vdog5bUAbfuovJmt9QNkai8Xz/v20/pV/NdLf7iRbR5Av5TkoV/m0e RxXJUjsAFsRRDOxwuhALUfBI+ll4r4lt82bSdXxSUGjUGRl9p8HJWXQYO3Ig5FJ+ GNq95hpnexsDsDAP4hcu =QtHm -----END PGP SIGNATURE----- --JWEK1jqKZ6MHAcjA-- From owner-freebsd-current@freebsd.org Thu Dec 1 23:37:58 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1758C61C61; Thu, 1 Dec 2016 23:37:58 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C10F1299; Thu, 1 Dec 2016 23:37:58 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-io0-x230.google.com with SMTP id j65so453604979iof.0; Thu, 01 Dec 2016 15:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=WwPVqhaWWd3jNmYH7zlw0INNS+ICkfh2JV3tYbEtytY=; b=SfxY5lxK12sJjRi8lh+wSWXf3OybGaBnhbJnkvGGK44C3qnADlnjf1vqvc57SQT9Zp ufXMu1FQDdVn5VNIeVsfWcKB/m4IWaqS4CecMxOkpZZwXe/MJ+XuIIluLfjnXLkLSx7+ i6yWwj/9zD4C9paU/NYWp13K9QJoX50/saKPBF2RuVqOAWiJA8gyF78lPooRb4hxbida W8eiJ2+VyhkmwnD7oe1wRLuQm+9HBgARln9BN+wbi15RobwlbDuwiS0MWG6oqiE7VKDl 7eTRuPAWksv3b9Kq9qr690VGB7HVAWFnHlF2p4L00Q7hDEERswebGKFP8O2vyzd66sfD +Vqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=WwPVqhaWWd3jNmYH7zlw0INNS+ICkfh2JV3tYbEtytY=; b=OSg86rXozZv53Pj8Tp/2/pmBV9Tx5Snn23U3xWkB9pk0By8+i89BqZdkfR4ZpCg9Y6 xleea6Xv/OtcfVYC+6IEfC+HlgnzbjUz6wB3ylyfp49/hVkcKi16EZRlHXuFFNNF5r3K vTcUO65DkRy1r0Qqr3OastfytciUMf3wu5X8TxlbAdj9xLmwCh5Vl6Rbow1arbpSVQuB +Rvn5G+pgN0HeK/QCljKgj4ZnF/nInId0d+hex4v7M+xrh3PLnR+KemrYbH33JlAv6vu XG5SPk9RmOjtgu1swAnfElQIxTc95cUD2RNPPBVCzVBDHy+WGTJ5Y8YLzLfElPyDZoXh 18bQ== X-Gm-Message-State: AKaTC01ypKzn0hDvyu8GsamAramMpwIxZ7LWNjxKxc232V3dXpI/U+hazcg/maBdu8/mTUvWNYlfpLsykRhZ7Q== X-Received: by 10.36.58.85 with SMTP id m82mr287705itm.29.1480635477486; Thu, 01 Dec 2016 15:37:57 -0800 (PST) MIME-Version: 1.0 References: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> In-Reply-To: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> From: Ben Woods Date: Thu, 01 Dec 2016 23:37:46 +0000 Message-ID: Subject: Re: drm-next update and longer term plans To: Matthew Macy , "freebsd-current@freebsd.org" , "freebsd-x11@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 23:37:58 -0000 On Fri., 2 Dec. 2016 at 6:25 am, Matthew Macy wrote: > I imagine that for most users the state of graphics support for > post-Haswell hardware is a bit of a black box so I'm sending out this note > to let users know what they can and cannot expect. > > Wayland has actually become a reality for some. Talk to Johannes Lundberg > if you're interested in tracking that. > > The i915 (Intel integrated GPUs) driver is currently best supported by the > drm-next-4.7 branch. Broadwell and Skylake support is complete and some > support came in late in the cycle for Kaby Lake. I can still consistently > lock up the kernel in the later stages of the piglit test suite, there is > no backlight support, and suspend/resume do not work on Skylake. The > drm-next branch is integrated with upstream up through Linux 4.8-rc5 and > thus has complete support for Kaby Lake, but there is a lockup in i915 that > occurs some time within an hour of startx. This takes too long for it to > have shown up in my limited integration smoke testing. > > The amdgpu driver is, in terms of KPI dependencies - as far as I can tell > - a strict superset of the radeon driver. For example, when I tested my one > older card that uses the radeon driver it manifested the same ttm bugs as > amdgpu did at that time. Thus, when amdgpu reaches a complete working state > I expect radeon to largely "just" work. As of this past Sunday amdgpu with > the amdgpu DDX works with 2D, supports external monitors - selecting the > appropriate resolution on a per display basis, and backlight works. It will > also typically panic in ttm within ~90 minutes of startx. Although this is > huge progress over panicking within 30s of startx (which was the case as of > Saturday) or not starting at all due to bugs in the libdrm port a few weeks > prior, it's obviously not something I encourage anyone to use. > > My primary motivation for starting with the work is being able to to train > DNNs/RNNs and other model types using Theano/Caffe/Tensorflow/BidMach etc > GPU accelerated whilst still running FreeBSD. The Radeon Open Compute stack > holds out the promise of doing that without using the closed source CUDA > stack on top of the Linux ABI emulation - which would inevitably be opaque > and fragile. My plan is to keep on fixing bugs and tracking upstream until > the first long term branch after ROC support has been integrated in to > Linux mainline. I have no exact knowledge of when exactly that will be (AMD > doesn't have sufficient developer resources to make any concrete > guarantees) but think it should happen by the summer of 2017. I would like > to think that by that time the i915, amdgpu, and radeon will be feature > complete and at least as stable as the drm2 support currently in tree. > > I need to weigh my soft commitment to make long-term DRM support happen > with paid work and other activities which are much more important to me > long term. Thus I've currently committed to spending every Sunday fixing > bugs in the drm-next branches. Amdgpu is both more important to me and has > gotten much less attention than i915. Thus I will be devoting my efforts to > it in the near term. I'd very much welcome efforts by others to triage the > issues in i915. > > Many people ask when drm-next will be available on 11. I am not a > committer and thus have no direct say in that. However, if you are a > motivated individual with kernel knowledge you should contact Adrian Chadd. > There are a few places where I was not able to provide proper linuxkpi > semantics without making (mostly quite modest) changes to sys/kern. There > is a general reluctance by some core developers to make changes to > accommodate Linux. It is possible that, with additional effort, the > linuxkpi can both be complete enough to avoid needing to port the graphics > drivers to FreeBSD (something clearly shown by past efforts to be > unsustainable) and not need to make any kernel changes. If you would like > to help with that, let Adrian know. In the meantime, TrueOS will continue > to use my development branches for the benefit of users with newer hardware. > > -M > > _______________________________________________ > freebsd-x11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-x11 > To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org" > Hi Matthew / others, Thanks for your work - I sincerely appreciate every minute of your personal time spent on this. What are your thoughts on whether this is ready for committing to 12-current, with plenty of time for polishing before it makes it into a release? Regards, Ben From owner-freebsd-current@freebsd.org Thu Dec 1 23:46:51 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2906FC620E7; Thu, 1 Dec 2016 23:46:51 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-ua0-x22a.google.com (mail-ua0-x22a.google.com [IPv6:2607:f8b0:400c:c08::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7C031FBC; Thu, 1 Dec 2016 23:46:50 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-ua0-x22a.google.com with SMTP id 20so265183084uak.0; Thu, 01 Dec 2016 15:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=D8Nz/O5r3s0emRW6Zx5yeK8CyKAQI4QYUIvWK275vXA=; b=Sj/KzJ6oireOFRs8hSoJUyjdRjvm9SMyh/J7/qRbci+Qpjr0P9RfoEkXya1MlXoWCQ VZTYAlWrC5qYtdfyTYxsjfaNpf2Y9tu+IntW1QU2q3UtG7yT2CV5DIjTBERaq2tgKVSh 6Ez7EzL0nZGhSxmUJWiYC6kj5DhMYizQWtA+gBtonxMHrjRli8c4S8afEsbB01waE0gD JHPNT6trIp6j6XAiTVKzE8elmcbj6NNvrYhJ7CHBMw0PUj3h399X6m4Fu6F5fQakwXte 1rpnix1Yv936mMJKOO4X3Br/jnD00x1B3YVYRh9bp0QZ7VghrzPJvrXQDPBesORj+F5S ax9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=D8Nz/O5r3s0emRW6Zx5yeK8CyKAQI4QYUIvWK275vXA=; b=XagSneGpewLYXX8KIVn0rLfeyBsHQw99FI5syN8UejtzGTGlBtPcKC0v/lWtgUiWvV cpNXo0C8R7FOUr740lI7XQmfcax9imQttPEXamRGXKm+NRzW8sogK9knbxKdFIld85so z9tXAYhfsTKyuOpXtNtS2It5NTZ8uBYF59ZdaRjR+XjKIdYv71iNm9wOjk+o3eIDj545 yK1mkJiphxOZOEECMyGhiym3vAOgbe3M6JOFtaz2gUs5CKI7Fl7VeoIxArGm5RJKtVMW jdKuY9AMYvOe8d6jHpLgdQoZEH+RSCwvRPSb/so704uysf0X6r71uGqieCMmivVBlcNB bkgA== X-Gm-Message-State: AKaTC01Ca488RuHaGda7eQ+nFKewnbn16q8FrIjxSpxYZpwx8w75n5vqoA8EcTVNwaGPKrHjFcxQ12XWVu73KQ== X-Received: by 10.159.32.133 with SMTP id 5mr30156193uaa.145.1480636009951; Thu, 01 Dec 2016 15:46:49 -0800 (PST) MIME-Version: 1.0 Sender: kob6558@gmail.com Received: by 10.103.106.66 with HTTP; Thu, 1 Dec 2016 15:46:49 -0800 (PST) In-Reply-To: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> References: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> From: Kevin Oberman Date: Thu, 1 Dec 2016 15:46:49 -0800 X-Google-Sender-Auth: h8mlecrdcMNg2cu1yJYR9XLJAlg Message-ID: Subject: Re: drm-next update and longer term plans To: Matthew Macy Cc: "freebsd-x11@freebsd.org" , "freebsd-current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 01 Dec 2016 23:46:51 -0000 On Thu, Dec 1, 2016 at 2:25 PM, Matthew Macy wrote: > I imagine that for most users the state of graphics support for > post-Haswell hardware is a bit of a black box so I'm sending out this note > to let users know what they can and cannot expect. > > Wayland has actually become a reality for some. Talk to Johannes Lundberg > if you're interested in tracking that. > > The i915 (Intel integrated GPUs) driver is currently best supported by the > drm-next-4.7 branch. Broadwell and Skylake support is complete and some > support came in late in the cycle for Kaby Lake. I can still consistently > lock up the kernel in the later stages of the piglit test suite, there is > no backlight support, and suspend/resume do not work on Skylake. The > drm-next branch is integrated with upstream up through Linux 4.8-rc5 and > thus has complete support for Kaby Lake, but there is a lockup in i915 that > occurs some time within an hour of startx. This takes too long for it to > have shown up in my limited integration smoke testing. > > The amdgpu driver is, in terms of KPI dependencies - as far as I can tell > - a strict superset of the radeon driver. For example, when I tested my one > older card that uses the radeon driver it manifested the same ttm bugs as > amdgpu did at that time. Thus, when amdgpu reaches a complete working state > I expect radeon to largely "just" work. As of this past Sunday amdgpu with > the amdgpu DDX works with 2D, supports external monitors - selecting the > appropriate resolution on a per display basis, and backlight works. It will > also typically panic in ttm within ~90 minutes of startx. Although this is > huge progress over panicking within 30s of startx (which was the case as of > Saturday) or not starting at all due to bugs in the libdrm port a few weeks > prior, it's obviously not something I encourage anyone to use. > > My primary motivation for starting with the work is being able to to train > DNNs/RNNs and other model types using Theano/Caffe/Tensorflow/BidMach etc > GPU accelerated whilst still running FreeBSD. The Radeon Open Compute stack > holds out the promise of doing that without using the closed source CUDA > stack on top of the Linux ABI emulation - which would inevitably be opaque > and fragile. My plan is to keep on fixing bugs and tracking upstream until > the first long term branch after ROC support has been integrated in to > Linux mainline. I have no exact knowledge of when exactly that will be (AMD > doesn't have sufficient developer resources to make any concrete > guarantees) but think it should happen by the summer of 2017. I would like > to think that by that time the i915, amdgpu, and radeon will be feature > complete and at least as stable as the drm2 support currently in tree. > > I need to weigh my soft commitment to make long-term DRM support happen > with paid work and other activities which are much more important to me > long term. Thus I've currently committed to spending every Sunday fixing > bugs in the drm-next branches. Amdgpu is both more important to me and has > gotten much less attention than i915. Thus I will be devoting my efforts to > it in the near term. I'd very much welcome efforts by others to triage the > issues in i915. > > Many people ask when drm-next will be available on 11. I am not a > committer and thus have no direct say in that. However, if you are a > motivated individual with kernel knowledge you should contact Adrian Chadd. > There are a few places where I was not able to provide proper linuxkpi > semantics without making (mostly quite modest) changes to sys/kern. There > is a general reluctance by some core developers to make changes to > accommodate Linux. It is possible that, with additional effort, the > linuxkpi can both be complete enough to avoid needing to port the graphics > drivers to FreeBSD (something clearly shown by past efforts to be > unsustainable) and not need to make any kernel changes. If you would like > to help with that, let Adrian know. In the meantime, TrueOS will continue > to use my development branches for the benefit of users with newer hardware. > > -M > Matt, Thanks for your and your teams work on this. While I am still running on Sandy Bridge hardware, I am hoping that my next system will be able to run real X or Wayland without being stuck with VESA formonths, as I was when my Sandy Bridge system was new. While I understand that this is really a by-product of you goal, thanks for it. I really hope that Core understands that unless FreeBSD can run drivers developed for Linux or required only trivial patches, FreeBSD will always lag at least months and probably years behind for both graphics and GPU compute. While Linux does compete with FreeBSD, it is not an enemy. It is fellow traveler and, when there is no legal reason that Linux code support can't be accommodated, it should not be dismissed. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 From owner-freebsd-current@freebsd.org Fri Dec 2 04:53:04 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FCDDC5EF5C for ; Fri, 2 Dec 2016 04:53:04 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF6F13C3 for ; Fri, 2 Dec 2016 04:53:04 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 7C809C5EF5B; Fri, 2 Dec 2016 04:53:04 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A721C5EF5A for ; Fri, 2 Dec 2016 04:53:04 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x22d.google.com (mail-ua0-x22d.google.com [IPv6:2607:f8b0:400c:c08::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2917B13C2; Fri, 2 Dec 2016 04:53:04 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x22d.google.com with SMTP id 12so270902642uas.2; Thu, 01 Dec 2016 20:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=s/0bsfqaA4ap70pwKzZHqiFI4psBNX8I4r8ZSY/SFv4=; b=UvJIPHhOaPcE0vJD/k1QqcfU9Chc6RJO0KqgZVYLi7VUjq7KM0bmeV0v1eGxUtbYnS xf9PfvENqONLz7O2IOnPUO43lgAFnunXlgCO6pOHYfzcNhaZlHy7zOm3L4W1dlatPbl+ H8FkMkKRiKPyiX5aaTOQiMcN6lUBcIhDgIE2e3xqBX7F3Z2nflJkbu/ixwHNOyM+V0V1 8dqD/erSMkDYcUXolZSSCmL8faHC14MmkcQLyCOvJwxDAnlQQ6WbX5FbTmmj/Yb1muWs t6p4MVIft9EwPlOR/oPjV7+ZwgifHy18Kf9V1perfu492uKNlaTxcg5Y9kmhzGQ/6jri wfoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=s/0bsfqaA4ap70pwKzZHqiFI4psBNX8I4r8ZSY/SFv4=; b=NpoNr6HzpcgmRNjJ1oZvOtq99T7XkrvpNN5su3w4mySVn7Mcriyl2hFbOInxMtNWjw AJg5bv4GwFo9aItOKzYjJ81ye4H67lxCYNmFRo9+bDgecQLMVYtmY8SoOZ0d6mwx0Mom Li/X/9IxPE2hUgmObN9pOBBdNXRZaEn3KNs05aXVJXsoS+gt/VrN7jbNYdyLe7S0ytLX zX/79yQ+TAy7XW0xIEv0fb8jWQslUnKlFHvbkABFfpig+MJU/6unUW+uVzd6nSAaz6vf AazYl8jnp51teYgRhlhxgEck0DvoMgChNAeegBmxCKYhrZv6aGs8bwfHOpkB5iseM+Yy pn9Q== X-Gm-Message-State: AKaTC01GlYnbdEdMyyRKL/RESFuYSATEL132JSlxx0G8MFsFA0/COT+ijJXsHeJXxfwgjJe5Fai/MCiR1f2R9Q== X-Received: by 10.159.55.168 with SMTP id q37mr32532736uaq.63.1480654382967; Thu, 01 Dec 2016 20:53:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.5.198 with HTTP; Thu, 1 Dec 2016 20:53:02 -0800 (PST) In-Reply-To: <2914745.0k996KCSkq@ralph.baldwin.cx> References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> <2914745.0k996KCSkq@ralph.baldwin.cx> From: Sepherosa Ziehau Date: Fri, 2 Dec 2016 12:53:02 +0800 Message-ID: Subject: Re: Please test EARLY_AP_STARTUP To: John Baldwin Cc: "freebsd-current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 02 Dec 2016 04:53:04 -0000 On Fri, Dec 2, 2016 at 1:49 AM, John Baldwin wrote: > On Thursday, December 01, 2016 01:53:29 PM Sepherosa Ziehau wrote: >> On Wed, Nov 30, 2016 at 9:59 AM, Sepherosa Ziehau wrote: >> >>> After fdc is disabled and hyperv/storvsc is fixed, it seems to boot >> >>> fine, except a long delay (28~30seconds) here: >> >>> .... >> >>> Timecounters tick every 1.000 msec >> >>> ----- >> >>> 28 ~ 30 seconds delay >> >>> ----- >> >>> vlan: initialized, using hash tables with chaining >> >>> .... >> >>> >> >>> I have the bootverbose dmesg here: >> >>> https://people.freebsd.org/~sephe/dmesg_earlyap.txt >> >>> >> >>> I booted 10 times, only one boot does not suffer this 30 seconds >> >>> delay. It sounds like some races to me. Any hints? >> >> >> >> It is likely a race as we start running things sooner now, yes. Can you >> >> break into DDB during the hang and see what thread0 is waiting on? If >> >> it is in the interrupt hooks you can use 'show conifhk' in DDB to see the >> >> list of pending interrupt hooks. That provides a list of candidate drivers >> >> to inspect (e.g. stack traces of relevant kthreads) for what is actually >> >> waiting (and what it is waiting on) >> > >> > Just tried, but I failed to break into DDB during the 30 seconds >> > delay. DDB was entered after the 30 seconds delay, though I press the >> > break key when the delay started. >> >> I tried add VERBOSE_SYSINIT option in order to get a rough location of >> this delay, but the system boots just fine w/ VERBOSE_SYSINIT option, >> sigh. > > You could add KTR_PROC tracing and use 'show ktr' in DDB when you break in after the > 30 second delay to see what it was doing during the delay perhaps? I have narrowed it down by patching the VERBOSE_SYSINIT: the kthread_start(&deadlkres_kd) introduces the 30 seconds delay, i.e. SYSINIT(deadlkres, SI_SUB_CLOCKS, SI_ORDER_ANY, kthread_start, &deadlkres_kd) blocks for 30 seconds. Thanks, sephe -- Tomorrow Will Never Die From owner-freebsd-current@freebsd.org Fri Dec 2 05:39:46 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47C16C61F71 for ; Fri, 2 Dec 2016 05:39:46 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 271631D49 for ; Fri, 2 Dec 2016 05:39:46 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 266D7C61F70; Fri, 2 Dec 2016 05:39:46 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 260A0C61F6F for ; Fri, 2 Dec 2016 05:39:46 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x236.google.com (mail-ua0-x236.google.com [IPv6:2607:f8b0:400c:c08::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3FE01D48; Fri, 2 Dec 2016 05:39:45 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x236.google.com with SMTP id 20so271459647uak.0; Thu, 01 Dec 2016 21:39:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7U5FP4en8wqv3+F9JOy84W0ususdXgENa4zsefdrv5w=; b=c2oaGxv4VvXTePycDz7dKu3RmsBfIkbsCuz0O6imAZ+RE8FQr0RfVpXdFR+ggTGb09 ipfHMJV8D/Ce7HztEMQqWaRxFnJ5rUzj5PVa0Y7YA6jKwWu77Sp6SdOmBPZ5YSCCWUdi K7kI9Jel4Nrrxma1XeKe6HaxVU7qUesXOqHH1TGNS97sY4fbMEn6n6L/rm3EhOGH/NYS 3cTb+qUNSLypg8xA9Nsfpo+hfGF5W+scHcvlswskvs0/5c+zZo10ftqIezD0hMvoOj0m mTxDpxic//37ofSsD6la/gp1RWMK+hBzJVT+qqefwZk0Ccn3/Ku2SK96ZHHW169ToyYA Hfow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7U5FP4en8wqv3+F9JOy84W0ususdXgENa4zsefdrv5w=; b=a/duY7S7B27oUJDdFD4RESIe3AsOsLUe7G6+ohrkUIQUaTMZrRqwnaGUzv1o16aJ5m R5JqTP+p0SJPkPycFIwaRflNsTw/MAshIVXP8eluTpCBySrkl7JUNPscopJPcYGf8lfL w9o2pvbJI8mr8+CCzAXFOgod4vxcgq8FhKWQ+BjLZIrL5ZPJplzy16wpnoxVWQMMyfqi 5M8FDnzXoaCxfE4rGw5IsMiOJy86XEZ5x6MYLVEiHQ15O7YA63jw+lJdRizi0oOYOu2D vnyTjC3x/4fQw5Zac8CTUtft1nOKgsKfUjA/yXk+9TICYRSQJ9WxHUX1+q3BQO6wKJoF h3rA== X-Gm-Message-State: AKaTC02Gbcq0gOTsy6mCWYRhy7jYVOOGlLVAWLeILMRalVHyAa2nkjTOOIF9iZjiqI3V9y4xsnMkM3HHtcoCvw== X-Received: by 10.176.65.167 with SMTP id 36mr21574607uap.175.1480657184763; Thu, 01 Dec 2016 21:39:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.5.198 with HTTP; Thu, 1 Dec 2016 21:39:44 -0800 (PST) In-Reply-To: References: <7005233.xZtqgRZ2t6@ralph.baldwin.cx> <2914745.0k996KCSkq@ralph.baldwin.cx> From: Sepherosa Ziehau Date: Fri, 2 Dec 2016 13:39:44 +0800 Message-ID: Subject: Re: Please test EARLY_AP_STARTUP To: John Baldwin Cc: "freebsd-current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 02 Dec 2016 05:39:46 -0000 On Fri, Dec 2, 2016 at 12:53 PM, Sepherosa Ziehau wrote: > On Fri, Dec 2, 2016 at 1:49 AM, John Baldwin wrote: >> On Thursday, December 01, 2016 01:53:29 PM Sepherosa Ziehau wrote: >>> On Wed, Nov 30, 2016 at 9:59 AM, Sepherosa Ziehau wrote: >>> >>> After fdc is disabled and hyperv/storvsc is fixed, it seems to boot >>> >>> fine, except a long delay (28~30seconds) here: >>> >>> .... >>> >>> Timecounters tick every 1.000 msec >>> >>> ----- >>> >>> 28 ~ 30 seconds delay >>> >>> ----- >>> >>> vlan: initialized, using hash tables with chaining >>> >>> .... >>> >>> >>> >>> I have the bootverbose dmesg here: >>> >>> https://people.freebsd.org/~sephe/dmesg_earlyap.txt >>> >>> >>> >>> I booted 10 times, only one boot does not suffer this 30 seconds >>> >>> delay. It sounds like some races to me. Any hints? >>> >> >>> >> It is likely a race as we start running things sooner now, yes. Can you >>> >> break into DDB during the hang and see what thread0 is waiting on? If >>> >> it is in the interrupt hooks you can use 'show conifhk' in DDB to see the >>> >> list of pending interrupt hooks. That provides a list of candidate drivers >>> >> to inspect (e.g. stack traces of relevant kthreads) for what is actually >>> >> waiting (and what it is waiting on) >>> > >>> > Just tried, but I failed to break into DDB during the 30 seconds >>> > delay. DDB was entered after the 30 seconds delay, though I press the >>> > break key when the delay started. >>> >>> I tried add VERBOSE_SYSINIT option in order to get a rough location of >>> this delay, but the system boots just fine w/ VERBOSE_SYSINIT option, >>> sigh. >> >> You could add KTR_PROC tracing and use 'show ktr' in DDB when you break in after the >> 30 second delay to see what it was doing during the delay perhaps? > > I have narrowed it down by patching the VERBOSE_SYSINIT: the > kthread_start(&deadlkres_kd) introduces the 30 seconds delay, i.e. > SYSINIT(deadlkres, SI_SUB_CLOCKS, SI_ORDER_ANY, kthread_start, > &deadlkres_kd) blocks for 30 seconds. I commented out the DEADLKRES option, now the delay happens randomly, sometimes even before a VERBOSE_SYSINIT entry logging. But the delay always happens after inittimecounter(0), and before the SI_SUB_INT_CONFIG_HOOKS. I didn't notice useful information from DDB 'show ktr', once it thawed. Anything I should be aware of in the KTR_PROC ktrlog? Thanks, sephe -- Tomorrow Will Never Die From owner-freebsd-current@freebsd.org Fri Dec 2 06:56:47 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 533C6C629A2; Fri, 2 Dec 2016 06:56:47 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D7701A6A; Fri, 2 Dec 2016 06:56:47 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x230.google.com with SMTP id a124so466707976ioe.2; Thu, 01 Dec 2016 22:56:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yeNYzzjvQM7SJJiCZN44wy8+tYC1cNnwMusUz/Qv6PM=; b=0DlVW0Tv9Qd1MSpcNHatK01Fm5ktKgqnEUPEc4LxXXY/APzJmDeQN/OgN/CauFQ6XS xLbFSIzJ7Q/ky1tx2aGyu1vaIG1RBuR13EmW58Rk9+K/QVrShEuD25XKMr6052a4SfnV jERKEaDV0DaVxK1yA31B9PGkuUBH2z/diV6pWD9Qq5sF5amOiT3hQUF5PoRyuYeIPiPq NDR6sW8nX9xno1k5E53EjHMVOOkWDgCBrFpwLzat+ry237w0Fkgj7PV2C2iO7uspA5mV jUynJ2R8JnXZlo+ohfGpWV2iVFNG5Nx8n1eTv4sthmjN+zdMv6bPxdGt9UoALzhH5SBP c+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yeNYzzjvQM7SJJiCZN44wy8+tYC1cNnwMusUz/Qv6PM=; b=KouBvi005oovVSopA27+jQ7PzfX0WvLv9HEOX6AE9oGUXsOdZjYdBCiiBMBLw6FZ0j p+NysFhsMyW1LVmoRGNIGsyp6HBZaLCWE9O5PqXVi7jItLeMhr/tZVeX6RvnJ74W7yUt xMkoWYghb4RBjQUjBA4unkg2+DaBXMHbK225OIuPjhplpfIuviaZOQNVDcl0Lk349CNP EGlaBXvunA1PcscDcIZUlVetI2oXF/2c4qhXodWyCJO4jNrlA/2FJzSc+i+2vYzuLphH kOoDGSx6hkLnL+tQIv+0MiWNzeMd12snM5uRCEcCRwg8XkjvVEBPjmfH9zae5AW02YK5 zI+A== X-Gm-Message-State: AKaTC00vmWaNLhN5fSUnrOpAdYPRp9lkKO5cAuHXgeq+hIsGR/tA10CtMUfeqRJB9UwCmgeZNLqNIZlgWHOOfQ== X-Received: by 10.36.138.67 with SMTP id v64mr1346105itd.39.1480661806499; Thu, 01 Dec 2016 22:56:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.150.129 with HTTP; Thu, 1 Dec 2016 22:56:45 -0800 (PST) In-Reply-To: References: <158bc7db990.e5ab7400189889.2067341649206744373@nextbsd.org> From: Adrian Chadd Date: Thu, 1 Dec 2016 22:56:45 -0800 Message-ID: Subject: Re: drm-next update and longer term plans To: Kevin Oberman Cc: Matthew Macy , "freebsd-x11@freebsd.org" , "freebsd-current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 02 Dec 2016 06:56:47 -0000 Hi, The challenge right now is figuring out how to implement / commit the linux-y bits that the linux layer really wants. Kip has done a pretty great job at figuring out the minimum set of hilarity that needs to go into base versus linuxkpi. But the "challenge" is figuring out some comprimise between what's done and what we can do in FreeBSD land. Those changes are small but unfortunately change the expectations we have. If someone's willing to step up and help out with the linuxkpi side of things and the base system bits (the new lock, some UMA changes, some VM changes, the interrupt model that we have versus linux and what we're allowed to do, etc, etc) then that'll really help. I can help try to get stuff reviewed and help people know where some of the quirky controversial bits are, but I don't have the cycles to modify/rewrite any of it all to land in -HEAD. I need some help with that. If you're interested in helping out and can take some direction then sign up and we'll figure the bits out. Thanks! -adrian From owner-freebsd-current@freebsd.org Fri Dec 2 16:20:37 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A33BC6270C for ; Fri, 2 Dec 2016 16:20:37 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 48E9F1DCE for ; Fri, 2 Dec 2016 16:20:37 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 483D1C6270B; Fri, 2 Dec 2016 16:20:37 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E16C62709 for ; Fri, 2 Dec 2016 16:20:37 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 338D61DCC for ; Fri, 2 Dec 2016 16:20:37 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 78EB55648E; Fri, 2 Dec 2016 10:20:36 -0600 (CST) Subject: Re: copyinstr and ENAMETOOLONG To: Jilles Tjoelker References: <236b8c7c-a12e-0872-f3cb-03f99bb5fcc5@FreeBSD.org> <20161102203354.GA22693@stack.nl> Cc: "current@freebsd.org" From: Eric van Gyzen Message-ID: <196a4cbf-b213-97bd-aae4-e761ff41e36b@FreeBSD.org> Date: Fri, 2 Dec 2016 10:20:32 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161102203354.GA22693@stack.nl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 02 Dec 2016 16:20:37 -0000 On 11/02/2016 15:33, Jilles Tjoelker wrote: > On Wed, Nov 02, 2016 at 02:24:43PM -0500, Eric van Gyzen wrote: >> Does copyinstr guarantee that it has filled the output buffer when it >> returns ENAMETOOLONG? I usually try to answer my own questions, but I >> don't speak many dialects of assembly. :) > > The few I checked appear to work by checking the length while copying, > but the man page copy(9) does not guarantee that, and similar code in > sys/compat/linux/linux_misc.c linux_prctl() LINUX_PR_SET_NAME performs a > copyin() if copyinstr() fails with [ENAMETOOLONG]. Thanks. > In implementing copyinstr(), checking the length first may make sense > for economy of code: a user-strnlen() using an algorithm like > lib/libc/string/strlen.c and a copyin() connected together with a C > copyinstr(). This would probably be faster than the current amd64 code > (which uses lods and stos, meh). With that implementation, filling the > buffer in the [ENAMETOOLONG] case requires a small piece of additional > code. > >> I ask because I'd like to make the following change, and I'd like to >> know whether I should zero the buffer before calling copyinstr to ensure >> that I don't set the thread's name to the garbage that was on the stack. > >> Index: kern_thr.c >> =================================================================== >> --- kern_thr.c (revision 308217) >> +++ kern_thr.c (working copy) >> @@ -580,8 +580,13 @@ sys_thr_set_name(struct thread *td, struct thr_set >> if (uap->name != NULL) { >> error = copyinstr(uap->name, name, sizeof(name), >> NULL); >> - if (error) >> - return (error); >> + if (error) { >> + if (error == ENAMETOOLONG) { >> + name[sizeof(name) - 1] = '\0'; >> + } else { >> + return (error); >> + } >> + } >> } >> p = td->td_proc; >> ttd = tdfind((lwpid_t)uap->id, p->p_pid); > > For API design, it makes more sense to set error = 0 if a truncated name > is being set anyway. This preserves the property that the name remains > unchanged if the call fails. That makes sense. > A change to the man page thr_set_name(2) is needed in any case. Of course. Would you like to review the following? Index: lib/libc/sys/thr_set_name.2 =================================================================== --- lib/libc/sys/thr_set_name.2 (revision 309300) +++ lib/libc/sys/thr_set_name.2 (working copy) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd December 2, 2016 .Dt THR_SET_NAME 2 .Os .Sh NAME @@ -43,37 +43,34 @@ .Sh DESCRIPTION The .Fn thr_set_name -sets the user-visible name for the kernel thread with the identifier +system call sets the user-visible name for the thread with the identifier .Va id -in the current process, to the NUL-terminated string +in the current process to the NUL-terminated string .Va name . +The name will be silently truncated to fit into a buffer of +.Dv MAXCOMLEN + 1 +bytes. The thread name can be seen in the output of the .Xr ps 1 and .Xr top 1 commands, in the kernel debuggers and kernel tracing facility outputs, -also in userland debuggers and program core files, as notes. +and in userland debuggers and program core files, as notes. .Sh RETURN VALUES If successful, .Fn thr_set_name -will return zero, otherwise \-1 is returned, and +returns zero; otherwise, \-1 is returned, and .Va errno is set to indicate the error. .Sh ERRORS The .Fn thr_set_name -operation may return the following errors: +system call may return the following errors: .Bl -tag -width Er .It Bq Er EFAULT The memory pointed to by the .Fa name argument is not valid. -.It Bq Er ENAMETOOLONG -The string pointed to by the -.Fa name -argument exceeds -.Dv MAXCOMLEN + 1 -bytes in length. .It Bq Er ESRCH The thread with the identifier .Fa id @@ -92,6 +89,6 @@ does not exist in the current process. .Xr ktr 9 .Sh STANDARDS The -.Fn thr_new -system call is non-standard and is used by +.Fn thr_set_name +system call is non-standard and is used by the .Lb libthr . Index: share/man/man3/pthread_set_name_np.3 =================================================================== --- share/man/man3/pthread_set_name_np.3 (revision 309300) +++ share/man/man3/pthread_set_name_np.3 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd December 2, 2016 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME @@ -39,14 +39,15 @@ .Sh DESCRIPTION The .Fn pthread_set_name_np -function sets internal name for thread specified by -.Fa tid -argument to string value specified by +function applies a copy of the given .Fa name -argument. +to the thread specified by the given +.Fa tid . .Sh ERRORS Because of the debugging nature of this function, all errors that may appear inside are silently ignored. +.Sh SEE ALSO +.Xr thr_set_name 2 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . Index: sys/kern/kern_thr.c =================================================================== --- sys/kern/kern_thr.c (revision 309300) +++ sys/kern/kern_thr.c (working copy) @@ -578,8 +578,11 @@ sys_thr_set_name(struct thread *td, struct thr_set error = 0; name[0] = '\0'; if (uap->name != NULL) { - error = copyinstr(uap->name, name, sizeof(name), - NULL); + error = copyinstr(uap->name, name, sizeof(name), NULL); + if (error == ENAMETOOLONG) { + error = copyin(uap->name, name, sizeof(name) - 1); + name[sizeof(name) - 1] = '\0'; + } if (error) return (error); } From owner-freebsd-current@freebsd.org Fri Dec 2 17:03:09 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E086C63835 for ; Fri, 2 Dec 2016 17:03:09 +0000 (UTC) (envelope-from eric@metricspace.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 806A81574 for ; Fri, 2 Dec 2016 17:03:09 +0000 (UTC) (envelope-from eric@metricspace.net) Received: by mailman.ysv.freebsd.org (Postfix) id 7C295C6382E; Fri, 2 Dec 2016 17:03:09 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B01DC6382D; Fri, 2 Dec 2016 17:03:09 +0000 (UTC) (envelope-from eric@metricspace.net) Received: from mail.metricspace.net (mail.metricspace.net [IPv6:2001:470:1f11:617::107]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6EB156A; Fri, 2 Dec 2016 17:03:09 +0000 (UTC) (envelope-from eric@metricspace.net) Received: from [IPv6:2001:470:1f11:617:3210:b3ff:fe77:ca3f] (unknown [IPv6:2001:470:1f11:617:3210:b3ff:fe77:ca3f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: eric) by mail.metricspace.net (Postfix) with ESMTPSA id A37AA1D83; Fri, 2 Dec 2016 17:03:01 +0000 (UTC) To: freebsd-hackers@FreeBSD.org, freebsd-amd64@freebsd.org, "current@freebsd.org" From: Eric McCorkle Subject: CFT EFI Boot Refactoring Message-ID: Date: Fri, 2 Dec 2016 12:02:57 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2nIKx7PRAmhO47MXFmT0MDKUV6UMsh1v9" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 02 Dec 2016 17:03:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2nIKx7PRAmhO47MXFmT0MDKUV6UMsh1v9 Content-Type: multipart/mixed; boundary="7wWD2JXas7wNKFk1Kr7Jd8JHbiuG3wULI"; protected-headers="v1" From: Eric McCorkle To: freebsd-hackers@FreeBSD.org, freebsd-amd64@freebsd.org, "current@freebsd.org" Message-ID: Subject: CFT EFI Boot Refactoring --7wWD2JXas7wNKFk1Kr7Jd8JHbiuG3wULI Content-Type: multipart/mixed; boundary="------------689B5840033FA59B553C984F" This is a multi-part message in MIME format. --------------689B5840033FA59B553C984F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello everyone, My work to refactor the EFI boot loader has been in review for some time now. This work is a behavior-neutral refactoring which eliminates duplicated code in boot1, provides better integration of boot1 and loader with the EFI API, and moves towards better compliance with the recommendations of the UEFI driver writer's guide. This work also serves as a precursor to more work, such as GELI, hot-plugging, and other things. One of the reviewers was able to trigger a hang on his setup; however, it's not clear whether this is a problem in the refactoring, or whether it's due to a related bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D214423 Therefore, I would like to issue a CFT for this changeset. We need people using the boot1/loader EFI boot setup to test their setup using boot1 and loader as built with this patch applied. You can also get the source tree directly from my github (https://github.com/emc2/freebsd.git). Use the efize_new branch to get this changeset. Note that I am maintaining the state of this branch in a single change at this point using rebase -i, so there *will* be forced pushes to this branch. Here are some notes on testing the changeset: * To test it, just do a buildworld, then copy loader.efi in place and copy boot1.efi to /efi/BOOT/BOOTX64.EFI on your ESP. If your system boots, then the test was successful (there are no new features in this changeset). * The output of boot1 is slightly different, so you'll be able to tell if you installed it correctly. * I recommend keeping a copy of the basic boot1 around on your ESP, just in case something goes wrong. On my setup, I have a backup at /efi/BOOT/BOOTX64.BAK (with the main program at /efi/BOOT/BOOTX64.EFI, of course) * I have been using this on a machine with two disks, a ZFS pool spanning both disks, and a dummy UFS filesystem for months now, so it can be considered relatively safe. * This has also been tested on basic setups without incident, so priority is on complex or odd setups. * If something goes wrong, you will most likely get a boot-hang. If this happens, please contact me directly with the details, and I'll coordinate on diagnosis. --------------689B5840033FA59B553C984F Content-Type: text/x-patch; name="efize.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="efize.diff" diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 0ebcaf1..3b608c5 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -41,7 +41,7 @@ SRCS+=3D ntoh.c .PATH: ${LIBC_SRC}/string SRCS+=3D bcmp.c bcopy.c bzero.c ffs.c fls.c \ memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ - qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} =3D=3D "arm" diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index f77a586..066aff0 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD$ - * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $=09 + * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ */ =20 /*- @@ -131,7 +131,7 @@ extern struct fs_ops pkgfs_fsops; #define SEEK_CUR 1 /* set file offset to current plus offset */ #define SEEK_END 2 /* set file offset to EOF plus offset */ =20 -/*=20 +/* * Device switch */ struct devsw { @@ -166,8 +166,9 @@ struct devdesc #define DEVT_NONE 0 #define DEVT_DISK 1 #define DEVT_NET 2 -#define DEVT_CD 3 +#define DEVT_CD 3 #define DEVT_ZFS 4 +#define DEVT_EFI 5 int d_unit; void *d_opendata; }; @@ -279,7 +280,7 @@ extern struct dirent *readdirfd(int); =20 extern void srandom(u_long seed); extern u_long random(void); - =20 + /* imports from stdlib, locally modified */ extern long strtol(const char *, char **, int); extern unsigned long strtoul(const char *, char **, int); @@ -368,9 +369,9 @@ extern int null_stat(struct open_file *f, struct stat= *sb); extern int null_readdir(struct open_file *f, struct dirent *d); =20 =20 -/*=20 - * Machine dependent functions and data, must be provided or stubbed by = - * the consumer=20 +/* + * Machine dependent functions and data, must be provided or stubbed by + * the consumer */ extern int getchar(void); extern int ischar(void); diff --git a/sys/boot/efi/Makefile b/sys/boot/efi/Makefile index 66481f8..00490d0 100644 --- a/sys/boot/efi/Makefile +++ b/sys/boot/efi/Makefile @@ -15,7 +15,7 @@ SUBDIR+=3D fdt .if ${MACHINE_CPUARCH} =3D=3D "aarch64" || \ ${MACHINE_CPUARCH} =3D=3D "amd64" || \ ${MACHINE_CPUARCH} =3D=3D "arm" -SUBDIR+=3D libefi loader boot1 +SUBDIR+=3D libefi drivers loader boot1 .endif =20 .endif # ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40500 diff --git a/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile index 110a857..7480c9c 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/sys/boot/efi/boot1/Makefile @@ -8,34 +8,50 @@ MK_SSP=3D no =20 PROG=3D boot1.sym INTERNALPROG=3D -WARNS?=3D 6 +WARNS?=3D 3 + +# Include bcache code. +HAVE_BCACHE=3D yes =20 .if ${MK_ZFS} !=3D "no" # Disable warnings that are currently incompatible with the zfs boot cod= e -CWARNFLAGS.zfs_module.c +=3D -Wno-array-bounds -CWARNFLAGS.zfs_module.c +=3D -Wno-cast-align -CWARNFLAGS.zfs_module.c +=3D -Wno-cast-qual -CWARNFLAGS.zfs_module.c +=3D -Wno-missing-prototypes -CWARNFLAGS.zfs_module.c +=3D -Wno-sign-compare -CWARNFLAGS.zfs_module.c +=3D -Wno-unused-parameter -CWARNFLAGS.zfs_module.c +=3D -Wno-unused-function +CWARNFLAGS.boot1.c +=3D -Wno-missing-variable-declarations +CWARNFLAGS.zfs.c +=3D -Wno-incompatible-pointer-types-discards-qualifier= s +CWARNFLAGS.zfs.c +=3D -Wno-missing-variable-declarations +CWARNFLAGS.zfs.c +=3D -Wno-array-bounds +CWARNFLAGS.zfs.c +=3D -Wno-cast-align +CWARNFLAGS.zfs.c +=3D -Wno-cast-qual +CWARNFLAGS.zfs.c +=3D -Wno-missing-prototypes +CWARNFLAGS.zfs.c +=3D -Wno-sign-compare +CWARNFLAGS.zfs.c +=3D -Wno-unused-parameter +CWARNFLAGS.zfs.c +=3D -Wno-unused-function CWARNFLAGS.skein.c +=3D -Wno-cast-align CWARNFLAGS.skein.c +=3D -Wno-missing-variable-declarations .endif =20 + # architecture-specific loader code -SRCS=3D boot1.c self_reloc.c start.S ufs_module.c +SRCS=3D boot1.c self_reloc.c start.S .if ${MK_ZFS} !=3D "no" -SRCS+=3D zfs_module.c +.PATH: ${.CURDIR}/../../../crypto/skein SRCS+=3D skein.c skein_block.c # Do not unroll skein loops, reduce code size CFLAGS+=3D -DSKEIN_LOOP=3D111 -.PATH: ${.CURDIR}/../../../crypto/skein +.PATH: ${.CURDIR}/../../zfs +SRCS+=3D zfs.c .endif =20 +# Always add MI sources +.PATH: ${.CURDIR}/../../common +.include "${.CURDIR}/../../common/Makefile.inc" +CFLAGS+=3D -I${.CURDIR}/../../common + +.PATH: ${.CURDIR}/arch/${MACHINE} + CFLAGS+=3D -I. CFLAGS+=3D -I${.CURDIR}/../include CFLAGS+=3D -I${.CURDIR}/../include/${MACHINE} +CFLAGS+=3D -I${.CURDIR}/../drivers/ CFLAGS+=3D -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+=3D -I${.CURDIR}/../../.. CFLAGS+=3D -DEFI_UFS_BOOT @@ -56,6 +72,20 @@ CFLAGS+=3D -DEFI_ZFS_BOOT .PATH: ${.CURDIR}/../../common CFLAGS+=3D -I${.CURDIR}/../../common =20 +# make buildenv doesn't set DESTDIR, this means LIBSTAND +# will be wrong when crossbuilding. +.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a) +LIBSTAND=3D ${.OBJDIR}/../../../../lib/libstand/libstand.a +.endif + +# Add libefi +.PATH: ${.CURDIR}/../libefi +LIBEFI=3D ${.OBJDIR}/../libefi/libefi.a + +.PATH: ${.CURDIR}/../drivers +LIBEFI_DRIVERS=3D ${.OBJDIR}/../drivers/libefi_drivers.a + + FILES=3D boot1.efi boot1.efifat FILESMODE_boot1.efi=3D ${BINMODE} =20 @@ -75,8 +105,8 @@ LDFLAGS+=3D -Wl,-znocombreloc # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+=3D ${LIBSTAND} -LDADD+=3D -lstand +DPADD+=3D ${LIBEFI_DRIVERS} ${LIBEFI} ${LIBSTAND} +LDADD+=3D ${LIBEFI_DRIVERS} ${LIBEFI} ${LIBSTAND} =20 DPADD+=3D ${LDSCRIPT} =20 @@ -102,7 +132,7 @@ boot1.efi: ${PROG} SOURCE_DATE_EPOCH=3D${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ - -j .rela.dyn -j .reloc -j .eh_frame \ + -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ --output-target=3D${EFI_TARGET} ${.ALLSRC} ${.TARGET} =20 boot1.o: ${.CURDIR}/../../common/ufsread.c @@ -111,7 +141,7 @@ boot1.o: ${.CURDIR}/../../common/ufsread.c # created by generate-fat.sh =20 .include "${.CURDIR}/Makefile.fat" -BOOT1_MAXSIZE?=3D 131072 +BOOT1_MAXSIZE?=3D 524288 =20 boot1.efifat: boot1.efi @set -- `ls -l boot1.efi`; \ diff --git a/sys/boot/efi/boot1/Makefile.fat b/sys/boot/efi/boot1/Makefil= e.fat index c86a7c3..e2cda1c 100644 --- a/sys/boot/efi/boot1/Makefile.fat +++ b/sys/boot/efi/boot1/Makefile.fat @@ -1,4 +1,4 @@ # This file autogenerated by generate-fat.sh - DO NOT EDIT # $FreeBSD$ BOOT1_OFFSET=3D0x2d -BOOT1_MAXSIZE=3D131072 +BOOT1_MAXSIZE=3D524288 diff --git a/sys/boot/efi/boot1/boot1.c b/sys/boot/efi/boot1/boot1.c index 80b1895..9e02bfa 100644 --- a/sys/boot/efi/boot1/boot1.c +++ b/sys/boot/efi/boot1/boot1.c @@ -26,62 +26,118 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include =20 #include +#include +#include #include +#ifdef EFI_ZFS_BOOT +#include +#endif + +#include =20 -#include "boot_module.h" +#include "efi_drivers.h" #include "paths.h" =20 -static const boot_module_t *boot_modules[] =3D -{ -#ifdef EFI_ZFS_BOOT - &zfs_module, -#endif -#ifdef EFI_UFS_BOOT - &ufs_module +#ifdef EFI_DEBUG +#define DPRINTF(fmt, args...) printf(fmt, ##args) +#define DSTALL(d) bs->Stall(d) +#else +#define DPRINTF(fmt, ...) {} +#define DSTALL(d) {} #endif + +struct arch_switch archsw; /* MI/MD interface boundary */ + +static const efi_driver_t *efi_drivers[] =3D { + &fs_driver, + NULL }; =20 -#define NUM_BOOT_MODULES nitems(boot_modules) -/* The initial number of handles used to query EFI for partitions. */ -#define NUM_HANDLES_INIT 24 +extern struct console efi_console; +#if defined(__amd64__) || defined(__i386__) +extern struct console comconsole; +extern struct console nullconsole; +#endif =20 -void putchar(int c); -EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); +struct fs_ops *file_system[] =3D { + &dosfs_fsops, + &ufs_fsops, + &cd9660_fsops, + &nfs_fsops, + &gzipfs_fsops, + &bzipfs_fsops, + NULL +}; =20 -EFI_SYSTEM_TABLE *systab; -EFI_BOOT_SERVICES *bs; -static EFI_HANDLE *image; +struct devsw *devsw[] =3D { + &efipart_dev, +#ifdef EFI_ZFS_BOOT + &zfs_dev, +#endif + NULL +}; =20 -static EFI_GUID BlockIoProtocolGUID =3D BLOCK_IO_PROTOCOL; -static EFI_GUID DevicePathGUID =3D DEVICE_PATH_PROTOCOL; -static EFI_GUID LoadedImageGUID =3D LOADED_IMAGE_PROTOCOL; -static EFI_GUID ConsoleControlGUID =3D EFI_CONSOLE_CONTROL_PROTOCOL_GUID= ; +struct console *consoles[] =3D { + &efi_console, + NULL +}; =20 -/* - * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which en= sures - * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns fr= om - * EFI methods. +/* Definitions we don't actually need for boot, but we need to define + * to make the linker happy. */ -void * -Malloc(size_t len, const char *file __unused, int line __unused) +struct file_format *file_formats[] =3D { NULL }; + +struct netif_driver *netif_drivers[] =3D { NULL }; + +static int +efi_autoload(void) { - void *out; + printf("******** Boot block should not call autoload\n"); + return (-1); +} =20 - if (bs->AllocatePool(EfiLoaderData, len, &out) =3D=3D EFI_SUCCESS) - return (out); +static int efi_getdev(void **vdev __unused, const char *devspec __unused= , + const char **path __unused) +{ + printf("******** Boot block should not call getdev\n"); + return (-1); +} =20 - return (NULL); +static ssize_t +efi_copyin(const void *src __unused, vm_offset_t dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call copyin\n"); + return (-1); } =20 -void -Free(void *buf, const char *file __unused, int line __unused) +static ssize_t +efi_copyout(vm_offset_t src __unused, void *dest __unused, + const size_t len __unused) { - if (buf !=3D NULL) - (void)bs->FreePool(buf); + printf("******** Boot block should not call copyout\n"); + return (-1); +} + +static ssize_t +efi_readin(int fd __unused, vm_offset_t dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call readin\n"); + return (-1); } =20 +/* The initial number of handles used to query EFI for partitions. */ +#define NUM_HANDLES_INIT 24 + +static EFI_GUID DevicePathGUID =3D DEVICE_PATH_PROTOCOL; +static EFI_GUID LoadedImageGUID =3D LOADED_IMAGE_PROTOCOL; +static EFI_GUID SimpleFileSystemProtocolGUID =3D SIMPLE_FILE_SYSTEM_PROT= OCOL; +static EFI_GUID FileInfoGUID =3D EFI_FILE_INFO_ID;; + /* * nodes_match returns TRUE if the imgpath isn't NULL and the nodes matc= h, * FALSE otherwise. @@ -142,6 +198,7 @@ devpath_last(EFI_DEVICE_PATH *devpath) return (devpath); } =20 +#ifdef EFI_DEBUG /* * devpath_node_str is a basic output method for a devpath node which * only understands a subset of the available sub types. @@ -273,7 +330,7 @@ devpath_node_str(char *buf, size_t size, EFI_DEVICE_P= ATH *devpath) * devpath_strlcat appends a text description of devpath to buf but not = more * than size - 1 characters followed by NUL-terminator. */ -int +static int devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath) { size_t len, used; @@ -304,48 +361,207 @@ devpath_strlcat(char *buf, size_t size, EFI_DEVICE= _PATH *devpath) * devpath_str is convenience method which returns the text description = of * devpath using a static buffer, so it isn't thread safe! */ -char * +static char * devpath_str(EFI_DEVICE_PATH *devpath) { static char buf[256]; =20 devpath_strlcat(buf, sizeof(buf), devpath); =20 - return buf; + return (buf); +} +#endif + +static EFI_STATUS +efi_load(EFI_HANDLE dev, const char *filepath, void **bufp, size_t *bufs= ize) +{ + UINTN infosize =3D sizeof(EFI_FILE_INFO) + + ((strlen(filepath) + 1) * sizeof(CHAR16)); + EFI_FILE_INFO *finfo; + EFI_STATUS status; + EFI_FILE_IO_INTERFACE *iface; + EFI_FILE_HANDLE root; + EFI_FILE_HANDLE target; + CHAR16 path16[strlen(filepath) + 1]; + void *buf; + + finfo =3D malloc(infosize); + + if (finfo =3D=3D NULL) { + return (EFI_OUT_OF_RESOURCES); + } + + status =3D BS->OpenProtocol(dev, &SimpleFileSystemProtocolGUID, + (void **)&iface, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); + + if (status !=3D EFI_SUCCESS) { + free(finfo); + printf("Open protocol failed! %ld\n", EFI_ERROR_CODE(sta= tus)); + return (status); + } + + status =3D iface->OpenVolume(iface, &root); + + if (status !=3D EFI_SUCCESS) { + BS->CloseProtocol(dev, &SimpleFileSystemProtocolGUID, IH= , NULL); + free(finfo); + printf("Open volume failed! %ld\n", EFI_ERROR_CODE(statu= s)); + return (status); + } + + strcpy_to_16(path16, filepath); + status =3D root->Open(root, &target, path16, EFI_FILE_MODE_READ,= 0); + + if (status !=3D EFI_SUCCESS) { + BS->CloseProtocol(dev, &SimpleFileSystemProtocolGUID, IH= , NULL); + free(finfo); + + return (status); + } + + *bufsize =3D infosize; + status =3D target->GetInfo(target, &FileInfoGUID, bufsize, finfo= ); + + if (status !=3D EFI_SUCCESS) { + BS->CloseProtocol(dev, &SimpleFileSystemProtocolGUID, IH= , NULL); + free(finfo); + printf("Get info failed! %ld\n", EFI_ERROR_CODE(status))= ; + return (status); + } + + *bufsize =3D finfo->FileSize; + + if ((buf =3D malloc(finfo->FileSize)) =3D=3D NULL) { + BS->CloseProtocol(dev, &SimpleFileSystemProtocolGUID, IH= , NULL); + free(finfo); + printf("Failed to allocate load buffer %zd for '%s' " + "(%lu)\n", finfo->FileSize, filepath, EFI_ERROR_C= ODE(status)); + return (EFI_OUT_OF_RESOURCES); + } + + *bufp =3D buf; + status =3D target->Read(target, bufsize, buf); + BS->CloseProtocol(dev, &SimpleFileSystemProtocolGUID, IH, NULL);= + free(finfo); + + if (status !=3D EFI_SUCCESS) { + printf("Read failed! %ld\n", EFI_ERROR_CODE(status)); + return (status); + } + + return (EFI_SUCCESS); } =20 /* * load_loader attempts to load the loader image data. * - * It tries each module and its respective devices, identified by mod->p= robe, - * in order until a successful load occurs at which point it returns EFI= _SUCCESS - * and EFI_NOT_FOUND otherwise. + * This tries all handles which support the EFI_SIMPLE_FILE_SYSTEM inter= face. + * It is expected that the drivers will have installed this interface on= every + * handle representing a device containing a supported file system. + * + * Note: In the future, this may be altered to use the EFI_LOAD_FILE int= erface, + * which should work transparently with network booting. * * Only devices which have preferred matching the preferred parameter ar= e tried. */ static EFI_STATUS -load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bu= fp, - size_t *bufsize, BOOLEAN preferred) +load_loader(EFI_HANDLE *handlep, void **bufp, size_t *bufsize) { - UINTN i; - dev_info_t *dev; - const boot_module_t *mod; - - for (i =3D 0; i < NUM_BOOT_MODULES; i++) { - mod =3D boot_modules[i]; - for (dev =3D mod->devices(); dev !=3D NULL; dev =3D dev->next) { - if (dev->preferred !=3D preferred) - continue; - - if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) =3D=3D - EFI_SUCCESS) { - *devinfop =3D dev; - *modp =3D mod; - return (EFI_SUCCESS); - } + EFI_DEVICE_PATH *imgpath; + EFI_DEVICE_PATH *devpath; + EFI_LOADED_IMAGE *boot_image; + EFI_HANDLE *boot_handle; + EFI_HANDLE *preferred; + EFI_HANDLE *handles; + EFI_STATUS status; + UINTN i, hsize, nhandles, npreferred; + + if ((status =3D BS->OpenProtocol(IH, &LoadedImageGUID, + (VOID**)&boot_image, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL)) !=3D EFI_SUCCESS) { + panic("Failed to query LoadedImage (%lu)\n", + EFI_ERROR_CODE(status)); + } + + boot_handle =3D boot_image->DeviceHandle; + + if ((status =3D BS->OpenProtocol(boot_handle, &DevicePathGUID, + (void **)&imgpath, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL)= )) { + panic("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } + DPRINTF("boot1 imagepath: %s\n", devpath_str(imgpath)); + + /* Allocate space for the handles */ + hsize =3D (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); + if ((handles =3D malloc(hsize)) =3D=3D NULL) + panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT, + EFI_ERROR_CODE(status)); + + status =3D BS->LocateHandle(ByProtocol, &SimpleFileSystemProtocolGUID, = NULL, + &hsize, handles); + + switch (status) { + case EFI_SUCCESS: + break; + case EFI_BUFFER_TOO_SMALL: + (void)BS->FreePool(handles); + if ((handles =3D malloc(hsize)) =3D=3D NULL) { + panic("Failed to allocate %zu handles (%lu)", hsize / + sizeof(*handles), EFI_ERROR_CODE(status)); } + status =3D BS->LocateHandle(ByProtocol, + &SimpleFileSystemProtocolGUID, NULL, &hsize, handles= ); + if (status !=3D EFI_SUCCESS) + panic("Failed to get device handles (%lu)\n", + EFI_ERROR_CODE(status)); + break; + default: + panic("Failed to get device handles (%lu)", + EFI_ERROR_CODE(status)); } =20 + if ((preferred =3D malloc(hsize)) =3D=3D NULL) + panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT, + EFI_ERROR_CODE(status)); + + npreferred =3D 0; + nhandles =3D hsize / sizeof(*handles); + + /* Figure out which handles are preferred */ + for (i =3D 0; i < nhandles; i++) { + if (BS->OpenProtocol(handles[i], &DevicePathGUID, + (void **)&devpath, IH, NULL, EFI_OPEN_PROTOCOL_GET_P= ROTOCOL) =3D=3D + EFI_SUCCESS) { + if (device_paths_match(imgpath, devpath)) { + preferred[npreferred] =3D handles[i]; + npreferred++; + } + BS->CloseProtocol(handles[i], &DevicePathGUID, I= H, NULL); + } + } + + BS->CloseProtocol(boot_handle, &DevicePathGUID, IH, NULL); + + /* Try the preferred handles first, then all the handles */ + for (i =3D 0; i < npreferred; i++) { + if (efi_load(preferred[i], PATH_LOADER_EFI, bufp, bufsiz= e) =3D=3D + EFI_SUCCESS) { + *handlep =3D preferred[i]; + return (EFI_SUCCESS); + } + } + + for (i =3D 0; i < nhandles; i++) { + if (efi_load(handles[i], PATH_LOADER_EFI, bufp, bufsize)= =3D=3D + EFI_SUCCESS) { + *handlep =3D handles[i]; + return (EFI_SUCCESS); + } + } + + printf("Failed to load %s from any device!\n", PATH_LOADER_EFI);= + return (EFI_NOT_FOUND); } =20 @@ -359,20 +575,27 @@ try_boot(void) size_t bufsize, loadersize, cmdsize; void *buf, *loaderbuf; char *cmd; - dev_info_t *dev; - const boot_module_t *mod; + EFI_HANDLE fshandle; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + EFI_DEVICE_PATH *fspath; + + status =3D load_loader(&fshandle, &loaderbuf, &loadersize); =20 - status =3D load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE); - if (status !=3D EFI_SUCCESS) { - status =3D load_loader(&mod, &dev, &loaderbuf, &loadersize, - FALSE); + if (status !=3D EFI_SUCCESS) { + return (status); + } + + fspath =3D NULL; + if (status =3D=3D EFI_SUCCESS) { + status =3D BS->OpenProtocol(fshandle, &DevicePathGUID, + (void **)&fspath, IH, NULL, EFI_OPEN_PROTOCOL_GET_PR= OTOCOL); if (status !=3D EFI_SUCCESS) { - printf("Failed to load '%s'\n", PATH_LOADER_EFI); - return (status); - } + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } + DPRINTF("filesystem device path: %s\n", devpath_str(fspath)); } =20 /* @@ -387,9 +610,9 @@ try_boot(void) */ cmd =3D NULL; cmdsize =3D 0; - status =3D mod->load(PATH_DOTCONFIG, dev, &buf, &bufsize); + status =3D efi_load(fshandle, PATH_DOTCONFIG, &buf, &bufsize); if (status =3D=3D EFI_NOT_FOUND) - status =3D mod->load(PATH_CONFIG, dev, &buf, &bufsize); + status =3D efi_load(fshandle, PATH_CONFIG, &buf, &bufsize); if (status =3D=3D EFI_SUCCESS) { cmdsize =3D bufsize + 1; cmd =3D malloc(cmdsize); @@ -401,24 +624,25 @@ try_boot(void) buf =3D NULL; } =20 - if ((status =3D bs->LoadImage(TRUE, image, devpath_last(dev->devpath), + if ((status =3D BS->LoadImage(TRUE, IH, devpath_last(fspath), loaderbuf, loadersize, &loaderhandle)) !=3D EFI_SUCCESS) { - printf("Failed to load image provided by %s, size: %zu, (%lu)\n", - mod->name, loadersize, EFI_ERROR_CODE(status)); + printf("Failed to load image, size: %zu, (%lu)\n", + loadersize, EFI_ERROR_CODE(status)); goto errout; } =20 - if ((status =3D bs->HandleProtocol(loaderhandle, &LoadedImageGUID, - (VOID**)&loaded_image)) !=3D EFI_SUCCESS) { - printf("Failed to query LoadedImage provided by %s (%lu)\n", - mod->name, EFI_ERROR_CODE(status)); + if ((status =3D BS->OpenProtocol(loaderhandle, &LoadedImageGUID, + (VOID**)&loaded_image, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL)) !=3D EFI_SUCCESS) { + printf("Failed to query LoadedImage (%lu)\n", + EFI_ERROR_CODE(status)); goto errout; } =20 if (cmd !=3D NULL) printf(" command args: %s\n", cmd); =20 - loaded_image->DeviceHandle =3D dev->devhandle; + loaded_image->DeviceHandle =3D fshandle; loaded_image->LoadOptionsSize =3D cmdsize; loaded_image->LoadOptions =3D cmd; =20 @@ -434,10 +658,10 @@ try_boot(void) DSTALL(1000000); DPRINTF(".\n"); =20 - if ((status =3D bs->StartImage(loaderhandle, NULL, NULL)) !=3D + if ((status =3D BS->StartImage(loaderhandle, NULL, NULL)) !=3D EFI_SUCCESS) { - printf("Failed to start image provided by %s (%lu)\n", - mod->name, EFI_ERROR_CODE(status)); + printf("Failed to start image (%lu)\n", + EFI_ERROR_CODE(status)); loaded_image->LoadOptionsSize =3D 0; loaded_image->LoadOptions =3D NULL; } @@ -453,134 +677,19 @@ errout: return (status); } =20 -/* - * probe_handle determines if the passed handle represents a logical par= tition - * if it does it uses each module in order to probe it and if successful= it - * returns EFI_SUCCESS. - */ -static EFI_STATUS -probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, BOOLEAN *preferred)= -{ - dev_info_t *devinfo; - EFI_BLOCK_IO *blkio; - EFI_DEVICE_PATH *devpath; - EFI_STATUS status; - UINTN i; - - /* Figure out if we're dealing with an actual partition. */ - status =3D bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); - if (status =3D=3D EFI_UNSUPPORTED) - return (status); - - if (status !=3D EFI_SUCCESS) { - DPRINTF("\nFailed to query DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } - - DPRINTF("probing: %s\n", devpath_str(devpath)); - - status =3D bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio)= ; - if (status =3D=3D EFI_UNSUPPORTED) - return (status); - - if (status !=3D EFI_SUCCESS) { - DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } - - if (!blkio->Media->LogicalPartition) - return (EFI_UNSUPPORTED); - - *preferred =3D device_paths_match(imgpath, devpath); - - /* Run through each module, see if it can load this partition */ - for (i =3D 0; i < NUM_BOOT_MODULES; i++) { - if ((status =3D bs->AllocatePool(EfiLoaderData, - sizeof(*devinfo), (void **)&devinfo)) !=3D - EFI_SUCCESS) { - DPRINTF("\nFailed to allocate devinfo (%lu)\n", - EFI_ERROR_CODE(status)); - continue; - } - devinfo->dev =3D blkio; - devinfo->devpath =3D devpath; - devinfo->devhandle =3D h; - devinfo->devdata =3D NULL; - devinfo->preferred =3D *preferred; - devinfo->next =3D NULL; - - status =3D boot_modules[i]->probe(devinfo); - if (status =3D=3D EFI_SUCCESS) - return (EFI_SUCCESS); - (void)bs->FreePool(devinfo); - } - - return (EFI_UNSUPPORTED); -} - -/* - * probe_handle_status calls probe_handle and outputs the returned statu= s - * of the call. - */ -static void -probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) -{ - EFI_STATUS status; - BOOLEAN preferred; - - status =3D probe_handle(h, imgpath, &preferred); -=09 - DPRINTF("probe: "); - switch (status) { - case EFI_UNSUPPORTED: - printf("."); - DPRINTF(" not supported\n"); - break; - case EFI_SUCCESS: - if (preferred) { - printf("%c", '*'); - DPRINTF(" supported (preferred)\n"); - } else { - printf("%c", '+'); - DPRINTF(" supported\n"); - } - break; - default: - printf("x"); - DPRINTF(" error (%lu)\n", EFI_ERROR_CODE(status)); - break; - } - DSTALL(500000); -} - EFI_STATUS -efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) +main(int argc __unused, CHAR16 *argv[] __unused) { - EFI_HANDLE *handles; - EFI_LOADED_IMAGE *img; - EFI_DEVICE_PATH *imgpath; EFI_STATUS status; - EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl =3D NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout =3D NULL; - UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; - - /* Basic initialization*/ - systab =3D Xsystab; - image =3D Ximage; - bs =3D Xsystab->BootServices; - - /* Set up the console, so printf works. */ - status =3D bs->LocateProtocol(&ConsoleControlGUID, NULL, - (VOID **)&ConsoleControl); - if (status =3D=3D EFI_SUCCESS) - (void)ConsoleControl->SetMode(ConsoleControl, - EfiConsoleControlScreenText); + UINTN i, max_dim, best_mode, cols, rows; + + cons_probe(); + /* * Reset the console and find the best text mode. */ - conout =3D systab->ConOut; + conout =3D ST->ConOut; conout->Reset(conout, TRUE); max_dim =3D best_mode =3D 0; for (i =3D 0; ; i++) { @@ -597,123 +706,31 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsys= tab) conout->EnableCursor(conout, TRUE); conout->ClearScreen(conout); =20 - printf("\n>> FreeBSD EFI boot block\n"); - printf(" Loader path: %s\n\n", PATH_LOADER_EFI); - printf(" Initializing modules:"); - for (i =3D 0; i < NUM_BOOT_MODULES; i++) { - printf(" %s", boot_modules[i]->name); - if (boot_modules[i]->init !=3D NULL) - boot_modules[i]->init(); - } - putchar('\n'); - - /* Get all the device handles */ - hsize =3D (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); - if ((status =3D bs->AllocatePool(EfiLoaderData, hsize, (void **)&handle= s)) - !=3D EFI_SUCCESS) - panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT, - EFI_ERROR_CODE(status)); - - status =3D bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, - &hsize, handles); - switch (status) { - case EFI_SUCCESS: - break; - case EFI_BUFFER_TOO_SMALL: - (void)bs->FreePool(handles); - if ((status =3D bs->AllocatePool(EfiLoaderData, hsize, - (void **)&handles)) !=3D EFI_SUCCESS) { - panic("Failed to allocate %zu handles (%lu)", hsize / - sizeof(*handles), EFI_ERROR_CODE(status)); - } - status =3D bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, - NULL, &hsize, handles); - if (status !=3D EFI_SUCCESS) - panic("Failed to get device handles (%lu)\n", - EFI_ERROR_CODE(status)); - break; - default: - panic("Failed to get device handles (%lu)", - EFI_ERROR_CODE(status)); - } + /* + * Initialise the block cache. Set the upper limit. + */ + bcache_init(32768, 512); =20 - /* Scan all partitions, probing with all modules. */ - nhandles =3D hsize / sizeof(*handles); - printf(" Probing %zu block devices...", nhandles); - DPRINTF("\n"); + printf("\n>> FreeBSD EFI boot block\n"); =20 - /* Determine the devpath of our image so we can prefer it. */ - status =3D bs->HandleProtocol(image, &LoadedImageGUID, (VOID**)&img); - imgpath =3D NULL; - if (status =3D=3D EFI_SUCCESS) { - status =3D bs->HandleProtocol(img->DeviceHandle, &DevicePathGUID, - (void **)&imgpath); - if (status !=3D EFI_SUCCESS) - DPRINTF("Failed to get image DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - DPRINTF("boot1 imagepath: %s\n", devpath_str(imgpath)); - } + archsw.arch_autoload =3D efi_autoload; + archsw.arch_getdev =3D efi_getdev; + archsw.arch_copyin =3D efi_copyin; + archsw.arch_copyout =3D efi_copyout; + archsw.arch_readin =3D efi_readin; =20 - for (i =3D 0; i < nhandles; i++) - probe_handle_status(handles[i], imgpath); - printf(" done\n"); + printf(" Loader path: %s\n\n", PATH_LOADER_EFI); + printf(" Initializing modules:"); =20 - /* Status summary. */ - for (i =3D 0; i < NUM_BOOT_MODULES; i++) { - printf(" "); - boot_modules[i]->status(); + for (i =3D 0; efi_drivers[i] !=3D NULL; i++) { + printf(" %s", efi_drivers[i]->name); + if (efi_drivers[i]->init !=3D NULL) + efi_drivers[i]->init(); } + putchar('\n'); =20 try_boot(); =20 /* If we get here, we're out of luck... */ panic("No bootable partitions found!"); } - -/* - * add_device adds a device to the passed devinfo list. - */ -void -add_device(dev_info_t **devinfop, dev_info_t *devinfo) -{ - dev_info_t *dev; - - if (*devinfop =3D=3D NULL) { - *devinfop =3D devinfo; - return; - } - - for (dev =3D *devinfop; dev->next !=3D NULL; dev =3D dev->next) - ; - - dev->next =3D devinfo; -} - -void -panic(const char *fmt, ...) -{ - va_list ap; - - printf("panic: "); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - printf("\n"); - - while (1) {} -} - -void -putchar(int c) -{ - CHAR16 buf[2]; - - if (c =3D=3D '\n') { - buf[0] =3D '\r'; - buf[1] =3D 0; - systab->ConOut->OutputString(systab->ConOut, buf); - } - buf[0] =3D c; - buf[1] =3D 0; - systab->ConOut->OutputString(systab->ConOut, buf); -} diff --git a/sys/boot/efi/boot1/boot_module.h b/sys/boot/efi/boot1/boot_m= odule.h deleted file mode 100644 index 296d5a6..0000000 --- a/sys/boot/efi/boot1/boot_module.h +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * Copyright (c) 2015 Eric McCorkle - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in th= e - * documentation and/or other materials provided with the distributio= n. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _BOOT_MODULE_H_ -#define _BOOT_MODULE_H_ - -#include - -#include -#include -#include - -#ifdef EFI_DEBUG -#define DPRINTF(fmt, args...) printf(fmt, ##args) -#define DSTALL(d) bs->Stall(d) -#else -#define DPRINTF(fmt, ...) {} -#define DSTALL(d) {} -#endif - -/* EFI device info */ -typedef struct dev_info -{ - EFI_BLOCK_IO *dev; - EFI_DEVICE_PATH *devpath; - EFI_HANDLE *devhandle; - void *devdata; - BOOLEAN preferred; - struct dev_info *next; -} dev_info_t; - -/* - * A boot loader module. - * - * This is a standard interface for filesystem modules in the EFI system= =2E - */ -typedef struct boot_module_t -{ - const char *name; - - /* init is the optional initialiser for the module. */ - void (*init)(); - - /* - * probe checks to see if the module can handle dev. - * - * Return codes: - * EFI_SUCCESS =3D The module can handle the device. - * EFI_NOT_FOUND =3D The module can not handle the device. - * Other =3D The module encountered an error. - */ - EFI_STATUS (*probe)(dev_info_t* dev); - - /* - * load should select the best out of a set of devices that probe - * indicated were loadable and load the specified file. - * - * Return codes: - * EFI_SUCCESS =3D The module can handle the device. - * EFI_NOT_FOUND =3D The module can not handle the device. - * Other =3D The module encountered an error. - */ - EFI_STATUS (*load)(const char *filepath, dev_info_t *devinfo, - void **buf, size_t *bufsize); - - /* status outputs information about the probed devices. */ - void (*status)(); - - /* valid devices as found by probe. */ - dev_info_t *(*devices)(); -} boot_module_t; - -/* Standard boot modules. */ -#ifdef EFI_UFS_BOOT -extern const boot_module_t ufs_module; -#endif -#ifdef EFI_ZFS_BOOT -extern const boot_module_t zfs_module; -#endif - -/* Functions available to modules. */ -extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); -extern void panic(const char *fmt, ...) __dead2; -extern int printf(const char *fmt, ...); -extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap);= - -extern EFI_SYSTEM_TABLE *systab; -extern EFI_BOOT_SERVICES *bs; - -extern int devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devp= ath); -extern char *devpath_str(EFI_DEVICE_PATH *devpath); -#endif diff --git a/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu b/sys/boot/efi/boot= 1/fat-amd64.tmpl.bz2.uu index a3ec32d..c7308a4 100644 --- a/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu +++ b/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu @@ -2,25 +2,50 @@ FAT template boot filesystem created by generate-fat.sh= DO NOT EDIT $FreeBSD$ begin 644 fat-amd64.tmpl.bz2 -M0EIH.3%!62936?$)3$,`&U9_____Z^KJZ_^N_^O^Z_^[ON_NK^JJ^KZNKNNJ -MZNKNZOJ^P`+\#$!0$#1D-,@#)DT#1B&AIDQ,AD:#1HTR`-#)D80Q!D:,)D`` -M#1@F30```&@`$JJ9!_HU4:",3!,F0&C(83`F30T`T!B&!,F`(P3`"#0,@`/2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(0A#]BBBBB$(0A"$(0A#F^%\(9\,,-#0T-"$(0^$^>Z5TKZSPV? +M?D_1H&B?XB(B(B(B(B(CC6=3D?"R5*4I2E*4I2E*;/99@P8,&#!@X7"X7"X7"X +M7`X'$XG$XD(0A"$(0A"'6T444>51111"$(?]._?2?30A"'K****/-!1111"$ +M(;J***/O44440A"$(0A]=3DX3JWV'-?;>,[I]YSGQ'H'B]MK:VMK:VMK:VMK:V +MMK:VMK>"\-]ET[8V-C8V-C8V-C8V-C8V*4B(B(B(B(B(BE*4Q,3$A\&BBBB$ +M(0A"$/^_(_3T-#0T(0A#[G?O$>Q0\EY;@<#@1$1$1$1$1F6A=3D*T2E*4I2E*4I2E*4B(B(B(B +M(B(BFQL;'@T4440A"'E4444>BHHHH\.BBBB$(0ZCKO*YSG.+%B +MQ=3D;11113L;YQY+#P?@66666KA@888#-AA@`>5H:&AH:****(?:4440>6S/_G ++WQ=3DR13A0D#$"%&\` ` end diff --git a/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu b/sys/boot/efi/boot1/= fat-arm.tmpl.bz2.uu index 23e063e..ee2ee99 100644 --- a/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu +++ b/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu @@ -2,25 +2,50 @@ FAT template boot filesystem created by generate-fat.sh= DO NOT EDIT $FreeBSD$ begin 644 fat-arm.tmpl.bz2 -M0EIH.3%!62936>#67)H`&U9_____Z^KJZ_ZN_^O^J_^[OJ[NK^JJ^KZNKNNJ -MZNKNZOJ^P`+\```"``:`T::-`:8@P@&1D-!H:808)B:#0`T``,$T#!,@PC09 -M#33"9,0`T(`!H#1IHT!IB#"`9&0T&AIA!@F)H-`#0``P30,$R#"-!D--,)DQ -M`#0@`&@-&FC0&F(,(!D9#0:&F$&"8F@T`-``#!-`P3(,(T&0TTPF3$`-`522 -M$_(H2-DT0T:8C(T!H!ZC30R-&@-`,@&C1H:`:#1M3(T,@:::/1#331FII@)@ -M)Z:)R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;6UM;6UM;6UN9S-C8V-B$(0A"$(0A#[:BBBCT:***(0A#_-X[X3X: +M$(0]=3D1111"$(>D"BBBC?\C%BQ8O.HHHHA"$(0A#R7_;[5_X^*^.\U[%YSY3W +M#U+_[W/2=3D)TG2=3D)BQ8L6+%BQ8L6+['W-"VQ2E*4I2E*4I2E*1$1$1$1$1$12 +ME.=3D"$(>VHHHHA"$.%%%%'E]CU^3)DR0A"'7\A\1WKXR$(0A"$(0A"E%%%$(0 +MA"$(0A"$(0AUWF/Z7FOD/DO/?*>.[#Y;_D1$1$1$1$1$7:-T[^E*4I2E*4I2 +ME*4I$1$1$1$1',YG,YW.YW.\FBBBB$(0]&BBBCK4444>51111"$(>J^[]'T' +MH/0>@A"$/[GI\6+%B[RBBBBGL<6+%BICA@888#1AA@`>CDR9,F5%%%$/CJ** +1(/F-#S7_XNY(IPH2!C]4XX`` ` end diff --git a/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu b/sys/boot/efi/boot= 1/fat-arm64.tmpl.bz2.uu index 1101deb..1fa4138 100644 --- a/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu +++ b/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu @@ -2,25 +2,49 @@ FAT template boot filesystem created by generate-fat.sh= DO NOT EDIT $FreeBSD$ begin 644 fat-arm64.tmpl.bz2 -M0EIH.3%!629364C65#T`&U;_____Z^KJZ_^N_^O^J_^[OJ[NK^JJ^KZNKNNJ -MZNKNZOJ^P`+\#0``0`#0#)D&@TR8AD`,0!D--&`@:!H&@`!B#)IHR:--#(9, -MAA`8F@Q,0,#52`_U4?J@`&AH```:`:``````T-`T&@R&@T``````````$``T -M`R9!H-,F(9`#$`9#31@(&@:!H``8@R::,FC30R&3(80&)H,3$#`521(]I1I) -MF*:8C1Z`F0:`TR,@:&C30:`R!HTT,$!DTT-J:&@R&C)IA,:F33(S4]-3`--$ -MZ--B6=3D6F1M!<28FJA"+E)$0B<@B(B"TK+:2%L)0B!"'(D$$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AZ#L=3DKQ_6<'!P +M<'!P<'!P<'!P<'!P<'6=3D9UG6=3D3O=3D.UJE*4H]J:EEEG^60K4.N=3D,I2E"$(0A" +M'T7X>QL;&QWV7L*_H>,]P_S?[O*?`?%>H;V]O;V]$1$1$1$\ +M>4\M\%YCU3GYW.YW.YW.LLLLLLLLLL\5YCR'J*4I2E*4I2E*4I2(B(B(B(B( +MB*4I3R/?;&QL;$(0A"$(0A"$(0AY[VFQL;&QX_BO$>&[*$(0A"$*LLLLA"$( +M0A"$(0\OWOZ`UY99;6UM;4(0A[%[IWCO'O'_#RGY,\S[,?XB(B(B(B(B(CC6 +M;?"^12E*4I2E*4I2FS9;+66666666<[G<[G<[G;V]P<'!P0A"$(0A"$(>!99 +M99YUEEED(0A[AY#R7NT(0AZJRRRSN@LLLLA"$.-EEEGQ;+++(0A"$,C(^I]C +M@WW/Q9Y^SUW\,QW+!^G>8,&#!@P8,&#!@P8,&#!];[6=3D;.I2E*4I2E*4I2E( +MB(B(B(B(B(I2E,C(R,CP[+++(0A"$(0_Z[7KMK:VMJ$(0^'Y#_MX+WZ$(0A" +M$(0A"UEEED(0A"$(0A"$(0A_X^"\=3D\)\-\1YC_Y[IVGQGQV]O;V]$1$1$1$1 +M=3DF.F?TI2E*4I2E*4I2E(B(B(B(B(B(I3MW;O>V6660A"'G6666=3D]9999_S99 +M99"$(>D^N\[S7FO->:A"$/['H]C8V-CP+++++?@[&QL;%MF61EED-6660!YV +A<#S[+FVTI2&VRRRR'P%EED'QVI_Z__%W)%.%"0W.\..` ` end diff --git a/sys/boot/efi/boot1/generate-fat.sh b/sys/boot/efi/boot1/gene= rate-fat.sh index d9dfb27..7c46e92 100755 --- a/sys/boot/efi/boot1/generate-fat.sh +++ b/sys/boot/efi/boot1/generate-fat.sh @@ -13,7 +13,7 @@ =20 FAT_SIZE=3D1600 #Size in 512-byte blocks of the produced image =20 -BOOT1_SIZE=3D128k +BOOT1_SIZE=3D512k =20 # # Known filenames diff --git a/sys/boot/efi/boot1/ufs_module.c b/sys/boot/efi/boot1/ufs_mod= ule.c deleted file mode 100644 index 0860a86..0000000 --- a/sys/boot/efi/boot1/ufs_module.c +++ /dev/null @@ -1,180 +0,0 @@ -/*- - * Copyright (c) 1998 Robert Nordier - * All rights reserved. - * Copyright (c) 2001 Robert Drehmel - * All rights reserved. - * Copyright (c) 2014 Nathan Whitehorn - * All rights reserved. - * Copyright (c) 2015 Eric McCorkle - * All rights reverved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in th= e - * documentation and/or other materials provided with the distributio= n. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -#include -#include -#include -#include - -#include "boot_module.h" - -static dev_info_t *devinfo; -static dev_info_t *devices; - -static int -dskread(void *buf, u_int64_t lba, int nblk) -{ - int size; - EFI_STATUS status; - - lba =3D lba / (devinfo->dev->Media->BlockSize / DEV_BSIZE); - size =3D nblk * DEV_BSIZE; - - status =3D devinfo->dev->ReadBlocks(devinfo->dev, - devinfo->dev->Media->MediaId, lba, size, buf); - - if (status !=3D EFI_SUCCESS) { - DPRINTF("dskread: failed dev: %p, id: %u, lba: %ju, size: %d, " - "status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, (uintmax_t)lba, size, - EFI_ERROR_CODE(status)); - return (-1); - } - - return (0); -} - -#include "ufsread.c" - -static struct dmadat __dmadat; - -static int -init_dev(dev_info_t* dev) -{ - - devinfo =3D dev; - dmadat =3D &__dmadat; - - return fsread(0, NULL, 0); -} - -static EFI_STATUS -probe(dev_info_t* dev) -{ - - if (init_dev(dev) < 0) - return (EFI_UNSUPPORTED); - - add_device(&devices, dev); - - return (EFI_SUCCESS); -} - -static EFI_STATUS -load(const char *filepath, dev_info_t *dev, void **bufp, size_t *bufsize= ) -{ - ufs_ino_t ino; - EFI_STATUS status; - size_t size; - ssize_t read; - void *buf; - - DPRINTF("Loading '%s' from %s\n", filepath, devpath_str(dev->devpath));= - - if (init_dev(dev) < 0) { - DPRINTF("Failed to init device\n"); - return (EFI_UNSUPPORTED); - } - - if ((ino =3D lookup(filepath)) =3D=3D 0) { - DPRINTF("Failed to lookup '%s' (file not found?)\n", filepath); - return (EFI_NOT_FOUND); - } - - if (fsread_size(ino, NULL, 0, &size) < 0 || size <=3D 0) { - printf("Failed to read size of '%s' ino: %d\n", filepath, ino); - return (EFI_INVALID_PARAMETER); - } - - if ((status =3D bs->AllocatePool(EfiLoaderData, size, &buf)) !=3D - EFI_SUCCESS) { - printf("Failed to allocate read buffer %zu for '%s' (%lu)\n", - size, filepath, EFI_ERROR_CODE(status)); - return (status); - } - - read =3D fsread(ino, buf, size); - if ((size_t)read !=3D size) { - printf("Failed to read '%s' (%zd !=3D %zu)\n", filepath, read, - size); - (void)bs->FreePool(buf); - return (EFI_INVALID_PARAMETER); - } - - DPRINTF("Load complete\n"); - - *bufp =3D buf; - *bufsize =3D size; - - return (EFI_SUCCESS); -} - -static void -status(void) -{ - int i; - dev_info_t *dev; - - for (dev =3D devices, i =3D 0; dev !=3D NULL; dev =3D dev->next, i++) - ; - - printf("%s found ", ufs_module.name); - switch (i) { - case 0: - printf("no partitions\n"); - break; - case 1: - printf("%d partition\n", i); - break; - default: - printf("%d partitions\n", i); - } -} - -static dev_info_t * -_devices(void) -{ - - return (devices); -} - -const boot_module_t ufs_module =3D -{ - .name =3D "UFS", - .probe =3D probe, - .load =3D load, - .status =3D status, - .devices =3D _devices -}; diff --git a/sys/boot/efi/boot1/zfs_module.c b/sys/boot/efi/boot1/zfs_mod= ule.c deleted file mode 100644 index 1926a33..0000000 --- a/sys/boot/efi/boot1/zfs_module.c +++ /dev/null @@ -1,196 +0,0 @@ -/*- - * Copyright (c) 2015 Eric McCorkle - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in th= e - * documentation and/or other materials provided with the distributio= n. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F - * SUCH DAMAGE. - * - * $FreeBSD$ - */ -#include -#include -#include -#include -#include -#include -#include - -#include "boot_module.h" - -#include "libzfs.h" -#include "zfsimpl.c" - -static dev_info_t *devices; - -static int -vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) -{ - dev_info_t *devinfo; - off_t lba; - EFI_STATUS status; - - devinfo =3D (dev_info_t *)priv; - lba =3D off / devinfo->dev->Media->BlockSize; - - status =3D devinfo->dev->ReadBlocks(devinfo->dev, - devinfo->dev->Media->MediaId, lba, bytes, buf); - if (status !=3D EFI_SUCCESS) { - DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: %zu," - " status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, (intmax_t)lba, bytes, - EFI_ERROR_CODE(status)); - return (-1); - } - - return (0); -} - -static EFI_STATUS -probe(dev_info_t *dev) -{ - spa_t *spa; - dev_info_t *tdev; - EFI_STATUS status; - - /* ZFS consumes the dev on success so we need a copy. */ - if ((status =3D bs->AllocatePool(EfiLoaderData, sizeof(*dev), - (void**)&tdev)) !=3D EFI_SUCCESS) { - DPRINTF("Failed to allocate tdev (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } - memcpy(tdev, dev, sizeof(*dev)); - - if (vdev_probe(vdev_read, tdev, &spa) !=3D 0) { - (void)bs->FreePool(tdev); - return (EFI_UNSUPPORTED); - } - - dev->devdata =3D spa; - add_device(&devices, dev); - - return (EFI_SUCCESS); -} - -static EFI_STATUS -load(const char *filepath, dev_info_t *devinfo, void **bufp, size_t *buf= size) -{ - spa_t *spa; - struct zfsmount zfsmount; - dnode_phys_t dn; - struct stat st; - int err; - void *buf; - EFI_STATUS status; - - spa =3D devinfo->devdata; - - DPRINTF("load: '%s' spa: '%s', devpath: %s\n", filepath, spa->spa_name,= - devpath_str(devinfo->devpath)); - - if ((err =3D zfs_spa_init(spa)) !=3D 0) { - DPRINTF("Failed to load pool '%s' (%d)\n", spa->spa_name, err); - return (EFI_NOT_FOUND); - } - - if ((err =3D zfs_mount(spa, 0, &zfsmount)) !=3D 0) { - DPRINTF("Failed to mount pool '%s' (%d)\n", spa->spa_name, err); - return (EFI_NOT_FOUND); - } - - if ((err =3D zfs_lookup(&zfsmount, filepath, &dn)) !=3D 0) { - if (err =3D=3D ENOENT) { - DPRINTF("Failed to find '%s' on pool '%s' (%d)\n", - filepath, spa->spa_name, err); - return (EFI_NOT_FOUND); - } - printf("Failed to lookup '%s' on pool '%s' (%d)\n", filepath, - spa->spa_name, err); - return (EFI_INVALID_PARAMETER); - } - - if ((err =3D zfs_dnode_stat(spa, &dn, &st)) !=3D 0) { - printf("Failed to stat '%s' on pool '%s' (%d)\n", filepath, - spa->spa_name, err); - return (EFI_INVALID_PARAMETER); - } - - if ((status =3D bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf= )) - !=3D EFI_SUCCESS) { - printf("Failed to allocate load buffer %zd for pool '%s' for '%s' " - "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(sta= tus)); - return (EFI_INVALID_PARAMETER); - } - - if ((err =3D dnode_read(spa, &dn, 0, buf, st.st_size)) !=3D 0) { - printf("Failed to read node from %s (%d)\n", spa->spa_name, - err); - (void)bs->FreePool(buf); - return (EFI_INVALID_PARAMETER); - } - - *bufsize =3D st.st_size; - *bufp =3D buf; - - return (EFI_SUCCESS); -} - -static void -status(void) -{ - spa_t *spa; - - spa =3D STAILQ_FIRST(&zfs_pools); - if (spa =3D=3D NULL) { - printf("%s found no pools\n", zfs_module.name); - return; - } - - printf("%s found the following pools:", zfs_module.name); - STAILQ_FOREACH(spa, &zfs_pools, spa_link) - printf(" %s", spa->spa_name); - - printf("\n"); -} - -static void -init(void) -{ - - zfs_init(); -} - -static dev_info_t * -_devices(void) -{ - - return (devices); -} - -const boot_module_t zfs_module =3D -{ - .name =3D "ZFS", - .init =3D init, - .probe =3D probe, - .load =3D load, - .status =3D status, - .devices =3D _devices -}; diff --git a/sys/boot/efi/drivers/Makefile b/sys/boot/efi/drivers/Makefil= e new file mode 100644 index 0000000..5e1f18b --- /dev/null +++ b/sys/boot/efi/drivers/Makefile @@ -0,0 +1,34 @@ +# $FreeBSD$ + +.include + +LIB=3D efi_drivers +INTERNALLIB=3D +WARNS?=3D 2 + +SRCS=3D efipart.c fs_driver.c + +.if ${MACHINE_CPUARCH} =3D=3D "aarch64" +CFLAGS+=3D -msoft-float -mgeneral-regs-only +.endif +.if ${MACHINE_ARCH} =3D=3D "amd64" +CFLAGS+=3D -fPIC -mno-red-zone +.endif +.if ${MK_ZFS} !=3D "no" +CFLAGS+=3D -I${.CURDIR}/../../zfs +CFLAGS+=3D -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+=3D -DEFI_ZFS_BOOT +.endif + +CFLAGS+=3D -I${.CURDIR}/../include +CFLAGS+=3D -I${.CURDIR}/../include/${MACHINE} +CFLAGS+=3D -I${.CURDIR}/../../../../lib/libstand + +# Pick up the bootstrap header for some interface items +CFLAGS+=3D -I${.CURDIR}/../../common + +# Handle FreeBSD specific %b and %D printf format specifiers +CFLAGS+=3D ${FORMAT_EXTENSIONS} +CFLAGS+=3D -DTERM_EMU + +.include diff --git a/sys/boot/efi/drivers/efi_drivers.h b/sys/boot/efi/drivers/ef= i_drivers.h new file mode 100644 index 0000000..0c599d1 --- /dev/null +++ b/sys/boot/efi/drivers/efi_drivers.h @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in th= e + * documentation and/or other materials provided with the distributio= n. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _EFI_DRIVERS_H_ +#define _EFI_DRIVERS_H_ + +typedef struct efi_driver_t { + const char *name; + void (*init)(void); +} efi_driver_t; + +extern struct devsw efipart_dev; + +/* EFI drivers. */ +extern const efi_driver_t fs_driver; + +#endif diff --git a/sys/boot/efi/libefi/efipart.c b/sys/boot/efi/drivers/efipart= =2Ec similarity index 75% rename from sys/boot/efi/libefi/efipart.c rename to sys/boot/efi/drivers/efipart.c index 5a99381..3e3a9c0 100644 --- a/sys/boot/efi/libefi/efipart.c +++ b/sys/boot/efi/drivers/efipart.c @@ -74,90 +74,109 @@ static int npdinfo =3D 0; =20 #define PD(dev) (pdinfo[(dev)->d_unit]) =20 +static EFI_STATUS +efipart_supported(EFI_DRIVER_BINDING *This, EFI_HANDLE handle, + EFI_DEVICE_PATH *RemainingDevicePath __unused) +{ + return BS->OpenProtocol(handle, &blkio_guid, + NULL, IH, handle, + EFI_OPEN_PROTOCOL_TEST_PROTOCOL); +} + +static EFI_STATUS +efipart_start(EFI_DRIVER_BINDING *This, EFI_HANDLE handle, + EFI_DEVICE_PATH *RemainingDevicePath __unused, + u_int* ndisk, uint* nrdisk) +{ + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node; + EFI_STATUS status; + EFI_HANDLE alias; + + devpath =3D efi_lookup_devpath(handle); + + if (devpath =3D=3D NULL) { + return (EFI_DEVICE_ERROR); + } + + status =3D BS->HandleProtocol(handle, &blkio_guid, + (void**)&blkio); + if (EFI_ERROR(status)) + return (status); + + if (!blkio->Media->LogicalPartition) { + *nrdisk++; + return (EFI_UNSUPPORTED); + } + + /* + * If we come across a logical partition of subtype CDROM + * it doesn't refer to the CD filesystem itself, but rather + * to any usable El Torito boot image on it. In this case + * we try to find the parent device and add that instead as + * that will be the CD filesystem. + */ + node =3D efi_devpath_last_node(devpath); + if (DevicePathType(node) =3D=3D MEDIA_DEVICE_PATH && + DevicePathSubType(node) =3D=3D MEDIA_CDROM_DP) { + devpathcpy =3D efi_devpath_trim(devpath); + tmpdevpath =3D devpathcpy; + status =3D BS->LocateDevicePath(&blkio_guid, &tmpdevpath= , + &alias); + free(devpathcpy); + + if (EFI_ERROR(status)) + return (status); + + efi_register_handle(&efipart_dev, handle, alias); + } else + efi_register_handle(&efipart_dev, handle, NULL); + + pdinfo[npdinfo].pd_open =3D 0; + pdinfo[npdinfo].pd_bcache =3D NULL; + pdinfo[npdinfo].pd_unit =3D npdinfo; + npdinfo++; + *ndisk++; + + return (EFI_SUCCESS); +} + static int -efipart_init(void)=20 +efipart_init(void) { - EFI_BLOCK_IO *blkio; - EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node; - EFI_HANDLE *hin, *hout, *aliases, handle; + EFI_HANDLE *handles; EFI_STATUS status; UINTN sz; - u_int n, nin, nout, nrdisk; + u_int n, nin, ndisk, nrdisk; int err; =20 sz =3D 0; - hin =3D NULL; + handles =3D NULL; status =3D BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, 0); if (status =3D=3D EFI_BUFFER_TOO_SMALL) { - hin =3D (EFI_HANDLE *)malloc(sz * 3); + handles =3D (EFI_HANDLE *)malloc(sz); status =3D BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, - hin); + handles); if (EFI_ERROR(status)) - free(hin); + free(handles); } if (EFI_ERROR(status)) return (efi_status_to_errno(status)); =20 /* Filter handles to only include FreeBSD partitions. */ nin =3D sz / sizeof(EFI_HANDLE); - hout =3D hin + nin; - aliases =3D hout + nin; - nout =3D 0; - nrdisk =3D 0; - - bzero(aliases, nin * sizeof(EFI_HANDLE)); pdinfo =3D malloc(nin * sizeof(*pdinfo)); - if (pdinfo =3D=3D NULL) - return (ENOMEM); + ndisk =3D 0; + nrdisk =3D 0; =20 for (n =3D 0; n < nin; n++) { - devpath =3D efi_lookup_devpath(hin[n]); - if (devpath =3D=3D NULL) { - continue; - } - - status =3D BS->HandleProtocol(hin[n], &blkio_guid, - (void**)&blkio); - if (EFI_ERROR(status)) - continue; - if (!blkio->Media->LogicalPartition) { - nrdisk++; - continue; - } - - /* - * If we come across a logical partition of subtype CDROM - * it doesn't refer to the CD filesystem itself, but rather - * to any usable El Torito boot image on it. In this case - * we try to find the parent device and add that instead as - * that will be the CD filesystem. - */ - node =3D efi_devpath_last_node(devpath); - if (DevicePathType(node) =3D=3D MEDIA_DEVICE_PATH && - DevicePathSubType(node) =3D=3D MEDIA_CDROM_DP) { - devpathcpy =3D efi_devpath_trim(devpath); - tmpdevpath =3D devpathcpy; - status =3D BS->LocateDevicePath(&blkio_guid, &tmpdevpath, - &handle); - free(devpathcpy); - if (EFI_ERROR(status)) - continue; - hout[nout] =3D handle; - aliases[nout] =3D hin[n]; - } else - hout[nout] =3D hin[n]; - nout++; - pdinfo[npdinfo].pd_open =3D 0; - pdinfo[npdinfo].pd_bcache =3D NULL; - pdinfo[npdinfo].pd_unit =3D npdinfo; - npdinfo++; + efipart_start(NULL, handles[n], NULL, &ndisk, &nrdisk); } =20 bcache_add_dev(npdinfo); - err =3D efi_register_handles(&efipart_dev, hout, aliases, nout); - free(hin); + free(handles); =20 - if (nout =3D=3D 0 && nrdisk > 0) + if (ndisk =3D=3D 0 && nrdisk > 0) printf("Found %d disk(s) but no logical partition\n", nrdisk); return (err); } diff --git a/sys/boot/efi/drivers/fs_driver.c b/sys/boot/efi/drivers/fs_d= river.c new file mode 100644 index 0000000..b9c8536 --- /dev/null +++ b/sys/boot/efi/drivers/fs_driver.c @@ -0,0 +1,853 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in th= e + * documentation and/or other materials provided with the distributio= n. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef EFI_ZFS_BOOT +#include +#endif +#include + +#include "efi_drivers.h" + +static EFI_GUID SimpleFileSystemProtocolGUID =3D SIMPLE_FILE_SYSTEM_PROT= OCOL; + +static struct fs_ops *backend_file_system[] =3D { + &dosfs_fsops, + &ufs_fsops, + &cd9660_fsops, + &tftp_fsops, + &nfs_fsops, + &gzipfs_fsops, + &bzipfs_fsops, + NULL +}; + +static struct devsw *backend_devsw[] =3D { + &efipart_dev, +#ifdef EFI_ZFS_BOOT + &zfs_dev, +#endif + NULL +}; + +typedef struct volinfo_t { + struct fs_ops *fsops; + struct devdesc *dev; +} volinfo_t; + +typedef struct fileinfo_t { + const volinfo_t* vinfo; + struct open_file fdata; + char path[]; +} fileinfo_t; + +static EFI_GUID FileInfoGUID =3D EFI_FILE_INFO_ID;; + +static EFIAPI EFI_STATUS +file_open_impl(EFI_FILE_HANDLE File, EFI_FILE_HANDLE *NewHandle, + CHAR16 *FileName, UINT64 OpenMode, UINT64 Attributes); + +static EFIAPI EFI_STATUS +file_close_impl(EFI_FILE_HANDLE File); + +static EFIAPI EFI_STATUS +file_delete_impl(EFI_FILE_HANDLE File); + +static EFIAPI EFI_STATUS +dir_read_impl(EFI_FILE_HANDLE File, UINTN *BufferSize, VOID *Buffer); + +static EFIAPI EFI_STATUS +dir_write_impl(EFI_FILE_HANDLE File, UINTN *BufferSize, + VOID *Buffer); + +static EFIAPI EFI_STATUS +file_read_impl(EFI_FILE_HANDLE File, UINTN *BufferSize, VOID *Buffer); + +static EFIAPI EFI_STATUS +file_write_impl(EFI_FILE_HANDLE File, UINTN *BufferSize, + VOID *Buffer); + +static EFIAPI EFI_STATUS +file_set_position_impl(EFI_FILE_HANDLE File, UINT64 Position); + +static EFIAPI EFI_STATUS +file_get_position_impl(EFI_FILE_HANDLE File, UINT64 *Position); + +static EFIAPI EFI_STATUS +file_get_info_impl(EFI_FILE_HANDLE File, EFI_GUID *InformationType, + UINTN *BufferSize, VOID *Buffer); + +static EFIAPI EFI_STATUS +file_set_info_impl(EFI_FILE_HANDLE File, EFI_GUID *InformationType, + UINTN BufferSize, VOID *Buffer); + +static EFIAPI EFI_STATUS +file_flush_impl(EFI_FILE_HANDLE File); + +static struct devdesc* +clone_devdesc(struct devdesc *dev) +{ + struct devdesc *out; + + switch(dev->d_dev->dv_type) { + case DEVT_ZFS: + out =3D malloc(sizeof(struct zfs_devdesc)); + + if (out =3D=3D NULL) { + return NULL; + } + + memcpy(out, dev, sizeof(struct zfs_devdesc)); + + return out; + + default: + out =3D malloc(sizeof(struct devdesc)); + + if (out =3D=3D NULL) { + return NULL; + } + + memcpy(out, dev, sizeof(struct devdesc)); + + return out; + } +} + +static EFI_STATUS +do_file_open(const volinfo_t *vinfo, const char filepath[], + int mode, EFI_FILE_HANDLE *out) +{ + EFI_FILE_HANDLE fhandle; + fileinfo_t *finfo; + struct stat st; + struct devdesc *tmpdev; + int err; + + memset(&st, 0, sizeof(struct stat)); + fhandle =3D malloc(sizeof(EFI_FILE) + sizeof(fileinfo_t) + + strlen(filepath) + 1); + + if (fhandle =3D=3D NULL) { + return (EFI_OUT_OF_RESOURCES); + } + + tmpdev =3D clone_devdesc(vinfo->dev); + + if (tmpdev =3D=3D NULL) { + free(fhandle); + return (EFI_OUT_OF_RESOURCES); + } + + finfo =3D (fileinfo_t*)(fhandle + 1); + finfo->fdata.f_flags =3D mode + 1; + finfo->fdata.f_dev =3D NULL; + finfo->fdata.f_ops =3D NULL; + finfo->fdata.f_offset =3D 0; + finfo->fdata.f_devdata =3D NULL; + + if ((err =3D vinfo->dev->d_dev->dv_open(&(finfo->fdata), tmpdev)= ) !=3D 0) { + free(fhandle); + return (errno_to_efi_status(err)); + } + + finfo->fdata.f_dev =3D vinfo->dev->d_dev; + + if ((err =3D vinfo->fsops->fo_open(filepath, &(finfo->fdata))) != =3D 0) { + free(fhandle); + return (errno_to_efi_status(err)); + } + + finfo->fdata.f_ops =3D vinfo->fsops; + + if ((err =3D vinfo->fsops->fo_stat(&(finfo->fdata), &st)) !=3D 0= ) { + free(fhandle); + return (errno_to_efi_status(err)); + } + + strcpy(finfo->path, filepath); + finfo->vinfo =3D vinfo; + fhandle->Revision =3D EFI_FILE_HANDLE_REVISION; + fhandle->Open =3D file_open_impl; + fhandle->Close =3D file_close_impl; + fhandle->Delete =3D file_delete_impl; + fhandle->SetPosition =3D file_set_position_impl; + fhandle->GetPosition =3D file_get_position_impl; + fhandle->GetInfo =3D file_get_info_impl; + fhandle->SetInfo =3D file_set_info_impl; + fhandle->Flush =3D file_flush_impl; + + if (S_ISDIR(st.st_mode)) { + fhandle->Read =3D dir_read_impl; + fhandle->Write =3D dir_write_impl; + } else { + fhandle->Read =3D file_read_impl; + fhandle->Write =3D file_write_impl; + } + + *out =3D fhandle; + + return (EFI_SUCCESS); +} + +static int +mode_from_efi(UINT64 efi_mode) +{ + int mode =3D 0; + + if (efi_mode & EFI_FILE_MODE_WRITE) { + mode |=3D O_WRONLY; + } else if (efi_mode & EFI_FILE_MODE_READ) { + mode |=3D O_RDONLY; + } else if (efi_mode & EFI_FILE_MODE_READ && + efi_mode & EFI_FILE_MODE_WRITE) { + mode |=3D O_RDWR; + } + + return mode; +} + +static UINT64 +mode_to_efi(int mode) +{ + UINT64 efi_mode =3D 0; + + if (mode & O_WRONLY) { + efi_mode |=3D EFI_FILE_MODE_WRITE; + } else if (mode & O_RDONLY) { + efi_mode |=3D EFI_FILE_MODE_READ; + } else if (mode & O_RDWR) { + efi_mode |=3D EFI_FILE_MODE_READ; + efi_mode |=3D EFI_FILE_MODE_WRITE; + } + + return (efi_mode); +} + +static EFIAPI EFI_STATUS +file_open_impl(EFI_FILE_HANDLE File, EFI_FILE_HANDLE *NewHandle, + CHAR16 *FileName, UINT64 OpenMode, UINT64 Attributes) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + char buf[strlen(finfo->path) + strlen16(FileName) + 1]; + + strcpy_from_16(stpcpy(buf, finfo->path), FileName); + + return do_file_open(finfo->vinfo, buf, + mode_from_efi(OpenMode), NewHandle); +} + +static EFIAPI EFI_STATUS +file_close_impl(EFI_FILE_HANDLE File) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + int res; + + if ((res =3D finfo->fdata.f_ops->fo_close(&(finfo->fdata))) !=3D= 0) { + return (errno_to_efi_status(res)); + } + + if ((res =3D finfo->vinfo->dev->d_dev->dv_close(&(finfo->fdata))= ) !=3D 0) { + return (errno_to_efi_status(res)); + } + + free(File); + return (EFI_SUCCESS); +} + +static EFIAPI EFI_STATUS +file_delete_impl(EFI_FILE_HANDLE File) +{ + file_close_impl(File); + + return (EFI_WARN_DELETE_FAILURE); +} + +static EFIAPI EFI_STATUS +dir_read_impl(EFI_FILE_HANDLE File, UINTN *BufferSize, VOID *Buffer) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + fileinfo_t *entinfo; + struct dirent d; + struct stat st; + int err; + UINTN currsize =3D *BufferSize; + UINTN reqsize; + EFI_FILE_INFO *out =3D (EFI_FILE_INFO*)Buffer; + EFI_FILE_HANDLE enthandle; + EFI_STATUS status; + off_t currpos; + + /* Record teh current position so we can rewind if we have to */= + if ((currpos =3D finfo->fdata.f_ops->fo_seek(&(finfo->fdata), + 0, SEEK_CUR)) < 0) { + return (errno_to_efi_status(errno)); + } + + if ((err =3D finfo->fdata.f_ops->fo_readdir(&(finfo->fdata), &d)) !=3D = 0) { + return (errno_to_efi_status(errno)); + } + + reqsize =3D sizeof(EFI_FILE_INFO) + + ((strlen(d.d_name) + 1) * sizeof(CHAR16)); + + if (Buffer =3D=3D NULL || currsize < reqsize) { + finfo->fdata.f_ops->fo_seek(&(finfo->fdata), currpos, SE= EK_SET); + *BufferSize =3D reqsize; + + return (EFI_BUFFER_TOO_SMALL); + } + + // We have to actually open the file, since EFI directory + // reads are supposed to return stat information. + CHAR16 buf[d.d_namlen]; + strcpy_to_16(buf, d.d_name); + status =3D file_open_impl(File, &enthandle, buf, EFI_FILE_READ_O= NLY, 0); + + if (EFI_ERROR(status)) { + finfo->fdata.f_ops->fo_seek(&(finfo->fdata), currpos, SE= EK_SET); + return (status); + } + + entinfo =3D (fileinfo_t*)(enthandle + 1); + + if ((err =3D finfo->fdata.f_ops->fo_stat(&(entinfo->fdata), &st)= ) !=3D 0) { + finfo->fdata.f_ops->fo_seek(&(finfo->fdata), currpos, SE= EK_SET); + return (errno_to_efi_status(errno)); + } + + status =3D file_close_impl(enthandle); + + if (EFI_ERROR(status)) { + finfo->fdata.f_ops->fo_seek(&(finfo->fdata), currpos, SE= EK_SET); + return (status); + } + + // We're good at this point, copy everything into place. + out->Size =3D reqsize; + out->FileSize =3D st.st_size; + out->PhysicalSize =3D st.st_blocks * st.st_blksize; + out->Attribute =3D mode_to_efi(st.st_mode); + to_efi_time(&(out->LastAccessTime), st.st_atime); + to_efi_time(&(out->ModificationTime), st.st_mtime); + to_efi_time(&(out->CreateTime), st.st_ctime); + + if (S_ISDIR(st.st_mode)) { + out->Attribute |=3D EFI_FILE_DIRECTORY; + } + + strcpy_to_16(out->FileName, d.d_name); + *BufferSize =3D reqsize; + + return (EFI_SUCCESS); +} + +static EFIAPI EFI_STATUS +dir_write_impl(EFI_FILE_HANDLE File __unused, UINTN *BufferSize __unused= , + VOID *Buffer __unused) +{ + // EFI API doesn't allow writing to directories + return (EFI_UNSUPPORTED); +} + +static EFIAPI EFI_STATUS +file_read_impl(EFI_FILE_HANDLE File, UINTN *BufferSize, VOID *Buffer) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + size_t readsize =3D *BufferSize; + size_t resid; + int err; + + if ((err =3D finfo->fdata.f_ops->fo_read(&(finfo->fdata), Buffer, + readsize, &resid)) !=3D 0= ) { + return (errno_to_efi_status(errno)); + } + + *BufferSize =3D readsize - resid; + + return (EFI_SUCCESS); +} + +static EFIAPI EFI_STATUS +file_write_impl(EFI_FILE_HANDLE File, UINTN *BufferSize, VOID *Buffer) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + size_t writesize =3D *BufferSize; + size_t resid; + int err; + + if ((err =3D finfo->fdata.f_ops->fo_write(&(finfo->fdata), Buffer, + writesize, &resid)) !=3D= 0) { + return (errno_to_efi_status(errno)); + } + + *BufferSize =3D writesize - resid; + + return (EFI_SUCCESS); +} + +static EFIAPI EFI_STATUS +file_set_position_impl(EFI_FILE_HANDLE File, UINT64 Position) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + int res; + + if (Position !=3D 0xffffffffffffffffLL) { + res =3D finfo->fdata.f_ops->fo_seek(&(finfo->fdata), + Position, SEEK_SET); + } else { + res =3D finfo->fdata.f_ops->fo_seek(&(finfo->fdata), + 0, SEEK_END); + } + + if (res > 0) { + return (EFI_SUCCESS); + } else { + return (errno_to_efi_status(res)); + } +} + + +static EFIAPI EFI_STATUS +file_get_position_impl(EFI_FILE_HANDLE File, UINT64 *Position) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + off_t res; + + res =3D finfo->fdata.f_ops->fo_seek(&(finfo->fdata), 0, SEEK_CUR= ); + + if (res > 0) { + *Position =3D res; + + return (EFI_SUCCESS); + } else { + return (errno_to_efi_status(errno)); + } +} + +static EFIAPI EFI_STATUS +file_get_info_impl(EFI_FILE_HANDLE File, EFI_GUID *InformationType, + UINTN *BufferSize, VOID *Buffer) +{ + fileinfo_t *finfo =3D (fileinfo_t*)(File + 1); + + if (!memcmp(InformationType, &FileInfoGUID, sizeof(EFI_GUID))) {= + EFI_FILE_INFO *out =3D (EFI_FILE_INFO*)Buffer; + UINTN str16len =3D(strlen(finfo->path) + 1) * sizeof(CHA= R16); + UINTN currsize =3D *BufferSize; + UINTN reqsize =3D sizeof(EFI_FILE_INFO) + str16len; + struct stat st; + int err; + + memset(&st, 0, sizeof(struct stat)); + *BufferSize =3D reqsize; + + if (Buffer =3D=3D NULL || + currsize < sizeof(EFI_FILE_INFO) + str16len) { + *BufferSize =3D sizeof(EFI_FILE_INFO) + str16len= ; + return (EFI_BUFFER_TOO_SMALL); + } + + if ((err =3D finfo->fdata.f_ops->fo_stat(&(finfo->fdata)= , + &st)) !=3D 0) { + return (errno_to_efi_status(errno)); + } + + out->Size =3D sizeof(EFI_FILE_INFO) + str16len; + out->FileSize =3D st.st_size; + out->PhysicalSize =3D st.st_blocks * st.st_blksize; + to_efi_time(&(out->LastAccessTime), st.st_atime); + to_efi_time(&(out->ModificationTime), st.st_mtime); + to_efi_time(&(out->CreateTime), st.st_ctime); + out->Attribute =3D mode_to_efi(st.st_mode); + + if (S_ISDIR(st.st_mode)) { + out->Attribute |=3D EFI_FILE_DIRECTORY; + } + + strcpy_to_16(out->FileName, finfo->path); + } else { + return (EFI_UNSUPPORTED); + } + + return (EFI_SUCCESS); +} + +static EFIAPI EFI_STATUS +file_set_info_impl(EFI_FILE_HANDLE File __unused, + EFI_GUID *InformationType __unused, + UINTN BufferSize __unused, VOID *Buffer __unused) +{ + return (EFI_WRITE_PROTECTED); +} + +static EFIAPI EFI_STATUS +file_flush_impl(EFI_FILE_HANDLE File __unused) +{ + return (EFI_SUCCESS); +} + +static EFIAPI EFI_STATUS +open_volume_impl(EFI_FILE_IO_INTERFACE *This, EFI_FILE_HANDLE *Root) +{ + volinfo_t *vinfo =3D (volinfo_t*)(This + 1); + + return do_file_open(vinfo, "", O_RDONLY, Root); +} + +static struct fs_ops* +fs_probe(struct devdesc *dev) +{ + struct open_file f; + int err, i; + + f.f_flags =3D O_RDONLY + 1; + f.f_dev =3D (struct devsw *)0; + f.f_ops =3D (struct fs_ops *)0; + f.f_offset =3D 0; + f.f_devdata =3D dev; + + if ((err =3D dev->d_dev->dv_open(&f, dev)) !=3D 0) { + return NULL; + } + + for (i =3D 0; backend_file_system[i] !=3D NULL; i++) { + f.f_ops =3D backend_file_system[i]; + + if ((err =3D f.f_ops->fo_open("/", &f)) =3D=3D 0) { + return backend_file_system[i]; + } + } + + return NULL; +} + +static EFI_STATUS +make_fs_file_io_iface(struct devdesc *dev, EFI_FILE_IO_INTERFACE **out) +{ + static struct fs_ops* fsops; + EFI_FILE_IO_INTERFACE* fiface; + volinfo_t *vinfo; + + switch (dev->d_type) { +#ifdef EFI_ZFS_BOOT + case DEVT_ZFS: + fsops =3D &zfs_fsops; + break; +#endif + default: + fsops =3D fs_probe(dev); + break; + } + + if (fsops =3D=3D NULL) { + return (EFI_UNSUPPORTED); + } + + fiface =3D malloc(sizeof(EFI_FILE_IO_INTERFACE) + sizeof(volinfo= _t)); + + if (fiface =3D=3D NULL) { + return (EFI_OUT_OF_RESOURCES); + } + + vinfo =3D (volinfo_t*)(fiface + 1); + + fiface->Revision =3D EFI_FILE_IO_INTERFACE_REVISION; + fiface->OpenVolume =3D open_volume_impl; + vinfo->dev =3D dev; + vinfo->fsops =3D fsops; + + *out =3D fiface; + + return (EFI_SUCCESS); +} + +static EFIAPI EFI_STATUS +bind_iface(EFI_HANDLE handle, struct devdesc *dev) +{ + EFI_STATUS status; + EFI_FILE_IO_INTERFACE *iface; + + // Check if there is already a filesystem interface + status =3D BS->OpenProtocol(handle, &SimpleFileSystemProtocolGUI= D, + NULL, IH, handle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL); + + if (!EFI_ERROR(status)) { + return (EFI_ACCESS_DENIED); + } else if (status !=3D EFI_UNSUPPORTED) { + return (status); + } + + status =3D make_fs_file_io_iface(dev, &iface); + + if (EFI_ERROR(status)) { + return (status); + } + + status =3D BS->InstallMultipleProtocolInterfaces(&handle, + &SimpleFileSystemProtocolGUID, iface, NULL); + + if (EFI_ERROR(status)) { + free(iface); + + return (status); + } + + return (status); +} + +static EFIAPI EFI_STATUS +stop_impl(EFI_DRIVER_BINDING *This __unused, EFI_HANDLE ControllerHandle= __unused, + UINTN NumberOfChildren __unused, EFI_HANDLE *ChildHandleBuffer= __unused) +{ + // Get the protocol inteface, uninstall it, and free it + return (EFI_SUCCESS); +} + +#ifdef EFI_ZFS_BOOT +static void +efi_zfs_probe(void) +{ + EFI_HANDLE h; + u_int unit; + int i; + char dname[SPECNAMELEN + 1]; + uint64_t guid; + + unit =3D 0; + h =3D efi_find_handle(&efipart_dev, 0); + for (i =3D 0; h !=3D NULL; h =3D efi_find_handle(&efipart_dev, ++i)) { + snprintf(dname, sizeof(dname), "%s%d:", efipart_dev.dv_name, i); + if (zfs_probe_dev(dname, &guid) =3D=3D 0) { + (void)efi_handle_update_dev(h, &zfs_dev, unit++, guid); + } + } +} +#endif + +static int +backend_parsedev(struct devdesc **dev, const char *devspec, const char *= *path) +{ + struct devdesc *idev; + struct devsw *dv; + char *cp; + const char *np; + int i; + + /* minimum length check */ + if (strlen(devspec) < 2) + return (EINVAL); + + /* look for a device that matches */ + for (i =3D 0; backend_devsw[i] !=3D NULL; i++) { + dv =3D backend_devsw[i]; + if (!strncmp(devspec, dv->dv_name, strlen(dv->dv_name))) + break; + } + if (backend_devsw[i] =3D=3D NULL) { + return (ENOENT); + } + + np =3D devspec + strlen(dv->dv_name); + +#ifdef EFI_ZFS_BOOT + if (dv->dv_type =3D=3D DEVT_ZFS) { + int err; + + idev =3D malloc(sizeof(struct zfs_devdesc)); + if (idev =3D=3D NULL) + return (ENOMEM); + + err =3D zfs_parsedev((struct zfs_devdesc*)idev, np, path); + if (err !=3D 0) { + free(idev); + return (err); + } + *dev =3D idev; + cp =3D strchr(np + 1, ':'); + } else +#endif + { + idev =3D malloc(sizeof(struct devdesc)); + if (idev =3D=3D NULL) + return (ENOMEM); + + idev->d_dev =3D dv; + idev->d_type =3D dv->dv_type; + idev->d_unit =3D -1; + if (*np !=3D '\0' && *np !=3D ':') { + idev->d_unit =3D strtol(np, &cp, 0); + if (cp =3D=3D np) { + idev->d_unit =3D -1; + free(idev); + return (EUNIT); + } + } + } + + if (*cp !=3D '\0' && *cp !=3D ':') { + free(idev); + return (EINVAL); + } + + if (path !=3D NULL) + *path =3D (*cp =3D=3D 0) ? cp : cp + 1; + if (dev !=3D NULL) + *dev =3D idev; + else + free(idev); + return (0); +} + +static int +backend_getdev(void **vdev, const char *devspec, const char **path) +{ + struct devdesc **dev =3D (struct devdesc **)vdev; + int rv; + + /* + * If it looks like this is just a path and no device, then + * use the current device instead. + */ + if (devspec =3D=3D NULL || *devspec =3D=3D '/' || !strchr(devspec, ':')= ) { + rv =3D backend_parsedev(dev, getenv("currdev"), NULL); + if (rv =3D=3D 0 && path !=3D NULL) + *path =3D devspec; + return (rv); + } + + /* Parse the device name off the beginning of the devspec. */ + return (backend_parsedev(dev, devspec, path)); +} + +static void +init(void) +{ + EFI_HANDLE h; + EFI_STATUS status; + u_int unit; + int i; + struct devsw *dev; + uint64_t pool_guid; + int (*old_getdev)(void **, const char *, const char **) =3D + archsw.arch_getdev; + + archsw.arch_getdev =3D backend_getdev; +#ifdef EFI_ZFS_BOOT + /* Note this needs to be set before ZFS init. */ + archsw.arch_zfs_probe =3D efi_zfs_probe; +#endif + + /* Initialize all the backend drivers */ + for (i =3D 0; backend_devsw[i] !=3D NULL; i++) { + if (backend_devsw[i]->dv_init !=3D NULL) + (backend_devsw[i]->dv_init)(); + } + + /* Attach SIMPLE_FILE_SYSTEM interfaces to all efipart devices *= / + unit =3D 0; + h =3D efi_find_handle(&efipart_dev, 0); + for (i =3D 0; h !=3D NULL; h =3D efi_find_handle(&efipart_dev, ++i)) { + struct devdesc *currdev; + + currdev =3D malloc(sizeof(struct devdesc)); + + if (currdev =3D=3D NULL) { + continue; + } + + if (efi_handle_lookup(h, &dev, &unit, &pool_guid) !=3D 0= ) { + free(currdev); + continue; + } + + currdev->d_dev =3D dev; + currdev->d_unit =3D unit; + currdev->d_opendata =3D NULL; + currdev->d_type =3D currdev->d_dev->dv_type; + + status =3D bind_iface(h, currdev); + + if (EFI_ERROR(status) && status !=3D EFI_UNSUPPORTED && + status !=3D EFI_ACCESS_DENIED) { + printf("Failed to attach filesystem interface t= o efipart%u (%ld)\n", + unit, EFI_ERROR_CODE(status)); + free(currdev); + } + } + + /* Attach SIMPLE_FILE_SYSTEM interface to all ZFS devices */ +#ifdef EFI_ZFS_BOOT + unit =3D 0; + h =3D efi_find_handle(&zfs_dev, 0); + for (i =3D 0; h !=3D NULL; h =3D efi_find_handle(&zfs_dev, ++i)) { + struct zfs_devdesc *currdev; + + currdev =3D malloc(sizeof(struct zfs_devdesc)); + + if (currdev =3D=3D NULL) { + continue; + } + + if (efi_handle_lookup(h, &dev, &unit, &pool_guid) !=3D 0= ) { + free(currdev); + continue; + } + + currdev->d_dev =3D dev; + currdev->d_unit =3D unit; + currdev->d_opendata =3D NULL; + currdev->d_type =3D currdev->d_dev->dv_type; + currdev->pool_guid =3D pool_guid; + currdev->root_guid =3D 0; + + status =3D bind_iface(h, (struct devdesc*)currdev); + + if (EFI_ERROR(status)) { + printf("Failed to attach filesystem interface to zfs%u= (%ld)\n", + unit, EFI_ERROR_CODE(status)); + } + } +#endif + archsw.arch_getdev =3D old_getdev; +} + +const efi_driver_t fs_driver =3D +{ + .name =3D "FS Backend", + .init =3D init, +}; diff --git a/sys/boot/efi/include/efilib.h b/sys/boot/efi/include/efilib.= h index 09ccc2f..15d4b48 100644 --- a/sys/boot/efi/include/efilib.h +++ b/sys/boot/efi/include/efilib.h @@ -31,22 +31,26 @@ #define _LOADER_EFILIB_H =20 #include +#include =20 extern EFI_HANDLE IH; -extern EFI_SYSTEM_TABLE *ST; +extern EFI_SYSTEM_TABLE *ST; extern EFI_BOOT_SERVICES *BS; extern EFI_RUNTIME_SERVICES *RS; =20 -extern struct devsw efipart_dev; +extern struct devsw efifs_dev; extern struct devsw efinet_dev; +extern struct fs_ops efifs_fsops; extern struct netif_driver efinetif; =20 void *efi_get_table(EFI_GUID *tbl); =20 int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int= ); +int efi_register_handle(struct devsw *, EFI_HANDLE, EFI_HANDLE); EFI_HANDLE efi_find_handle(struct devsw *, int); int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *, uint64_t *); int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t); +int efi_handle_remove_dev(EFI_HANDLE); =20 EFI_DEVICE_PATH *efi_lookup_image_devpath(EFI_HANDLE); EFI_DEVICE_PATH *efi_lookup_devpath(EFI_HANDLE); @@ -57,6 +61,7 @@ CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); =20 int efi_status_to_errno(EFI_STATUS); +EFI_STATUS errno_to_efi_status(int errno); =20 void efi_time_init(void); void efi_time_fini(void); @@ -65,4 +70,7 @@ EFI_STATUS main(int argc, CHAR16 *argv[]); void exit(EFI_STATUS status); void delay(int usecs); =20 +time_t from_efi_time(EFI_TIME *efi_time); +void to_efi_time(EFI_TIME *efi_time, time_t time); + #endif /* _LOADER_EFILIB_H */ diff --git a/sys/boot/efi/include/efiprot.h b/sys/boot/efi/include/efipro= t.h index 28cec59..2221577 100644 --- a/sys/boot/efi/include/efiprot.h +++ b/sys/boot/efi/include/efiprot.h @@ -27,6 +27,8 @@ Revision History =20 --*/ =20 +#include + // // Device Path protocol // @@ -307,9 +309,9 @@ typedef struct { // // The FileName field of the EFI_FILE_INFO data structure is variable le= ngth. // Whenever code needs to know the size of the EFI_FILE_INFO data struct= ure, it needs to -// be the size of the data structure without the FileName field. The fo= llowing macro=20 +// be the size of the data structure without the FileName field. The fo= llowing macro // computes this size correctly no matter how big the FileName array is = declared. -// This is required to make the EFI_FILE_INFO data structure ANSI compil= ant.=20 +// This is required to make the EFI_FILE_INFO data structure ANSI compil= ant. // =20 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName) @@ -329,9 +331,9 @@ typedef struct { // // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is v= ariable length. // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data= structure, it needs -// to be the size of the data structure without the VolumeLable field. = The following macro=20 +// to be the size of the data structure without the VolumeLable field. = The following macro // computes this size correctly no matter how big the VolumeLable array = is declared. -// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI= compilant.=20 +// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI= compilant. // =20 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_IN= FO,VolumeLabel) @@ -411,7 +413,7 @@ typedef struct { EFI_DEVICE_IO Write; } EFI_IO_ACCESS; =20 -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_PCI_DEVICE_PATH) ( IN struct _EFI_DEVICE_IO_INTERFACE *This, @@ -555,4 +557,47 @@ typedef struct _EFI_UNICODE_COLLATION_INTERFACE { CHAR8 *SupportedLanguages; } EFI_UNICODE_COLLATION_INTERFACE; =20 +// +// Driver Binding protocol +// + +#define DRIVER_BINDING_PROTOCOL \ + { 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0x0c, 0x09, 0x26, 0x1e, 0x9= f, 0x71} } + +INTERFACE_DECL(_EFI_DRIVER_BINDING); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) ( + IN struct _EFI_DRIVER_BINDING *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH *RemainingPath + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_BINDING_START) ( + IN struct _EFI_DRIVER_BINDING *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH *RemainingPath + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_BINDING_STOP) ( + IN struct _EFI_DRIVER_BINDING *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ); + +typedef struct _EFI_DRIVER_BINDING { + EFI_DRIVER_BINDING_SUPPORTED Supported; + EFI_DRIVER_BINDING_START Start; + EFI_DRIVER_BINDING_STOP Stop; + UINT32 Version; + EFI_HANDLE ImageHandle; + EFI_HANDLE DriverBindingHandle; +} EFI_DRIVER_BINDING; + #endif diff --git a/sys/boot/efi/include/string16.h b/sys/boot/efi/include/strin= g16.h new file mode 100644 index 0000000..5e4f9c1 --- /dev/null +++ b/sys/boot/efi/include/string16.h @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in th= e + * documentation and/or other materials provided with the distributio= n. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _STRING16_H_ +#define _STRING16_H_ + +#include +#include + +/* + * These are 16-bit variants of string,h functions for use with EFI code= =2E + */ + +extern size_t strlen16(const CHAR16 *str); +extern CHAR16* strcpy16(CHAR16 *dst, const CHAR16 *src); +extern CHAR16* stpcpy16(CHAR16 *dst, const CHAR16 *src); +extern CHAR16* strcpy_to_16(CHAR16 *dst, const char *src); +extern char* strcpy_from_16(char *dst, const CHAR16 *src); + +#endif diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile index d9619be..8684403 100644 --- a/sys/boot/efi/libefi/Makefile +++ b/sys/boot/efi/libefi/Makefile @@ -10,8 +10,8 @@ LIB=3D efi INTERNALLIB=3D WARNS?=3D 2 =20 -SRCS=3D delay.c devpath.c efi_console.c efinet.c efipart.c errno.c \ - handles.c libefi.c +SRCS=3D delay.c devpath.c efi_console.c efifs.c efinet.c env.c errno.c \= + handles.c libefi.c string16.c =20 .if ${MACHINE_CPUARCH} =3D=3D "amd64" || ${MACHINE_CPUARCH} =3D=3D "i386= " SRCS+=3D time.c diff --git a/sys/boot/efi/libefi/efifs.c b/sys/boot/efi/libefi/efifs.c new file mode 100644 index 0000000..dd9fb0f --- /dev/null +++ b/sys/boot/efi/libefi/efifs.c @@ -0,0 +1,464 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in th= e + * documentation and/or other materials provided with the distributio= n. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include + +static EFI_GUID FileInfoGUID =3D EFI_FILE_INFO_ID;; +static EFI_GUID SimpleFileSystemProtocolGUID =3D SIMPLE_FILE_SYSTEM_PROT= OCOL; +static EFI_GUID BlockIoProtocolGUID =3D BLOCK_IO_PROTOCOL; +static EFI_GUID DevicePathGUID =3D DEVICE_PATH_PROTOCOL; + +static int efifs_open(const char *path, struct open_file *f); +static int efifs_write(struct open_file *f, void *buf, size_t size, size= _t *resid); +static int efifs_close(struct open_file *f); +static int efifs_read(struct open_file *f, void *buf, size_t size, size_= t *resid); +static off_t efifs_seek(struct open_file *f, off_t offset, int where); +static int efifs_stat(struct open_file *f, struct stat *sb); +static int efifs_readdir(struct open_file *f, struct dirent *d); + +static int efifs_dev_init(void); +static int efifs_dev_strategy(void *, int, daddr_t, size_t, size_t, char= *, size_t *); +static int efifs_dev_open(struct open_file *, ...); +static int efifs_dev_close(struct open_file *); +static int efifs_dev_print(int); + +struct devsw efifs_dev =3D { + .dv_name =3D "EFI", + .dv_type =3D DEVT_EFI, + .dv_init =3D efifs_dev_init, + .dv_strategy =3D efifs_dev_strategy, + .dv_open =3D efifs_dev_open, + .dv_close =3D efifs_dev_close, + .dv_ioctl =3D noioctl, + .dv_print =3D efifs_dev_print, + .dv_cleanup =3D NULL +}; + +struct fs_ops efifs_fsops =3D { + "EFI", + efifs_open, + efifs_close, + efifs_read, + efifs_write, + efifs_seek, + efifs_stat, + efifs_readdir +}; + +static int +efifs_dev_init(void) +{ + EFI_HANDLE *hin; + EFI_STATUS status; + UINTN sz; + u_int n, nin, unit; + int err; + + sz =3D 0; + hin =3D NULL; + status =3D BS->LocateHandle(ByProtocol, &SimpleFileSystemProtocolGUID, + 0, &sz, 0); + if (status =3D=3D EFI_BUFFER_TOO_SMALL) { + hin =3D (EFI_HANDLE *)malloc(sz); + status =3D BS->LocateHandle(ByProtocol, + &SimpleFileSystemProtocolGUID, 0, &sz, hin); + if (EFI_ERROR(status)) + free(hin); + } + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + /* Filter handles to only include FreeBSD partitions. */ + nin =3D sz / sizeof(EFI_HANDLE); + unit =3D 0; + + for (n =3D 0; n < nin; n++) { + status =3D BS->OpenProtocol(hin[n], &SimpleFileSystemProtocolGUID, + NULL, IH, NULL, + EFI_OPEN_PROTOCOL_TEST_PROTOCO= L); + if (EFI_ERROR(status)) + continue; + + efi_handle_update_dev(hin[n], &efifs_dev, unit++, 0); + } + + free(hin); + return (err); +} + + +static int +efifs_dev_print(int verbose) +{ + char line[80]; + EFI_DEVICE_PATH *devpath; + EFI_BLOCK_IO *blkio; + EFI_HANDLE h, *hin; + EFI_STATUS status; + u_int unit, n; + + for (unit =3D 0, h =3D efi_find_handle(&efifs_dev, 0); + h !=3D NULL; h =3D efi_find_handle(&efifs_dev, ++unit)) { + sprintf(line, " %s%d:", efifs_dev.dv_name, unit); + pager_output(line); + pager_output(" EFI(SIMPLE_FILE_SYSTEM"); + + status =3D BS->HandleProtocol(hin[n], &DevicePathGUID, + (void **)&devpath); + if (!EFI_ERROR(status)) { + pager_output(", DEVICE_PATH"); + } + + status =3D BS->HandleProtocol(hin[n], &BlockIoProtocolGUID, + (void **)&blkio); + if (!EFI_ERROR(status)) { + pager_output(", BLOCK_IO"); + } + pager_output(")\n"); + } + return (0); +} + +static int +efifs_dev_open(struct open_file *f, ...) +{ + va_list args; + struct devdesc *dev; + EFI_FILE_IO_INTERFACE *fsiface; + EFI_HANDLE h; + EFI_STATUS status; + + va_start(args, f); + dev =3D va_arg(args, struct devdesc*); + va_end(args); + + h =3D efi_find_handle(&efifs_dev, dev->d_unit); + + if (h =3D=3D NULL) + return (EINVAL); + + status =3D BS->OpenProtocol(h, &SimpleFileSystemProtocolGUID, + (void**)&fsiface, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);= + + if (EFI_ERROR(status)) { + return (efi_status_to_errno(status)); + } + + dev->d_opendata =3D fsiface; + return (0); +} + +static int +efifs_dev_close(struct open_file *f) +{ + struct devdesc *dev; + EFI_HANDLE h; + EFI_STATUS status; + + dev =3D (struct devdesc *)(f->f_devdata); + h =3D efi_find_handle(&efifs_dev, dev->d_unit); + + if (h =3D=3D NULL) + return (EINVAL); + + if (dev->d_opendata =3D=3D NULL) + return (EINVAL); + + status =3D BS->CloseProtocol(h, &SimpleFileSystemProtocolGUID, I= H, NULL); + + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + dev->d_opendata =3D NULL; + return (0); +} + + +/* Raw I/O isn't supported on EFI FS devices, as they talk through + * SIMPLE_FILE_SYSTEM_INTERFACE. + */ +static int +efifs_dev_strategy(void *devdata __unused, int rw __unused, daddr_t blk = __unused, + size_t offset, size_t size __unused, char *buf __unus= ed, + size_t *rsize __unused) +{ + printf("Raw I/O not supported on EFI FS interface\n"); + return ENOTSUP; +} + +/* + * Open a file. + */ +static int +efifs_open(const char *upath, struct open_file *f) +{ + struct devdesc *dev; + EFI_FILE_IO_INTERFACE *fsiface; + EFI_FILE_HANDLE root; + EFI_STATUS status; + CHAR16 path[strlen(upath) + 1]; + + dev =3D (struct devdesc *)(f->f_devdata); + fsiface =3D dev->d_opendata; + + if (!strcmp(upath, "") || !strcmp(upath, "/")) { + return (fsiface->OpenVolume(fsiface, + (EFI_FILE_HANDLE*)&(f->f_fsd= ata))); + } else { + status =3D fsiface->OpenVolume(fsiface, &root); + + if (EFI_ERROR(status)) { + return (efi_status_to_errno(status)); + } + + strcpy_to_16(path, upath); + status =3D root->Open(root, (EFI_FILE_HANDLE*)&(f->f_fsd= ata), path, + EFI_FILE_MODE_READ, 0); + + root->Close(root); + + if (EFI_ERROR(status)) { + return (efi_status_to_errno(status)); + } + + return 0; + } +} + +static int +efifs_close(struct open_file *f) +{ + EFI_FILE_HANDLE file =3D (EFI_FILE_HANDLE)f->f_fsdata; + EFI_STATUS status; + + status =3D file->Close(file); + + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + return (0); +} + +static int +efifs_read(struct open_file *f, void *start, size_t size, size_t *resid = /* out */) +{ + EFI_FILE_HANDLE file =3D (EFI_FILE_HANDLE)f->f_fsdata; + UINTN readsize =3D size; + EFI_STATUS status; + + status =3D file->Read(file, &readsize, start); + + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + if (resid) + *resid =3D size - readsize; + + return (0); +} + +static int +efifs_write(struct open_file *f, void *start, size_t size, + size_t *resid /* out */) +{ + EFI_FILE_HANDLE file =3D (EFI_FILE_HANDLE)f->f_fsdata; + UINTN writesize =3D size; + EFI_STATUS status; + + status =3D file->Write(file, &writesize, start); + + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + if (resid) + *resid =3D size - writesize; + + return (0); +} + +static off_t +efifs_seek(struct open_file *f, off_t offset, int where) +{ + EFI_FILE_HANDLE file =3D (EFI_FILE_HANDLE)f->f_fsdata; + UINT64 pos; + EFI_STATUS status; + + switch (where) { + case SEEK_SET: + status =3D file->SetPosition(file, offset); + + if (status !=3D EFI_SUCCESS) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + break; + case SEEK_CUR: + status =3D file->GetPosition(file, &pos); + + if (status !=3D EFI_SUCCESS) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + status =3D file->SetPosition(file, pos + offset); + + if (status !=3D EFI_SUCCESS) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + break; + case SEEK_END: + status =3D file->SetPosition(file, 0xffffffffffffffff); + + if (status !=3D EFI_SUCCESS) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + default: + errno =3D EINVAL; + return (-1); + } + + status =3D file->GetPosition(file, &pos); + + if (status !=3D EFI_SUCCESS) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + return (pos); +} + +/* SIMPLE_FILE_SYSTEM_PROTOCOL is geared towards FAT, so we can't + * reproduce stat with absolute fidelity. + */ +static int +efifs_stat(struct open_file *f, struct stat *sb) +{ + EFI_FILE_HANDLE file; + UINTN size =3D 0; + EFI_FILE_INFO *finfo;; + EFI_STATUS status; + + file =3D (EFI_FILE_HANDLE)f->f_fsdata; + status =3D file->GetInfo(file, &FileInfoGUID, &size, NULL); + + if (status !=3D EFI_BUFFER_TOO_SMALL) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + finfo =3D malloc(size); + status =3D file->GetInfo(file, &FileInfoGUID, &size, finfo); + + if (status !=3D EFI_SUCCESS) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + /* We can't properly fill these in... */ + sb->st_ino =3D 0; + sb->st_nlink =3D 0; + sb->st_uid =3D 0; + sb->st_gid =3D 0; + sb->st_blksize =3D 512; + /* Build the mode field */ + if (finfo->Attribute & EFI_FILE_DIRECTORY) { + sb->st_mode =3D S_IFDIR; + } else { + sb->st_mode =3D S_IFREG; + } + + if (finfo->Attribute & EFI_FILE_MODE_READ) { + sb->st_mode =3D S_IRUSR | S_IXUSR | S_IRGRP | + S_IXGRP | S_IROTH | S_IXOTH; + } + + if (finfo->Attribute & EFI_FILE_MODE_READ) { + sb->st_mode =3D S_IWUSR | S_IWGRP | S_IWOTH; + } + /* This may or may not be supported, depending on the FS driver = */ + sb->st_blocks =3D finfo->PhysicalSize / 512; + /* These fields we can get right */ + sb->st_size =3D finfo->FileSize; + sb->st_atime =3D from_efi_time(&(finfo->LastAccessTime)); + sb->st_mtime =3D from_efi_time(&(finfo->ModificationTime)); + sb->st_ctime =3D from_efi_time(&(finfo->CreateTime)); + + free(finfo); + + return (0); +} + +static int +efifs_readdir(struct open_file *f, struct dirent *d) +{ + EFI_FILE_HANDLE file; + UINTN size =3D 0; + EFI_FILE_INFO *finfo;; + EFI_STATUS status; + + file =3D (EFI_FILE_HANDLE)f->f_fsdata; + status =3D file->Read(file, &size, NULL); + + if (status !=3D EFI_BUFFER_TOO_SMALL) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + if (size =3D=3D 0) { + return (ENOENT); + } + + finfo =3D malloc(size); + status =3D file->Read(file, &size, finfo); + + if (status !=3D EFI_SUCCESS) { + errno =3D (efi_status_to_errno(status)); + return -1; + } + + strcpy_from_16(d->d_name, finfo->FileName); + d->d_namlen =3D strlen(d->d_name); + d->d_reclen =3D sizeof(struct dirent); + /* We can't faithfully reproduce this due to the limitations + * of the SIMPLE_FILE_SYSTEM interface */ + d->d_fileno =3D 0; + + free(finfo); + + return (0); +} diff --git a/sys/boot/efi/libefi/errno.c b/sys/boot/efi/libefi/errno.c index fac903f..0f354c3 100644 --- a/sys/boot/efi/libefi/errno.c +++ b/sys/boot/efi/libefi/errno.c @@ -30,6 +30,69 @@ __FBSDID("$FreeBSD$"); #include #include =20 +EFI_STATUS +errno_to_efi_status(int errno) +{ + EFI_STATUS status; + + switch (errno) { + case EPERM: + status =3D EFI_ACCESS_DENIED; + break; + + case EOVERFLOW: + status =3D EFI_BUFFER_TOO_SMALL; + break; + + case EIO: + status =3D EFI_DEVICE_ERROR; + break; + + case EINVAL: + status =3D EFI_INVALID_PARAMETER; + break; + + case ESTALE: + status =3D EFI_MEDIA_CHANGED; + break; + + case ENXIO: + status =3D EFI_NO_MEDIA; + break; + + case ENOENT: + status =3D EFI_NOT_FOUND; + break; + + case ENOMEM: + status =3D EFI_OUT_OF_RESOURCES; + break; + + case ENOTSUP: + case ENODEV: + status =3D EFI_UNSUPPORTED; + break; + + case ENOSPC: + status =3D EFI_VOLUME_FULL; + break; + + case EACCES: + status =3D EFI_WRITE_PROTECTED; + break; + + case 0: + status =3D EFI_SUCCESS; + break; + + default: + status =3D EFI_DEVICE_ERROR; + break; + } + + return (status); +} + int efi_status_to_errno(EFI_STATUS status) { diff --git a/sys/boot/efi/libefi/handles.c b/sys/boot/efi/libefi/handles.= c index 1e4ef6f..c118085 100644 --- a/sys/boot/efi/libefi/handles.c +++ b/sys/boot/efi/libefi/handles.c @@ -41,21 +41,36 @@ struct entry { struct entry *entry; int nentries; =20 +static int +get_next_unit(struct devsw *sw) +{ + int i, idx; + + for (i =3D 0, idx =3D 0; i < nentries; i++) { + if (entry[i].dev =3D=3D sw) { + idx++; + } + } + + return (idx); +} + int efi_register_handles(struct devsw *sw, EFI_HANDLE *handles, EFI_HANDLE *aliases, int count) { size_t sz; - int idx, unit; + int idx, unit, i; =20 idx =3D nentries; nentries +=3D count; sz =3D nentries * sizeof(struct entry); + unit =3D get_next_unit(sw); entry =3D (entry =3D=3D NULL) ? malloc(sz) : realloc(entry, sz); - for (unit =3D 0; idx < nentries; idx++, unit++) { - entry[idx].handle =3D handles[unit]; + for (i =3D 0; idx < nentries; idx++, unit++, i++) { + entry[idx].handle =3D handles[i]; if (aliases !=3D NULL) - entry[idx].alias =3D aliases[unit]; + entry[idx].alias =3D aliases[i]; else entry[idx].alias =3D NULL; entry[idx].dev =3D sw; @@ -64,6 +79,16 @@ efi_register_handles(struct devsw *sw, EFI_HANDLE *han= dles, return (0); } =20 +int +efi_register_handle(struct devsw *sw, EFI_HANDLE handle, EFI_HANDLE alia= s) +{ + if (alias =3D=3D NULL) { + return efi_register_handles(sw, &handle, NULL, 1); + } else { + return efi_register_handles(sw, &handle, &alias, 1); + } +} + EFI_HANDLE efi_find_handle(struct devsw *dev, int unit) { @@ -116,3 +141,29 @@ efi_handle_update_dev(EFI_HANDLE h, struct devsw *de= v, int unit, =20 return (ENOENT); } + +int +efi_handle_remove_dev(EFI_HANDLE h) +{ + int idx; + + /* Find the entry */ + for (idx =3D 0; idx < nentries; idx++) { + if (entry[idx].handle !=3D h) + continue; + } + + if (idx >=3D nentries) + return (ENOENT); + else if (idx =3D=3D nentries - 1) { + nentries--; + entry =3D realloc(entry, nentries * sizeof(struct entry)= ); + } else { + memcpy(entry + idx, entry + idx + 1, + sizeof(struct entry) * (nentries - (idx + 1))); + nentries--; + entry =3D realloc(entry, nentries * sizeof(struct entry)= ); + } + + return (0); +} diff --git a/sys/boot/efi/libefi/string16.c b/sys/boot/efi/libefi/string1= 6.c new file mode 100644 index 0000000..299d72d --- /dev/null +++ b/sys/boot/efi/libefi/string16.c @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in th= e + * documentation and/or other materials provided with the distributio= n. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE= + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)= + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "string16.h" +#include + +size_t +strlen16(const CHAR16 *str) +{ + size_t i; + + for (i =3D 0; str[i] !=3D 0; i++); + + return i; +} + +CHAR16 * +strcpy16(CHAR16 *dst, const CHAR16 *src) +{ + stpcpy16(dst, src); + + return (dst); +} + +CHAR16 * +stpcpy16(CHAR16 *dst, const CHAR16 *src) +{ + for (; *src !=3D 0; src++, dst++) { + *dst =3D *src; + } + + *dst =3D *src; + + return dst; +} + +char * +strcpy_from_16(char *dst, const CHAR16 *src) +{ + int i; + + for (i =3D 0; src[i] !=3D 0; i++) { + dst[i] =3D src[i]; + } + + dst[i] =3D 0; + + return (dst); +} + +CHAR16 * +strcpy_to_16(CHAR16 *dst, const char *src) +{ + int i; + + for (i =3D 0; src[i] !=3D 0; i++) { + dst[i] =3D src[i]; + } + + dst[i] =3D 0; + + return (dst); +} diff --git a/sys/boot/efi/libefi/time.c b/sys/boot/efi/libefi/time.c index 99831e1..2df466e 100644 --- a/sys/boot/efi/libefi/time.c +++ b/sys/boot/efi/libefi/time.c @@ -2,28 +2,28 @@ * Copyright (c) 1999, 2000 * Intel Corporation. * All rights reserved. - *=20 + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - *=20 + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - *=20 + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in th= e * documentation and/or other materials provided with the distributio= n. - *=20 + * * 3. All advertising materials mentioning features or use of this softw= are * must display the following acknowledgement: - *=20 + * * This product includes software developed by Intel Corporation and * its contributors. - *=20 + * * 4. Neither the name of Intel Corporation or its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. - *=20 + * * THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION AND CONTRIBUTORS ``AS = IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,= THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE @@ -35,7 +35,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS= E) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O= F * THE POSSIBILITY OF SUCH DAMAGE. - *=20 + * */ =20 #include @@ -58,6 +58,41 @@ __FBSDID("$FreeBSD$"); #define SECSPERHOUR ( 60*60 ) #define SECSPERDAY (24 * SECSPERHOUR) =20 +/* +// These arrays give the cumulative number of days up to the first of t= he +// month number used as the index (1 -> 12) for regular and leap years.= +// The value at index 13 is for the whole year. +*/ +static const time_t CumulativeDays[2][14] =3D { + {0, + 0, + 31, + 31 + 28, + 31 + 28 + 31, + 31 + 28 + 31 + 30, + 31 + 28 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }, + {0, + 0, + 31, + 31 + 29, + 31 + 29 + 31, + 31 + 29 + 31 + 30, + 31 + 29 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }}; + void efi_time_init(void) { @@ -68,45 +103,46 @@ efi_time_fini(void) { } =20 -static time_t -efi_time(EFI_TIME *ETime) +void +to_efi_time(EFI_TIME *efi_time, time_t time) { - /* - // These arrays give the cumulative number of days up to the first = of the - // month number used as the index (1 -> 12) for regular and leap ye= ars. - // The value at index 13 is for the whole year. - */ - static time_t CumulativeDays[2][14] =3D { - {0, - 0, - 31, - 31 + 28, - 31 + 28 + 31, - 31 + 28 + 31 + 30, - 31 + 28 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }, - {0, - 0, - 31, - 31 + 29, - 31 + 29 + 31, - 31 + 29 + 31 + 30, - 31 + 29 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }}; - - time_t UTime;=20 + if (time >=3D 0) { + for (efi_time->Year =3D 1970; + time > CumulativeDays[isleap(efi_time->Year)][13] * = SECSPERDAY; + time -=3D CumulativeDays[isleap(efi_time->Year)][13]= * SECSPERDAY, + efi_time->Year++); + + for (efi_time->Month =3D 0; + time > CumulativeDays[isleap(efi_time->Year)][efi_ti= me->Month] * + SECSPERDAY; + efi_time->Month++); + + time -=3D CumulativeDays[isleap(efi_time->Year)][efi_tim= e->Month - 1] * + SECSPERDAY; + + for (efi_time->Day =3D 0; time > SECSPERDAY; + time -=3D SECSPERDAY, efi_time->Day++); + + for (efi_time->Hour =3D 0; time > SECSPERHOUR; + time -=3D SECSPERHOUR, efi_time->Hour++); + + for (efi_time->Minute =3D 0; time > 60; + time -=3D 60, efi_time->Minute++); + + efi_time->Second =3D time; + efi_time->Nanosecond =3D 0; + efi_time->TimeZone =3D 0; + efi_time->Daylight =3D 0; + } else { + memset(efi_time, 0, sizeof(EFI_TIME)); + } +} + +time_t +from_efi_time(EFI_TIME *ETime) +{ + + time_t UTime; int Year; =20 /* @@ -134,7 +170,7 @@ efi_time(EFI_TIME *ETime) /* // UTime should now be set to 00:00:00 on Jan 1 of the file's year. // - // Months =20 + // Months */ UTime +=3D (CumulativeDays[isleap(ETime->Year)][ETime->Month] * SECS= PERDAY); =20 @@ -170,7 +206,7 @@ efi_time(EFI_TIME *ETime) */ UTime +=3D (ETime->TimeZone * 60); } - =20 + return UTime; } =20 @@ -196,7 +232,7 @@ EFI_GetTimeOfDay( // Convert to UNIX time (ie seconds since the epoch */ =20 - tp->tv_sec =3D efi_time( &EfiTime ); + tp->tv_sec =3D from_efi_time( &EfiTime ); tp->tv_usec =3D 0; /* EfiTime.Nanosecond * 1000; */ =20 /* @@ -221,7 +257,7 @@ time(time_t *tloc) { struct timeval tv; EFI_GetTimeOfDay(&tv, 0); -=09 + if (tloc) *tloc =3D tv.tv_sec; return tv.tv_sec; diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile index d9d3532..300c65b 100644 --- a/sys/boot/efi/loader/Makefile +++ b/sys/boot/efi/loader/Makefile @@ -50,6 +50,7 @@ CWARNFLAGS.main.c+=3D -Wno-format CFLAGS+=3D -I${.CURDIR} CFLAGS+=3D -I${.CURDIR}/arch/${MACHINE} CFLAGS+=3D -I${.CURDIR}/../include +CFLAGS+=3D -I${.CURDIR}/../drivers CFLAGS+=3D -I${.CURDIR}/../include/${MACHINE} CFLAGS+=3D -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+=3D -I${.CURDIR}/../../.. @@ -68,6 +69,8 @@ CFLAGS+=3D -DNO_PCI -DEFI LIBSTAND=3D ${.OBJDIR}/../../../../lib/libstand/libstand.a .endif =20 +LIBEFI_DRIVERS=3D ${.OBJDIR}/../drivers/libefi_drivers.a + .if !defined(BOOT_HIDE_SERIAL_NUMBERS) # Export serial numbers, UUID, and asset tag from loader. CFLAGS+=3D -DSMBIOS_SERIAL_NUMBERS @@ -150,9 +153,10 @@ loader.efi: ${PROG} =20 LIBEFI=3D ${.OBJDIR}/../libefi/libefi.a =20 -DPADD=3D ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} \ - ${LDSCRIPT} -LDADD=3D ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} +DPADD=3D ${LIBFICL} ${LIBEFI} ${LIBEFI_DRIVERS} ${LIBFDT} ${LIBEFI_FDT}= \ + ${LIBSTAND} ${LDSCRIPT} +LDADD=3D ${LIBFICL} ${LIBEFI} ${LIBEFI_DRIVERS} ${LIBFDT} ${LIBEFI_FDT}= \ + ${LIBSTAND} =20 .include =20 diff --git a/sys/boot/efi/loader/conf.c b/sys/boot/efi/loader/conf.c index 3596a63..56733ff 100644 --- a/sys/boot/efi/loader/conf.c +++ b/sys/boot/efi/loader/conf.c @@ -31,30 +31,22 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef EFI_ZFS_BOOT -#include -#endif + +#include "efi_drivers.h" + +const efi_driver_t *efi_drivers[] =3D { + &fs_driver, + NULL +}; =20 struct devsw *devsw[] =3D { - &efipart_dev, + &efifs_dev, &efinet_dev, -#ifdef EFI_ZFS_BOOT - &zfs_dev, -#endif NULL }; =20 struct fs_ops *file_system[] =3D { -#ifdef EFI_ZFS_BOOT - &zfs_fsops, -#endif - &dosfs_fsops, - &ufs_fsops, - &cd9660_fsops, - &tftp_fsops, - &nfs_fsops, - &gzipfs_fsops, - &bzipfs_fsops, + &efifs_fsops, NULL }; =20 diff --git a/sys/boot/efi/loader/loader_efi.h b/sys/boot/efi/loader/loade= r_efi.h index ee7c4bb..dbd36bf 100644 --- a/sys/boot/efi/loader/loader_efi.h +++ b/sys/boot/efi/loader/loader_efi.h @@ -33,6 +33,10 @@ =20 #include =20 +#include "efi_drivers.h" + +extern const efi_driver_t *efi_drivers[]; + int efi_autoload(void); =20 int efi_getdev(void **vdev, const char *devspec, const char **path); diff --git a/sys/boot/efi/loader/main.c b/sys/boot/efi/loader/main.c index b97f2af..42e3ebe1 100644 --- a/sys/boot/efi/loader/main.c +++ b/sys/boot/efi/loader/main.c @@ -87,10 +87,6 @@ EFI_GUID debugimg =3D DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb =3D FDT_TABLE_GUID; EFI_GUID inputid =3D SIMPLE_TEXT_INPUT_PROTOCOL; =20 -#ifdef EFI_ZFS_BOOT -static void efi_zfs_probe(void); -#endif - /* * cpy8to16 copies a traditional C string into a CHAR16 string and * 0 terminates it. len is the size of *dst in bytes. @@ -125,7 +121,7 @@ has_keyboard(void) EFI_HANDLE *hin, *hin_end, *walker; UINTN sz; int retval =3D 0; -=09 + /* * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and= * do the typical dance to get the right sized buffer. @@ -182,7 +178,7 @@ has_keyboard(void) } else if (DevicePathType(path) =3D=3D MESSAGING_DEVICE_PATH && DevicePathSubType(path) =3D=3D MSG_USB_CLASS_DP) { USB_CLASS_DEVICE_PATH *usb; - =20 + usb =3D (USB_CLASS_DEVICE_PATH *)(void *)path; if (usb->DeviceClass =3D=3D 3 && /* HID */ usb->DeviceSubClass =3D=3D 1 && /* Boot devices */ @@ -263,10 +259,6 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyin =3D efi_copyin; archsw.arch_copyout =3D efi_copyout; archsw.arch_readin =3D efi_readin; -#ifdef EFI_ZFS_BOOT - /* Note this needs to be set before ZFS init. */ - archsw.arch_zfs_probe =3D efi_zfs_probe; -#endif =20 /* Init the time source */ efi_time_init(); @@ -391,6 +383,10 @@ main(int argc, CHAR16 *argv[]) /* * March through the device switch probing for things. */ + for (i =3D 0; efi_drivers[i] !=3D NULL; i++) + if (efi_drivers[i]->init !=3D NULL) + (efi_drivers[i]->init)(); + for (i =3D 0; devsw[i] !=3D NULL; i++) if (devsw[i]->dv_init !=3D NULL) (devsw[i]->dv_init)(); @@ -427,6 +423,7 @@ main(int argc, CHAR16 *argv[]) if (find_currdev(img, &dev, &unit, &pool_guid) !=3D 0) return (EFI_NOT_FOUND); =20 + printf("Found efi device under %s\n", dev->dv_name); switch (dev->dv_type) { #ifdef EFI_ZFS_BOOT case DEVT_ZFS: { @@ -1093,23 +1090,3 @@ command_fdt(int argc, char *argv[]) =20 COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt); #endif - -#ifdef EFI_ZFS_BOOT -static void -efi_zfs_probe(void) -{ - EFI_HANDLE h; - u_int unit; - int i; - char dname[SPECNAMELEN + 1]; - uint64_t guid; - - unit =3D 0; - h =3D efi_find_handle(&efipart_dev, 0); - for (i =3D 0; h !=3D NULL; h =3D efi_find_handle(&efipart_dev, ++i)) { - snprintf(dname, sizeof(dname), "%s%d:", efipart_dev.dv_name, i); - if (zfs_probe_dev(dname, &guid) =3D=3D 0) - (void)efi_handle_update_dev(h, &zfs_dev, unit++, guid); - } -} -#endif --------------689B5840033FA59B553C984F-- --7wWD2JXas7wNKFk1Kr7Jd8JHbiuG3wULI-- --2nIKx7PRAmhO47MXFmT0MDKUV6UMsh1v9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iF4EARYIAAYFAlhBqUEACgkQVsKIQKqABI0NwwD+O1MDmogaR5FqsK+h8rSwmZNi dwlYfTF2UPTht+5a2o4A/jhsOjEJ94T0YMrmbe2ly2cq708HCkidkkRtMjE/CbwM =gnu+ -----END PGP SIGNATURE----- --2nIKx7PRAmhO47MXFmT0MDKUV6UMsh1v9-- From owner-freebsd-current@freebsd.org Fri Dec 2 17:15:07 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE0ADC63E71 for ; Fri, 2 Dec 2016 17:15:07 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id DDA41265 for ; Fri, 2 Dec 2016 17:15:07 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: by mailman.ysv.freebsd.org (Postfix) id D9E80C63E70; Fri, 2 Dec 2016 17:15:07 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D98BFC63E6F for ; Fri, 2 Dec 2016 17:15:07 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A06C9264 for ; Fri, 2 Dec 2016 17:15:07 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cCrQI-000198-MA for current@freebsd.org; Fri, 02 Dec 2016 20:14:58 +0300 Date: Fri, 2 Dec 2016 20:14:58 +0300 From: Slawa Olhovchenkov To: current@freebsd.org Subject: QLogic FastLinQ support Message-ID: <20161202171458.GO57876@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 02 Dec 2016 17:15:08 -0000 Is support for QLogic FastLinQ QL45000 planed in FreeBSD? From owner-freebsd-current@freebsd.org Fri Dec 2 23:35:16 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADB37C638D0 for ; Fri, 2 Dec 2016 23:35:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 9AD0C966 for ; Fri, 2 Dec 2016 23:35:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mailman.ysv.freebsd.org (Postfix) id 976C8C638CC; Fri, 2 Dec 2016 23:35:16 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95551C638CA for ; Fri, 2 Dec 2016 23:35:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E65B965; Fri, 2 Dec 2016 23:35:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id 9AF8341EF; Sat, 3 Dec 2016 00:35:13 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 8A16728494; Sat, 3 Dec 2016 00:35:13 +0100 (CET) Date: Sat, 3 Dec 2016 00:35:13 +0100 From: Jilles Tjoelker To: Eric van Gyzen Cc: "current@freebsd.org" Subject: Re: copyinstr and ENAMETOOLONG Message-ID: <20161202233513.GA41141@stack.nl> References: <236b8c7c-a12e-0872-f3cb-03f99bb5fcc5@FreeBSD.org> <20161102203354.GA22693@stack.nl> <196a4cbf-b213-97bd-aae4-e761ff41e36b@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <196a4cbf-b213-97bd-aae4-e761ff41e36b@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 02 Dec 2016 23:35:16 -0000 On Fri, Dec 02, 2016 at 10:20:32AM -0600, Eric van Gyzen wrote: > On 11/02/2016 15:33, Jilles Tjoelker wrote: > > On Wed, Nov 02, 2016 at 02:24:43PM -0500, Eric van Gyzen wrote: > >> Does copyinstr guarantee that it has filled the output buffer when it > >> returns ENAMETOOLONG? I usually try to answer my own questions, but I > >> don't speak many dialects of assembly. :) > > > > The few I checked appear to work by checking the length while copying, > > but the man page copy(9) does not guarantee that, and similar code in > > sys/compat/linux/linux_misc.c linux_prctl() LINUX_PR_SET_NAME performs a > > copyin() if copyinstr() fails with [ENAMETOOLONG]. > Thanks. > > In implementing copyinstr(), checking the length first may make sense > > for economy of code: a user-strnlen() using an algorithm like > > lib/libc/string/strlen.c and a copyin() connected together with a C > > copyinstr(). This would probably be faster than the current amd64 code > > (which uses lods and stos, meh). With that implementation, filling the > > buffer in the [ENAMETOOLONG] case requires a small piece of additional > > code. > >> I ask because I'd like to make the following change, and I'd like to > >> know whether I should zero the buffer before calling copyinstr to ensure > >> that I don't set the thread's name to the garbage that was on the stack. > [snip] > > For API design, it makes more sense to set error = 0 if a truncated name > > is being set anyway. This preserves the property that the name remains > > unchanged if the call fails. > That makes sense. > > A change to the man page thr_set_name(2) is needed in any case. > Of course. > Would you like to review the following? > Index: lib/libc/sys/thr_set_name.2 > =================================================================== > --- lib/libc/sys/thr_set_name.2 (revision 309300) > +++ lib/libc/sys/thr_set_name.2 (working copy) > @@ -28,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd June 1, 2016 > +.Dd December 2, 2016 > .Dt THR_SET_NAME 2 > .Os > .Sh NAME > @@ -43,37 +43,34 @@ > .Sh DESCRIPTION > The > .Fn thr_set_name > -sets the user-visible name for the kernel thread with the identifier > +system call sets the user-visible name for the thread with the identifier > .Va id > -in the current process, to the NUL-terminated string > +in the current process to the NUL-terminated string > .Va name . > +The name will be silently truncated to fit into a buffer of > +.Dv MAXCOMLEN + 1 > +bytes. > The thread name can be seen in the output of the > .Xr ps 1 > and > .Xr top 1 > commands, in the kernel debuggers and kernel tracing facility outputs, > -also in userland debuggers and program core files, as notes. > +and in userland debuggers and program core files, as notes. > .Sh RETURN VALUES > If successful, > .Fn thr_set_name > -will return zero, otherwise \-1 is returned, and > +returns zero; otherwise, \-1 is returned, and > .Va errno > is set to indicate the error. > .Sh ERRORS > The > .Fn thr_set_name > -operation may return the following errors: > +system call may return the following errors: > .Bl -tag -width Er > .It Bq Er EFAULT > The memory pointed to by the > .Fa name > argument is not valid. > -.It Bq Er ENAMETOOLONG > -The string pointed to by the > -.Fa name > -argument exceeds > -.Dv MAXCOMLEN + 1 > -bytes in length. > .It Bq Er ESRCH > The thread with the identifier > .Fa id > @@ -92,6 +89,6 @@ does not exist in the current process. > .Xr ktr 9 > .Sh STANDARDS > The > -.Fn thr_new > -system call is non-standard and is used by > +.Fn thr_set_name > +system call is non-standard and is used by the > .Lb libthr . > Index: share/man/man3/pthread_set_name_np.3 > =================================================================== > --- share/man/man3/pthread_set_name_np.3 (revision 309300) > +++ share/man/man3/pthread_set_name_np.3 (working copy) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 13, 2003 > +.Dd December 2, 2016 > .Dt PTHREAD_SET_NAME_NP 3 > .Os > .Sh NAME > @@ -39,14 +39,15 @@ > .Sh DESCRIPTION > The > .Fn pthread_set_name_np > -function sets internal name for thread specified by > -.Fa tid > -argument to string value specified by > +function applies a copy of the given > .Fa name > -argument. > +to the thread specified by the given > +.Fa tid . > .Sh ERRORS > Because of the debugging nature of this function, all errors that may > appear inside are silently ignored. > +.Sh SEE ALSO > +.Xr thr_set_name 2 > .Sh AUTHORS > This manual page was written by > .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . > Index: sys/kern/kern_thr.c > =================================================================== > --- sys/kern/kern_thr.c (revision 309300) > +++ sys/kern/kern_thr.c (working copy) > @@ -578,8 +578,11 @@ sys_thr_set_name(struct thread *td, struct thr_set > error = 0; > name[0] = '\0'; > if (uap->name != NULL) { > - error = copyinstr(uap->name, name, sizeof(name), > - NULL); > + error = copyinstr(uap->name, name, sizeof(name), NULL); > + if (error == ENAMETOOLONG) { > + error = copyin(uap->name, name, sizeof(name) - 1); > + name[sizeof(name) - 1] = '\0'; > + } > if (error) > return (error); > } Looks good to me. (I have not tested it.) -- Jilles Tjoelker From owner-freebsd-current@freebsd.org Sat Dec 3 06:40:20 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BFDCC629C9 for ; Sat, 3 Dec 2016 06:40:20 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id DC8DB185 for ; Sat, 3 Dec 2016 06:40:19 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id DB2C3C629C4; Sat, 3 Dec 2016 06:40:19 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA271C629C3; Sat, 3 Dec 2016 06:40:19 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CBF6184; Sat, 3 Dec 2016 06:40:19 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-io0-x233.google.com with SMTP id c21so474941161ioj.1; Fri, 02 Dec 2016 22:40:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tK09wVe1HF9xICJ3AS7r1B3PbABBZSB4Ok8lnXl3r6w=; b=gxaqePDSlRcZcTXwZdrUtRvz3nVh3kkgR4S59Q3Ki2dR9QP1okzGbM5udvK9XEauGi ydoIOLMNzut223PCYjeq1455PnWH7d6S/Em8YvoBPZszo0fZkpg5sH7MEP8fa5Q5Gtv+ ZyaXU2rGm3JThhCiEXA1hfWyY8i+f3H9phzSEjx890MQwev2LKHpQ/79dCyn5qIVoN5f qCnqMXx9KV5/SM5fIIfnDLZL6iUhrn3cel6F8O2rZUQIykdzJQgiONxf6sAwLrTcnrxc ZuUik9wW3rfAViZsHvSqgYRYuQMBTDuZB8aINffGNDijUDgBDWzCNxbZmqAVREn/R2fp tQrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tK09wVe1HF9xICJ3AS7r1B3PbABBZSB4Ok8lnXl3r6w=; b=aSQHnnigGnn6t6OanN9Ver+uq9mk1DIOJykdbwRLYmhAmCZQywkh500MUt7cVQRbIW KS3wy0XTjyrhREykBvT7V0Pw52jzONV+ta1W3R32hQx3vstQbYwUNBOFf8AkMg5HHPa+ RVHzuR6KziDMnT7zX3wC2qbA729VWw2QTPFQ1Iw+yyiFwXEXSjetAfAay/1vPJ7ve+W1 FFc4sydlbuOTm1eZ+6ufFapGdBbZNxT0t3C7g9OmbDC+iOsj0j7DJXy6FCCYpcp1qs2O nI2FhCIAOgDIhI9ltJCfXwhHvsY0qpPHiiPEoJHHdGag2Ng5U/lmtQ5gWKyvw0YAQ+1I TG/A== X-Gm-Message-State: AKaTC00wBlN0atB1csbrBspMvrF1KTA2Llw83V9DkDvaS01sLNMkraaYHmghuD0NEqyxzao+nGqqDh8EQlMi/g== X-Received: by 10.36.192.84 with SMTP id u81mr708837itf.51.1480747218893; Fri, 02 Dec 2016 22:40:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.136.197 with HTTP; Fri, 2 Dec 2016 22:40:18 -0800 (PST) In-Reply-To: References: From: Ben Woods Date: Sat, 3 Dec 2016 14:40:18 +0800 Message-ID: Subject: Re: CFT EFI Boot Refactoring To: Eric McCorkle Cc: freebsd-hackers@freebsd.org, freebsd-amd64@freebsd.org, "current@freebsd.org" Content-Type: multipart/mixed; boundary=94eb2c058ce8fc2ff60542bb5373 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 03 Dec 2016 06:40:20 -0000 --94eb2c058ce8fc2ff60542bb5373 Content-Type: text/plain; charset=UTF-8 Hi Eric, Thanks for your work on this. I just applied your diff to my subversion repository, and tried to buildworld, but the build failed with the following error: make[6]: make[6]: don't know how to make efipart.c. Stop make[6]: stopped in /usr/src/sys/boot/efi/drivers *** [all_subdir_sys/boot/efi/drivers] Error code 2 Does it build ok for you? Because I use subversion, and I wanted to build it from my main tree, I had to regenerate your patch using "git diff --no-prefix master..origin/efize_new > /tmp/efize_new.diff". I could then apply this cleanly with "svn patch /tmp/efize_new.diff". I checked the difference between your diff and the diff I generated, and the only differences were in the file headers. Therefore I don't think the patch change should make any difference. I have attached my version of the patch for reference. For example: diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 0ebcaf1..3b608c5 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile Became: diff --git lib/libstand/Makefile lib/libstand/Makefile index 0ebcaf1ccfd..3b608c5bc92 100644 --- lib/libstand/Makefile +++ lib/libstand/Makefile To show the differences with your patch applied: $ svn status M lib/libstand/Makefile M lib/libstand/stand.h M sys/boot/efi/Makefile M sys/boot/efi/boot1/Makefile M sys/boot/efi/boot1/Makefile.fat M sys/boot/efi/boot1/boot1.c D sys/boot/efi/boot1/boot_module.h M sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu M sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu M sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu M sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu M sys/boot/efi/boot1/generate-fat.sh D sys/boot/efi/boot1/ufs_module.c D sys/boot/efi/boot1/zfs_module.c A sys/boot/efi/drivers A sys/boot/efi/drivers/Makefile A sys/boot/efi/drivers/efi_drivers.h A sys/boot/efi/drivers/fs_driver.c M sys/boot/efi/include/efilib.h M sys/boot/efi/include/efiprot.h A sys/boot/efi/include/string16.h M sys/boot/efi/libefi/Makefile A sys/boot/efi/libefi/efifs.c M sys/boot/efi/libefi/efipart.c M sys/boot/efi/libefi/errno.c M sys/boot/efi/libefi/handles.c A sys/boot/efi/libefi/string16.c M sys/boot/efi/libefi/time.c M sys/boot/efi/loader/Makefile M sys/boot/efi/loader/conf.c M sys/boot/efi/loader/loader_efi.h M sys/boot/efi/loader/main.c Regards, Ben -- From: Benjamin Woods woodsb02@gmail.com On 3 December 2016 at 01:02, Eric McCorkle wrote: > Hello everyone, > > My work to refactor the EFI boot loader has been in review for some time > now. This work is a behavior-neutral refactoring which eliminates > duplicated code in boot1, provides better integration of boot1 and > loader with the EFI API, and moves towards better compliance with the > recommendations of the UEFI driver writer's guide. This work also > serves as a precursor to more work, such as GELI, hot-plugging, and > other things. > > One of the reviewers was able to trigger a hang on his setup; however, > it's not clear whether this is a problem in the refactoring, or whether > it's due to a related bug: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214423 > > Therefore, I would like to issue a CFT for this changeset. We need > people using the boot1/loader EFI boot setup to test their setup using > boot1 and loader as built with this patch applied. > > You can also get the source tree directly from my github > (https://github.com/emc2/freebsd.git). Use the efize_new branch to get > this changeset. Note that I am maintaining the state of this branch in > a single change at this point using rebase -i, so there *will* be forced > pushes to this branch. > > > Here are some notes on testing the changeset: > > * To test it, just do a buildworld, then copy loader.efi in place and > copy boot1.efi to /efi/BOOT/BOOTX64.EFI on your ESP. If your system > boots, then the test was successful (there are no new features in this > changeset). > > * The output of boot1 is slightly different, so you'll be able to tell > if you installed it correctly. > > * I recommend keeping a copy of the basic boot1 around on your ESP, just > in case something goes wrong. On my setup, I have a backup at > /efi/BOOT/BOOTX64.BAK (with the main program at /efi/BOOT/BOOTX64.EFI, > of course) > > * I have been using this on a machine with two disks, a ZFS pool > spanning both disks, and a dummy UFS filesystem for months now, so it > can be considered relatively safe. > > * This has also been tested on basic setups without incident, so > priority is on complex or odd setups. > > * If something goes wrong, you will most likely get a boot-hang. If > this happens, please contact me directly with the details, and I'll > coordinate on diagnosis. > --94eb2c058ce8fc2ff60542bb5373 Content-Type: text/plain; charset=US-ASCII; name="efize_new.diff" Content-Disposition: attachment; filename="efize_new.diff"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XJucyB0aGUgdGV4dCBkZXNjcmlwdGlv biBvZgogICogZGV2cGF0aCB1c2luZyBhIHN0YXRpYyBidWZmZXIsIHNvIGl0IGlzbid0IHRocmVh ZCBzYWZlIQogICovCi1jaGFyICoKK3N0YXRpYyBjaGFyICoKIGRldnBhdGhfc3RyKEVGSV9ERVZJ Q0VfUEFUSCAqZGV2cGF0aCkKIHsKIAlzdGF0aWMgY2hhciBidWZbMjU2XTsKIAogCWRldnBhdGhf c3RybGNhdChidWYsIHNpemVvZihidWYpLCBkZXZwYXRoKTsKIAotCXJldHVybiBidWY7CisJcmV0 dXJuIChidWYpOworfQorI2VuZGlmCisKK3N0YXRpYyBFRklfU1RBVFVTCitlZmlfbG9hZChFRklf SEFORExFIGRldiwgY29uc3QgY2hhciAqZmlsZXBhdGgsIHZvaWQgKipidWZwLCBzaXplX3QgKmJ1 ZnNpemUpCit7CisgICAgICAgIFVJTlROIGluZm9zaXplID0gc2l6ZW9mKEVGSV9GSUxFX0lORk8p ICsKKyAgICAgICAgICAoKHN0cmxlbihmaWxlcGF0aCkgKyAxKSAqIHNpemVvZihDSEFSMTYpKTsK KyAgICAgICAgRUZJX0ZJTEVfSU5GTyAqZmluZm87CisJRUZJX1NUQVRVUyBzdGF0dXM7CisgICAg ICAgIEVGSV9GSUxFX0lPX0lOVEVSRkFDRSAqaWZhY2U7CisgICAgICAgIEVGSV9GSUxFX0hBTkRM RSByb290OworICAgICAgICBFRklfRklMRV9IQU5ETEUgdGFyZ2V0OworICAgICAgICBDSEFSMTYg cGF0aDE2W3N0cmxlbihmaWxlcGF0aCkgKyAxXTsKKwl2b2lkICpidWY7CisKKyAgICAgICAgZmlu Zm8gPSBtYWxsb2MoaW5mb3NpemUpOworCisgICAgICAgIGlmIChmaW5mbyA9PSBOVUxMKSB7Cisg ICAgICAgICAgICAgICAgcmV0dXJuIChFRklfT1VUX09GX1JFU09VUkNFUyk7CisgICAgICAgIH0K KworCXN0YXR1cyA9IEJTLT5PcGVuUHJvdG9jb2woZGV2LCAmU2ltcGxlRmlsZVN5c3RlbVByb3Rv Y29sR1VJRCwKKyAgICAgICAgICAgICh2b2lkICoqKSZpZmFjZSwgSUgsIE5VTEwsIEVGSV9PUEVO X1BST1RPQ09MX0dFVF9QUk9UT0NPTCk7CisKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBFRklfU1VD Q0VTUykgeworICAgICAgICAgICAgICAgIGZyZWUoZmluZm8pOworICAgICAgICAgICAgICAgIHBy aW50ZigiT3BlbiBwcm90b2NvbCBmYWlsZWQhICVsZFxuIiwgRUZJX0VSUk9SX0NPREUoc3RhdHVz KSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIChzdGF0dXMpOworICAgICAgICB9CisKKyAgICAg ICAgc3RhdHVzID0gaWZhY2UtPk9wZW5Wb2x1bWUoaWZhY2UsICZyb290KTsKKworICAgICAgICBp ZiAoc3RhdHVzICE9IEVGSV9TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgQlMtPkNsb3NlUHJv dG9jb2woZGV2LCAmU2ltcGxlRmlsZVN5c3RlbVByb3RvY29sR1VJRCwgSUgsIE5VTEwpOworICAg ICAgICAgICAgICAgIGZyZWUoZmluZm8pOworICAgICAgICAgICAgICAgIHByaW50ZigiT3BlbiB2 b2x1bWUgZmFpbGVkISAlbGRcbiIsIEVGSV9FUlJPUl9DT0RFKHN0YXR1cykpOworICAgICAgICAg ICAgICAgIHJldHVybiAoc3RhdHVzKTsKKyAgICAgICAgfQorCisgICAgICAgIHN0cmNweV90b18x NihwYXRoMTYsIGZpbGVwYXRoKTsKKyAgICAgICAgc3RhdHVzID0gcm9vdC0+T3Blbihyb290LCAm dGFyZ2V0LCBwYXRoMTYsIEVGSV9GSUxFX01PREVfUkVBRCwgMCk7CisKKyAgICAgICAgaWYgKHN0 YXR1cyAhPSBFRklfU1VDQ0VTUykgeworICAgICAgICAgICAgICAgIEJTLT5DbG9zZVByb3RvY29s KGRldiwgJlNpbXBsZUZpbGVTeXN0ZW1Qcm90b2NvbEdVSUQsIElILCBOVUxMKTsKKyAgICAgICAg ICAgICAgICBmcmVlKGZpbmZvKTsKKworICAgICAgICAgICAgICAgIHJldHVybiAoc3RhdHVzKTsK KyAgICAgICAgfQorCisgICAgICAgICpidWZzaXplID0gaW5mb3NpemU7CisgICAgICAgIHN0YXR1 cyA9IHRhcmdldC0+R2V0SW5mbyh0YXJnZXQsICZGaWxlSW5mb0dVSUQsIGJ1ZnNpemUsIGZpbmZv KTsKKworICAgICAgICBpZiAoc3RhdHVzICE9IEVGSV9TVUNDRVNTKSB7CisgICAgICAgICAgICAg ICAgQlMtPkNsb3NlUHJvdG9jb2woZGV2LCAmU2ltcGxlRmlsZVN5c3RlbVByb3RvY29sR1VJRCwg SUgsIE5VTEwpOworICAgICAgICAgICAgICAgIGZyZWUoZmluZm8pOworICAgICAgICAgICAgICAg IHByaW50ZigiR2V0IGluZm8gZmFpbGVkISAlbGRcbiIsIEVGSV9FUlJPUl9DT0RFKHN0YXR1cykp OworICAgICAgICAgICAgICAgIHJldHVybiAoc3RhdHVzKTsKKyAgICAgICAgfQorCisgICAgICAg ICpidWZzaXplID0gZmluZm8tPkZpbGVTaXplOworCisgICAgICAgIGlmICgoYnVmID0gbWFsbG9j KGZpbmZvLT5GaWxlU2l6ZSkpID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICBCUy0+Q2xvc2VQ cm90b2NvbChkZXYsICZTaW1wbGVGaWxlU3lzdGVtUHJvdG9jb2xHVUlELCBJSCwgTlVMTCk7Cisg ICAgICAgICAgICAgICAgZnJlZShmaW5mbyk7CisgICAgICAgICAgICAgICAgcHJpbnRmKCJGYWls ZWQgdG8gYWxsb2NhdGUgbG9hZCBidWZmZXIgJXpkIGZvciAnJXMnICIKKyAgICAgICAgICAgICAg ICAgICAgICAgIiglbHUpXG4iLCBmaW5mby0+RmlsZVNpemUsIGZpbGVwYXRoLCBFRklfRVJST1Jf Q09ERShzdGF0dXMpKTsKKyAgICAgICAgICAgICAgICByZ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aChpbWdwYXRoLCBkZXZwYXRoKSkgeworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBwcmVmZXJyZWRbbnByZWZlcnJlZF0gPSBoYW5kbGVzW2ldOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBucHJlZmVycmVkKys7CisgICAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBCUy0+Q2xvc2VQcm90b2Nv bChoYW5kbGVzW2ldLCAmRGV2aWNlUGF0aEdVSUQsIElILCBOVUxMKTsKKyAgICAgICAgICAgICAg ICB9CisgICAgICAgIH0KKworICAgICAgICBCUy0+Q2xvc2VQcm90b2NvbChib290X2hhbmRsZSwg JkRldmljZVBhdGhHVUlELCBJSCwgTlVMTCk7CisKKyAgICAgICAgLyogVHJ5IHRoZSBwcmVmZXJy ZWQgaGFuZGxlcyBmaXJzdCwgdGhlbiBhbGwgdGhlIGhhbmRsZXMgKi8KKyAgICAgICAgZm9yIChp ID0gMDsgaSA8IG5wcmVmZXJyZWQ7IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChlZmlfbG9h ZChwcmVmZXJyZWRbaV0sIFBBVEhfTE9BREVSX0VGSSwgYnVmcCwgYnVmc2l6ZSkgPT0KKyAgICAg ICAgICAgICAgICAgICBFRklfU1VDQ0VTUykgeworICAgICAgICAgICAgICAgICAgICAgICAgKmhh bmRsZXAgPSBwcmVmZXJyZWRbaV07CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKEVG SV9TVUNDRVNTKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmb3Ig KGkgPSAwOyBpIDwgbmhhbmRsZXM7IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChlZmlfbG9h ZChoYW5kbGVzW2ldLCBQQVRIX0xPQURFUl9FRkksIGJ1ZnAsIGJ1ZnNpemUpID09CisgICAgICAg ICAgICAgICAgICAgRUZJX1NVQ0NFU1MpIHsKKyAgICAgICA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UZJX1NUQVRVUworZWZpcGFydF9zdXBwb3J0ZWQoRUZJX0RSSVZFUl9CSU5ESU5HICpU aGlzLCBFRklfSEFORExFIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgIEVGSV9ERVZJQ0VfUEFU SCAqUmVtYWluaW5nRGV2aWNlUGF0aCBfX3VudXNlZCkKK3sKKyAgICAgICAgcmV0dXJuIEJTLT5P cGVuUHJvdG9jb2woaGFuZGxlLCAmYmxraW9fZ3VpZCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgTlVMTCwgSUgsIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgRUZJX09QRU5fUFJPVE9DT0xfVEVTVF9QUk9UT0NPTCk7Cit9CisKK3N0YXRpYyBFRklfU1RB VFVTCitlZmlwYXJ0X3N0YXJ0KEVGSV9EUklWRVJfQklORElORyAqVGhpcywgRUZJX0hBTkRMRSBo YW5kbGUsCisgICAgICAgICAgICAgIEVGSV9ERVZJQ0VfUEFUSCAqUmVtYWluaW5nRGV2aWNlUGF0 aCBfX3VudXNlZCwKKyAgICAgICAgICAgICAgdV9pbnQqIG5kaXNrLCB1aW50KiBucmRpc2spCit7 CisgICAgICAgIEVGSV9CTE9DS19JTyAqYmxraW87CisgICAgICAgIEVGSV9ERVZJQ0VfUEFUSCAq ZGV2cGF0aCwgKmRldnBhdGhjcHksICp0bXBkZXZwYXRoLCAqbm9kZTsKKwlFRklfU1RBVFVTIHN0 YXR1czsKKyAgICAgICAgRUZJX0hBTkRMRSBhbGlhczsKKworICAgICAgICBkZXZwYXRoID0gZWZp X2xvb2t1cF9kZXZwYXRoKGhhbmRsZSk7CisKKyAgICAgICAgaWYgKGRldnBhdGggPT0gTlVMTCkg eworICAgICAgICAgICAgICAgIHJldHVybiAoRUZJX0RFVklDRV9FUlJPUik7CisgICAgICAgIH0K KworICAgICAgICBzdGF0dXMgPSBCUy0+SGFuZGxlUHJvdG9jb2woaGFuZGxlLCAmYmxraW9fZ3Vp ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiopJmJsa2lvKTsK KyAgICAgICAgaWYgKEVGSV9FUlJPUihzdGF0dXMpKQorICAgICAgICAgICAgICAgIHJldHVybiAo c3RhdHVzKTsKKworICAgICAgICBpZiAoIWJsa2lvLT5NZWRpYS0+TG9naWNhbFBhcnRpdGlvbikg eworICAgICAgICAgICAgICAgICpucmRpc2srKzsKKyAgICAgICAgICAgICAgICByZXR1cm4gKEVG SV9VTlNVUFBPUlRFRCk7CisgICAgICAgIH0KKworICAgICAgICAvKgorICAgICAgICAgKiBJZiB3 ZSBjb21lIGFjcm9zcyBhIGxvZ2ljYWwgcGFydGl0aW9uIG9mIHN1YnR5cGUgQ0RST00KKyAgICAg ICAgICogaXQgZG9lc24ndCByZWZlciB0byB0aGUgQ0QgZmlsZXN5c3RlbSBpdHNlbGYsIGJ1dCBy YXRoZXIKKyAgICAgICAgICogdG8gYW55IHVzYWJsZSBFbCBUb3JpdG8gYm9vdCBpbWFnZSBvbiBp dC4gSW4gdGhpcyBjYXNlCisgICAgICAgICAqIHdlIHRyeSB0byBmaW5kIHRoZSBwYXJlbnQgZGV2 aWNlIGFuZCBhZGQgdGhhdCBpbnN0ZWFkIGFzCisgICAgICAgICAqIHRoYXQgd2lsbCBiZSB0aGUg Q0QgZmlsZXN5c3RlbS4KKyAgICAgICAgICovCisgICAgICAgIG5vZGUgPSBlZmlfZGV2cGF0aF9s YXN0X25vZGUoZGV2cGF0aCk7CisgICAgICAgIGlmIChEZXZpY2VQYXRoVHlwZShub2RlKSA9PSBN RURJQV9ERVZJQ0VfUEFUSCAmJgorICAgICAgICAgICAgRGV2aWNlUGF0aFN1YlR5cGUobm9kZSkg PT0gTUVESUFfQ0RST01fRFApIHsKKyAgICAgICAgICAgICAgICBkZXZwYXRoY3B5ID0gZWZpX2Rl dnBhdGhfdHJpbShkZXZwYXRoKTsKKyAgICAgICAgICAgICAgICB0bXBkZXZwYXRoID0gZGV2cGF0 aGNweTsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBCUy0+TG9jYXRlRGV2aWNlUGF0aCgmYmxr aW9fZ3VpZCwgJnRtcGRldnBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJmFsaWFzKTsKKyAgICAgICAgICAgICAgICBmcmVlKGRldnBhdGhjcHkpOwor CisgICAgICAgICAgICAgICAgaWYgKEVGSV9FUlJPUihzdGF0dXMpKQorICAgICAgICAgICAgICAg ICAgICAgICAgcmV0dXJuIChzdGF0dXMpOworCisgICAgICAgICAgICAgICAgZWZpX3JlZ2lzdGVy X2hhbmRsZSgmZWZpcGFydF9kZXYsIGhhbmRsZSwgYWxpYXMpOworICAgICAgICB9IGVsc2UKKyAg ICAgICAgICAgICAgICBlZmlfcmVnaXN0ZXJfaGFuZGxlKCZlZmlwYXJ0X2RldiwgaGFuZGxlLCBO VUxMKTsKKworICAgICAgICBwZGluZm9bbnBkaW5mb10ucGRfb3BlbiA9IDA7CisgICAgICAgIHBk aW5mb1tucGRpbmZvXS5wZF9iY2FjaGUgPSBOVUxMOworICAgICAgICBwZGluZm9bbnBkaW5mb10u cGRfdW5pdCA9IG5wZGluZm87CisgICAgICAgIG5wZGluZm8rKzsKKyAgICAgICAgKm5kaXNrKys7 CisKKyAgICAgICAgcmV0dXJuIChFRklfU1VDQ0VTUyk7Cit9CisKIHN0YXRpYyBpbnQKLWVmaXBh cnRfaW5pdCh2b2lkKSAKK2VmaXBhcnRfaW5pdCh2b2lkKQogewotCUVGSV9CTE9DS19JTyAqYmxr aW87Ci0JRUZJX0RFVklDRV9QQVRIICpkZXZwYXRoLCAqZGV2cGF0aGNweSwgKnRtcGRldnBhdGgs ICpub2RlOwotCUVGSV9IQU5ETEUgKmhpbiwgKmhvdXQsICphbGlhc2VzLCBoYW5kbGU7CisJRUZJ X0hBTkRMRSAqaGFuZGxlczsKIAlFRklfU1RBVFVTIHN0YX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gICBpZiAob3V0ID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBO VUxMOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIG1lbWNweShvdXQsIGRl diwgc2l6ZW9mKHN0cnVjdCB6ZnNfZGV2ZGVzYykpOworCisgICAgICAgICAgICAgICAgcmV0dXJu IG91dDsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIG91dCA9IG1hbGxvYyhz aXplb2Yoc3RydWN0IGRldmRlc2MpKTsKKworICAgICAgICAgICAgICAgIGlmIChvdXQgPT0gTlVM TCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgICAgICAg ICAgfQorCisgICAgICAgICAgICAgICAgbWVtY3B5KG91dCwgZGV2LCBzaXplb2Yoc3RydWN0IGRl dmRlc2MpKTsKKworICAgICAgICAgICAgICAgIHJldHVybiBvdXQ7CisgICAgICAgIH0KK30KKwor c3RhdGljIEVGSV9TVEFUVVMKK2RvX2ZpbGVfb3Blbihjb25zdCB2b2xpbmZvX3QgKnZpbmZvLCBj b25zdCBjaGFyIGZpbGVwYXRoW10sCisgICAgICAgICAgICAgaW50IG1vZGUsIEVGSV9GSUxFX0hB TkRMRSAqb3V0KQoreworICAgICAgICBFRklfRklMRV9IQU5ETEUgZmhhbmRsZTsKKyAgICAgICAg ZmlsZWluZm9fdCAqZmluZm87CisgICAgICAgIHN0cnVjdCBzdGF0IHN0OworICAgICAgICBzdHJ1 Y3QgZGV2ZGVzYyAqdG1wZGV2OworCWludCBlcnI7CisKKyAgICAgICAgbWVtc2V0KCZzdCwgMCwg c2l6ZW9mKHN0cnVjdCBzdGF0KSk7CisgICAgICAgIGZoYW5kbGUgPSBtYWxsb2Moc2l6ZW9mKEVG SV9GSUxFKSArIHNpemVvZihmaWxlaW5mb190KSArCisgICAgICAgICAgICAgICAgICAgICAgICAg c3RybGVuKGZpbGVwYXRoKSArIDEpOworCisgICAgICAgIGlmIChmaGFuZGxlID09IE5VTEwpIHsK KyAgICAgICAgICAgICAgICByZXR1cm4gKEVGSV9PVVRfT0ZfUkVTT1VSQ0VTKTsKKyAgICAgICAg fQorCisgICAgICAgIHRtcGRldiA9IGNsb25lX2RldmRlc2ModmluZm8tPmRldik7CisKKyAgICAg ICAgaWYgKHRtcGRldiA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgZnJlZShmaGFuZGxlKTsK KyAgICAgICAgICAgICAgICByZXR1cm4gKEVGSV9PVVRfT0ZfUkVTT1VSQ0VTKTsKKyAgICAgICAg fQorCisgICAgICAgIGZpbmZvID0gKGZpbGVpbmZvX3QqKShmaGFuZGxlICsgMSk7CisgICAgICAg IGZpbmZvLT5mZGF0YS5mX2ZsYWdzID0gbW9kZSArIDE7CisgICAgICAgIGZpbmZvLT5mZGF0YS5m X2RldiA9IE5VTEw7CisgICAgICAgIGZpbmZvLT5mZGF0YS5mX29wcyA9IE5VTEw7CisgICAgICAg IGZpbmZvLT5mZGF0YS5mX29mZnNldCA9IDA7CisgICAgICAgIGZpbmZvLT5mZGF0YS5mX2RldmRh dGEgPSBOVUxMOworCisgICAgICAgIGlmICgoZXJyID0gdmluZm8tPmRldi0+ZF9kZXYtPmR2X29w ZW4oJihmaW5mby0+ZmRhdGEpLCB0bXBkZXYpKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgZnJl ZShmaGFuZGxlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gKGVycm5vX3RvX2VmaV9zdGF0dXMo ZXJyKSk7CisgICAgICAgIH0KKworICAgICAgICBmaW5mby0+ZmRhdGEuZl9kZXYgPSB2aW5mby0+ ZGV2LT5kX2RldjsKKworICAgICAgICBpZiAoKGVyciA9IHZpbmZvLT5mc29wcy0+Zm9fb3Blbihm aWxlcGF0aCwgJihmaW5mby0+ZmRhdGEpKSkgIT0gMCkgeworICAgICAgICAgICAgICAgIGZyZWUo ZmhhbmRsZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIChlcnJub190b19lZmlfc3RhdHVzKGVy cikpOworICAgICAgICB9CisKKyAgICAgICAgZmluZm8tPmZkYXRhLmZfb3BzID0gdmluZm8tPmZz b3BzOworCisgICAgICAgIGlmICgoZXJyID0gdmluZm8tPmZzb3BzLT5mb19zdGF0KCYoZmluZm8t PmZkYXRhKSwgJnN0KSkgIT0gMCkgeworICAgICAgICAgICAgICAgIGZyZWUoZmhhbmRsZSk7Cisg ICAgICAgICAgICAgICAgcmV0dXJuIChlcnJub190b19lZmlfc3RhdHVzKGVycikpOworICAgICAg ICB9CisKKyAgICAgICAgc3RyY3B5KGZpbmZvLT5wYXRoLCBmaWxlcGF0aCk7CisgICAgICAgIGZp bmZvLT52aW5mbyA9IHZpbmZvOworICAgICAgICBmaGFuZGxlLT5SZXZpc2lvbiA9IEVGSV9GSUxF X0hBTkRMRV9SRVZJU0lPTjsKKyAgICAgICAgZmhhbmRsZS0+T3BlbiA9IGZpbGVfb3Blbl9pbXBs OworICAgICAgICBmaGFuZGxlLT5DbG9zZSA9IGZpbGVfY2xvc2VfaW1wbDsKKyAgICAgICAgZmhh bmRsZS0+RGVsZXRlID0gZmlsZV9kZWxldGVfaW1wbDsKKyAgICAgICAgZmhhbmRsZS0+U2V0UG9z aXRpb24gPSBmaWxlX3NldF9wb3NpdGlvbl9pbXBsOworICAgICAgICBmaGFuZGxlLT5HZXRQb3Np dGlvbiA9IGZpbGVfZ2V0X3Bvc2l0aW9uX2ltcGw7CisgICAgICAgIGZoYW5kbGUtPkdldEluZm8g PSBmaWxlX2dldF9pbmZvX2ltcGw7CisgICAgICAgIGZoYW5kbGUtPlNldEluZm8gPSBmaWxlX3Nl dF9pbmZvX2ltcGw7CisgICAgICAgIGZoYW5kbGUtPkZsdXNoID0gZmlsZV9mbHVzaF9pbXBsOwor CisgICAgICAgIGlmIChTX0lTRElSKHN0LnN0X21vZGUpKSB7CisgICAgICAgICAgICAgICAgZmhh bmRsZS0+UmVhZCA9IGRpcl9yZWFkX2ltcGw7CisgICAgICAgICAgICAgICAgZmhhbmRsZS0+V3Jp dGUgPSBkaXJfd3JpdGVfaW1wbDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBm aGFuZGxlLT5SZWFkID0gZmlsZV9yZWFkX2ltcGw7CisgICAgICAgICAgICAgICAgZmhhbmRsZS0+ V3JpdGUgPSBmaWxlX3dyaXRlX2ltcGw7CisgICAgICAgIH0KKworICAgICAgICAqb3V0ID0gZmhh bmRsZTsKKworICAgICAgICByZXR1cm4gKEVGSV9TVUNDRVNTKTsKK30KKworc3RhdGljIGludAor bW9kZV9mcm9tX2VmaShVSU5UNjQgZWZpX21vZGUpCit7CisgICAgICAgIGludCBtb2RlID0gMDsK KworICAgICAgICBpZiAoZWZpX21vZGUgJiBFRklfRklMRV9NT0RFX1dSSVRFKSB7CisgICAgICAg ICAgICAgICAgbW9kZSB8PSBPX1dST05MWTsKKyAgICAgICAgfSBlbHNlIGlmIChlZmlfbW9kZSAm IEVGSV9GSUxFX01PREVfUkVBRCkgeworICAgICAgICAgICAgICAgIG1vZGUgfD0gT19SRE9OTFk7 CisgICAgICAgIH0gZWxzZSBpZiAoZWZpX21vZGUgJiBFRklfRklMRV9NT0RFX1JFQUQgJiYKKyAg ICAgICAgICAgICAgICAgICBlZmlfbW9kZSAmIEVGSV9GSUxFX01PREVfV1JJVEUpIHsKKyAgICAg ICAgICAgICAgICBtb2RlIHw9IE9fUkRXUjsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBt b2RlOworfQorCitzdGF0aWMgVUlOVDY0Cittb2RlX3RvX2VmaShpbnQgbW9kZSkKK3sKKyAgICAg ICAgVUlOVDY0IGVmaV9tb2RlID0gMDsKKworICAgICAgICBpZiAobW9kZSAmIE9fV1JPTkxZKSB7 CisgICAgICAgICAgICAgICAgZWZpX21vZGUgfD0gRUZJX0ZJTEVfTU9ERV9XUklURTsKKyAgICAg ICAgfSBlbHNlIGlmIChtb2RlICYgT19SRE9OTFkpIHsKKyAgICAgICAgICAgICAgICBlZmlfbW9k ZSB8PSBFRklfRklMRV9NT0RFX1JFQUQ7CisgICAgICAgIH0gZWxzZSBpZiAobW9kZSAmIE9fUkRX UikgeworICAgICAgICAgICAgICAgIGVmaV9tb2RlIHw9IEVGSV9GSUxFX01PREVfUkVBRDsKKyAg ICAgICAgICAgICAgICBlZmlfbW9kZSB8PSBFRklfRklMRV9NT0RFX1dSSVRFOworICAgICAgICB9 CisKKyAgICAgICAgcmV0dXJuIChlZmlfbW9kZSk7Cit9CisKK3N0YXRpYyBFRklBUEkgRUZJX1NU QVRVUworZmlsZV9vcGVuX2ltcGwoRUZJX0ZJTEVfSEFORExFIEZpbGUsIEVGSV9GSUxFX0hBTkRM RSAqTmV3SGFuZGxlLAorICAgICAgICAgICAgICAgQ0hBUjE2ICpGaWxlTmFtZSwgVUlOVDY0IE9w ZW5Nb2RlLCBVSU5UNjQgQXR0cmlidXRlcykKK3sKKyAgICAgICAgZmlsZWluZm9fdCAqZmluZm8g PSAoZmlsZWluZm9fdCopKEZpbGUgKyAxKTsKKyAgICAgICAgY2hhciBidWZbc3RybGVuKGZpbmZv LT5wYXRoKSArIHN0cmxlbjE2KEZpbGVOYW1lKSArIDFdOworCisgICAgICAgIHN0cmNweV9mcm9t XzE2KHN0cGNweShidWYsIGZpbmZvLT5wYXRoKSwgRmlsZU5hbWUpOworCisgICAgICAgIHJldHVy biBkb19maWxlX29wZW4oZmluZm8tPnZpbmZvLCBidWYsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbW9kZV9mcm9tX2VmaShPcGVuTW9kZSksIE5ld0hhbmRsZSk7Cit9CisKK3N0YXRpYyBF RklBUEkgRUZJX1NUQVRVUworZmlsZV9jbG9zZV9pbXBsKEVGSV9GSUxFX0hBTkRMRSBGaWxlKQor eworICAgICAgICBmaWxlaW5mb190ICpmaW5mbyA9IChmaWxlaW5mb190KikoRmlsZSArIDEpOwor ICAgICAgICBpbnQgcmVzOworCisgICAgICAgIGlmICgocmVzID0gZmluZm8tPmZkYXRhLmZfb3Bz LT5mb19jbG9zZSgmKGZpbmZvLT5mZGF0YSkpKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgcmV0 dXJuIChlcnJub190b19lZmlfc3RhdHVzKHJlcykpOworICAgICAgICB9CisKKyAgICAgICAgaWYg KChyZXMgPSBmaW5mby0+dmluZm8tPmRldi0+ZF9kZXYtPmR2X2Nsb3NlKCYoZmluZm8tPmZkYXRh KSkpICE9IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gKGVycm5vX3RvX2VmaV9zdGF0dXMo cmVzKSk7CisgICAgICAgIH0KKworICAgICAgICBmcmVlKEZpbGUpOworICAgICAgICByZXR1cm4g KEVGSV9TVUNDRVNTKTsKK30KKworc3RhdGljIEVGSUFQSSBFRklfU1RBVFVTCitmaWxlX2RlbGV0 ZV9pbXBsKEVGSV9GSUxFX0hBTkRMRSBGaWxlKQoreworICAgICAgICBmaWxlX2Nsb3NlX2ltcGwo RmlsZSk7CisKKyAgICAgICAgcmV0dXJuIChFRklfV0FSTl9ERUxFVEVfRkFJTFVSRSk7Cit9CisK K3N0YXRpYyBFRklBUEkgRUZJX1NUQVRVUworZGlyX3JlYWRfaW1wbChFRklfRklMRV9IQU5ETEUg RmlsZSwgVUlOVE4gKkJ1ZmZlclNpemUsIFZPSUQgKkJ1ZmZlcikKK3sKKyAgICAgICAgZmlsZWlu Zm9fdCAqZmluZm8gPSAoZmlsZWluZm9fdCopKEZpbGUgKyAxKTsKKyAgICAgICAgZmlsZWluZm9f dCAqZW50aW5mbzsKKyAgICAgICAgc3RydWN0IGRpcmVudCBkOworICAgICAgICBzdHJ1Y3Qgc3Rh dCBzdDsKKyAgICAgICAgaW50IGVycjsKKyAgICAgICAgVUlOVE4gY3VycnNpemUgPSAqQnVmZmVy U2l6ZTsKKyAgICAgICAgVUlOVE4gcmVxc2l6ZTsKKyAgICAgICAgRUZJX0ZJTEVfSU5GTyAqb3V0 ID0gKEVGSV9GSUxFX0lORk8qKUJ1ZmZlcjsKKyAgICAgICAgRUZJX0ZJTEVfSEFORExFIGVudGhh bmRsZTsKKyAgICAgICAgRUZJX1NUQVRVUyBzdGF0dXM7CisgICAgICAgIG9mZl90IGN1cnJwb3M7 CisKKyAgICAgICAgLyogUmVjb3JkIHRlaCBjdXJyZW50IHBvc2l0aW9uIHNvIHdlIGNhbiByZXdp bmQgaWYgd2UgaGF2ZSB0byAqLworICAgICAgICBpZiAoKGN1cnJwb3MgPSBmaW5mby0+ZmRhdGEu Zl9vcHMtPmZvX3NlZWsoJihmaW5mby0+ZmRhdGEpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBTRUVLX0NVUikpIDwgMCkgeworICAgICAgICAg ICAgICAgIHJldHVybiAoZXJybm9fdG9fZWZpX3N0YXR1cyhlcnJubykpOworICAgICAgICB9CisK KwlpZiAoKGVyciA9IGZpbmZvLT5mZGF0YS5mX29wcy0+Zm9fcmVhZGRpcigmKGZpbmZvLT5mZGF0 YSksICZkKSkgIT0gMCkgeworCQlyZXR1cm4gKGVycm5vX3RvX2VmaV9zdGF0dXMoZXJybm8pKTsK Kwl9CisKKyAgICAgICAgcmVxc2l6ZSA9IHNpemVvZihFRklfRklMRV9JTkZPKSArCisgICAgICAg ICAgKChzdHJsZW4oZC5kX25hbWUpICsgMSkgKiBzaXplb2YoQ0hBUjE2KSk7CisKKyAgICAgICAg aWYgKEJ1ZmZlciA9PSBOVUxMIHx8IGN1cnJzaXplIDwgcmVxc2l6ZSkgeworICAgICAgICAgICAg ICAgIGZpbmZvLT5mZGF0YS5mX29wcy0+Zm9fc2VlaygmKGZpbmZvLT5mZGF0YSksIGN1cnJwb3Ms IFNFRUtfU0VUKTsKKyAgICAgICAgICAgICAgICAqQnVmZmVyU2l6ZSA9IHJlcXNpemU7CisKKyAg ICAgICAgICAgICAgICByZXR1cm4gKEVGSV9CVUZGRVJfVE9PX1NNQUxMKTsKKyAgICAgICAgfQor CisgICAgICAgIC8vIFdlIGhhdmUgdG8gYWN0dWFsbHkgb3BlbiB0aGUgZmlsZSwgc2luY2UgRUZJ IGRpcmVjdG9yeQorICAgICAgICAvLyByZWFkcyBhcmUgc3VwcG9zZWQgdG8gcmV0dXJuIHN0YXQg aW5mb3JtYXRpb24uCisgICAgICAgIENIQVIxNiBidWZbZC5kX25hbWxlbl07CisgICAgICAgIHN0 cmNweV90b18xNihidWYsIGQuZF9uYW1lKTsKKyAgICAgICAgc3RhdHVzID0gZmlsZV9vcGVuX2lt cGwoRmlsZSwgJmVudGhhbmRsZSwgYnVmLCBFRklfRklMRV9SRUFEX09OTFksIDApOworCisgICAg ICAgIGlmIChFRklfRVJST1Ioc3RhdHVzKSkgeworICAgICAgICAgICAgICAgIGZpbmZvLT5mZGF0 YS5mX29wcy0+Zm9fc2VlaygmKGZpbmZvLT5mZGF0YSksIGN1cnJwb3MsIFNFRUtfU0VUKTsKKyAg ICAgICAgICAgICAgICByZXR1cm4gKHN0YXR1cyk7CisgICAgICAgIH0KKworICAgICAgICBlbnRp bmZvID0gKGZpbGVpbmZvX3QqKShlbnRoYW5kbGUgKyAxKTsKKworICAgICAgICBpZiAoKGVyciA9 IGZpbmZvLT5mZGF0YS5mX29wcy0+Zm9fc3RhdCgmKGVudGluZm8tPmZkYXRhKSwgJnN0KSkgIT0g MCkgeworICAgICAgICAgICAgICAgIGZpbmZvLT5mZGF0YS5mX29wcy0+Zm9fc2VlaygmKGZpbmZv LT5mZGF0YSksIGN1cnJwb3MsIFNFRUtfU0VUKTsKKwkJcmV0dXJuIChlcnJub190b19lZmlfc3Rh dHVzKGVycm5vKSk7CisgICAgICAgIH0KKworICAgICAgICBzdGF0dXMgPSBmaWxlX2Nsb3NlX2lt cGwoZW50aGFuZGxlKTsKKworICAgICAgICBpZiAoRUZJX0VSUk9SKHN0YXR1cykpIHsKKyAgICAg ICAgICAgICAgICBmaW5mby0+ZmRhdGEuZl9vcHMtPmZvX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kLAorICAgICAgICAgICAgICAgVk9JRCAqQnVmZmVyIF9fdW51c2VkKQoreworICAg ICAgICAvLyBFRkkgQVBJIGRvZXNuJ3QgYWxsb3cgd3JpdGluZyB0byBkaXJlY3RvcmllcworICAg ICAgICByZXR1cm4gKEVGSV9VTlNVUFBPUlRFRCk7Cit9CisKK3N0YXRpYyBFRklBUEkgRUZJX1NU QVRVUworZmlsZV9yZWFkX2ltcGwoRUZJX0ZJTEVfSEFORExFIEZpbGUsIFVJTlROICpCdWZmZXJT aXplLCBWT0lEICpCdWZmZXIpCit7CisgICAgICAgIGZpbGVpbmZvX3QgKmZpbmZvID0gKGZpbGVp bmZvX3QqKShGaWxlICsgMSk7CisgICAgICAgIHNpemVfdCByZWFkc2l6ZSA9ICpCdWZmZXJTaXpl OworICAgICAgICBzaXplX3QgcmVzaWQ7CisgICAgICAgIGludCBlcnI7CisKKwlpZiAoKGVyciA9 IGZpbmZvLT5mZGF0YS5mX29wcy0+Zm9fcmVhZCgmKGZpbmZvLT5mZGF0YSksIEJ1ZmZlciwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhZHNpemUsICZy ZXNpZCkpICE9IDApIHsKKwkJcmV0dXJuIChlcnJub190b19lZmlfc3RhdHVzKGVycm5vKSk7CisJ fQorCisgICAgICAgICpCdWZmZXJTaXplID0gcmVhZHNpemUgLSByZXNpZDsKKworICAgICAgICBy ZXR1cm4gKEVGSV9TVUNDRVNTKTsKK30KKworc3RhdGljIEVGSUFQSSBFRklfU1RBVFVTCitmaWxl X3dyaXRlX2ltcGwoRUZJX0ZJTEVfSEFORExFIEZpbGUsIFVJTlROICpCdWZmZXJTaXplLCBWT0lE ICpCdWZmZXIpCit7CisgICAgICAgIGZpbGVpbmZvX3QgKmZpbmZvID0gKGZpbGVpbmZvX3QqKShG aWxlICsgMSk7CisgICAgICAgIHNpemVfdCB3cml0ZXNpemUgPSAqQnVmZmVyU2l6ZTsKKyAgICAg ICAgc2l6ZV90IHJlc2lkOworICAgICAgICBpbnQgZXJyOworCisJaWYgKChlcnIgPSBmaW5mby0+ ZmRhdGEuZl9vcHMtPmZvX3dyaXRlKCYoZmluZm8tPmZkYXRhKSwgQnVmZmVyLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVzaXplLCAmcmVzaWQp KSAhPSAwKSB7CisJCXJldHVybiAoZXJybm9fdG9fZWZpX3N0YXR1cyhlcnJubykpOworCX0KKwor ICAgICAgICAqQnVmZmVyU2l6ZSA9IHdyaXRlc2l6ZSAtIHJlc2lkOworCisgICAgICAgIHJldHVy biAoRUZJX1NVQ0NFU1MpOworfQorCitzdGF0aWMgRUZJQVBJIEVGSV9TVEFUVVMKK2ZpbGVfc2V0 X3Bvc2l0aW9uX2ltcGwoRUZJX0ZJTEVfSEFORExFIEZpbGUsIFVJTlQ2NCBQb3NpdGlvbikKK3sK KyAgICAgICAgZmlsZWluZm9fdCAqZmluZm8gPSAoZmlsZWluZm9fdCopKEZpbGUgKyAxKTsKKyAg ICAgICAgaW50IHJlczsKKworICAgICAgICBpZiAoUG9zaXRpb24gIT0gMHhmZmZmZmZmZmZmZmZm ZmZmTEwpIHsKKyAgICAgICAgICAgICAgICByZXMgPSBmaW5mby0+ZmRhdGEuZl9vcHMtPmZvX3Nl ZWsoJihmaW5mby0+ZmRhdGEpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBQb3NpdGlvbiwgU0VFS19TRVQpOworICAgICAgICB9IGVsc2UgeworICAg ICAgICAgICAgICAgIHJlcyA9IGZpbmZvLT5mZGF0YS5mX29wcy0+Zm9fc2VlaygmKGZpbmZvLT5m ZGF0YSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDAsIFNFRUtfRU5EKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChyZXMgPiAwKSB7CisgICAg ICAgICAgICAgICAgcmV0dXJuIChFRklfU1VDQ0VTUyk7CisgICAgICAgIH0gZWxzZSB7CisgICAg ICAgICAgICAgICAgcmV0dXJuIChlcnJub190b19lZmlfc3RhdHVzKHJlcykpOworICAgICAgICB9 Cit9CisKKworc3RhdGljIEVGSUFQSSBFRklfU1RBVFVTCitmaWxlX2dldF9wb3NpdGlvbl9pbXBs KEVGSV9GSUxFX0hBTkRMRSBGaWxlLCBVSU5UNjQgKlBvc2l0aW9uKQoreworICAgICAgICBmaWxl aW5mb190ICpmaW5mbyA9IChmaWxlaW5mb190KikoRmlsZSArIDEpOworICAgICAgICBvZmZfdCBy ZXM7CisKKyAgICAgICAgcmVzID0gZmluZm8tPmZkYXRhLmZfb3BzLT5mb19zZWVrKCYoZmluZm8t PmZkYXRhKSwgMCwgU0VFS19DVVIpOworCisgICAgICAgIGlmIChyZXMgPiAwKSB7CisgICAgICAg ICAgICAgICAgKlBvc2l0aW9uID0gcmVzOworCisgICAgICAgICAgICAgICAgcmV0dXJuIChFRklf U1VDQ0VTUyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIChlcnJu b190b19lZmlfc3RhdHVzKGVycm5vKSk7CisgICAgICAgIH0KK30KKworc3RhdGljIEVGSUFQSSBF RklfU1RBVFVTCitmaWxlX2dldF9pbmZvX2ltcGwoRUZJX0ZJTEVfSEFORExFIEZpbGUsIEVGSV9H VUlEICpJbmZvcm1hdGlvblR5cGUsCisgICAgICAgICAgICAgICAgICAgVUlOVE4gKkJ1ZmZlclNp emUsIFZPSUQgKkJ1ZmZlcikKK3sKKyAgICAgICAgZmlsZWluZm9fdCAqZmluZm8gPSAoZmlsZWlu Zm9fdCopKEZpbGUgKyAxKTsKKworICAgICAgICBpZiAoIW1lbWNtcChJbmZvcm1hdGlvblR5cGUs ICZGaWxlSW5mb0dVSUQsIHNpemVvZihFRklfR1VJRCkpKSB7CisgICAgICAgICAgICAgICAgRUZJ X0ZJTEVfSU5GTyAqb3V0ID0gKEVGSV9GSUxFX0lORk8qKUJ1ZmZlcjsKKyAgICAgICAgICAgICAg ICBVSU5UTiBzdHIxNmxlbiA9KHN0cmxlbihmaW5mby0+cGF0aCkgKyAxKSAqIHNpemVvZihDSEFS MTYpOworICAgICAgICAgICAgICAgIFVJTlROIGN1cnJzaXplID0gKkJ1ZmZlclNpemU7CisgICAg ICAgICAgICAgICAgVUlOVE4gcmVxc2l6ZSA9IHNpemVvZihFRklfRklMRV9JTkZPKSArIHN0cjE2 bGVuOworICAgICAgICAgICAgICAgIHN0cnVjdCBzdGF0IHN0OworICAgICAgICAgICAgICAgIGlu dCBlcnI7CisKKyAgICAgICAgICAgICAgICBtZW1zZXQoJnN0LCAwLCBzaXplb2Yoc3RydWN0IHN0 YXQpKTsKKyAgICAgICAgICAgICAgICAqQnVmZmVyU2l6ZSA9IHJlcXNpemU7CisKKyAgICAgICAg ICAgICAgICBpZiAoQnVmZmVyID09IE5VTEwgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vy cnNpemUgPCBzaXplb2YoRUZJX0ZJTEVfSU5GTykgKyBzdHIxNmxlbikgeworICAgICAgICAgICAg ICAgICAgICAgICAgKkJ1ZmZlclNpemUgPSBzaXplb2YoRUZJX0ZJTEVfSU5GTykgKyBzdHIxNmxl bjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoRUZJX0JVRkZFUl9UT09fU01BTEwp OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICgoZXJyID0gZmluZm8t PmZkYXRhLmZfb3BzLT5mb19zdGF0KCYoZmluZm8tPmZkYXRhKSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzdCkpICE9IDApIHsKKyAgICAg ICAJCXJldHVybiAoZXJybm9fdG9fZWZpX3N0YXR1cyhlcnJubykpOworICAgICAgICAgICAgICAg IH0KKworICAgICAgICAgICAgICAgIG91dC0+U2l6ZSA9IHNpemVvZihFRklfRklMRV9JTkZPKSAr IHN0cjE2bGVuOworICAgICAgICAgICAgICAgIG91dC0+RmlsZVNpemUgPSBzdC5zdF9zaXplOwor ICAgICAgICAgICAgICAgIG91dC0+UGh5c2ljYWxTaXplID0gc3Quc3RfYmxvY2tzICogc3Quc3Rf Ymxrc2l6ZTsKKyAgICAgICAgICAgICAgICB0b19lZmlfdGltZSgmKG91dC0+TGFzdEFjY2Vzc1Rp bWUpLCBzdC5zdF9hdGltZSk7CisgICAgICAgICAgICAgICAgdG9fZWZpX3RpbWUoJihvdXQtPk1v ZGlmaWNhdGlvblRpbWUpLCBzdC5zdF9tdGltZSk7CisgICAgICAgICAgICAgICAgdG9fZWZpX3Rp bWUoJihvdXQtPkNyZWF0ZVRpbWUpLCBzdC5zdF9jdGltZSk7CisgICAgICAgICAgICAgICAgb3V0 LT5BdHRyaWJ1dGUgPSBtb2RlX3RvX2VmaShzdC5zdF9tb2RlKTsKKworICAgICAgICAgICAgICAg IGlmIChTX0lTRElSKHN0LnN0X21vZGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvdXQt PkF0dHJpYnV0ZSB8PSBFRklfRklMRV9ESVJFQ1RPUlk7CisgICAgICAgICAgICAgICAgfQorCisg ICAgICAgICAgICAgICAgc3RyY3B5X3RvXzE2KG91dC0+RmlsZU5hbWUsIGZpbmZvLT5wYXRoKTsK KyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gKEVGSV9VTlNVUFBPUlRF RCk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gKEVGSV9TVUNDRVNTKTsKK30KKworc3Rh dGljIEVGSUFQSSBFRklfU1RBVFVTCitmaWxlX3NldF9pbmZvX2ltcGwoRUZJX0ZJTEVfSEFORExF IEZpbGUgX191bnVzZWQsCisgICAgICAgICAgICAgICAgICAgRUZJX0dVSUQgKkluZm9ybWF0aW9u VHlwZSBfX3VudXNlZCwKKyAgICAgICAgICAgICAgICAgICBVSU5UTiBCdWZmZXJTaXplIF9fdW51 c2VkLCBWT0lEICpCdWZmZXIgX191bnVzZWQpCit7CisgICAgICAgIHJldHVybiAoRUZJX1dSSVRF X1BST1RFQ1RFRCk7Cit9CisKK3N0YXRpYyBFRklBUEkgRUZJX1NUQVRVUworZmlsZV9mbHVzaF9p bXBsKEVGSV9GSUxFX0hBTkRMRSBGaWxlIF9fdW51c2VkKQoreworICAgICAgICByZXR1cm4gKEVG SV9TVUNDRVNTKTsKK30KKworc3RhdGljIEVGSUFQSSBFRklfU1RBVFVTCitvcGVuX3ZvbHVtZV9p bXBsKEVGSV9GSUxFX0lPX0lOVEVSRkFDRSAqVGhpcywgRUZJX0ZJTEVfSEFORExFICpSb290KQor eworICAgICAgICB2b2xpbmZvX3QgKnZpbmZvID0gKHZvbGluZm9fdCopKFRoaXMgKyAxKTsKKwor ICAgICAgICByZXR1cm4gZG9fZmlsZV9vcGVuKHZpbmZvLCAiIiwgT19SRE9OTFksIFJvb3QpOwor fQorCitzdGF0aWMgc3RydWN0IGZzX29wcyoKK2ZzX3Byb2JlKHN0cnVjdCBkZXZkZXNjICpkZXYp Cit7CisgICAgICAgIHN0cnVjdCBvcGVuX2ZpbGUgZjsKKwlpbnQgZXJyLCBpOworCisgICAgICAg IGYuZl9mbGFncyA9IE9fUkRPTkxZICsgMTsKKyAgICAgICAgZi5mX2RldiA9IChzdHJ1Y3QgZGV2 c3cgKikwOworICAgICAgICBmLmZfb3BzID0gKHN0cnVjdCBmc19vcHMgKikwOworICAgICAgICBm LmZfb2Zmc2V0ID0gMDsKKyAgICAgICAgZi5mX2RldmRhdGEgPSBkZXY7CisKKyAgICAgICAgaWYg KChlcnIgPSBkZXYtPmRfZGV2LT5kdl9vcGVuKCZmLCBkZXYpKSAhPSAwKSB7CisgICAgICAgICAg ICAgICAgcmV0dXJuIE5VTEw7CisgICAgICAgIH0KKworICAgICAgICBmb3IgKGkgPSAwOyBiYWNr ZW5kX2ZpbGVfc3lzdGVtW2ldICE9IE5VTEw7IGkrKykgeworICAgICAgICAgICAgICAgIGYuZl9v cHMgPSBiYWNrZW5kX2ZpbGVfc3lzdGVtW2ldOworCisgICAgICAgICAgICAgICAgaWYgKChlcnIg PSBmLmZfb3BzLT5mb19vcGVuKCIvIiwgJmYpKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAg ICAgICByZXR1cm4gYmFja2VuZF9maWxlX3N5c3RlbVtpXTsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKworICAgICAgICByZXR1cm4gTlVMTDsKK30KKworc3RhdGljIEVGSV9TVEFUVVMK K21ha2VfZnNfZmlsZV9pb19pZmFjZShzdHJ1Y3QgZGV2ZGVzYyAqZGV2LCBFRklfRklMRV9JT19J TlRFUkZBQ0UgKipvdXQpCit7CisgICAgICAgIHN0YXRpYyBzdHJ1Y3QgZnNfb3BzKiBmc29wczsK KyAgICAgICAgRUZJX0ZJTEVfSU9fSU5URVJGQUNFKiBmaWZhY2U7CisgICAgICAgIHZvbGluZm9f dCAqdmluZm87CisKKyAgICAgICAgc3dpdGNoIChkZXYtPmRfdHlwZSkgeworI2lmZGVmIEVGSV9a RlNfQk9PVAorCWNhc2UgREVWVF9aRlM6CisgICAgICAgICAgICAgICAgZnNvcHMgPSAmemZzX2Zz b3BzOworICAgICAgICAgICAgICAgIGJyZWFrOworI2VuZGlmCisgICAgICAgIGRlZmF1bHQ6Cisg ICAgICAgICAgICAgICAgZnNvcHMgPSBmc19wcm9iZShkZXYpOworICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGZzb3BzID09IE5VTEwpIHsKKyAgICAgICAg ICAgICAgICByZXR1cm4gKEVGSV9VTlNVUFBPUlRFRCk7CisgICAgICAgIH0KKworICAgICAgICBm aWZhY2UgPSBtYWxsb2Moc2l6ZW9mKEVGSV9GSUxFX0lPX0lOVEVSRkFDRSkgKyBzaXplb2Yodm9s aW5mb190KSk7CisKKyAgICAgICAgaWYgKGZpZmFjZSA9PSBOVUxMKSB7CisgICAgICAgICAgICAg ICAgcmV0dXJuIChFRklfT1VUX09GX1JFU09VUkNFUyk7CisgICAgICAgIH0KKworICAgICAgICB2 aW5mbyA9ICh2b2xpbmZvX3QqKShmaWZhY2UgKyAxKTsKKworICAgICAgICBmaWZhY2UtPlJldmlz aW9uID0gRUZJX0ZJTEVfSU9fSU5URVJGQUNFX1JFVklTSU9OOworICAgICAgICBmaWZhY2UtPk9w ZW5Wb2x1bWUgPSBvcGVuX3ZvbHVtZV9pbXBsOworICAgICAgICB2aW5mby0+ZGV2ID0gZGV2Owor ICAgICAgICB2aW5mby0+ZnNvcHMgPSBmc29wczsKKworICAgICAgICAqb3V0ID0gZmlmYWNlOwor CisgICAgICAgIHJldHVybiAoRUZJX1NVQ0NFU1MpOworfQorCitzdGF0aWMgRUZJQVBJIEVGSV9T VEFUVVMKK2JpbmRfaWZhY2UoRUZJX0hBTkRMRSBoYW5kbGUsIHN0cnVjdCBkZXZkZXNjICpkZXYp Cit7CisgICAgICAgIEVGSV9TVEFUVVMgc3RhdHVzOworICAgICAgICBFRklfRklMRV9JT19JTlRF UkZBQ0UgKmlmYWNlOworCisgICAgICAgIC8vIENoZWNrIGlmIHRoZXJlIGlzIGFscmVhZHkgYSBm aWxlc3lzdGVtIGludGVyZmFjZQorICAgICAgICBzdGF0dXMgPSBCUy0+T3BlblByb3RvY29sKGhh bmRsZSwgJlNpbXBsZUZpbGVTeXN0ZW1Qcm90b2NvbEdVSUQsCisgICAgICAgICAgICBOVUxMLCBJ SCwgaGFuZGxlLCBFRklfT1BFTl9QUk9UT0NPTF9URVNUX1BST1RPQ09MKTsKKworICAgICAgICBp ZiAoIUVGSV9FUlJPUihzdGF0dXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIChFRklfQUND RVNTX0RFTklFRCk7CisgICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzICE9IEVGSV9VTlNVUFBPUlRF RCkgeworICAgICAgICAgICAgICAgIHJldHVybiAoc3RhdHVzKTsKKyAgICAgICAgfQorCisgICAg ICAgIHN0YXR1cyA9IG1ha2VfZnNfZmlsZV9pb19pZmFjZShkZXYsICZpZmFjZSk7CisKKyAgICAg ICAgaWYgKEVGSV9FUlJPUihzdGF0dXMpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIChzdGF0 dXMpOworICAgICAgICB9CisKKyAgICAgICAgc3RhdHVzID0gQlMtPkluc3RhbGxNdWx0aXBsZVBy b3RvY29sSW50ZXJmYWNlcygmaGFuZGxlLAorICAgICAgICAgICAgJlNpbXBsZUZpbGVTeXN0ZW1Q cm90b2NvbEdVSUQsIGlmYWNlLCBOVUxMKTsKKworICAgICAgICBpZiAoRUZJX0VSUk9SKHN0YXR1 cykpIHsKKyAgICAgICAgICAgICAgICBmcmVlKGlmYWNlKTsKKworICAgICAgICAgICAgICAgIHJl dHVybiAoc3RhdHVzKTsKKyAgICAgICAgfQorCisJcmV0dXJuIChzdGF0dXMpOworfQorCitzdGF0 aWMgRUZJQVBJIEVGSV9TVEFUVVMKK3N0b3BfaW1wbChFRklfRFJJVkVSX0JJTkRJTkcgKlRoaXMg X191bnVzZWQsIEVGSV9IQU5ETEUgQ29udHJvbGxlckhhbmRsZSBfX3VudXNlZCwKKyAgICAgICAg ICBVSU5UTiBOdW1iZXJPZkNoaWxkcmVuIF9fdW51c2VkLCBFRklfSEFORExFICpDaGlsZEhhbmRs ZUJ1ZmZlciBfX3VudXNlZCkKK3sKKyAgICAgICAgLy8gR2V0IHRoZSBwcm90b2NvbCBpbnRlZmFj ZSwgdW5pbnN0YWxsIGl0LCBhbmQgZnJlZSBpdAorICAgICAgICByZXR1cm4gKEVGSV9TVUNDRVNT KTsKK30KKworI2lmZGVmIEVGSV9aRlNfQk9PVAorc3RhdGljIHZvaWQKK2VmaV96ZnNfcHJvYmUo dm9pZCkKK3sKKwlFRklfSEFORExFIGg7CisJdV9pbnQgdW5pdDsKKwlpbnQgaTsKKwljaGFyIGRu YW1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biAoRUlOVkFMKTsKKwl9CisKKwlpZiAocGF0aCAhPSBOVUxMKQorCQkqcGF0aCA9ICgqY3AgPT0g MCkgPyBjcCA6IGNwICsgMTsKKwlpZiAoZGV2ICE9IE5VTEwpCisJCSpkZXYgPSBpZGV2OworCWVs c2UKKwkJZnJlZShpZGV2KTsKKwlyZXR1cm4gKDApOworfQorCitzdGF0aWMgaW50CitiYWNrZW5k X2dldGRldih2b2lkICoqdmRldiwgY29uc3QgY2hhciAqZGV2c3BlYywgY29uc3QgY2hhciAqKnBh dGgpCit7CisJc3RydWN0IGRldmRlc2MgKipkZXYgPSAoc3RydWN0IGRldmRlc2MgKiopdmRldjsK KwlpbnQgcnY7CisKKwkvKgorCSAqIElmIGl0IGxvb2tzIGxpa2UgdGhpcyBpcyBqdXN0IGEgcGF0 aCBhbmQgbm8gZGV2aWNlLCB0aGVuCisJICogdXNlIHRoZSBjdXJyZW50IGRldmljZSBpbnN0ZWFk LgorCSAqLworCWlmIChkZXZzcGVjID09IE5VTEwgfHwgKmRldnNwZWMgPT0gJy8nIHx8ICFzdHJj aHIoZGV2c3BlYywgJzonKSkgeworCQlydiA9IGJhY2tlbmRfcGFyc2VkZXYoZGV2LCBnZXRlbnYo ImN1cnJkZXYiKSwgTlVMTCk7CisJCWlmIChydiA9PSAwICYmIHBhdGggIT0gTlVMTCkKKwkJCSpw YXRoID0gZGV2c3BlYzsKKwkJcmV0dXJuIChydik7CisJfQorCisJLyogUGFyc2UgdGhlIGRldmlj ZSBuYW1lIG9mZiB0aGUgYmVnaW5uaW5nIG9mIHRoZSBkZXZzcGVjLiAqLworCXJldHVybiAoYmFj a2VuZF9wYXJzZWRldihkZXYsIGRldnNwZWMsIHBhdGgpKTsKK30KKworc3RhdGljIHZvaWQKK2lu aXQodm9pZCkKK3sKKwlFRklfSEFORExFIGg7CisgICAgICAgIEVGSV9TVEFUVVMgc3RhdHVzOwor CXVfaW50IHVuaXQ7CisgICAgICAgIGludCBpOworCXN0cnVjdCBkZ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AgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAg ICAgICAgIGlmIChlZmlfaGFuZGxlX2xvb2t1cChoLCAmZGV2LCAmdW5pdCwgJnBvb2xfZ3VpZCkg IT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZnJlZShjdXJyZGV2KTsKKyAgICAgICAg ICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworCQljdXJyZGV2 LT5kX2RldiA9IGRldjsKKwkJY3VycmRldi0+ZF91bml0ID0gdW5pdDsKKwkJY3VycmRldi0+ZF9v cGVuZGF0YSA9IE5VTEw7CisJCWN1cnJkZXYtPmRfdHlwZSA9IGN1cnJkZXYtPmRfZGV2LT5kdl90 eXBlOworCisgICAgICAgICAgICAgICAgc3RhdHVzID0gYmluZF9pZmFjZShoLCBjdXJyZGV2KTsK KworICAgICAgICAgICAgICAgIGlmIChFRklfRVJST1Ioc3RhdHVzKSAmJiBzdGF0dXMgIT0gRUZJ X1VOU1VQUE9SVEVEICYmCisgICAgICAgICAgICAgICAgICAgc3RhdHVzICE9IEVGSV9BQ0NFU1Nf REVOSUVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJGYWlsZWQgdG8gYXR0 YWNoIGZpbGVzeXN0ZW0gaW50ZXJmYWNlIHRvIGVmaXBhcnQldSAoJWxkKVxuIiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdW5pdCwgRUZJX0VSUk9SX0NPREUoc3RhdHVzKSk7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgZnJlZShjdXJyZGV2KTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgIH0KKworICAgICAgICAvKiBBdHRhY2ggU0lNUExFX0ZJTEVfU1lTVEVNIGludGVy ZmFjZSB0byBhbGwgWkZTIGRldmljZXMgKi8KKyNpZmRlZiBFRklfWkZTX0JPT1QKKwl1bml0ID0g MDsKKwloID0gZWZpX2ZpbmRfaGFuZGxlKCZ6ZnNfZGV2LCAwKTsKKwlmb3IgKGkgPSAwOyBoICE9 IE5VTEw7IGggPSBlZmlfZmluZF9oYW5kbGUoJnpmc19kZXYsICsraSkpIHsKKwkJc3RydWN0IHpm c19kZXZkZXNjICpjdXJyZGV2OworCisgICAgICAgICAgICAgICAgY3VycmRldiA9IG1hbGxvYyhz aXplb2Yoc3RydWN0IHpmc19kZXZkZXNjKSk7CisKKyAgICAgICAgICAgICAgICBpZiAoY3VycmRl diA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg ICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoZWZpX2hhbmRsZV9sb29rdXAoaCwgJmRl diwgJnVuaXQsICZwb29sX2d1aWQpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZy ZWUoY3VycmRldik7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg ICAgICAgICB9CisKKwkJY3VycmRldi0+ZF9kZXYgPSBkZXY7CisJCWN1cnJkZXYtPmRfdW5pdCA9 IHVuaXQ7CisJCWN1cnJkZXYtPmRfb3BlbmRhdGEgPSBOVUxMOworCQljdXJyZGV2LT5kX3R5cGUg PSBjdXJyZGV2LT5kX2Rldi0+ZHZfdHlwZTsKKyAgICAgICAgICAgICAgICBjdXJyZGV2LT5wb29s X2d1aWQgPSBwb29sX2d1aWQ7CisgICAgICAgICAgICAgICAgY3VycmRldi0+cm9vdF9ndWlkID0g MDsKKworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGJpbmRfaWZhY2UoaCwgKHN0cnVjdCBkZXZk ZXNjKiljdXJyZGV2KTsKKworICAgICAgICAgICAgICAgIGlmIChFRklfRVJST1Ioc3RhdHVzKSkg eworICAgICAgICAgICAgICAgICAgcHJpbnRmKCJGYWlsZWQgdG8gYXR0YWNoIGZpbGVzeXN0ZW0g aW50ZXJmYWNlIHRvIHpmcyV1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vcGVuLAor CS5kdl9jbG9zZSA9IGVmaWZzX2Rldl9jbG9zZSwKKwkuZHZfaW9jdGwgPSBub2lvY3RsLAorCS5k dl9wcmludCA9IGVmaWZzX2Rldl9wcmludCwKKwkuZHZfY2xlYW51cCA9IE5VTEwKK307CisKK3N0 cnVjdCBmc19vcHMgZWZpZnNfZnNvcHMgPSB7CisJIkVGSSIsCisJZWZpZnNfb3BlbiwKKwllZmlm c19jbG9zZSwKKwllZmlmc19yZWFkLAorCWVmaWZzX3dyaXRlLAorCWVmaWZzX3NlZWssCisJZWZp ZnNfc3RhdCwKKwllZmlmc19yZWFkZGlyCit9OworCitzdGF0aWMgaW50CitlZmlmc19kZXZfaW5p dCh2b2lkKQoreworCUVGSV9IQU5ETEUgKmhpbjsKKwlFRklfU1RBVFVTIHN0YXR1czsKKwlVSU5U TiBzejsKKwl1X2ludCBuLCBuaW4sIHVuaXQ7CisJaW50IGVycjsKKworCXN6ID0gMDsKKwloaW4g PSBOVUxMOworCXN0YXR1cyA9IEJTLT5Mb2NhdGVIYW5kbGUoQnlQcm90b2NvbCwgJlNpbXBsZUZp bGVTeXN0ZW1Qcm90b2NvbEdVSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg MCwgJnN6LCAwKTsKKwlpZiAoc3RhdHVzID09IEVGSV9CVUZGRVJfVE9PX1NNQUxMKSB7CisJCWhp biA9IChFRklfSEFORExFICopbWFsbG9jKHN6KTsKKwkJc3RhdHVzID0gQlMtPkxvY2F0ZUhhbmRs ZShCeVByb3RvY29sLAorICAgICAgICAgICAgICAgICAgICAmU2ltcGxlRmlsZVN5c3RlbVByb3Rv Y29sR1VJRCwgMCwgJnN6LCBoaW4pOworCQlpZiAoRUZJX0VSUk9SKHN0YXR1cykpCisJCQlmcmVl KGhpbik7CisJfQorCWlmIChFRklfRVJST1Ioc3RhdHVzKSkKKwkJcmV0dXJuIChlZmlfc3RhdHVz X3RvX2Vycm5vKHN0YXR1cykpOworCisJLyogRmlsdGVyIGhhbmRsZXMgdG8gb25seSBpbmNsdWRl IEZyZWVCU0QgcGFydGl0aW9ucy4gKi8KKwluaW4gPSBzeiAvIHNpemVvZihFRklfSEFORExFKTsK Kwl1bml0ID0gMDsKKworCWZvciAobiA9IDA7IG4gPCBuaW47IG4rKykgeworCQlzdGF0dXMgPSBC Uy0+T3BlblByb3RvY29sKGhpbltuXSwgJlNpbXBsZUZpbGVTeXN0ZW1Qcm90b2NvbEdVSUQsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBJSCwgTlVMTCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGSV9PUEVOX1BST1RP Q09MX1RFU1RfUFJPVE9DT0wpOworCQlpZiAoRUZJX0VSUk9SKHN0YXR1cykpCisJCQljb250aW51 ZTsKKworICAgICAgICAgICAgICAgIGVmaV9oYW5kbGVfdXBkYXRlX2RldihoaW5bbl0sICZlZmlm c19kZXYsIHVuaXQrKywgMCk7CisJfQorCisJZnJlZShoaW4pOworCXJldHVybiAoZXJyKTsKK30K KworCitzdGF0aWMgaW50CitlZmlmc19kZXZfcHJpbnQoaW50IHZlcmJvc2UpCit7CisJY2hhciBs aW5lWzgwXTsKKyAgICAgICAgRUZJX0RFVklDRV9QQVRIICpkZXZwYXRoOworICAgICAgICBFRklf QkxPQ0tfSU8gKmJsa2lvOworCUVGSV9IQU5ETEUgaCwgKmhpbjsKKwlFRklfU1RBVFVTIHN0YXR1 czsKKwl1X2ludCB1bml0LCBuOworCisJZm9yICh1bml0ID0gMCwgaCA9IGVmaV9maW5kX2hhbmRs ZSgmZWZpZnNfZGV2LCAwKTsKKwkgICAgaCAhPSBOVUxMOyBoID0gZWZpX2ZpbmRfaGFuZGxlKCZl Zmlmc19kZXYsICsrdW5pdCkpIHsKKwkJc3ByaW50ZihsaW5lLCAiICAgICVzJWQ6IiwgZWZpZnNf ZGV2LmR2X25hbWUsIHVuaXQpOworCQlwYWdlcl9vdXRwdXQobGluZSk7CisgICAgICAgICAgICAg ICAgcGFnZXJfb3V0cHV0KCIgICAgRUZJKFNJTVBMRV9GSUxFX1NZU1RFTSIpOworCisJCXN0YXR1 cyA9IEJTLT5IYW5kbGVQcm90b2NvbChoaW5bbl0sICZEZXZpY2VQYXRoR1VJRCwKKwkJICAgICh2 b2lkICoqKSZkZXZwYXRoKTsKKwkJaWYgKCFFRklfRVJST1Ioc3RhdHVzKSkgeworICAgICAgICAg ICAgICAgICAgICAgICAgcGFnZXJfb3V0cHV0KCIsIERFVklDRV9QQVRIIik7CisJCX0KKworCQlz dGF0dXMgPSBCUy0+SGFuZGxlUHJvdG9jb2woaGluW25dLCAmQmxvY2tJb1Byb3RvY29sR1VJRCwK KwkJICAgICh2b2lkICoqKSZibGtpbyk7CisJCWlmICghRUZJX0VSUk9SKHN0YXR1cykpIHsKKyAg ICAgICAgICAgICAgICAgICAgICAgIHBhZ2VyX291dHB1dCgiLCBCTE9DS19JTyIpOworCQl9CisJ CXBhZ2VyX291dHB1dCgiKVxuIik7CisJfQorICAgICAgICByZXR1cm4gKDApOworfQorCitzdGF0 aWMgaW50CitlZmlmc19kZXZfb3BlbihzdHJ1Y3Qgb3Blbl9maWxlICpmLCAuLi4pCit7CisJdmFf bGlzdCBhcmdzOworCXN0cnVjdCBkZXZkZXNjICpkZXY7CisJRUZJX0ZJTEVfSU9fSU5URVJGQUNF ICpmc2lmYWNlOworCUVGSV9IQU5ETEUgaDsKKwlFRklfU1RBVFVTIHN0YXR1czsKKworCXZhX3N0 YXJ0KGFyZ3MsIGYpOworCWRldiA9IHZhX2FyZyhhcmdzLCBzdHJ1Y3QgZGV2ZGVzYyopOworCXZh X2VuZChhcmdzKTsKKworCWggPSBlZmlfZmluZF9oYW5kbGUoJmVmaWZzX2RldiwgZGV2LT5kX3Vu aXQpOworCisJaWYgKGggPT0gTlVMTCkKKwkJcmV0dXJuIChFSU5WQUwpOworCisgICAgICAgIHN0 YXR1cyA9IEJ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GFzIHRoZXkgdGFsayB0aHJvdWdo CisgKiBTSU1QTEVfRklMRV9TWVNURU1fSU5URVJGQUNFLgorICovCitzdGF0aWMgaW50CitlZmlm c19kZXZfc3RyYXRlZ3kodm9pZCAqZGV2ZGF0YSBfX3VudXNlZCwgaW50IHJ3IF9fdW51c2VkLCBk YWRkcl90IGJsayBfX3VudXNlZCwKKyAgICAgICAgICAgICAgICAgICBzaXplX3Qgb2Zmc2V0LCBz aXplX3Qgc2l6ZSBfX3VudXNlZCwgY2hhciAqYnVmIF9fdW51c2VkLAorICAgICAgICAgICAgICAg ICAgIHNpemVfdCAqcnNpemUgX191bnVzZWQpCit7CisgICAgICAgIHByaW50ZigiUmF3IEkvTyBu b3Qgc3VwcG9ydGVkIG9uIEVGSSBGUyBpbnRlcmZhY2VcbiIpOworCXJldHVybiBFTk9UU1VQOwor fQorCisvKgorICogT3BlbiBhIGZpbGUuCisgKi8KK3N0YXRpYyBpbnQKK2VmaWZzX29wZW4oY29u c3QgY2hhciAqdXBhdGgsIHN0cnVjdCBvcGVuX2ZpbGUgKmYpCit7CisJc3RydWN0IGRldmRlc2Mg KmRldjsKKwlFRklfRklMRV9JT19JTlRFUkZBQ0UgKmZzaWZhY2U7CisJRUZJX0ZJTEVfSEFORExF IHJvb3Q7CisgICAgICAgIEVGSV9TVEFUVVMgc3RhdHVzOworICAgICAgICBDSEFSMTYgcGF0aFtz dHJsZW4odXBhdGgpICsgMV07CisKKwlkZXYgPSAoc3RydWN0IGRldmRlc2MgKikoZi0+Zl9kZXZk YXRhKTsKKyAgICAgICAgZnNpZmFjZSA9IGRldi0+ZF9vcGVuZGF0YTsKKworICAgICAgICBpZiAo IXN0cmNtcCh1cGF0aCwgIiIpIHx8ICFzdHJjbXAodXBhdGgsICIvIikpIHsKKyAgICAgICAgICAg ICAgICByZXR1cm4gKGZzaWZhY2UtPk9wZW5Wb2x1bWUoZnNpZmFjZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEVGSV9GSUxFX0hBTkRMRSopJihmLT5mX2Zz ZGF0YSkpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBmc2lm YWNlLT5PcGVuVm9sdW1lKGZzaWZhY2UsICZyb290KTsKKworICAgICAgICAgICAgICAgIGlmIChF RklfRVJST1Ioc3RhdHVzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChlZmlf c3RhdHVzX3RvX2Vycm5vKHN0YXR1cykpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAg ICAgICAgIHN0cmNweV90b18xNihwYXRoLCB1cGF0aCk7CisgICAgICAgICAgICAgICAgc3RhdHVz ID0gcm9vdC0+T3Blbihyb290LCAoRUZJX0ZJTEVfSEFORExFKikmKGYtPmZfZnNkYXRhKSwgcGF0 aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGSV9GSUxFX01PREVfUkVB RCwgMCk7CisKKyAgICAgICAgICAgICAgICByb290LT5DbG9zZShyb290KTsKKworICAgICAgICAg ICAgICAgIGlmIChFRklfRVJST1Ioc3RhdHVzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAg cmV0dXJuIChlZmlfc3RhdHVzX3RvX2Vycm5vKHN0YXR1cykpOworICAgICAgICAgICAgICAgIH0K KworICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9Cit9CisKK3N0YXRpYyBpbnQK K2VmaWZzX2Nsb3NlKHN0cnVjdCBvcGVuX2ZpbGUgKmYpCit7CisgICAgICAgIEVGSV9GSUxFX0hB TkRMRSBmaWxlID0gKEVGSV9GSUxFX0hBTkRMRSlmLT5mX2ZzZGF0YTsKKyAgICAgICAgRUZJX1NU QVRVUyBzdGF0dXM7CisKKyAgICAgICAgc3RhdHVzID0gZmlsZS0+Q2xvc2UoZmlsZSk7CisKKyAg ICAgICAgaWYgKEVGSV9FUlJPUihzdGF0dXMpKQorCQlyZXR1cm4gKGVmaV9zdGF0dXNfdG9fZXJy bm8oc3RhdHVzKSk7CisKKyAgICAgICAgcmV0dXJuICgwKTsKK30KKworc3RhdGljIGludAorZWZp ZnNfcmVhZChzdHJ1Y3Qgb3Blbl9maWxlICpmLCB2b2lkICpzdGFydCwgc2l6ZV90IHNpemUsIHNp emVfdCAqcmVzaWQgLyogb3V0ICovKQoreworICAgICAgICBFRklfRklMRV9IQU5ETEUgZmlsZSA9 IChFRklfRklMRV9IQU5ETEUpZi0+Zl9mc2RhdGE7CisgICAgICAgIFVJTlROIHJlYWRzaXplID0g c2l6ZTsKKyAgICAgICAgRUZJX1NUQVRVUyBzdGF0dXM7CisKKyAgICAgICAgc3RhdHVzID0gZmls ZS0+UmVhZChmaWxlLCAmcmVhZHNpemUsIHN0YXJ0KTsKKworICAgICAgICBpZiAoRUZJX0VSUk9S KHN0YXR1cykpCisJCXJldHVybiAoZWZpX3N0YXR1c190b19lcnJubyhzdGF0dXMpKTsKKworCWlm IChyZXNpZCkKKwkJKnJlc2lkID0gc2l6ZSAtIHJlYWRzaXplOworCisJcmV0dXJuICgwKTsKK30K Kworc3RhdGljIGludAorZWZpZnNfd3JpdGUoc3RydWN0IG9wZW5fZmlsZSAqZiwgdm9pZCAqc3Rh cnQsIHNpemVfdCBzaXplLAorICAgICAgICAgICAgc2l6ZV90ICpyZXNpZCAvKiBvdXQgKi8pCit7 CisgICAgICAgIEVGSV9GSUxFX0hBTkRMRSBmaWxlID0gKEVGSV9GSUxFX0hBTkRMRSlmLT5mX2Zz ZGF0YTsKKyAgICAgICAgVUlOVE4gd3JpdGVzaXplID0gc2l6ZTsKKyAgICAgICAgRUZJX1NUQVRV UyBzdGF0dXM7CisKKyAgICAgICAgc3RhdHVzID0gZmlsZS0+V3JpdGUoZmlsZSwgJndyaXRlc2l6 ZSwgc3RhcnQpOworCisgICAgICAgIGlmIChFRklfRVJST1Ioc3RhdHVzKSkKKwkJcmV0dXJuIChl Zmlfc3RhdHVzX3RvX2Vycm5vKHN0YXR1cykpOworCisJaWYgKHJlc2lkKQorCQkqcmVzaWQgPSBz aXplIC0gd3JpdGVzaXplOworCisJcmV0dXJuICgwKTsKK30KKworc3RhdGljIG9mZl90CitlZmlm c19zZWVrKHN0cnVjdCBvcGVuX2ZpbGUgKmYsIG9mZl90IG9mZnNldCwgaW50IHdoZXJlKQorewor ICAgICAgICBFRklfRklMRV9IQU5ETEUgZmlsZSA9IChFRklfRklMRV9IQU5ETEUpZi0+Zl9mc2Rh dGE7CisgICAgICAgIFVJTlQ2NCBwb3M7CisgICAgICAgIEVGSV9TVEFUVVMgc3RhdHVzOworCisJ c3dpdGNoICh3aGVyZSkgeworCWNhc2UgU0VFS19TRVQ6CisgICAgICAgICAgICAgICAgc3RhdHVz ID0gZmlsZS0+U2V0UG9zaXRpb24oZmlsZSwgb2Zmc2V0KTsKKworICAgICAgICAgICAgICAgIGlm IChzdGF0dXMgIT0gRUZJX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVycm5v ID0gKGVmaV9zdGF0dXNfdG9fZXJybm8oc3RhdHVzKSk7CisgICAgICAgICAgICAgICAgICAgICAg ICByZXR1cm4gLTE7CisgICAgICAgICAgICAgICAgfQorCisJCWJyZWFrOworCWNhc2UgU0VFS19D VVI6CisgICAgICAgICAgICAgICAgc3RhdHVzID0gZmlsZS0+R2V0UG9zaXRpb24oZmlsZSwgJnBv cyk7CisKKyAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IEVGSV9TVUNDRVNTKSB7CisgICAg ICAgICAgICAgICAgICAgICAgICBlcnJubyA9IChlZmlfc3RhdHVzX3RvX2Vycm5vKHN0YXR1cykp OworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgICAgIH0K KworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGZpbGUtPlNldFBvc2l0aW9uKGZpbGUsIHBvcyAr IG9mZnNldCk7CisKKyAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IEVGSV9TVUNDRVNTKSB7 CisgICAgICAgICAgICAgICAgICAgICAgICBlcnJubyA9IChlZmlfc3RhdHVzX3RvX2Vycm5vKHN0 YXR1cykpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAg ICAgIH0KKworCQlicmVhazsKKwljYXNlIFNFRUtfRU5EOgorICAgICAgICAgICAgICAgIHN0YXR1 cyA9IGZpbGUtPlNldFBvc2l0aW9uKGZpbGUsIDB4ZmZmZmZmZmZmZmZmZmZmZik7CisKKyAgICAg ICAgICAgICAgICBpZiAoc3RhdHVzICE9IEVGSV9TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAg ICAgICAgICBlcnJubyA9IChlZmlfc3RhdHVzX3RvX2Vycm5vKHN0YXR1cykpOworICAgICAgICAg ICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgICAgIH0KKwlkZWZhdWx0Ogor CQllcnJubyA9IEVJTlZBTDsKKwkJcmV0dXJuICgtMSk7CisJfQorCisgICAgICAgIHN0YXR1cyA9 IGZpbGUtPkdldFBvc2l0aW9uKGZpbGUsICZwb3MpOworCisgICAgICAgIGlmIChzdGF0dXMgIT0g RUZJX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICBlcnJubyA9IChlZmlfc3RhdHVzX3RvX2Vy cm5vKHN0YXR1cykpOworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorCisJ cmV0dXJuIChwb3MpOworfQorCisvKiBTSU1QTEVfRklMRV9TWVNURU1fUFJPVE9DT0wgaXMgZ2Vh cmVkIHRvd2FyZHMgRkFULCBzbyB3ZSBjYW4ndAorICogcmVwcm9kdWNlIHN0YXQgd2l0aCBhYnNv bHV0ZSBmaWRlbGl0eS4KKyAqLworc3RhdGljIGludAorZWZpZnNfc3RhdChzdHJ1Y3Qgb3Blbl9m aWxlICpmLCBzdHJ1Y3Qgc3RhdCAqc2IpCit7CisgICAgICAgIEVGSV9GSUxFX0hBTkRMRSBmaWxl OworICAgICAgICBVSU5UTiBzaXplID0gMDsKKyAgICAgICAgRUZJX0ZJTEVfSU5GTyAqZmluZm87 OworICAgICAgICBFRklfU1RBVFVTIHN0YXR1czsKKworICAgICAgICBmaWxlID0gKEVGSV9GSUxF X0hBTkRMRSlmLT5mX2ZzZGF0YTsKKyAgICAgICAgc3RhdHVzID0gZmlsZS0+R2V0SW5mbyhmaWxl LCAmRmlsZUluZm9HVUlELCAmc2l6ZSwgTlVMTCk7CisKKyAgICAgICAgaWYgKHN0YXR1cyAhPSBF RklfQlVGRkVSX1RPT19TTUFMTCkgeworICAgICAgICAgICAgICAgIGVycm5vID0gKGVmaV9zdGF0 dXNfdG9fZXJybm8oc3RhdHVzKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAg ICB9CisKKyAgICAgICAgZmluZm8gPSBtYWxsb2Moc2l6ZSk7CisgICAgICAgIHN0YXR1cyA9IGZp bGUtPkdldEluZm8oZmlsZSwgJkZpbGVJbmZvR1VJRCwgJnNpemUsIGZpbmZvKTsKKworICAgICAg ICBpZiAoc3RhdHVzICE9IEVGSV9TVUNDRVNTKSB7CisgICAgICAgICAgICAgICAgZXJybm8gPSAo ZWZpX3N0YXR1c190b19lcnJubyhzdGF0dXMpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLTE7 CisgICAgICAgIH0KKworICAgICAgICAvKiBXZSBjYW4ndCBwcm9wZXJseSBmaWxsIHRoZXNlIGlu Li4uICovCisgICAgICAgIHNiLT5zdF9pbm8gPSAwOworICAgICAgICBzYi0+c3RfbmxpbmsgPSAw OworICAgICAgICBzYi0+c3RfdWlkID0gMDsKKyAgICAgICAgc2ItPnN0X2dpZCA9IDA7CisgICAg ICAgIHNiLT5zdF9ibGtzaXplID0gNTEyOworICAgICAgICAvKiBCdWlsZCB0aGUgbW9kZSBmaWVs ZCAqLworICAgICAgICBpZiAoZmluZm8tPkF0dHJpYnV0ZSAmI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ZnJlZShmaW5mbyk7CisKKyAgICAgICAgcmV0dXJuICgwKTsKK30KKwor c3RhdGljIGludAorZWZpZnNfcmVhZGRpcihzdHJ1Y3Qgb3Blbl9maWxlICpmLCBzdHJ1Y3QgZGly ZW50ICpkKQoreworICAgICAgICBFRklfRklMRV9IQU5ETEUgZmlsZTsKKyAgICAgICAgVUlOVE4g c2l6ZSA9IDA7CisgICAgICAgIEVGSV9GSUxFX0lORk8gKmZpbmZvOzsKKyAgICAgICAgRUZJX1NU QVRVUyBzdGF0dXM7CisKKyAgICAgICAgZmlsZSA9IChFRklfRklMRV9IQU5ETEUpZi0+Zl9mc2Rh dGE7CisgICAgICAgIHN0YXR1cyA9IGZpbGUtPlJlYWQoZmlsZSwgJnNpemUsIE5VTEwpOworCisg ICAgICAgIGlmIChzdGF0dXMgIT0gRUZJX0JVRkZFUl9UT09fU01BTEwpIHsKKyAgICAgICAgICAg ICAgICBlcnJubyA9IChlZmlfc3RhdHVzX3RvX2Vycm5vKHN0YXR1cykpOworICAgICAgICAgICAg ICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzaXplID09IDApIHsKKyAg ICAgICAgICAgICAgICByZXR1cm4gKEVOT0VOVCk7CisgICAgICAgIH0KKworICAgICAgICBmaW5m byA9IG1hbGxvYyhzaXplKTsKKyAgICAgICAgc3RhdHVzID0gZmlsZS0+UmVhZChmaWxlLCAmc2l6 ZSwgZmluZm8pOworCisgICAgICAgIGlmIChzdGF0dXMgIT0gRUZJX1NVQ0NFU1MpIHsKKyAgICAg ICAgICAgICAgICBlcnJubyA9IChlZmlfc3RhdHVzX3RvX2Vycm5vKHN0YXR1cykpOworICAgICAg ICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorCisgICAgICAgIHN0cmNweV9mcm9tXzE2 KGQtPmRfbmFtZSwgZmluZm8tPkZpbGVOYW1lKTsKKyAgICAgICAgZC0+ZF9uYW1sZW4gPSBzdHJs ZW4oZC0+ZF9uYW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HVzID0gRUZJX0RF VklDRV9FUlJPUjsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIEVJTlZB TDoKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBFRklfSU5WQUxJRF9QQVJBTUVURVI7CisgICAg ICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBFU1RBTEU6CisgICAgICAgICAgICAg ICAgc3RhdHVzID0gRUZJX01FRElBX0NIQU5HRUQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisK KyAgICAgICAgY2FzZSBFTlhJTzoKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBFRklfTk9fTUVE SUE7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBFTk9FTlQ6CisgICAg ICAgICAgICAgICAgc3RhdHVzID0gRUZJX05PVF9GT1VORDsKKyAgICAgICAgICAgICAgICBicmVh azsKKworICAgICAgICBjYXNlIEVOT01FTToKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBFRklf T1VUX09GX1JFU09VUkNFUzsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNl IEVOT1RTVVA6CisgICAgICAgIGNhc2UgRU5PREVWOgorICAgICAgICAgICAgICAgIHN0YXR1cyA9 IEVGSV9VTlNVUFBPUlRFRDsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNl IEVOT1NQQzoKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBFRklfVk9MVU1FX0ZVTEw7CisgICAg ICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBFQUNDRVM6CisgICAgICAgICAgICAg ICAgc3RhdHVzID0gRUZJX1dSSVRFX1BST1RFQ1RFRDsKKyAgICAgICAgICAgICAgICBicmVhazsK KworICAgICAgICBjYXNlIDA6CisgICAgICAgICAgICAgICAgc3RhdHVzID0gRUZJX1NVQ0NFU1M7 CisgICAgICAgICAgICAgICAgYnJlYWs7C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fSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZWZpX3JlZ2lz dGVyX2hhbmRsZXMoc3csICZoYW5kbGUsICZhbGlhcywgMSk7CisgICAgICAgIH0KK30KKwogRUZJ X0hBTkRMRQogZWZpX2ZpbmRfaGFuZGxlKHN0cnVjdCBkZXZzdyAqZGV2LCBpbnQgdW5pdCkKIHsK QEAgLTExNiwzICsxNDEsMjkgQEAgZWZpX2hhbmRsZV91cGRhdGVfZGV2KEVGSV9IQU5ETEUgaCwg c3RydWN0IGRldnN3ICpkZXYsIGludCB1bml0LAogCiAJcmV0dXJuIChFTk9FTlQpOwogfQorCitp bnQKK2VmaV9oYW5kbGVfcmVtb3ZlX2RldihFRklfSEFORExFIGgpCit7CisJaW50IGlkeDsKKwor ICAgICAgICAvKiBGaW5kIHRoZSBlbnRyeSAqLworCWZvciAoaWR4ID0gMDsgaWR4IDwgbmVudHJp ZXM7IGlkeCsrKSB7CisJCWlmIChlbnRyeVtpZHhdLmhhbmRsZSAhPSBoKQorCQkJY29udGludWU7 CisJfQorCisgICAgICAgIGlmIChpZHggPj0gbmVudHJpZXMpCisgICAgICAgICAgICAgICAgcmV0 dXJuIChFTk9FTlQpOworICAgICAgICBlbHNlIGlmIChpZHggPT0gbmVudHJpZXMgLSAxKSB7Cisg ICAgICAgICAgICAgICAgbmVudHJpZXMtLTsKKyAgICAgICAgICAgICAgICBlbnRyeSA9IHJlYWxs b2MoZW50cnksIG5lbnRyaWVzICogc2l6ZW9mKHN0cnVjdCBlbnRyeSkpOworICAgICAgICB9IGVs c2UgeworICAgICAgICAgICAgICAgIG1lbWNweShlbnRyeSArIGlkeCwgZW50cnkgKyBpZHggKyAx LAorICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yoc3RydWN0IGVudHJ5KSAqIChuZW50cmll cyAtIChpZHggKyAxKSkpOworICAgICAgICAgICAgICAgIG5lbnRyaWVzLS07CisgICAgICAgICAg ICAgICAgZW50cnkgPSByZWFsbG9jKGV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NTSUJJTElUWSBPRgorICog U1VDSCBEQU1BR0UuCisgKgorICogJEZyZWVCU0QkCisgKi8KKworI2luY2x1ZGUgInN0cmluZzE2 LmgiCisjaW5jbHVkZSA8c3RkZGVmLmg+CisKK3NpemVfdAorc3RybGVuMTYoY29uc3QgQ0hBUjE2 ICpzdHIpCit7CisgICAgICAgIHNpemVfdCBpOworCisgICAgICAgIGZvciAoaSA9IDA7IHN0cltp XSAhPSAwOyBpKyspOworCisgICAgICAgIHJldHVybiBpOworfQorCitDSEFSMTYgKgorc3RyY3B5 MTYoQ0hBUjE2ICpkc3QsIGNvbnN0IENIQVIxNiAqc3JjKQoreworICAgICAgICBzdHBjcHkxNihk c3QsIHNyYyk7CisKKyAgICAgICAgcmV0dXJuIChkc3QpOworfQorCitDSEFSMTYgKgorc3RwY3B5 MTYoQ0hBUjE2ICpkc3QsIGNvbnN0IENIQVIxNiAqc3JjKQoreworICAgICAgICBmb3IgKDsgKnNy YyAhPSAwOyBzcmMrKywgZHN0KyspIHsKKyAgICAgICAgICAgICAgICAqZHN0ID0gKnNyYzsKKyAg ICAgICAgfQorCisgICAgICAgICpkc3QgPSAqc3JjOworCisgICAgICAgIHJldHVybiBkc3Q7Cit9 CisKK2NoYXIgKgorc3RyY3B5X2Zyb21fMTYoY2hhciAqZHN0LCBjb25zdCBDSEFSMTYgKnNyYykK K3sKKyAgICAgICAgaW50IGk7CisKKyAgICAgICAgZm9yIChpID0gMDsgc3JjW2ldICE9IDA7IGkr KykgeworICAgICAgICAgICAgICAgIGRzdFtpXSA9IHNyY1tpXTsKKyAgICAgICAgfQorCisgICAg ICAgIGRzdFtpXSA9IDA7CisKKyAgICAgICAgcmV0dXJuIChkc3QpOworfQorCitDSEFSMTYgKgor c3RyY3B5X3RvXzE2KENIQVIxNiAqZHN0LCBjb25zdCBjaGFyICpzcmMpCit7CisgICAgICAgIGlu dCBpOworCisgICAgICAgIGZvciAoaSA9IDA7IHNyY1tpXSAhPSAwOyBpKyspIHsKKyA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xICsgMzAgKyAzMSAr IDMxICsgMzAsCisgICAzMSArIDI4ICsgMzEgKyAzMCArIDMxICsgMzAgKyAzMSArIDMxICsgMzAg KyAzMSwKKyAgIDMxICsgMjggKyAzMSArIDMwICsgMzEgKyAzMCArIDMxICsgMzEgKyAzMCArIDMx ICsgMzAsCisgICAzMSArIDI4ICsgMzEgKyAzMCArIDMxICsgMzAgKyAzMSArIDMxICsgMzAgKyAz MSArIDMwICsgMzEgfSwKKyAgezAsCisgICAwLAorICAgMzEsCisgICAzMSArIDI5LAorICAgMzEg KyAyOSArIDMxLAorICAgMzEgKyAyOSArIDMxICsgMzAsCisgICAzMSArIDI5ICsgMzEgKyAzMCAr IDMxLAorICAgMzEgKyAyOSArIDMxICsgMzAgKyAzMSArIDMwLAorICAgMzEgKyAyOSArIDMxICsg MzAgKyAzMSArIDMwICsgMzEsCisgICAzMSArIDI5ICsgMzEgKyAzMCArIDMxICsgMzAgKyAzMSAr IDMxLAorICAgMzEgKyAyOSArIDMxICsgMzAgKyAzMSArIDMwICsgMzEgKyAzMSArIDMwLAorICAg MzEgKyAyOSArIDMxICsgMzAgKyAzMSArIDMwICsgMzEgKyAzMSArIDMwICsgMzEsCisgICAzMSAr IDI5ICsgMzEgKyAzMCArIDMxICsgMzAgKyAzMSArIDMxICsgMzAgKyAzMSArIDMwLAorICAgMzEg KyAyOSArIDMxICsgMzAgKyAzMSArIDMwICsgMzEgKyAzMSArIDMwICsgMzEgKyAzMCArIDMxIH19 OworCiB2b2lkCiBlZmlfdGltZV9pbml0KHZvaWQpCiB7CkBAIC02OCw0NSArMTAzLDQ2IEBAIGVm aV90aW1lX2Zpbmkodm9pZCkKIHsKIH0KIAotc3RhdGljIHRpbWVfdAotZWZpX3RpbWUoRUZJX1RJ TUUgKkVUaW1lKQordm9pZAordG9fZWZpX3RpbWUoRUZJX1RJTUUgKmVmaV90aW1lLCB0aW1lX3Qg dGltZSkKIHsKLSAgICAvKgotICAgIC8vICBUaGVzZSBhcnJheXM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wKLSAgICAgMzEgKyAyOSArIDMxICsgMzAgKyAzMSArIDMwLAotICAgICAz MSArIDI5ICsgMzEgKyAzMCArIDMxICsgMzAgKyAzMSwKLSAgICAgMzEgKyAyOSArIDMxICsgMzAg KyAzMSArIDMwICsgMzEgKyAzMSwKLSAgICAgMzEgKyAyOSArIDMxICsgMzAgKyAzMSArIDMwICsg MzEgKyAzMSArIDMwLAotICAgICAzMSArIDI5ICsgMzEgKyAzMCArIDMxICsgMzAgKyAzMSArIDMx ICsgMzAgKyAzMSwKLSAgICAgMzEgKyAyOSArIDMxICsgMzAgKyAzMSArIDMwICsgMzEgKyAzMSAr IDMwICsgMzEgKyAzMCwKLSAgICAgMzEgKyAyOSArIDMxICsgMzAgKyAzMSArIDMwICsgMzEgKyAz MSArIDMwICsgMzEgKyAzMCArIDMxIH19OwotCi0gICAgdGltZV90ICBVVGltZTsgCisgICAgICAg IGlmICh0aW1lID49IDApIHsKKyAgICAgICAgICAgICAgICBmb3IgKGVmaV90aW1lLT5ZZWFyID0g MTk3MDsKKyAgICAgICAgICAgICAgICAgICAgdGltZSA+IEN1bXVsYXRpdmVEYXlzW2lzbGVhcChl ZmlfdGltZS0+WWVhcildWzEzXSAqIFNFQ1NQRVJEQVk7CisgICAgICAgICAgICAgICAgICAgIHRp bWUgLT0gQ3VtdWxhdGl2ZURheXNbaXNsZWFwKGVmaV90aW1lLT5ZZWFyKV1bMTNdICogU0VDU1BF UkRBWSwKKyAgICAgICAgICAgICAgICAgICAgZWZpX3RpbWUtPlllYXIrKyk7CisKKyAgICAgICAg ICAgICAgICBmb3IgKGVmaV90aW1lLT5Nb250aCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHRp bWUgPiBDdW11bGF0aXZlRGF5c1tpc2xlYXAoZWZpX3RpbWUtPlllYXIpXVtlZmlfdGltZS0+TW9u dGhdICoKKyAgICAgICAgICAgICAgICAgICAgICBTRUNTUEVSREFZOworICAgICAgICAgICAgICAg ICAgICBlZmlfdGltZS0+TW9udGgrKyk7CisKKyAgICAgICAgICAgICAgICB0aW1lIC09IEN1bXVs YXRpdmVEYXlzW2lzbGVhcChlZmlfdGltZS0+WWVhcildW2VmaV90aW1lLT5Nb250aCAtIDFdICoK KyAgICAgICAgICAgICAgICAgICAgU0VDU1BFUkRBWTsKKworICAgICAgICAgICAgICAgIGZvciAo ZWZpX3RpbWUtPkRheSA9IDA7IHRpbWUgPiBTRUNTUEVSREFZOworICAgICAgICAgICAgICAgICAg ICB0aW1lIC09IFNFQ1NQRVJEQVksIGVmaV90aW1lLT5EYXkrKyk7CisKKyAgICAgICAgICAgICAg ICBmb3IgKGVmaV90aW1lLT5Ib3VyID0gMDsgdGltZSA+IFNFQ1NQRVJIT1VSOworICAgICAgICAg ICAgICAgICAgICB0aW1lIC09IFNFQ1NQRVJIT1VSLCBlZmlfdGltZS0+SG91cisrKTsKKworICAg ICAgICAgICAgICAgIGZvciAoZWZpX3RpbWUtPk1pbnV0ZSA9IDA7IHRpbWUgPiA2MDsKKyAgICAg ICAgICAgICAgICAgICAgdGltZSAtPSA2MCwgZWZpX3RpbWUtPk1pbnV0ZSsrKTsKKworICAgICAg ICAgICAgICAgIGVmaV90aW1lLT5TZWNvbmQgPSB0aW1lOworICAgICAgICAgICAgICAgIGVmaV90 aW1lLT5OYW5vc2Vjb25kID0gMDsKKyAgICAgICAgICAgICAgICBlZmlfdGltZS0+VGltZVpvbmUg PSAwOworICAgICAgICAgICAgICAgIGVmaV90aW1lLT5EYXlsaWdodCA9IDA7CisgICAgICAgIH0g ZWxzZSB7CisgICAgICAgICAgICAgICAgbWVtc2V0KGVmaV90aW1lLCAwLCBzaXplb2YoRUZJX1RJ TUUpKTsKKyAgICAgICAgfQorfQorCit0aW1lX3QKK2Zyb21fZWZpX3RpbWUoRUZJX1RJTUUgKkVU aW1lKQoreworCisgICAgdGltZV90ICBVVGltZTsKICAgICBpbnQgICAgIFllYXI7CiAKICAgICAv KgpAQCAtMTM0LDcgKzE3MCw3IEBAIGVmaV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XBh cnRfZGV2LCArK2kpKSB7Ci0JCXNucHJpbnRmKGRuYW1lLCBzaXplb2YoZG5hbWUpLCAiJXMlZDoi LCBlZmlwYXJ0X2Rldi5kdl9uYW1lLCBpKTsKLQkJaWYgKHpmc19wcm9iZV9kZXYoZG5hbWUsICZn dWlkKSA9PSAwKQotCQkJKHZvaWQpZWZpX2hhbmRsZV91cGRhdGVfZGV2KGgsICZ6ZnNfZGV2LCB1 bml0KyssIGd1aWQpOwotCX0KLX0KLSNlbmRpZgo= --94eb2c058ce8fc2ff60542bb5373-- From owner-freebsd-current@freebsd.org Sat Dec 3 06:57:25 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B70FC64125 for ; Sat, 3 Dec 2016 06:57:25 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4A95BBD1 for ; Sat, 3 Dec 2016 06:57:25 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 49EF8C64122; Sat, 3 Dec 2016 06:57:25 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 494FDC64121; Sat, 3 Dec 2016 06:57:25 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FFD4BD0; Sat, 3 Dec 2016 06:57:25 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id m5so381506783ioe.3; Fri, 02 Dec 2016 22:57:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9QzwDbl5calEjqEEMAErKeGN1StJQ2YCBxcA/wkjhIM=; b=Jg+2k/ALQxpqJAAkplNaat7C03yV8zY7nqOo09NTDFXDyRcmEPo4fWqCjt25W4/8Ex n9dlDfsKjCCXZ+FfQf6u3g6DrotPamAGrrzfMAU7O5shsR9pJFyPJo44g5uz5OL32qFv baV3pruYn54b2vxeynIEtke7CBtoq5c+oUUvZ2Reg9AzFZ/Cn+9PJz9CDg2yPsGH/q6o pDgtMNXx3qM/F0Ty3Xs6NOo/EGQ0S2CWoKvENGZzKg5N8WcdllMKM3ZN59cvqS1zI74c 6MI5ioYbt/JShCXrSg/FHiVp4uaWcmaudGjOkN+m2DYMEm2QIxVG3kejlxKXLudCLZ3q ig/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9QzwDbl5calEjqEEMAErKeGN1StJQ2YCBxcA/wkjhIM=; b=LP+Xpx+BVtfUyGe7G15XD6mC/iZODju5Ad50vbWhM/DH3JzcdvmnwvEhgEAcSHBZZy 5zhK5EsiHIAkhcq6zDza6d+u8VeWomwskfWNiThS0sqn05C8ZWJkuoz1IUKdl7iPIW4M vXOxmnFd0dDgw6LJgbTbHFQ/9JVA8WZBCSaencYqvtt/+PPjYm+ajwcqtSJhknd1pacV fsK/+c+qeWsRNzO+P/rLW54hN387Pdvhwb926DcmEIrecFxJhs6mnMyqMZtEX3OE5uNi e3muLSfOunMcwi7S7rzkFqUqY4sfdlHKm3dBb75lbYp5eoCogfVbpEczWq3JIxAVoQr+ If+g== X-Gm-Message-State: AKaTC02rJIKJu5Jklwkhio/CBko2O3QVnS4lqnSagtfkOAdz7BF63l7NLMuabrS10FZbNoaMyF34pV2zY81i2w== X-Received: by 10.36.58.85 with SMTP id m82mr754844itm.29.1480748244476; Fri, 02 Dec 2016 22:57:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.136.197 with HTTP; Fri, 2 Dec 2016 22:57:24 -0800 (PST) In-Reply-To: References: From: Ben Woods Date: Sat, 3 Dec 2016 14:57:24 +0800 Message-ID: Subject: Re: CFT EFI Boot Refactoring To: Eric McCorkle Cc: freebsd-hackers@freebsd.org, freebsd-amd64@freebsd.org, "current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 03 Dec 2016 06:57:25 -0000 On 3 December 2016 at 14:40, Ben Woods wrote: > I just applied your diff to my subversion repository, and tried to > buildworld, but the build failed with the following error: > > make[6]: make[6]: don't know how to make efipart.c. Stop > > make[6]: stopped in /usr/src/sys/boot/efi/drivers > *** [all_subdir_sys/boot/efi/drivers] Error code 2 > > > Does it build ok for you? > > Because I use subversion, and I wanted to build it from my main tree, I > had to regenerate your patch using "git diff --no-prefix > master..origin/efize_new > /tmp/efize_new.diff". > I could then apply this cleanly with "svn patch /tmp/efize_new.diff". > > Never mind, I have realised that efipart.c was moved from boot/efi/libefi/ to boot/efi/drivers/ in your git patch, but subversion did not interpret this change and simply patched the file in place. I have fixed this with: $ svn mv boot/efi/libefi/efipart.c boot/efi/drivers/efipart.c Sorry for the noise (and the previous top post). Regards, Ben -- From: Benjamin Woods woodsb02@gmail.com From owner-freebsd-current@freebsd.org Sat Dec 3 10:10:41 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD606C62BB7 for ; Sat, 3 Dec 2016 10:10:41 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 8CD15108F for ; Sat, 3 Dec 2016 10:10:41 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 8C2EEC62BB3; Sat, 3 Dec 2016 10:10:41 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B88BC62BB0; Sat, 3 Dec 2016 10:10:41 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55AF1108D; Sat, 3 Dec 2016 10:10:41 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-io0-x234.google.com with SMTP id c21so479273463ioj.1; Sat, 03 Dec 2016 02:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tWbfHRFQVRNY2LVfb8yomegI84LMbuo8S184Y7nGdQs=; b=LSD5HbZIQMZFglefnW6cOrZZQDXp723wfiqgYPHTSbT5BUV2fvJ+mQbyAlGFo/PFY/ +fDvjVBe4nZKpuV9Q4gEPNNSD3m/N2hsxfYAqTv2HYzzgZCO2Xtjm4ecMLMIzg7N8B+t dzQQtdhRecqdyXNGtToqCDx9W4L3uGeYaUsln7icvFrpGU98h6Al4Qo5dwBfadUp8Rsg 0y4oYO1BCgBGrC9P6UP435ppq8aDR4GbCggNz/KS64aIlgxbpTI0NkCFMkKI4ug10hRa Dru1fa7VmU2diviHwwSsFI1Mf5erWUAyK0hvBH0iLo+cu85OLObZmr+ma/Cc7W3knB38 NRhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tWbfHRFQVRNY2LVfb8yomegI84LMbuo8S184Y7nGdQs=; b=FBqNrEVuBJlXqEByyHhjejliOVfFsqdnGCkPuYPCMTr52lBZPWhLZIdP+eiCbg17OT zlnRq86a9mK+x38t/EafQGKF70rMA+tkH5vTBuY4ZXQztt4gJ8zwQ5zh4T02GGbCROAs Rjzr/oWx/TGyQUXGQli/vX3vPB7QDFfIrosjWGfUoFYMykqf4wEF+eX9wnurnln2zo9c i8hLAjwJqIlpHmNeaN3GelbFFhCJYHGjnMLQ+z907Z0dawEZgaQFYUIDhhREy8U72KRc v0tYix85cCi2awhtLnoavNFImCn6839cPACDRFqRuCX+re4JsucQB8VWQXAMOLw2odDR +t1Q== X-Gm-Message-State: AKaTC02YA/ivyXeyXK2l6/aFPiHV2oT0z0g55H3CFqWRB5gP0fqiIoq1+I4SUkSdRMX6vhq3EBPHoehqJo8olg== X-Received: by 10.36.43.193 with SMTP id h184mr1154910ita.29.1480759840445; Sat, 03 Dec 2016 02:10:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.136.197 with HTTP; Sat, 3 Dec 2016 02:10:39 -0800 (PST) In-Reply-To: References: From: Ben Woods Date: Sat, 3 Dec 2016 18:10:39 +0800 Message-ID: Subject: Re: CFT EFI Boot Refactoring To: Eric McCorkle Cc: freebsd-hackers@freebsd.org, freebsd-amd64@freebsd.org, "current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 03 Dec 2016 10:10:41 -0000 On 3 December 2016 at 01:02, Eric McCorkle wrote: > Therefore, I would like to issue a CFT for this changeset. We need > people using the boot1/loader EFI boot setup to test their setup using > boot1 and loader as built with this patch applied. > After I got this to build, I managed to install the new world, and copy the new boot1.efi to /EFI/BOOT/BOOTX64.EFI. Upon reboot, my machine hung at the loader, with the following text on the screen: >> FreeBSD EFI boot block Loader path: /boot/loader.efi Initializing modules: FS Backend| Unfortunately it stopped there and didn't continue. I was able to recover my system by moving my BOOTX64.BAK to BOOTX64.EFI, and changing back to my old loader.efi. Any thoughts of how we can debug this? Regards, Ben -- From: Benjamin Woods woodsb02@gmail.com From owner-freebsd-current@freebsd.org Sat Dec 3 12:13:16 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AB88C6375C for ; Sat, 3 Dec 2016 12:13:16 +0000 (UTC) (envelope-from daniel.dalonzo@gmail.com) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ABBD128C for ; Sat, 3 Dec 2016 12:13:16 +0000 (UTC) (envelope-from daniel.dalonzo@gmail.com) Received: by mail-qk0-x241.google.com with SMTP id y205so33766939qkb.1 for ; Sat, 03 Dec 2016 04:13:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:message-id:date:in-reply-to:references:delivered-to :mime-version; bh=9+iJJDsKIpz/oWxktQwAotyaRROtv7ZwSlsAUaHZvzQ=; b=EmrkYjgjog1/KW+wjTcAcZrPzkdkbQO1QCVKYRW8+m8WimNhibg1CJOGcoY3+WIPin F6KTg4qaFmjDSk8l6ne/PHlfgbjFRqJrfCIuBfXxohhu/UOEi0VxMAcNZqxUKAlg1yXq aq7ag29ouxz+1O5n5jobTzvUnwhtTFw3S6MMn7dPglv1qK5ifB/A31ZrRRL4B5d24xFD +FrUtzlaZhpw9JBrEyyUCPmSIEFL7pmv5ZxJFwmmr6qbZShzOWLZSQ43w18zuFj9yYqZ Qzd6XxXJQZAXS1j/vwx/Hjn0NQh86nfLLt3V7/925DRq7JYKTd74rIYlZdKdORiOLGjC JQgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:message-id:date:in-reply-to :references:delivered-to:mime-version; bh=9+iJJDsKIpz/oWxktQwAotyaRROtv7ZwSlsAUaHZvzQ=; b=eRSA6vLjTVfhUApJhxLcpfp3XFm2QZnlCzpT30/8J0fw+08gGHnNhEpExkR9Rk2IOY tXD092zM39SRCNfjLTi58j9qPalJg4aJAJZUEnKDVRBB6Qxdept+o4mm0GLaP8y/KIXQ ypfRtMoFakbxl4ZuoTwIcrzeciMgnpB6c4LLWHRkwyhep33QpyH970CQPLaFHGu0pxb1 yvYnv5vMTRj9NAsIXFbNvVAlzbC2vzBEUfeVwJrNob8ki1/02fa9rXsmqwCYHitI2S/n 8SFIMS9Y5pLrK95hFUpJXDXG7Ps4EXLoiA/1ApQKXCzjPOlvcIfOPPc0jWxyw19HLoJF qedA== X-Gm-Message-State: AKaTC00bJaxjdMmcuWLAudnDp/LLJXkS3qyb33rvrhNeOaScCLve1c+599T6I1bijRUbHg== X-Received: by 10.55.127.7 with SMTP id a7mr41650713qkd.204.1480767194972; Sat, 03 Dec 2016 04:13:14 -0800 (PST) Received: from [127.0.0.1] (send-12.prod.mixmax-mailer.com. [52.200.39.124]) by smtp.gmail.com with ESMTPSA id w34sm4837802qtw.10.2016.12.03.04.13.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 04:13:14 -0800 (PST) From: Daniel D'Alonzo To: freebsd-current@freebsd.org, freebsd-current-unsubscribe@freebsd.org Subject: Re: freebsd-current Digest, Vol 684, Issue 8 Message-Id: <00a1d58c-0677-7595-29a6-c86c69a7cf62@mixmax.com> Date: Sat, 03 Dec 2016 12:13:11 +0000 In-Reply-To: References: X-Mixmax-Message-Id: MQeSYd95ct81nCflE Delivered-To: rsm@mixmax.com X-Mailer: Mixmax (mixmax.com) MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 03 Dec 2016 12:13:16 -0000 please remove me from your mailing list. i repeat, please remove me from = the thi subscription and any other subscription Daniel = D'Alonzohttp://danieldalonzo.com/ On Sat, Dec 3, 2016 7:00 AM, = freebsd-current-request@freebsd.org wrote: Send freebsd-current mailing = list submissions to freebsd-current@freebsd.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.freebsd.org/mailman/listinfo/freebsd-current or, via email, send a message with subject or body 'help' to freebsd-current-request@freebsd.org You can reach the person managing = the list at freebsd-current-owner@freebsd.org When replying, please edit your Subject line so it is more specific than "Re: Contents of freebsd-current digest..." Today's Topics: 1. Re: CFT EFI Boot Refactoring (Ben Woods) 2. Re: CFT EFI Boot = Refactoring (Ben Woods) --------------------------------------------= -------------------------- Message: 1 Date: Sat, 3 Dec 2016 14:57:24 = +0800 From: Ben Woods To: Eric McCorkle = Cc: freebsd-hackers@freebsd.org, = freebsd-amd64@freebsd.org, "current@freebsd.org" Subject: Re: CFT EFI Boot Refactoring Message-ID: Content-Type: text/plain; charset=3DUTF-8 On 3 December 2016 at 14:40, = Ben Woods wrote: > I just applied your diff to my = subversion repository, and tried to > buildworld, but the build failed = with the following error: > > make[6]: make[6]: don't know how to make = efipart.c. Stop > > make[6]: stopped in /usr/src/sys/boot/efi/drivers > *** [all_subdir_sys/boot/efi/drivers] Error code 2 > > > Does it build ok for you? > > Because I use subversion, and I wanted to= build it from my main tree, I > had to regenerate your patch using "git = diff --no-prefix > master..origin/efize_new > /tmp/efize_new.diff". > I could then apply this cleanly with "svn patch /tmp/efize_new.diff". > > Never mind, I have realised that efipart.c was moved from = boot/efi/libefi/ to boot/efi/drivers/ in your git patch, but subversion = did not interpret this change and simply patched the file in place. I have fixed this with: $ svn mv boot/efi/libefi/efipart.c = boot/efi/drivers/efipart.c Sorry for the noise (and the previous top = post). Regards, Ben -- From: Benjamin Woods woodsb02@gmail.com ------------------------------ Message: 2 Date: Sat, 3 Dec 2016 18:10:39 +0800 From: Ben Woods To: Eric McCorkle Cc: freebsd-hackers@freebsd.org, = freebsd-amd64@freebsd.org, "current@freebsd.org" Subject: Re: CFT EFI Boot Refactoring Message-ID: Content-Type: text/plain; charset=3DUTF-8 On 3 December 2016 at 01:02, = Eric McCorkle wrote: > Therefore, I would like = to issue a CFT for this changeset. We need > people using the boot1/loader= EFI boot setup to test their setup using > boot1 and loader as built with= this patch applied. > After I got this to build, I managed to install= the new world, and copy the new boot1.efi to /EFI/BOOT/BOOTX64.EFI. Upon reboot, my machine hung at the loader, with the following text on the screen: >> FreeBSD EFI boot block Loader path: /boot/loader.efi Initializing modules: FS Backend| Unfortunately it stopped there and = didn't continue. I was able to recover my system by moving my BOOTX64.= BAK to BOOTX64.EFI, and changing back to my old loader.efi. Any thoughts of how we can debug this? Regards, Ben -- From: Benjamin Woods woodsb02@gmail.com ---------------------------= --- Subject: Digest Footer ________________________________________= _______ freebsd-current@freebsd.org mailing list https://lists.freebsd.= org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" -----------------------------= - End of freebsd-current Digest, Vol 684, Issue 8 ***********************************************