From owner-svn-src-all@freebsd.org Sun Jun 23 00:16:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB6F415BE5DF; Sun, 23 Jun 2019 00:16:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F1CE6C3A2; Sun, 23 Jun 2019 00:16:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f43.google.com with SMTP id e3so592712ioc.12; Sat, 22 Jun 2019 17:16:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=HuSoddGLS1i4kPG2LBRYp2pxleDet6LQhX5axlGnyrg=; b=uSvb1KPzIJG74Jixx74mFmmkdkY4uKPbwrnp5TO9QRP8vGslM7O6P/W8I6P1nv98lv zcGGru2Li0F3jQGp05O4YD5OXhwOY0FWB2BP2NIL4d71LupcHjR/EC0Ghy0rZhD14lhZ o8/dWbbid9dyTgnWoyTKR7cWm1qEUNrPP4Ic/lQtZDOEh9fVbPfo9sHDy7fi75jGWZ8p eXMyGHXxl4S+gx8bY1vREAQxtDbGsvhseK/gh5BVAX3EqjUSc9QThEMn3uTvBO+LAckJ 05UKjjEknLRigxeXedev7pd2ACwV2mkhMYJHa8Mk5VZkmYg4vFb3HEEr4ODsnmxVEUSs FYYQ== X-Gm-Message-State: APjAAAWpdpktXQzyuDeqHnnV/URh11CAIN371bhHBeq6kyMY7l0HvUR3 LsZU9Ce0uewMeoNxOhW9d0Vw5YuP X-Google-Smtp-Source: APXvYqz0tOg39O2vRwuhiPNgh/AGLl2rm3LwJaUsqAL1d3wYZ4aODcWAzCU5wPHb74EvYuYgoLb3rA== X-Received: by 2002:a5e:9241:: with SMTP id z1mr8905765iop.39.1561248970222; Sat, 22 Jun 2019 17:16:10 -0700 (PDT) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com. [209.85.166.52]) by smtp.gmail.com with ESMTPSA id y18sm8345348iob.64.2019.06.22.17.16.09 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sat, 22 Jun 2019 17:16:09 -0700 (PDT) Received: by mail-io1-f52.google.com with SMTP id k8so349963iot.1; Sat, 22 Jun 2019 17:16:09 -0700 (PDT) X-Received: by 2002:a6b:6409:: with SMTP id t9mr32603194iog.270.1561248969777; Sat, 22 Jun 2019 17:16:09 -0700 (PDT) MIME-Version: 1.0 References: <201906171949.x5HJn9Ed091108@repo.freebsd.org> In-Reply-To: <201906171949.x5HJn9Ed091108@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 22 Jun 2019 17:15:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker... To: Xin LI Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 8F1CE6C3A2 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.43 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.43 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[43.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.43)[ip: (-6.34), ipnet: 209.85.128.0/17(-3.44), asn: 15169(-2.33), country: US(-0.06)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 00:16:20 -0000 Hi Xin Li, On Mon, Jun 17, 2019 at 12:49 PM Xin LI wrote: > > Author: delphij > Date: Mon Jun 17 19:49:08 2019 > New Revision: 349151 > URL: https://svnweb.freebsd.org/changeset/base/349151 > > Log: > Separate kernel crc32() implementation to its own header (gsb_crc32.h) = and > rename the source to gsb_crc32.c. > > This is a prerequisite of unifying kernel zlib instances. > >... > Modified: head/sys/libkern/x86/crc32_sse42.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 17:35:55 2019 (= r349150) > +++ head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 19:49:08 2019 (= r349151) > @@ -29,14 +29,14 @@ __FBSDID("$FreeBSD$"); > /* > * This file is compiled in userspace in order to run ATF unit tests. > */ > -#ifdef USERSPACE_TESTING > +#ifndef _KERNEL This change and following identical changes revert a request by kib@ in https://reviews.freebsd.org/D9342 . (When this revision was initially proposed in , it was '#ifndef _KERNEL' =E2=80=94 kib@ requested = the use of a different preprocessor macro.) Cheers, Conrad From owner-svn-src-all@freebsd.org Sun Jun 23 04:13:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACB1C15C4D39; Sun, 23 Jun 2019 04:13:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0BB724A0; Sun, 23 Jun 2019 04:13:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from odin.corp.delphij.net (c-24-6-173-228.hsd1.ca.comcast.net [24.6.173.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: delphij/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 7F9DC17999; Sun, 23 Jun 2019 04:13:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head , kib@freebsd.org References: <201906171949.x5HJn9Ed091108@repo.freebsd.org> From: Xin Li Openpgp: preference=signencrypt Autocrypt: addr=delphij@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFuSR4oBEACvvEgwRIHs6IcSP/yaDtySF78Ji3rP29qdiQsxhMsOtvtffdbS56VApIWO UFb3/iN2gA8HwLvrmjijN0HEoLVX7na1WARmxRYzQMtApsZIUTtx7hnUYlsi2F5odZa6CDW9 a954DLRzYxiUwYDcu5Zjl9bglK1H8e/N9uC0Vuigr4teWfh86brzOyf819QzwFVYfMIK4ihw QGwMvTzbyVuCFy+LENkmcVYni70oQy6rZ5ktSuYbuOFvu7inRRfhSWPHziV7k+bW88sJ7xhv lBlegcnhkSudWX2M8tZ3MO1PJOcyys0CJlsBY5Weiog2lIPi05h/E9pZ9mc1Vud17iqDaL6w RaggOUhuPfDGCdO5ro82W4BZGeQMRnRF5Ntk+t2ShIH4nn3xRLV0E5nziCiKlgiMqOrz/ZTL QTVbHrCuiwD+fSK14y0oHbkOLYTYLlgh1JbwfY2Ty7elOYiWzyeJ7sJh2dF91NSEneWIOys3 mBpuvtU3nSzzTvAB48VV+Nbg1CpIOgNlPjj7uhIum/Z/VjUaJEyaLpTIRh0MVJVcbP7hXSqZ NA35EEZZVnWEOYdycm4CmEdeNPWkrAf2Ya77iR5VLGypwMlsUMQPh+sKVWDD38M8stFGBBNm d01Hi74Bsq5hKan654dOqMt5eYklrVj0ucMzFQtus7oE502UswARAQABtBxYaW4gTEkgPGRl bHBoaWpARnJlZUJTRC5vcmc+iQJXBBMBCgBBAhsDBQkJroQABQsJCAcDBRUKCQgLBRYCAwEA Ah4BAheAFiEEceNg5NEMZIki80nQQHl/fJX0g08FAluSUkoCGQEACgkQQHl/fJX0g08OIxAA pcCm2QCi6IM0o5N5ro5rTodh2rlMuf31TTYBjdf9laZvpnA8a80XBLgx7bxASxH0EOaxcJZk Hl6D0Ex8jcrwOoe9kmbzJ1ZrqBBJBup+mTrf4SwRceSqo6OGHrun8C6kOnq4X62RsvJ9j9nU PqowhXJ4zZHNk9ZXLDzWbrNvYNXxhb+GgK5SniIKMM5Jw/qlMYvxaiIwnS5So+UzIbNsycnk CLbzZxE0d9pe97G3zDvCCwUYoo6LmSx7R20yRnGgO0BlvTPHeWn5WtK1ku3aiarHJW7mRMbD 617GLdc2vuT3bDSd3XwQztgZdiOZkYCdNZVQvuOqMdTtg+phCoQyvEB0+OWoIc/9Cam826nG lazUzURU/FNKJMcxP+1eFI+D/Kl8lpLTtmcjZNbmxeYR2OG6gz7fkyX2D3Is7GEcxuAi6j8f 3OpyFxb9IX4ZsP54/C41bzbcZtQgsU30Ptp/AhJpThHzYHrskfIcLNdmu2ngD5GvrBNX/x4W dO0SgI8tsdY7UQqU9IMWYdkVP8smIUDypMS5x/VZe47afq+VxACOhL0hSixWJDt6Rbl/4iyM EE6Cgu3/YAWQhAK7B97wJj5vPxqdAtPQjkUZGtlTOJWm/NIf4MCYjoHlfan07zatzJ2XF6y6 XcRiCQXULUYpshhY7mXOTSHXZ8n6HB+Z1ri5Ag0EW5JHigEQANiBmIFAfRNH3nzYNWC0yC+t fx3zsUwAsH1VaBM/cTib+yKtbBOSIlXWjJZWX3MHwoI/1LeGghB2mxkkX1L0pJ/vj1eXNR+s FZ320pYcl61Fxg/5fioG4QDTM4i3i7NR5PxDnc6UVaynSlII93DedRhZ1ROtdn4vyMgzsDiq hbL7BthDOt5KxjqdRk4qRPSw7BovEqZLOcG5IJtf/zZUzRbM7SBljEbOAfekDGx1Br+RrYSD 7/EfPwwzou9T8315IpBpIHyQF/dZNk3iFiB9Ed5CA71ZRYV5YoLWE9lL0j9kxOLQ5vHnX3mV q7QZBc7nzwZ6UhQgYmrG5+RWvuiPpGwvDRIsugJUGXucYkAQh5kuNblmkwpv6u9rNMjCNbzA ylOaqdogra5EW+RUSbRz0b4iIr8nnZeAlh7BihCe7JjOwbDjoBEEEtSfVc4hD/LENqpcYVrC hphfaOLB9YIXhnVDTVvMc9OklWT/81HzAaDQqOQCzEfY92199Ct9/CwRoQ2OpO8TO5+8A7b9 Nb33nmxMn09mb48ruRacMrfHxCWbgU4w9SEfbip4GcS5wGG6yTC+hw55Iwnnwus40NrJ0GEr 8a4rcdsLbkvlyoNHB8ZGgyJ4aFCQ1V4qE1BnlTk7Z8BYBUkJM1odPSkVvHpCnMUjVpJ3hEOC +73ZYH1dh7lZABEBAAGJAjwEGAEKACYWIQRx42Dk0QxkiSLzSdBAeX98lfSDTwUCW5JHigIb DAUJCa6EAAAKCRBAeX98lfSDTz8DEACMh3poeUb+gWNF4RWFZuLteZVo0+E1JLYXQkmtrRBL XviP+Qy0pXyFAVxLM4hNIBoIDYfK9BcwrBYf7AwSKrH0GiNwFpgHCkbZd6qoZy2gB+adTnCp VCTJKJetsH/8awkrChJWMK0ckGf3EeWMPvawG7kW7FBz70NYEZ0pOMiaEZNVtzD3wwbYWUiD FYth83XGglOExg+1ShTW5XjQPRrdyJAO+aUW4o3lVjfyUJXMgI4rmhMiLVm06GuNrbpKIF0s +4VdjQAjhrDQjfoXi9CkfsA/cONseuHNv1JGj3RqHiqHJq1dbrpodXp925zGDAnUGxCOBPoF opAHgVzR89GTut059GpwqsddZmU6y7rqifuam/ekJ+QRwc16vgt7pHqCrTY8WPxRZr2UpFU1 wlToCOdeiFep1gq1F9jzFjJnoMaAdmC6k7bgAA+RQusOgIhJL0jIej7DoAHxmxFFCfRy+lDt pXwFgQ8HMvzHI65QWmQnMo7s6SQH/ZH5s1yR6SJq8+3lDz+dCuT42qJVqIPVvxd10LW0FNN+ t7HFeLadU6ekSgD13/EYMYXlvNHkw7dAItSDxIzgRyykLz0bCU9xwNWoS4Z43+ifF9anJ+uR 0ltWEl1j++h6ZrD3LLuCgJIt1so0m49GzdcSpOI7LCwMlacyvafiEyjUn+tSNDsnfw== Organization: The FreeBSD Project Subject: Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker... Message-ID: <58af4bc5-0097-1540-be64-e9bceab6d4f8@FreeBSD.org> Date: Sat, 22 Jun 2019 21:13:05 -0700 User-Agent: Thunderbird MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="El5xSSqvJdctsskaVtUROdjjySJWxQGZi" X-Rspamd-Queue-Id: 4A0BB724A0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.938,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 04:13:16 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --El5xSSqvJdctsskaVtUROdjjySJWxQGZi Content-Type: multipart/mixed; boundary="sHl1TCSPVBIEDsBcTLotjbMNyEdGRZhjy"; protected-headers="v1" From: Xin Li To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head , kib@freebsd.org Message-ID: <58af4bc5-0097-1540-be64-e9bceab6d4f8@FreeBSD.org> Subject: Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker... References: <201906171949.x5HJn9Ed091108@repo.freebsd.org> In-Reply-To: --sHl1TCSPVBIEDsBcTLotjbMNyEdGRZhjy Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/22/19 17:15, Conrad Meyer wrote: > Hi Xin Li, >=20 > On Mon, Jun 17, 2019 at 12:49 PM Xin LI wrote: >> >> Author: delphij >> Date: Mon Jun 17 19:49:08 2019 >> New Revision: 349151 >> URL: https://svnweb.freebsd.org/changeset/base/349151 >> >> Log: >> Separate kernel crc32() implementation to its own header (gsb_crc32.= h) and >> rename the source to gsb_crc32.c. >> >> This is a prerequisite of unifying kernel zlib instances. >> >> ... >> Modified: head/sys/libkern/x86/crc32_sse42.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 17:35:55 2019 = (r349150) >> +++ head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 19:49:08 2019 = (r349151) >> @@ -29,14 +29,14 @@ __FBSDID("$FreeBSD$"); >> /* >> * This file is compiled in userspace in order to run ATF unit tests.= >> */ >> -#ifdef USERSPACE_TESTING >> +#ifndef _KERNEL >=20 > This change and following identical changes revert a request by kib@ > in https://reviews.freebsd.org/D9342 . (When this revision was > initially proposed in , it was '#ifndef _KERNEL' =E2=80=94 kib@ reques= ted the > use of a different preprocessor macro.) Thanks for pointing this out -- admittedly, I haven't read the reasoning before. But after reading more about the original review context, I don't quite agree with Kostik's reasoning because the code actually works in userland regardless of the original intention. It's true that the code is at the time only used in the test program, but they do enabled usage in userland, and they by themselves do not serve purely test purposed task (these are not mock interfaces, nor test cases, etc.), and the common practice in sys/libkern is to wrap these with #if[n]def _KERNEL. I don't insist but I still think it's more reasonable to use _KERNEL because it's more consistent with the surrounding code. Cheers, --sHl1TCSPVBIEDsBcTLotjbMNyEdGRZhjy-- --El5xSSqvJdctsskaVtUROdjjySJWxQGZi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJdDvxYAAoJEEB5f3yV9INPvW4P/2dsu9GGnDtrKVyrGY75Y+vx jLuxdPJc9kYRWK6gblM/G8/23R7svJMn5l/Gotj2YA/boV4hCtOvvY9wq4S2+BPT I04pnhSGt6YP/6y2XNfzptQ4M0zAaXJh4XYjmS0wmMTUdRCI6uKcRSRkebDvMs3F S/tdHWIOSTU3wuVyGSRWgxrWSVcuSLe1JXVrvWWX5s/gkJoZuQTXje4E5/l/A9KP b5flSdLZi69vDISXCp6Q22pJRTU64fTIf12OUYwkXRBF82VRyXADBCEGPsravCCy flR+qmdZkh9m6fCpSCsMFKswZTNQvf/20T0hjhmr8M+DWUpjcxFbfZQTkbmskd4S q8lQQ56cO8DxvhiWBKP8ToGeQzTcZaw9wVw6FyPt9ZN9ZhUigUbEYhtcK+fmikb2 XQfUT4N1XL/+LbGQXsTpdbMkzGIlt9ZxOsRb9WLlcE/ScUXEbsuarjKM4nxsv0zZ 9Lp+E2ECmJd1hMhlx70e/8ZFhuQt8veKcDcE1k9ykuPQT224UEV9CNBNc/+LAWD1 HNiXczHNtxCn+D9Bllap3Dk3ibU4TOAqGSJUK/76ZtBsGXEIBXMPGCrSoom0TI3o +X5r0YHqpf9zRgv0lyKwKd0nyoM5y9q58r04OXkLEQdxqiFXoCV85Ah+izIKUILh v09ZvimTPls1EODpConL =Da5+ -----END PGP SIGNATURE----- --El5xSSqvJdctsskaVtUROdjjySJWxQGZi-- From owner-svn-src-all@freebsd.org Sun Jun 23 10:45:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AF9815CCCFD; Sun, 23 Jun 2019 10:45:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B42D484F19; Sun, 23 Jun 2019 10:45:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53A1920A08; Sun, 23 Jun 2019 10:45:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NAjpfR088177; Sun, 23 Jun 2019 10:45:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NAjpw4088176; Sun, 23 Jun 2019 10:45:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231045.x5NAjpw4088176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 10:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349297 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 349297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B42D484F19 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 10:45:52 -0000 Author: kib Date: Sun Jun 23 10:45:50 2019 New Revision: 349297 URL: https://svnweb.freebsd.org/changeset/base/349297 Log: Remove redundand 'else' and 'return'. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/libc_dlopen.c Modified: head/lib/libc/gen/libc_dlopen.c ============================================================================== --- head/lib/libc/gen/libc_dlopen.c Sat Jun 22 23:36:28 2019 (r349296) +++ head/lib/libc/gen/libc_dlopen.c Sun Jun 23 10:45:50 2019 (r349297) @@ -48,8 +48,8 @@ libc_dlopen(const char *path, int mode) if (__libc_restricted_mode) { _rtld_error("Service unavailable -- libc in restricted mode"); return (NULL); - } else - return (dlopen(path, mode)); + } + return (dlopen(path, mode)); } void @@ -57,6 +57,5 @@ __FreeBSD_libc_enter_restricted_mode(void) { __libc_restricted_mode = 1; - return; } From owner-svn-src-all@freebsd.org Sun Jun 23 10:47:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C5815CCD8B; Sun, 23 Jun 2019 10:47:08 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48EAF8507D; Sun, 23 Jun 2019 10:47:08 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2023E20A09; Sun, 23 Jun 2019 10:47:08 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NAl87e088294; Sun, 23 Jun 2019 10:47:08 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NAl7OC088291; Sun, 23 Jun 2019 10:47:07 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201906231047.x5NAl7OC088291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Sun, 23 Jun 2019 10:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349298 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 349298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48EAF8507D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 10:47:08 -0000 Author: arichardson Date: Sun Jun 23 10:47:07 2019 New Revision: 349298 URL: https://svnweb.freebsd.org/changeset/base/349298 Log: Fix two WARNS=6 warnings in opendir.c and telldir.c This is in preparation for compiling these files as part of rtld (which is built with WARNS=6). See https://reviews.freebsd.org/D20663 for more details. Modified: head/lib/libc/gen/opendir.c head/lib/libc/gen/telldir.c Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Sun Jun 23 10:45:50 2019 (r349297) +++ head/lib/libc/gen/opendir.c Sun Jun 23 10:47:07 2019 (r349298) @@ -99,8 +99,8 @@ static int opendir_compar(const void *p1, const void *p2) { - return (strcmp((*(const struct dirent **)p1)->d_name, - (*(const struct dirent **)p2)->d_name)); + return (strcmp((*(const struct dirent * const *)p1)->d_name, + (*(const struct dirent * const *)p2)->d_name)); } /* Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Sun Jun 23 10:45:50 2019 (r349297) +++ head/lib/libc/gen/telldir.c Sun Jun 23 10:47:07 2019 (r349298) @@ -63,8 +63,8 @@ telldir(DIR *dirp) * 2) Otherwise, see if it's already been recorded in the linked list * 3) Otherwise, malloc a new one */ - if (dirp->dd_seek < (1ul << DD_SEEK_BITS) && - dirp->dd_loc < (1ul << DD_LOC_BITS)) { + if (dirp->dd_seek < (off_t)(1l << DD_SEEK_BITS) && + dirp->dd_loc < (1l << DD_LOC_BITS)) { ddloc.s.is_packed = 1; ddloc.s.loc = dirp->dd_loc; ddloc.s.seek = dirp->dd_seek; From owner-svn-src-all@freebsd.org Sun Jun 23 10:50:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1961A15CCF37; Sun, 23 Jun 2019 10:50:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B039A853AE; Sun, 23 Jun 2019 10:50:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BD1820A13; Sun, 23 Jun 2019 10:50:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NAoR4Y088509; Sun, 23 Jun 2019 10:50:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NAoQjE088504; Sun, 23 Jun 2019 10:50:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231050.x5NAoQjE088504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 10:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349299 - in head/lib: libc/gen libc/include libthr/thread X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/lib: libc/gen libc/include libthr/thread X-SVN-Commit-Revision: 349299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B039A853AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 10:50:28 -0000 Author: kib Date: Sun Jun 23 10:50:26 2019 New Revision: 349299 URL: https://svnweb.freebsd.org/changeset/base/349299 Log: Add libc stub for pthread_getthreadid_np(3). Requested by: jbeich PR: 238650 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/_pthread_stubs.c head/lib/libc/include/libc_private.h head/lib/libthr/thread/thr_init.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sun Jun 23 10:47:07 2019 (r349298) +++ head/lib/libc/gen/Symbol.map Sun Jun 23 10:50:26 2019 (r349299) @@ -338,6 +338,7 @@ FBSD_1.2 { getutxid; getutxline; getutxuser; + pthread_getthreadid_np; pututxline; sem_close; sem_destroy; Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Sun Jun 23 10:47:07 2019 (r349298) +++ head/lib/libc/gen/_pthread_stubs.c Sun Jun 23 10:50:26 2019 (r349299) @@ -130,6 +130,7 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = { {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_CONSISTENT */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_GETROBUST */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_SETROBUST */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_GETTHREADID_NP */ }; /* @@ -248,6 +249,7 @@ STUB_FUNC1(pthread_rwlock_trywrlock, PJT_RWLOCK_TRYWRL STUB_FUNC1(pthread_rwlock_unlock, PJT_RWLOCK_UNLOCK, int, void *) STUB_FUNC1(pthread_rwlock_wrlock, PJT_RWLOCK_WRLOCK, int, void *) STUB_FUNC(pthread_self, PJT_SELF, pthread_t) +STUB_FUNC(pthread_getthreadid_np, PJT_GETTHREADID_NP, int) STUB_FUNC2(pthread_setspecific, PJT_SETSPECIFIC, int, pthread_key_t, void *) STUB_FUNC3(pthread_sigmask, PJT_SIGMASK, int, int, void *, void *) STUB_FUNC3(pthread_atfork, PJT_ATFORK, int, void *, void *, void*) Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sun Jun 23 10:47:07 2019 (r349298) +++ head/lib/libc/include/libc_private.h Sun Jun 23 10:50:26 2019 (r349299) @@ -176,6 +176,7 @@ typedef enum { PJT_MUTEX_CONSISTENT, PJT_MUTEXATTR_GETROBUST, PJT_MUTEXATTR_SETROBUST, + PJT_GETTHREADID_NP, PJT_MAX } pjt_index_t; Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Sun Jun 23 10:47:07 2019 (r349298) +++ head/lib/libthr/thread/thr_init.c Sun Jun 23 10:50:26 2019 (r349299) @@ -272,6 +272,7 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(_pthread_mutex_consistent)},/* PJT_MUTEX_CONSISTENT */ {DUAL_ENTRY(_pthread_mutexattr_getrobust)},/* PJT_MUTEXATTR_GETROBUST */ {DUAL_ENTRY(_pthread_mutexattr_setrobust)},/* PJT_MUTEXATTR_SETROBUST */ + {DUAL_ENTRY(_pthread_getthreadid_np)}, /* PJT_GETTHREADID_NP */ }; static int init_once = 0; From owner-svn-src-all@freebsd.org Sun Jun 23 10:59:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BCDF15CD2B7; Sun, 23 Jun 2019 10:59:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94AA185B05; Sun, 23 Jun 2019 10:58:59 +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 x5NAwiUi061489 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 23 Jun 2019 13:58:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x5NAwiUi061489 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x5NAwivY061488; Sun, 23 Jun 2019 13:58:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 23 Jun 2019 13:58:44 +0300 From: Konstantin Belousov To: Greg Lehey Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r349296 - stable/10/usr.bin/calendar/calendars Message-ID: <20190623105844.GR8697@kib.kiev.ua> References: <201906222336.x5MNaSpn036617@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906222336.x5MNaSpn036617@repo.freebsd.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 10:59:00 -0000 On Sat, Jun 22, 2019 at 11:36:28PM +0000, Greg Lehey wrote: > Author: grog > Date: Sat Jun 22 23:36:28 2019 > New Revision: 349296 > URL: https://svnweb.freebsd.org/changeset/base/349296 > > Log: > Correct Konrad Zuse's year of birth. > > Modified: > stable/10/usr.bin/calendar/calendars/calendar.birthday > > Modified: stable/10/usr.bin/calendar/calendars/calendar.birthday > ============================================================================== > --- stable/10/usr.bin/calendar/calendars/calendar.birthday Sat Jun 22 22:43:40 2019 (r349295) > +++ stable/10/usr.bin/calendar/calendars/calendar.birthday Sat Jun 22 23:36:28 2019 (r349296) > @@ -167,7 +167,7 @@ > 06/19 FreeBSD project born, 1993 > 06/22 Carl Hubbell born, 1903 > 06/22 Meryl Streep born in Summit, New Jersey, 1949 > -06/22 Konrad Zuse born in Berlin, 1919 > +06/22 Konrad Zuse born in Berlin, 1910 > 06/23 Alan Mathison Turing born, 1912 > 06/25 Eric Arthur Blair (a.k.a. George Orwell) born, 1903 > 06/27 Helen Keller born, 1880 Why is this committed to stable/10, without first doing it in HEAD, and then merge to 12 and 11 beforehand ? From owner-svn-src-all@freebsd.org Sun Jun 23 10:59:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA0E415CD33F; Sun, 23 Jun 2019 10:59:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60A3C85C51; Sun, 23 Jun 2019 10:59:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3545420BEA; Sun, 23 Jun 2019 10:59:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NAxs2M093724; Sun, 23 Jun 2019 10:59:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NAxshc093723; Sun, 23 Jun 2019 10:59:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231059.x5NAxshc093723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 10:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349300 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 349300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60A3C85C51 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 10:59:55 -0000 Author: kib Date: Sun Jun 23 10:59:53 2019 New Revision: 349300 URL: https://svnweb.freebsd.org/changeset/base/349300 Log: MFC r348798: amd64 trap.c: Modernize syntax around trap_msg[]. Modified: stable/12/sys/amd64/amd64/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/trap.c ============================================================================== --- stable/12/sys/amd64/amd64/trap.c Sun Jun 23 10:50:26 2019 (r349299) +++ stable/12/sys/amd64/amd64/trap.c Sun Jun 23 10:59:53 2019 (r349300) @@ -118,41 +118,41 @@ static bool trap_user_dtrace(struct trapframe *, int (**hook)(struct trapframe *)); #endif -#define MAX_TRAP_MSG 32 -static char *trap_msg[] = { - "", /* 0 unused */ - "privileged instruction fault", /* 1 T_PRIVINFLT */ - "", /* 2 unused */ - "breakpoint instruction fault", /* 3 T_BPTFLT */ - "", /* 4 unused */ - "", /* 5 unused */ - "arithmetic trap", /* 6 T_ARITHTRAP */ - "", /* 7 unused */ - "", /* 8 unused */ - "general protection fault", /* 9 T_PROTFLT */ - "debug exception", /* 10 T_TRCTRAP */ - "", /* 11 unused */ - "page fault", /* 12 T_PAGEFLT */ - "", /* 13 unused */ - "alignment fault", /* 14 T_ALIGNFLT */ - "", /* 15 unused */ - "", /* 16 unused */ - "", /* 17 unused */ - "integer divide fault", /* 18 T_DIVIDE */ - "non-maskable interrupt trap", /* 19 T_NMI */ - "overflow trap", /* 20 T_OFLOW */ - "FPU bounds check fault", /* 21 T_BOUND */ - "FPU device not available", /* 22 T_DNA */ - "double fault", /* 23 T_DOUBLEFLT */ - "FPU operand fetch fault", /* 24 T_FPOPFLT */ - "invalid TSS fault", /* 25 T_TSSFLT */ - "segment not present fault", /* 26 T_SEGNPFLT */ - "stack fault", /* 27 T_STKFLT */ - "machine check trap", /* 28 T_MCHK */ - "SIMD floating-point exception", /* 29 T_XMMFLT */ - "reserved (unknown) fault", /* 30 T_RESERVED */ - "", /* 31 unused (reserved) */ - "DTrace pid return trap", /* 32 T_DTRACE_RET */ +static const char UNKNOWN[] = "unknown"; +static const char *trap_msg[] = { + [0] = UNKNOWN, /* unused */ + [T_PRIVINFLT] = "privileged instruction fault", + [2] = UNKNOWN, /* unused */ + [T_BPTFLT] = "breakpoint instruction fault", + [4] = UNKNOWN, /* unused */ + [5] = UNKNOWN, /* unused */ + [T_ARITHTRAP] = "arithmetic trap", + [7] = UNKNOWN, /* unused */ + [8] = UNKNOWN, /* unused */ + [T_PROTFLT] = "general protection fault", + [T_TRCTRAP] = "debug exception", + [11] = UNKNOWN, /* unused */ + [T_PAGEFLT] = "page fault", + [13] = UNKNOWN, /* unused */ + [T_ALIGNFLT] = "alignment fault", + [15] = UNKNOWN, /* unused */ + [16] = UNKNOWN, /* unused */ + [17] = UNKNOWN, /* unused */ + [T_DIVIDE] = "integer divide fault", + [T_NMI] = "non-maskable interrupt trap", + [T_OFLOW] = "overflow trap", + [T_BOUND] = "FPU bounds check fault", + [T_DNA] = "FPU device not available", + [T_DOUBLEFLT] = "double fault", + [T_FPOPFLT] = "FPU operand fetch fault", + [T_TSSFLT] = "invalid TSS fault", + [T_SEGNPFLT] = "segment not present fault", + [T_STKFLT] = "stack fault", + [T_MCHK] = "machine check trap", + [T_XMMFLT] = "SIMD floating-point exception", + [T_RESERVED] = "reserved (unknown) fault", + [31] = UNKNOWN, /* reserved */ + [T_DTRACE_RET] = "DTrace pid return trap", }; static int prot_fault_translation; @@ -879,7 +879,6 @@ trap_fatal(frame, eva) int code, ss; u_int type; struct soft_segment_descriptor softseg; - char *msg; #ifdef KDB bool handled; #endif @@ -889,11 +888,8 @@ trap_fatal(frame, eva) sdtossd(&gdt[NGDT * PCPU_GET(cpuid) + IDXSEL(frame->tf_cs & 0xffff)], &softseg); - if (type <= MAX_TRAP_MSG) - msg = trap_msg[type]; - else - msg = "UNKNOWN"; - printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg, + printf("\n\nFatal trap %d: %s while in %s mode\n", type, + type < nitems(trap_msg) ? trap_msg[type] : UNKNOWN, TRAPF_USERMODE(frame) ? "user" : "kernel"); #ifdef SMP /* two separate prints in case of a trap on an unmapped page */ @@ -944,10 +940,8 @@ trap_fatal(frame, eva) } #endif printf("trap number = %d\n", type); - if (type <= MAX_TRAP_MSG) - panic("%s", trap_msg[type]); - else - panic("unknown/reserved trap"); + panic("%s", type < nitems(trap_msg) ? trap_msg[type] : + "unknown/reserved trap"); } #ifdef KDTRACE_HOOKS From owner-svn-src-all@freebsd.org Sun Jun 23 11:01:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC79515CD584; Sun, 23 Jun 2019 11:01:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72D1685E28; Sun, 23 Jun 2019 11:01:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65BC220C1B; Sun, 23 Jun 2019 11:01:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NB1Aqt095334; Sun, 23 Jun 2019 11:01:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NB1ACX095333; Sun, 23 Jun 2019 11:01:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231101.x5NB1ACX095333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 11:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349301 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 349301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72D1685E28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 11:01:11 -0000 Author: kib Date: Sun Jun 23 11:01:09 2019 New Revision: 349301 URL: https://svnweb.freebsd.org/changeset/base/349301 Log: MFC r348813: Make trap_msg array constant as well. Modified: stable/12/sys/amd64/amd64/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/trap.c ============================================================================== --- stable/12/sys/amd64/amd64/trap.c Sun Jun 23 10:59:53 2019 (r349300) +++ stable/12/sys/amd64/amd64/trap.c Sun Jun 23 11:01:09 2019 (r349301) @@ -119,7 +119,7 @@ static bool trap_user_dtrace(struct trapframe *, #endif static const char UNKNOWN[] = "unknown"; -static const char *trap_msg[] = { +static const char *const trap_msg[] = { [0] = UNKNOWN, /* unused */ [T_PRIVINFLT] = "privileged instruction fault", [2] = UNKNOWN, /* unused */ From owner-svn-src-all@freebsd.org Sun Jun 23 11:02:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35EDE15CD61A; Sun, 23 Jun 2019 11:02:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1F2686192; Sun, 23 Jun 2019 11:02:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC00120D88; Sun, 23 Jun 2019 11:02:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NB2V1s098504; Sun, 23 Jun 2019 11:02:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NB2V6W098503; Sun, 23 Jun 2019 11:02:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231102.x5NB2V6W098503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 11:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349302 - stable/12/sys/i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/i386/i386 X-SVN-Commit-Revision: 349302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1F2686192 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 11:02:32 -0000 Author: kib Date: Sun Jun 23 11:02:31 2019 New Revision: 349302 URL: https://svnweb.freebsd.org/changeset/base/349302 Log: MFC r348799: i386 trap.c: Remove unused MAX_TRAP_MSG define. Modified: stable/12/sys/i386/i386/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/i386/trap.c ============================================================================== --- stable/12/sys/i386/i386/trap.c Sun Jun 23 11:01:09 2019 (r349301) +++ stable/12/sys/i386/i386/trap.c Sun Jun 23 11:02:31 2019 (r349302) @@ -124,8 +124,6 @@ void dblfault_handler(void); extern inthand_t IDTVEC(bpt), IDTVEC(dbg), IDTVEC(int0x80_syscall); -#define MAX_TRAP_MSG 32 - struct trap_data { bool ei; const char *msg; From owner-svn-src-all@freebsd.org Sun Jun 23 11:04:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5A6E15CD6B2; Sun, 23 Jun 2019 11:04:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C98C862FE; Sun, 23 Jun 2019 11:04:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F67620D8B; Sun, 23 Jun 2019 11:04:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NB4ZnZ098652; Sun, 23 Jun 2019 11:04:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NB4ZVf098651; Sun, 23 Jun 2019 11:04:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231104.x5NB4ZVf098651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 11:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349303 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 349303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C98C862FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 11:04:36 -0000 Author: kib Date: Sun Jun 23 11:04:34 2019 New Revision: 349303 URL: https://svnweb.freebsd.org/changeset/base/349303 Log: MFC r348798, r348813: amd64 trap.c: Modernize syntax around trap_msg[]. Modified: stable/11/sys/amd64/amd64/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/trap.c ============================================================================== --- stable/11/sys/amd64/amd64/trap.c Sun Jun 23 11:02:31 2019 (r349302) +++ stable/11/sys/amd64/amd64/trap.c Sun Jun 23 11:04:34 2019 (r349303) @@ -111,41 +111,41 @@ void dblfault_handler(struct trapframe *frame); static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 32 -static char *trap_msg[] = { - "", /* 0 unused */ - "privileged instruction fault", /* 1 T_PRIVINFLT */ - "", /* 2 unused */ - "breakpoint instruction fault", /* 3 T_BPTFLT */ - "", /* 4 unused */ - "", /* 5 unused */ - "arithmetic trap", /* 6 T_ARITHTRAP */ - "", /* 7 unused */ - "", /* 8 unused */ - "general protection fault", /* 9 T_PROTFLT */ - "debug exception", /* 10 T_TRCTRAP */ - "", /* 11 unused */ - "page fault", /* 12 T_PAGEFLT */ - "", /* 13 unused */ - "alignment fault", /* 14 T_ALIGNFLT */ - "", /* 15 unused */ - "", /* 16 unused */ - "", /* 17 unused */ - "integer divide fault", /* 18 T_DIVIDE */ - "non-maskable interrupt trap", /* 19 T_NMI */ - "overflow trap", /* 20 T_OFLOW */ - "FPU bounds check fault", /* 21 T_BOUND */ - "FPU device not available", /* 22 T_DNA */ - "double fault", /* 23 T_DOUBLEFLT */ - "FPU operand fetch fault", /* 24 T_FPOPFLT */ - "invalid TSS fault", /* 25 T_TSSFLT */ - "segment not present fault", /* 26 T_SEGNPFLT */ - "stack fault", /* 27 T_STKFLT */ - "machine check trap", /* 28 T_MCHK */ - "SIMD floating-point exception", /* 29 T_XMMFLT */ - "reserved (unknown) fault", /* 30 T_RESERVED */ - "", /* 31 unused (reserved) */ - "DTrace pid return trap", /* 32 T_DTRACE_RET */ +static const char UNKNOWN[] = "unknown"; +static const char *const trap_msg[] = { + [0] = UNKNOWN, /* unused */ + [T_PRIVINFLT] = "privileged instruction fault", + [2] = UNKNOWN, /* unused */ + [T_BPTFLT] = "breakpoint instruction fault", + [4] = UNKNOWN, /* unused */ + [5] = UNKNOWN, /* unused */ + [T_ARITHTRAP] = "arithmetic trap", + [7] = UNKNOWN, /* unused */ + [8] = UNKNOWN, /* unused */ + [T_PROTFLT] = "general protection fault", + [T_TRCTRAP] = "debug exception", + [11] = UNKNOWN, /* unused */ + [T_PAGEFLT] = "page fault", + [13] = UNKNOWN, /* unused */ + [T_ALIGNFLT] = "alignment fault", + [15] = UNKNOWN, /* unused */ + [16] = UNKNOWN, /* unused */ + [17] = UNKNOWN, /* unused */ + [T_DIVIDE] = "integer divide fault", + [T_NMI] = "non-maskable interrupt trap", + [T_OFLOW] = "overflow trap", + [T_BOUND] = "FPU bounds check fault", + [T_DNA] = "FPU device not available", + [T_DOUBLEFLT] = "double fault", + [T_FPOPFLT] = "FPU operand fetch fault", + [T_TSSFLT] = "invalid TSS fault", + [T_SEGNPFLT] = "segment not present fault", + [T_STKFLT] = "stack fault", + [T_MCHK] = "machine check trap", + [T_XMMFLT] = "SIMD floating-point exception", + [T_RESERVED] = "reserved (unknown) fault", + [31] = UNKNOWN, /* reserved */ + [T_DTRACE_RET] = "DTrace pid return trap", }; static int prot_fault_translation; @@ -837,7 +837,6 @@ trap_fatal(frame, eva) int code, ss; u_int type; struct soft_segment_descriptor softseg; - char *msg; #ifdef KDB bool handled; #endif @@ -847,11 +846,8 @@ trap_fatal(frame, eva) sdtossd(&gdt[NGDT * PCPU_GET(cpuid) + IDXSEL(frame->tf_cs & 0xffff)], &softseg); - if (type <= MAX_TRAP_MSG) - msg = trap_msg[type]; - else - msg = "UNKNOWN"; - printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg, + printf("\n\nFatal trap %d: %s while in %s mode\n", type, + type < nitems(trap_msg) ? trap_msg[type] : UNKNOWN, TRAPF_USERMODE(frame) ? "user" : "kernel"); #ifdef SMP /* two separate prints in case of a trap on an unmapped page */ @@ -900,10 +896,8 @@ trap_fatal(frame, eva) } #endif printf("trap number = %d\n", type); - if (type <= MAX_TRAP_MSG) - panic("%s", trap_msg[type]); - else - panic("unknown/reserved trap"); + panic("%s", type < nitems(trap_msg) ? trap_msg[type] : + "unknown/reserved trap"); } /* From owner-svn-src-all@freebsd.org Sun Jun 23 11:09:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 308C415CD7EE; Sun, 23 Jun 2019 11:09:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7B058649E; Sun, 23 Jun 2019 11:09:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99C7920D8F; Sun, 23 Jun 2019 11:09:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NB98l9098890; Sun, 23 Jun 2019 11:09:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NB98tU098889; Sun, 23 Jun 2019 11:09:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231109.x5NB98tU098889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 11:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349304 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 349304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7B058649E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 11:09:09 -0000 Author: kib Date: Sun Jun 23 11:09:08 2019 New Revision: 349304 URL: https://svnweb.freebsd.org/changeset/base/349304 Log: MFC r348802: Remove lazy FPU switch support from amd64. For the merge, the hw.lazy_fpu_switch sysctl was kept but made read-only with the value of 0. Modified: stable/12/sys/amd64/amd64/fpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/fpu.c ============================================================================== --- stable/12/sys/amd64/amd64/fpu.c Sun Jun 23 11:04:34 2019 (r349303) +++ stable/12/sys/amd64/amd64/fpu.c Sun Jun 23 11:09:08 2019 (r349304) @@ -155,7 +155,7 @@ SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_ SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware"); int lazy_fpu_switch = 0; -SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RD, &lazy_fpu_switch, 0, "Lazily load FPU context after context switch"); @@ -269,7 +269,6 @@ fpuinit_bsp1(void) uint64_t xsave_mask_user; bool old_wp; - TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if (!use_xsave) return; cpuid_count(0xd, 0x0, cp); @@ -774,8 +773,7 @@ void fpu_activate_sw(struct thread *td) { - if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || - !PCB_USER_FPU(td->td_pcb)) { + if ((td->td_pflags & TDP_KTHREAD) != 0 || !PCB_USER_FPU(td->td_pcb)) { PCPU_SET(fpcurthread, NULL); start_emulating(); } else if (PCPU_GET(fpcurthread) != td) { From owner-svn-src-all@freebsd.org Sun Jun 23 11:23:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7514515CDFB9; Sun, 23 Jun 2019 11:23:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A48A486CF4; Sun, 23 Jun 2019 11:23:22 +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 x5NBNFPr087905 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 23 Jun 2019 14:23:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x5NBNFPr087905 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x5NBNF45087900; Sun, 23 Jun 2019 14:23:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 23 Jun 2019 14:23:15 +0300 From: Konstantin Belousov To: Xin Li Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head , kib@freebsd.org Subject: Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker... Message-ID: <20190623112315.GS8697@kib.kiev.ua> References: <201906171949.x5HJn9Ed091108@repo.freebsd.org> <58af4bc5-0097-1540-be64-e9bceab6d4f8@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <58af4bc5-0097-1540-be64-e9bceab6d4f8@FreeBSD.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 11:23:23 -0000 On Sat, Jun 22, 2019 at 09:13:05PM -0700, Xin Li wrote: > On 6/22/19 17:15, Conrad Meyer wrote: > > Hi Xin Li, > > > > On Mon, Jun 17, 2019 at 12:49 PM Xin LI wrote: > >> > >> Author: delphij > >> Date: Mon Jun 17 19:49:08 2019 > >> New Revision: 349151 > >> URL: https://svnweb.freebsd.org/changeset/base/349151 > >> > >> Log: > >> Separate kernel crc32() implementation to its own header (gsb_crc32.h) and > >> rename the source to gsb_crc32.c. > >> > >> This is a prerequisite of unifying kernel zlib instances. > >> > >> ... > >> Modified: head/sys/libkern/x86/crc32_sse42.c > >> ============================================================================== > >> --- head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 17:35:55 2019 (r349150) > >> +++ head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 19:49:08 2019 (r349151) > >> @@ -29,14 +29,14 @@ __FBSDID("$FreeBSD$"); > >> /* > >> * This file is compiled in userspace in order to run ATF unit tests. > >> */ > >> -#ifdef USERSPACE_TESTING > >> +#ifndef _KERNEL > > > > This change and following identical changes revert a request by kib@ > > in https://reviews.freebsd.org/D9342 . (When this revision was > > initially proposed in , it was '#ifndef _KERNEL' — kib@ requested the > > use of a different preprocessor macro.) > > Thanks for pointing this out -- admittedly, I haven't read the reasoning > before. > > But after reading more about the original review context, I don't quite > agree with Kostik's reasoning because the code actually works in > userland regardless of the original intention. It's true that the code > is at the time only used in the test program, but they do enabled usage > in userland, and they by themselves do not serve purely test purposed > task (these are not mock interfaces, nor test cases, etc.), and the > common practice in sys/libkern is to wrap these with #if[n]def _KERNEL. > > I don't insist but I still think it's more reasonable to use _KERNEL > because it's more consistent with the surrounding code. #ifndef _KERNEL is used when you provide generally useful code which must be limited to userspace. There, the conditionally compiled code is very specific, it is only for testing. Being explicit would allow to avoid questions, e.g. why userspace requires constructors. And still see my confusion in the referenced review. From owner-svn-src-all@freebsd.org Sun Jun 23 13:35:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 188AF15D1122; Sun, 23 Jun 2019 13:35:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B207C8B1A9; Sun, 23 Jun 2019 13:35:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BBF9226B0; Sun, 23 Jun 2019 13:35:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NDZ4aa079320; Sun, 23 Jun 2019 13:35:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NDZ13w079305; Sun, 23 Jun 2019 13:35:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906231335.x5NDZ13w079305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 23 Jun 2019 13:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349305 - in stable/12/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient kern sys ufs/ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient kern sys ufs/ffs X-SVN-Commit-Revision: 349305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B207C8B1A9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 13:35:05 -0000 Author: asomers Date: Sun Jun 23 13:35:01 2019 New Revision: 349305 URL: https://svnweb.freebsd.org/changeset/base/349305 Log: MFC r348251: Remove "struct ucred*" argument from vtruncbuf vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever since that function was first added in r34611. Remove it. Also, remove some "struct ucred" arguments from fuse and nfs functions that were only used by vtruncbuf. Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20377 Modified: stable/12/sys/fs/ext2fs/ext2_inode.c stable/12/sys/fs/fuse/fuse_io.c stable/12/sys/fs/fuse/fuse_node.c stable/12/sys/fs/fuse/fuse_node.h stable/12/sys/fs/fuse/fuse_vnops.c stable/12/sys/fs/msdosfs/msdosfs_denode.c stable/12/sys/fs/nfsclient/nfs.h stable/12/sys/fs/nfsclient/nfs_clbio.c stable/12/sys/fs/nfsclient/nfs_clvnops.c stable/12/sys/kern/vfs_subr.c stable/12/sys/sys/vnode.h stable/12/sys/ufs/ffs/ffs_inode.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_inode.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/ext2fs/ext2_inode.c Sun Jun 23 13:35:01 2019 (r349305) @@ -356,7 +356,7 @@ ext2_ind_truncate(struct vnode *vp, off_t length, int oip->i_ib[i] = oldblks[EXT2_NDADDR + i]; } oip->i_size = osize; - error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize); + error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) allerror = error; vnode_pager_setsize(ovp, length); @@ -530,7 +530,7 @@ ext2_ext_truncate(struct vnode *vp, off_t length, int } oip->i_size = osize; - error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize); + error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize); if (error) return (error); Modified: stable/12/sys/fs/fuse/fuse_io.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_io.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/fuse/fuse_io.c Sun Jun 23 13:35:01 2019 (r349305) @@ -363,7 +363,7 @@ fuse_write_directbackend(struct vnode *vp, struct uio uio->uio_resid += diff; uio->uio_offset -= diff; if (uio->uio_offset > fvdat->filesize) - fuse_vnode_setsize(vp, cred, uio->uio_offset); + fuse_vnode_setsize(vp, uio->uio_offset); } fdisp_destroy(&fdi); @@ -435,7 +435,7 @@ again: if (bp != NULL) { long save; - err = fuse_vnode_setsize(vp, cred, + err = fuse_vnode_setsize(vp, uio->uio_offset + n); if (err) { brelse(bp); @@ -462,7 +462,7 @@ again: FS_DEBUG("getting block from OS, bcount %d\n", bcount); bp = getblk(vp, lbn, bcount, PCATCH, 0, 0); if (bp && uio->uio_offset + n > fvdat->filesize) { - err = fuse_vnode_setsize(vp, cred, + err = fuse_vnode_setsize(vp, uio->uio_offset + n); if (err) { brelse(bp); Modified: stable/12/sys/fs/fuse/fuse_node.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_node.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/fuse/fuse_node.c Sun Jun 23 13:35:01 2019 (r349305) @@ -379,7 +379,7 @@ fuse_vnode_refreshsize(struct vnode *vp, struct ucred } int -fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize) +fuse_vnode_setsize(struct vnode *vp, off_t newsize) { struct fuse_vnode_data *fvdat = VTOFUD(vp); off_t oldsize; @@ -395,7 +395,7 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cre fvdat->flag |= FN_SIZECHANGE; if (newsize < oldsize) { - err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp)); + err = vtruncbuf(vp, newsize, fuse_iosize(vp)); } vnode_pager_setsize(vp, newsize); return err; Modified: stable/12/sys/fs/fuse/fuse_node.h ============================================================================== --- stable/12/sys/fs/fuse/fuse_node.h Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/fuse/fuse_node.h Sun Jun 23 13:35:01 2019 (r349305) @@ -128,6 +128,6 @@ void fuse_vnode_refreshsize(struct vnode *vp, struct u int fuse_vnode_savesize(struct vnode *vp, struct ucred *cred); -int fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize); +int fuse_vnode_setsize(struct vnode *vp, off_t newsize); #endif /* _FUSE_NODE_H_ */ Modified: stable/12/sys/fs/fuse/fuse_vnops.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_vnops.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/fuse/fuse_vnops.c Sun Jun 23 13:35:01 2019 (r349305) @@ -539,7 +539,7 @@ fuse_vnop_getattr(struct vop_getattr_args *ap) fdi.answ)->attr.size; if (fvdat->filesize != new_filesize) { - fuse_vnode_setsize(vp, cred, new_filesize); + fuse_vnode_setsize(vp, new_filesize); } } debug_printf("fuse_getattr e: returning 0\n"); @@ -1649,7 +1649,7 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) out: fdisp_destroy(&fdi); if (!err && sizechanged) { - fuse_vnode_setsize(vp, cred, newsize); + fuse_vnode_setsize(vp, newsize); VTOFUD(vp)->flag &= ~FN_SIZECHANGE; } return err; Modified: stable/12/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- stable/12/sys/fs/msdosfs/msdosfs_denode.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/msdosfs/msdosfs_denode.c Sun Jun 23 13:35:01 2019 (r349305) @@ -429,7 +429,7 @@ detrunc(struct denode *dep, u_long length, int flags, dep->de_FileSize = length; if (!isadir) dep->de_flag |= DE_UPDATE | DE_MODIFIED; - allerror = vtruncbuf(DETOV(dep), cred, length, pmp->pm_bpcluster); + allerror = vtruncbuf(DETOV(dep), length, pmp->pm_bpcluster); #ifdef MSDOSFS_DEBUG if (allerror) printf("detrunc(): vtruncbuf error %d\n", allerror); Modified: stable/12/sys/fs/nfsclient/nfs.h ============================================================================== --- stable/12/sys/fs/nfsclient/nfs.h Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/nfsclient/nfs.h Sun Jun 23 13:35:01 2019 (r349305) @@ -91,8 +91,7 @@ enum nfsiod_state { /* * Function prototypes. */ -int ncl_meta_setsize(struct vnode *, struct ucred *, struct thread *, - u_quad_t); +int ncl_meta_setsize(struct vnode *, struct thread *, u_quad_t); void ncl_doio_directwrite(struct buf *); int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *); int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *); Modified: stable/12/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clbio.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/nfsclient/nfs_clbio.c Sun Jun 23 13:35:01 2019 (r349305) @@ -1832,7 +1832,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre */ int -ncl_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad_t nsize) +ncl_meta_setsize(struct vnode *vp, struct thread *td, u_quad_t nsize) { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; @@ -1854,7 +1854,7 @@ ncl_meta_setsize(struct vnode *vp, struct ucred *cred, * truncation point. We may have a B_DELWRI and/or B_CACHE * buffer that now needs to be truncated. */ - error = vtruncbuf(vp, cred, nsize, biosize); + error = vtruncbuf(vp, nsize, biosize); lbn = nsize / biosize; bufsize = nsize - (lbn * biosize); bp = nfs_getcacheblk(vp, lbn, bufsize, td); Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 23 13:35:01 2019 (r349305) @@ -954,8 +954,7 @@ nfs_setattr(struct vop_setattr_args *ap) mtx_lock(&np->n_mtx); tsize = np->n_size; mtx_unlock(&np->n_mtx); - error = ncl_meta_setsize(vp, ap->a_cred, td, - vap->va_size); + error = ncl_meta_setsize(vp, td, vap->va_size); mtx_lock(&np->n_mtx); if (np->n_flag & NMODIFIED) { tsize = np->n_size; Modified: stable/12/sys/kern/vfs_subr.c ============================================================================== --- stable/12/sys/kern/vfs_subr.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/kern/vfs_subr.c Sun Jun 23 13:35:01 2019 (r349305) @@ -1854,15 +1854,15 @@ again: * sync activity. */ int -vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, int blksize) +vtruncbuf(struct vnode *vp, off_t length, int blksize) { struct buf *bp, *nbp; int anyfreed; daddr_t trunclbn; struct bufobj *bo; - CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__, - vp, cred, blksize, (uintmax_t)length); + CTR4(KTR_VFS, "%s: vp %p with block %d:%ju", __func__, + vp, blksize, (uintmax_t)length); /* * Round up to the *next* lbn. Modified: stable/12/sys/sys/vnode.h ============================================================================== --- stable/12/sys/sys/vnode.h Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/sys/vnode.h Sun Jun 23 13:35:01 2019 (r349305) @@ -657,8 +657,7 @@ void vgone(struct vnode *vp); void _vhold(struct vnode *, bool); void vinactive(struct vnode *, struct thread *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); -int vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, - int blksize); +int vtruncbuf(struct vnode *vp, off_t length, int blksize); void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); int vrecycle(struct vnode *vp); Modified: stable/12/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_inode.c Sun Jun 23 11:09:08 2019 (r349304) +++ stable/12/sys/ufs/ffs/ffs_inode.c Sun Jun 23 13:35:01 2019 (r349305) @@ -502,7 +502,7 @@ ffs_truncate(vp, length, flags, cred) ip->i_size = osize; DIP_SET(ip, i_size, osize); - error = vtruncbuf(vp, cred, length, fs->fs_bsize); + error = vtruncbuf(vp, length, fs->fs_bsize); if (error && (allerror == 0)) allerror = error; From owner-svn-src-all@freebsd.org Sun Jun 23 13:41:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C941B15D1769; Sun, 23 Jun 2019 13:41:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6515A8B939; Sun, 23 Jun 2019 13:41:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F2A4226CC; Sun, 23 Jun 2019 13:40:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NDeu85079904; Sun, 23 Jun 2019 13:40:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NDeuOf079903; Sun, 23 Jun 2019 13:40:56 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906231340.x5NDeuOf079903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 23 Jun 2019 13:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349306 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 349306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6515A8B939 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 13:41:03 -0000 Author: asomers Date: Sun Jun 23 13:40:56 2019 New Revision: 349306 URL: https://svnweb.freebsd.org/changeset/base/349306 Log: MFC r348316: VOP_ADVLOCK.9: fix description of flags * F_RDLCK, F_UNLCK, and F_WRLCK aren't flags. They're stored in the fl.l_type field. * Add F_REMOTE, added in r177633 * Add F_NOINTR, added in r180025 Sponsored by: The FreeBSD Foundation Modified: stable/12/share/man/man9/VOP_ADVLOCK.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/VOP_ADVLOCK.9 ============================================================================== --- stable/12/share/man/man9/VOP_ADVLOCK.9 Sun Jun 23 13:35:01 2019 (r349305) +++ stable/12/share/man/man9/VOP_ADVLOCK.9 Sun Jun 23 13:40:56 2019 (r349306) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 1999 +.Dd May 27, 2019 .Dt VOP_ADVLOCK 9 .Os .Sh NAME @@ -56,13 +56,7 @@ Description of the lock. .It Fa flags One of more of the following: .Pp -.Bl -tag -width ".Dv F_UNLCK" -offset indent -compact -.It Dv F_RDLCK -Shared or read lock. -.It Dv F_UNLCK -Unlock. -.It Dv F_WRLCK -Exclusive or write lock. +.Bl -tag -width ".Dv F_REMOTE" -offset indent -compact .It Dv F_WAIT Wait until lock is granted. .It Dv F_FLOCK @@ -71,6 +65,10 @@ Use semantics for lock. .It Dv F_POSIX Use POSIX semantics for lock. +.It Dv F_REMOTE +Lock owner is remote NFS client. +.It Dv F_NOINTR +Mask signals while waiting for the lock. .El .El .Pp From owner-svn-src-all@freebsd.org Sun Jun 23 13:44:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3495615D184E; Sun, 23 Jun 2019 13:44:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBB388BDCC; Sun, 23 Jun 2019 13:44:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B91472286A; Sun, 23 Jun 2019 13:44:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NDi6Ex084870; Sun, 23 Jun 2019 13:44:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NDi68M084869; Sun, 23 Jun 2019 13:44:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906231344.x5NDi68M084869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 23 Jun 2019 13:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349307 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 349307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBB388BDCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 13:44:07 -0000 Author: asomers Date: Sun Jun 23 13:44:06 2019 New Revision: 349307 URL: https://svnweb.freebsd.org/changeset/base/349307 Log: MFC r348737: Add a testing facility to manually reclaim a vnode Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it will be reclaimed, as long as it isn't already or doomed. The purpose is to gain test coverage for vnode reclamation, which is otherwise hard to achieve. Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except that its argument is a file descriptor instead of a pathname. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20519 Modified: stable/12/sys/kern/vfs_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_subr.c ============================================================================== --- stable/12/sys/kern/vfs_subr.c Sun Jun 23 13:40:56 2019 (r349306) +++ stable/12/sys/kern/vfs_subr.c Sun Jun 23 13:44:06 2019 (r349307) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -337,6 +338,93 @@ SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, static int vnlru_nowhere; SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, &vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); + +static int +sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) +{ + struct vnode *vp; + struct nameidata nd; + char *buf; + unsigned long ndflags; + int error; + + if (req->newptr == NULL) + return (EINVAL); + if (req->newlen > PATH_MAX) + return (E2BIG); + + buf = malloc(PATH_MAX + 1, M_TEMP, M_WAITOK); + error = SYSCTL_IN(req, buf, req->newlen); + if (error != 0) + goto out; + + buf[req->newlen] = '\0'; + + ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | NOCACHE | SAVENAME; + NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf, curthread); + if ((error = namei(&nd)) != 0) + goto out; + vp = nd.ni_vp; + + if ((vp->v_iflag & VI_DOOMED) != 0) { + /* + * This vnode is being recycled. Return != 0 to let the caller + * know that the sysctl had no effect. Return EAGAIN because a + * subsequent call will likely succeed (since namei will create + * a new vnode if necessary) + */ + error = EAGAIN; + goto putvnode; + } + + counter_u64_add(recycles_count, 1); + vgone(vp); +putvnode: + NDFREE(&nd, 0); +out: + free(buf, M_TEMP); + return (error); +} + +static int +sysctl_ftry_reclaim_vnode(SYSCTL_HANDLER_ARGS) +{ + struct thread *td = curthread; + struct vnode *vp; + struct file *fp; + int error; + int fd; + + if (req->newptr == NULL) + return (EBADF); + + error = sysctl_handle_int(oidp, &fd, 0, req); + if (error != 0) + return (error); + error = getvnode(curthread, fd, &cap_fcntl_rights, &fp); + if (error != 0) + return (error); + vp = fp->f_vnode; + + error = vn_lock(vp, LK_EXCLUSIVE); + if (error != 0) + goto drop; + + counter_u64_add(recycles_count, 1); + vgone(vp); + VOP_UNLOCK(vp, 0); +drop: + fdrop(fp, td); + return (error); +} + +SYSCTL_PROC(_debug, OID_AUTO, try_reclaim_vnode, + CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, + sysctl_try_reclaim_vnode, "A", "Try to reclaim a vnode by its pathname"); +SYSCTL_PROC(_debug, OID_AUTO, ftry_reclaim_vnode, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, + sysctl_ftry_reclaim_vnode, "I", + "Try to reclaim a vnode by its file descriptor"); /* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ static int vnsz2log; From owner-svn-src-all@freebsd.org Sun Jun 23 14:49:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5711615D2FF4; Sun, 23 Jun 2019 14:49:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8B268E1C0; Sun, 23 Jun 2019 14:49:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6C662325D; Sun, 23 Jun 2019 14:49:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NEnXBX016172; Sun, 23 Jun 2019 14:49:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NEnVUK016161; Sun, 23 Jun 2019 14:49:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906231449.x5NEnVUK016161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 23 Jun 2019 14:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349308 - in stable/11/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient kern sys ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/11/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient kern sys ufs/ffs X-SVN-Commit-Revision: 349308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8B268E1C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 14:49:34 -0000 Author: asomers Date: Sun Jun 23 14:49:30 2019 New Revision: 349308 URL: https://svnweb.freebsd.org/changeset/base/349308 Log: MFC r348251: Remove "struct ucred*" argument from vtruncbuf vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever since that function was first added in r34611. Remove it. Also, remove some "struct ucred" arguments from fuse and nfs functions that were only used by vtruncbuf. Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20377 Modified: stable/11/sys/fs/ext2fs/ext2_inode.c stable/11/sys/fs/fuse/fuse_io.c stable/11/sys/fs/fuse/fuse_node.c stable/11/sys/fs/fuse/fuse_node.h stable/11/sys/fs/fuse/fuse_vnops.c stable/11/sys/fs/msdosfs/msdosfs_denode.c stable/11/sys/fs/nfsclient/nfs.h stable/11/sys/fs/nfsclient/nfs_clbio.c stable/11/sys/fs/nfsclient/nfs_clvnops.c stable/11/sys/kern/vfs_subr.c stable/11/sys/sys/vnode.h stable/11/sys/ufs/ffs/ffs_inode.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_inode.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/ext2fs/ext2_inode.c Sun Jun 23 14:49:30 2019 (r349308) @@ -263,7 +263,7 @@ ext2_truncate(struct vnode *vp, off_t length, int flag oip->i_ib[i] = oldblks[NDADDR + i]; } oip->i_size = osize; - error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize); + error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) allerror = error; vnode_pager_setsize(ovp, length); Modified: stable/11/sys/fs/fuse/fuse_io.c ============================================================================== --- stable/11/sys/fs/fuse/fuse_io.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/fuse/fuse_io.c Sun Jun 23 14:49:30 2019 (r349308) @@ -361,7 +361,7 @@ fuse_write_directbackend(struct vnode *vp, struct uio uio->uio_resid += diff; uio->uio_offset -= diff; if (uio->uio_offset > fvdat->filesize) - fuse_vnode_setsize(vp, cred, uio->uio_offset); + fuse_vnode_setsize(vp, uio->uio_offset); } fdisp_destroy(&fdi); @@ -433,7 +433,7 @@ again: if (bp != NULL) { long save; - err = fuse_vnode_setsize(vp, cred, + err = fuse_vnode_setsize(vp, uio->uio_offset + n); if (err) { brelse(bp); @@ -460,7 +460,7 @@ again: FS_DEBUG("getting block from OS, bcount %d\n", bcount); bp = getblk(vp, lbn, bcount, PCATCH, 0, 0); if (bp && uio->uio_offset + n > fvdat->filesize) { - err = fuse_vnode_setsize(vp, cred, + err = fuse_vnode_setsize(vp, uio->uio_offset + n); if (err) { brelse(bp); Modified: stable/11/sys/fs/fuse/fuse_node.c ============================================================================== --- stable/11/sys/fs/fuse/fuse_node.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/fuse/fuse_node.c Sun Jun 23 14:49:30 2019 (r349308) @@ -366,7 +366,7 @@ fuse_vnode_refreshsize(struct vnode *vp, struct ucred } int -fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize) +fuse_vnode_setsize(struct vnode *vp, off_t newsize) { struct fuse_vnode_data *fvdat = VTOFUD(vp); off_t oldsize; @@ -382,7 +382,7 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cre fvdat->flag |= FN_SIZECHANGE; if (newsize < oldsize) { - err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp)); + err = vtruncbuf(vp, newsize, fuse_iosize(vp)); } vnode_pager_setsize(vp, newsize); return err; Modified: stable/11/sys/fs/fuse/fuse_node.h ============================================================================== --- stable/11/sys/fs/fuse/fuse_node.h Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/fuse/fuse_node.h Sun Jun 23 14:49:30 2019 (r349308) @@ -126,6 +126,6 @@ void fuse_vnode_refreshsize(struct vnode *vp, struct u int fuse_vnode_savesize(struct vnode *vp, struct ucred *cred); -int fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize); +int fuse_vnode_setsize(struct vnode *vp, off_t newsize); #endif /* _FUSE_NODE_H_ */ Modified: stable/11/sys/fs/fuse/fuse_vnops.c ============================================================================== --- stable/11/sys/fs/fuse/fuse_vnops.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/fuse/fuse_vnops.c Sun Jun 23 14:49:30 2019 (r349308) @@ -536,7 +536,7 @@ fuse_vnop_getattr(struct vop_getattr_args *ap) fdi.answ)->attr.size; if (fvdat->filesize != new_filesize) { - fuse_vnode_setsize(vp, cred, new_filesize); + fuse_vnode_setsize(vp, new_filesize); } } debug_printf("fuse_getattr e: returning 0\n"); @@ -1648,7 +1648,7 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) out: fdisp_destroy(&fdi); if (!err && sizechanged) { - fuse_vnode_setsize(vp, cred, newsize); + fuse_vnode_setsize(vp, newsize); VTOFUD(vp)->flag &= ~FN_SIZECHANGE; } return err; Modified: stable/11/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_denode.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/msdosfs/msdosfs_denode.c Sun Jun 23 14:49:30 2019 (r349308) @@ -427,7 +427,7 @@ detrunc(struct denode *dep, u_long length, int flags, dep->de_FileSize = length; if (!isadir) dep->de_flag |= DE_UPDATE | DE_MODIFIED; - allerror = vtruncbuf(DETOV(dep), cred, length, pmp->pm_bpcluster); + allerror = vtruncbuf(DETOV(dep), length, pmp->pm_bpcluster); #ifdef MSDOSFS_DEBUG if (allerror) printf("detrunc(): vtruncbuf error %d\n", allerror); Modified: stable/11/sys/fs/nfsclient/nfs.h ============================================================================== --- stable/11/sys/fs/nfsclient/nfs.h Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/nfsclient/nfs.h Sun Jun 23 14:49:30 2019 (r349308) @@ -89,8 +89,7 @@ enum nfsiod_state { /* * Function prototypes. */ -int ncl_meta_setsize(struct vnode *, struct ucred *, struct thread *, - u_quad_t); +int ncl_meta_setsize(struct vnode *, struct thread *, u_quad_t); void ncl_doio_directwrite(struct buf *); int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *); int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *); Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clbio.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/nfsclient/nfs_clbio.c Sun Jun 23 14:49:30 2019 (r349308) @@ -1830,7 +1830,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre */ int -ncl_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad_t nsize) +ncl_meta_setsize(struct vnode *vp, struct thread *td, u_quad_t nsize) { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; @@ -1852,7 +1852,7 @@ ncl_meta_setsize(struct vnode *vp, struct ucred *cred, * truncation point. We may have a B_DELWRI and/or B_CACHE * buffer that now needs to be truncated. */ - error = vtruncbuf(vp, cred, nsize, biosize); + error = vtruncbuf(vp, nsize, biosize); lbn = nsize / biosize; bufsize = nsize - (lbn * biosize); bp = nfs_getcacheblk(vp, lbn, bufsize, td); Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 23 14:49:30 2019 (r349308) @@ -929,8 +929,7 @@ nfs_setattr(struct vop_setattr_args *ap) mtx_lock(&np->n_mtx); tsize = np->n_size; mtx_unlock(&np->n_mtx); - error = ncl_meta_setsize(vp, ap->a_cred, td, - vap->va_size); + error = ncl_meta_setsize(vp, td, vap->va_size); mtx_lock(&np->n_mtx); if (np->n_flag & NMODIFIED) { tsize = np->n_size; Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/kern/vfs_subr.c Sun Jun 23 14:49:30 2019 (r349308) @@ -1787,15 +1787,15 @@ again: * sync activity. */ int -vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, int blksize) +vtruncbuf(struct vnode *vp, off_t length, int blksize) { struct buf *bp, *nbp; int anyfreed; daddr_t trunclbn; struct bufobj *bo; - CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__, - vp, cred, blksize, (uintmax_t)length); + CTR4(KTR_VFS, "%s: vp %p with block %d:%ju", __func__, + vp, blksize, (uintmax_t)length); /* * Round up to the *next* lbn. Modified: stable/11/sys/sys/vnode.h ============================================================================== --- stable/11/sys/sys/vnode.h Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/sys/vnode.h Sun Jun 23 14:49:30 2019 (r349308) @@ -673,8 +673,7 @@ void vgone(struct vnode *vp); void _vhold(struct vnode *, bool); void vinactive(struct vnode *, struct thread *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); -int vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, - int blksize); +int vtruncbuf(struct vnode *vp, off_t length, int blksize); void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); int vrecycle(struct vnode *vp); Modified: stable/11/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_inode.c Sun Jun 23 13:44:06 2019 (r349307) +++ stable/11/sys/ufs/ffs/ffs_inode.c Sun Jun 23 14:49:30 2019 (r349308) @@ -497,7 +497,7 @@ ffs_truncate(vp, length, flags, cred) ip->i_size = osize; DIP_SET(ip, i_size, osize); - error = vtruncbuf(vp, cred, length, fs->fs_bsize); + error = vtruncbuf(vp, length, fs->fs_bsize); if (error && (allerror == 0)) allerror = error; From owner-svn-src-all@freebsd.org Sun Jun 23 15:09:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7177D15D34C0; Sun, 23 Jun 2019 15:09:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AB158EB8E; Sun, 23 Jun 2019 15:09:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBE18235B8; Sun, 23 Jun 2019 15:09:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NF9dnr026570; Sun, 23 Jun 2019 15:09:39 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NF9ddR026569; Sun, 23 Jun 2019 15:09:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906231509.x5NF9ddR026569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 23 Jun 2019 15:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349309 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 349309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0AB158EB8E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 15:09:40 -0000 Author: asomers Date: Sun Jun 23 15:09:39 2019 New Revision: 349309 URL: https://svnweb.freebsd.org/changeset/base/349309 Log: MFC r348737: Add a testing facility to manually reclaim a vnode Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it will be reclaimed, as long as it isn't already or doomed. The purpose is to gain test coverage for vnode reclamation, which is otherwise hard to achieve. Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except that its argument is a file descriptor instead of a pathname. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20519 Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Sun Jun 23 14:49:30 2019 (r349308) +++ stable/11/sys/kern/vfs_subr.c Sun Jun 23 15:09:39 2019 (r349309) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -331,6 +332,95 @@ SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, static int vnlru_nowhere; SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, &vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); + +static int +sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) +{ + struct vnode *vp; + struct nameidata nd; + char *buf; + unsigned long ndflags; + int error; + + if (req->newptr == NULL) + return (EINVAL); + if (req->newlen > PATH_MAX) + return (E2BIG); + + buf = malloc(PATH_MAX + 1, M_TEMP, M_WAITOK); + error = SYSCTL_IN(req, buf, req->newlen); + if (error != 0) + goto out; + + buf[req->newlen] = '\0'; + + ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | NOCACHE | SAVENAME; + NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf, curthread); + if ((error = namei(&nd)) != 0) + goto out; + vp = nd.ni_vp; + + if ((vp->v_iflag & VI_DOOMED) != 0) { + /* + * This vnode is being recycled. Return != 0 to let the caller + * know that the sysctl had no effect. Return EAGAIN because a + * subsequent call will likely succeed (since namei will create + * a new vnode if necessary) + */ + error = EAGAIN; + goto putvnode; + } + + counter_u64_add(recycles_count, 1); + vgone(vp); +putvnode: + NDFREE(&nd, 0); +out: + free(buf, M_TEMP); + return (error); +} + +static int +sysctl_ftry_reclaim_vnode(SYSCTL_HANDLER_ARGS) +{ + struct thread *td = curthread; + struct vnode *vp; + struct file *fp; + cap_rights_t rights; + int error; + int fd; + + if (req->newptr == NULL) + return (EBADF); + + error = sysctl_handle_int(oidp, &fd, 0, req); + if (error != 0) + return (error); + cap_rights_init(&rights, CAP_FCNTL); + error = getvnode(curthread, fd, &rights, &fp); + if (error != 0) + return (error); + vp = fp->f_vnode; + + error = vn_lock(vp, LK_EXCLUSIVE); + if (error != 0) + goto drop; + + counter_u64_add(recycles_count, 1); + vgone(vp); + VOP_UNLOCK(vp, 0); +drop: + fdrop(fp, td); + return (error); +} + +SYSCTL_PROC(_debug, OID_AUTO, try_reclaim_vnode, + CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, + sysctl_try_reclaim_vnode, "A", "Try to reclaim a vnode by its pathname"); +SYSCTL_PROC(_debug, OID_AUTO, ftry_reclaim_vnode, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, + sysctl_ftry_reclaim_vnode, "I", + "Try to reclaim a vnode by its file descriptor"); /* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ static int vnsz2log; From owner-svn-src-all@freebsd.org Sun Jun 23 15:55:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1931115D43D8; Sun, 23 Jun 2019 15:55:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6A5190508; Sun, 23 Jun 2019 15:55:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 886E623E0B; Sun, 23 Jun 2019 15:55:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NFtgqf055606; Sun, 23 Jun 2019 15:55:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NFtgdc055604; Sun, 23 Jun 2019 15:55:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231555.x5NFtgdc055604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 15:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349310 - stable/12/usr.sbin/i2c X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/usr.sbin/i2c X-SVN-Commit-Revision: 349310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6A5190508 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 15:55:43 -0000 Author: ian Date: Sun Jun 23 15:55:41 2019 New Revision: 349310 URL: https://svnweb.freebsd.org/changeset/base/349310 Log: MFC r348120: Add a new 'tr' (transfer) mode to i2c(8) to support more i2c controllers. Some i2c controller hardware does not provide a way to do individual START, REPEAT-START and STOP actions on the i2c bus. Instead, they can only do a complete transfer as a single operation. Typically they can do either START-data-STOP or START-data-REPEATSTART-data-STOP. In the i2c driver framework, this corresponds to the iicbus_transfer method. In the userland interface they are initiated with the I2CRDWR ioctl command. These changes add a new 'tr' mode which can be specified with the '-m' command line option. This mode should work on all hardware; when an i2c controller driver doesn't directly support the iicbus_transfer method, code in the i2c driver framework uses the lower-level START/REPEAT/STOP methods to implement the transfer. After this new mode has gotten some testing on various hardware, the 'tr' mode should probably become the new default mode. PR: 189914 Modified: stable/12/usr.sbin/i2c/i2c.8 stable/12/usr.sbin/i2c/i2c.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/i2c/i2c.8 ============================================================================== --- stable/12/usr.sbin/i2c/i2c.8 Sun Jun 23 15:09:39 2019 (r349309) +++ stable/12/usr.sbin/i2c/i2c.8 Sun Jun 23 15:55:41 2019 (r349310) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd May 22, 2019 .Dt I2C 8 .Os .Sh NAME @@ -39,7 +39,7 @@ .Op Fl w Ar 0|8|16 .Op Fl o Ar offset .Op Fl c Ar count -.Op Fl m Ar ss|rs|no +.Op Fl m Ar tr|ss|rs|no .Op Fl b .Op Fl v .Nm @@ -72,10 +72,29 @@ number of bytes to transfer (dec). transfer direction: r - read, w - write. .It Fl f Ar device I2C bus to use (default is /dev/iic0). -.It Fl m Ar ss|rs|no +.It Fl m Ar tr|ss|rs|no addressing mode, i.e., I2C bus operations performed after the offset for the transfer has been written to the device and before the actual read/write -operation. rs - repeated start; ss - stop start; no - none. +operation. +.Bl -tag -compact -offset indent +.It Va tr +complete-transfer +.It Va ss +stop then start +.It Va rs +repeated start +.It Va no +none +.El +Some I2C bus hardware does not provide control over the individual start, +repeat-start, and stop operations. +Such hardware can only perform a complete transfer of the offset and the +data as a single operation. +The +.Va tr +mode creates control structures describing the transfer and submits them +to the driver as a single complete transaction. +This mode works on all types of I2C hardware. .It Fl n Ar skip_addr skip address - address(es) to be skipped during bus scan. There are two ways to specify addresses to ignore: by range 'a..b' or Modified: stable/12/usr.sbin/i2c/i2c.c ============================================================================== --- stable/12/usr.sbin/i2c/i2c.c Sun Jun 23 15:09:39 2019 (r349309) +++ stable/12/usr.sbin/i2c/i2c.c Sun Jun 23 15:55:41 2019 (r349310) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #define I2C_MODE_NONE 1 #define I2C_MODE_STOP_START 2 #define I2C_MODE_REPEATED_START 3 +#define I2C_MODE_TRANSFER 4 struct options { int width; @@ -73,7 +74,7 @@ usage(void) { fprintf(stderr, "usage: %s -a addr [-f device] [-d [r|w]] [-o offset] " - "[-w [0|8|16]] [-c count] [-m [ss|rs|no]] [-b] [-v]\n", + "[-w [0|8|16]] [-c count] [-m [tr|ss|rs|no]] [-b] [-v]\n", getprogname()); fprintf(stderr, " %s -s [-f device] [-n skip_addr] -v\n", getprogname()); @@ -297,24 +298,9 @@ static int i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) { struct iiccmd cmd; - int ch, i, error, fd, bufsize; + int error, fd, bufsize; char *err_msg, *buf; - /* - * Read data to be written to the chip from stdin - */ - if (i2c_opt.verbose && !i2c_opt.binary) - fprintf(stderr, "Enter %u bytes of data: ", i2c_opt.count); - - for (i = 0; i < i2c_opt.count; i++) { - ch = getchar(); - if (ch == EOF) { - free(i2c_buf); - err(1, "not enough data, exiting\n"); - } - i2c_buf[i] = ch; - } - fd = open(dev, O_RDWR); if (fd == -1) { free(i2c_buf); @@ -558,6 +544,72 @@ err2: return (1); } +/* + * i2c_rdwr_transfer() - use I2CRDWR to conduct a complete i2c transfer. + * + * Some i2c hardware is unable to provide direct control over START, REPEAT- + * START, and STOP operations. Such hardware can only perform a complete + * START--STOP or START--REPEAT-START--STOP sequence as a + * single operation. The driver framework refers to this sequence as a + * "transfer" so we call it "transfer mode". We assemble either one or two + * iic_msg structures to describe the IO operations, and hand them off to the + * driver to be handled as a single transfer. + */ +static int +i2c_rdwr_transfer(char *dev, struct options i2c_opt, char *i2c_buf) +{ + struct iic_msg msgs[2]; + struct iic_rdwr_data xfer; + int fd, i; + union { + uint8_t buf[2]; + uint8_t off8; + uint16_t off16; + } off; + + i = 0; + if (i2c_opt.width > 0) { + msgs[i].flags = IIC_M_WR | IIC_M_NOSTOP; + msgs[i].slave = i2c_opt.addr; + msgs[i].buf = off.buf; + if (i2c_opt.width == 8) { + off.off8 = (uint8_t)i2c_opt.off; + msgs[i].len = 1; + } else { + off.off16 = (uint16_t)i2c_opt.off; + msgs[i].len = 2; + } + ++i; + } + + /* + * If the transfer direction is write and we did a write of the offset + * above, then we need to elide the start; this transfer is just more + * writing that follows the one started above. For a read, we always do + * a start; if we did an offset write above it'll be a repeat-start + * because of the NOSTOP flag used above. + */ + if (i2c_opt.dir == 'w') + msgs[i].flags = IIC_M_WR | (i > 0) ? IIC_M_NOSTART : 0; + else + msgs[i].flags = IIC_M_RD; + msgs[i].slave = i2c_opt.addr; + msgs[i].len = i2c_opt.count; + msgs[i].buf = i2c_buf; + ++i; + + xfer.msgs = msgs; + xfer.nmsgs = i; + + if ((fd = open(dev, O_RDWR)) == -1) + err(1, "open(%s) failed", dev); + if (ioctl(fd, I2CRDWR, &xfer) == -1 ) + err(1, "ioctl(I2CRDWR) failed"); + close(fd); + + return (0); +} + int main(int argc, char** argv) { @@ -620,6 +672,8 @@ main(int argc, char** argv) i2c_opt.mode = I2C_MODE_STOP_START; else if (!strcmp(optarg, "rs")) i2c_opt.mode = I2C_MODE_REPEATED_START; + else if (!strcmp(optarg, "tr")) + i2c_opt.mode = I2C_MODE_TRANSFER; else usage(); break; @@ -687,19 +741,33 @@ main(int argc, char** argv) if (i2c_buf == NULL) err(1, "data malloc"); + /* + * For a write, read the data to be written to the chip from stdin. + */ if (i2c_opt.dir == 'w') { - error = i2c_write(dev, i2c_opt, i2c_buf); - if (error) { - free(i2c_buf); - return (1); + if (i2c_opt.verbose && !i2c_opt.binary) + fprintf(stderr, "Enter %u bytes of data: ", + i2c_opt.count); + for (i = 0; i < i2c_opt.count; i++) { + ch = getchar(); + if (ch == EOF) { + free(i2c_buf); + err(1, "not enough data, exiting\n"); + } + i2c_buf[i] = ch; } } - if (i2c_opt.dir == 'r') { + + if (i2c_opt.mode == I2C_MODE_TRANSFER) + error = i2c_rdwr_transfer(dev, i2c_opt, i2c_buf); + else if (i2c_opt.dir == 'w') + error = i2c_write(dev, i2c_opt, i2c_buf); + else error = i2c_read(dev, i2c_opt, i2c_buf); - if (error) { - free(i2c_buf); - return (1); - } + + if (error != 0) { + free(i2c_buf); + return (1); } if (i2c_opt.verbose) From owner-svn-src-all@freebsd.org Sun Jun 23 15:58:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B5EB15D467B; Sun, 23 Jun 2019 15:58:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31B47908D7; Sun, 23 Jun 2019 15:58:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02AA923E0E; Sun, 23 Jun 2019 15:58:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NFwk1I055776; Sun, 23 Jun 2019 15:58:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NFwkYf055773; Sun, 23 Jun 2019 15:58:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231558.x5NFwkYf055773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 15:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349311 - in stable/12/sys: arm/freescale/imx dev/iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12/sys: arm/freescale/imx dev/iicbus X-SVN-Commit-Revision: 349311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31B47908D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 15:58:47 -0000 Author: ian Date: Sun Jun 23 15:58:46 2019 New Revision: 349311 URL: https://svnweb.freebsd.org/changeset/base/349311 Log: MFC r348123, r348164, r348166 r348123: Add pnp info to the imx_i2c driver. r348164: Mark i2c slave devices busy while they own the bus. Many i2c slave drivers are in modules that can be unloaded. If they detach while IO is in progress the bus would be hung forever. Conversely, lower-layer drivers (iicbus and the hardware driver) also live in modules and other kinds of bad things happen if they get detached while IO is in progress. Because device_busy() propagates up to parents, marking the slave device busy while it owns the bus solves both kinds of problems that come with detaching i2c devices while IO is in progress. r348166: Release the bus-recovery gpio pins in detach(), so that unload then reload of the module works without "pin already allocated" errors. Modified: stable/12/sys/arm/freescale/imx/imx_i2c.c stable/12/sys/dev/iicbus/iiconf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- stable/12/sys/arm/freescale/imx/imx_i2c.c Sun Jun 23 15:55:41 2019 (r349310) +++ stable/12/sys/arm/freescale/imx/imx_i2c.c Sun Jun 23 15:58:46 2019 (r349311) @@ -194,6 +194,7 @@ DRIVER_MODULE(imx_i2c, simplebus, i2c_driver, i2c_devc DRIVER_MODULE(ofw_iicbus, imx_i2c, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); MODULE_DEPEND(imx_i2c, iicbus, 1, 1, 1); MODULE_DEPEND(imx_i2c, ofw_iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); static phandle_t i2c_get_node(device_t bus, device_t dev) @@ -467,6 +468,10 @@ i2c_detach(device_t dev) if (sc->iicbus != NULL) device_delete_child(dev, sc->iicbus); + + /* Release bus-recover pins; gpio_pin_release() handles NULL args. */ + gpio_pin_release(sc->rb_sclpin); + gpio_pin_release(sc->rb_sdapin); if (sc->res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); Modified: stable/12/sys/dev/iicbus/iiconf.c ============================================================================== --- stable/12/sys/dev/iicbus/iiconf.c Sun Jun 23 15:55:41 2019 (r349310) +++ stable/12/sys/dev/iicbus/iiconf.c Sun Jun 23 15:58:46 2019 (r349311) @@ -128,6 +128,12 @@ iicbus_request_bus(device_t bus, device_t dev, int how ++sc->owncount; if (sc->owner == NULL) { sc->owner = dev; + /* + * Mark the device busy while it owns the bus, to + * prevent detaching the device, bus, or hardware + * controller, until ownership is relinquished. + */ + device_busy(dev); /* * Drop the lock around the call to the bus driver, it * should be allowed to sleep in the IIC_WAIT case. @@ -177,6 +183,7 @@ iicbus_release_bus(device_t bus, device_t dev) IICBUS_LOCK(sc); sc->owner = NULL; wakeup_one(sc); + device_unbusy(dev); } IICBUS_UNLOCK(sc); return (0); From owner-svn-src-all@freebsd.org Sun Jun 23 16:00:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCDAF15D473E; Sun, 23 Jun 2019 16:00:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED1B90A2C; Sun, 23 Jun 2019 16:00:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54D8223E14; Sun, 23 Jun 2019 16:00:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NG0U4O055943; Sun, 23 Jun 2019 16:00:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NG0UgB055942; Sun, 23 Jun 2019 16:00:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231600.x5NG0UgB055942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 16:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349312 - stable/12/libexec/rc/rc.d X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/libexec/rc/rc.d X-SVN-Commit-Revision: 349312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7ED1B90A2C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 16:00:31 -0000 Author: ian Date: Sun Jun 23 16:00:29 2019 New Revision: 349312 URL: https://svnweb.freebsd.org/changeset/base/349312 Log: MFC r348141, r348143 r348141: Handle the driftfile option correctly when ntpd_flags is empty. The logic I originally wrote to detect whether a driftfile option was in the set of flags was based on the result of removing the pattern *flag* being an empty string. That didn't handle the case where the string was empty to begin with. Doh! So now it also specifically checks for an empty string. The result of the bad check was that ntpd would run without a driftfile, but it would do so only if it was running as root instead of the non-priveleged ntpd user, which isn't a typical case. Ntpd runs fine without a driftfile, although it does take it longer to stabilize the clock frequency at startup. Reported by: avg@ Pointy hat: ian@ r348143: Remove accidentally-added blank line; the style throughout this file is to use no whitespace between a comment block and the code it describes. Modified: stable/12/libexec/rc/rc.d/ntpd Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/ntpd ============================================================================== --- stable/12/libexec/rc/rc.d/ntpd Sun Jun 23 15:58:46 2019 (r349311) +++ stable/12/libexec/rc/rc.d/ntpd Sun Jun 23 16:00:29 2019 (r349312) @@ -90,9 +90,10 @@ ntpd_precmd() if can_run_nonroot; then _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" - elif [ -z "${rc_flags##*-f*}" ] || - [ -z "${rc_flags##*--driftfile*}" ] || - grep -q "^[ \t]*driftfile" "${ntpd_config}"; then + elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || + [ -n "${rc_flags}" ] && + ( [ -z "${rc_flags##*-f*}" ] || + [ -z "${rc_flags##*--driftfile*}" ] ); then driftopt="" # admin set the option, we don't need to add it. elif [ -f "${_ntp_old_driftfile}" ]; then driftopt="-f ${_ntp_old_driftfile}" From owner-svn-src-all@freebsd.org Sun Jun 23 16:05:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC3D915D49A6; Sun, 23 Jun 2019 16:05:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BA61910A7; Sun, 23 Jun 2019 16:05:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 658B023FB4; Sun, 23 Jun 2019 16:05:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NG5swL061039; Sun, 23 Jun 2019 16:05:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NG5rTf061037; Sun, 23 Jun 2019 16:05:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231605.x5NG5rTf061037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 16:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349313 - in stable/12/sys: arm64/conf conf dev/iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12/sys: arm64/conf conf dev/iicbus X-SVN-Commit-Revision: 349313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7BA61910A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 16:05:55 -0000 Author: ian Date: Sun Jun 23 16:05:53 2019 New Revision: 349313 URL: https://svnweb.freebsd.org/changeset/base/349313 Log: MFC r341386 (by manu): Add Silergy SYR827 PMIC driver SYR827 is a PMIC that can output a voltage from 0.7125V to 1.5V in 12.5mV steps It's controlled via I2C. Added: stable/12/sys/dev/iicbus/syr827.c - copied unchanged from r341386, head/sys/dev/iicbus/syr827.c Modified: stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Sun Jun 23 16:00:29 2019 (r349312) +++ stable/12/sys/arm64/conf/GENERIC Sun Jun 23 16:05:53 2019 (r349313) @@ -203,6 +203,7 @@ device bcm2835_bsc # Broadcom BCM283x I2C bus device iicbus device iic device twsi # Allwinner I2C controller +device syr827 # Silergy SYR827 PMIC # Clock and reset controllers device aw_ccu # Allwinner clock controller Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Sun Jun 23 16:00:29 2019 (r349312) +++ stable/12/sys/conf/files Sun Jun 23 16:05:53 2019 (r349313) @@ -1845,6 +1845,7 @@ dev/iicbus/ds13rtc.c optional ds13rtc | ds133x | ds13 dev/iicbus/ds1672.c optional ds1672 dev/iicbus/ds3231.c optional ds3231 dev/iicbus/rtc8583.c optional rtc8583 +dev/iicbus/syr827.c optional ext_resources syr827 dev/iicbus/icee.c optional icee dev/iicbus/if_ic.c optional ic dev/iicbus/iic.c optional iic Copied: stable/12/sys/dev/iicbus/syr827.c (from r341386, head/sys/dev/iicbus/syr827.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/iicbus/syr827.c Sun Jun 23 16:05:53 2019 (r349313, copy of r341386, head/sys/dev/iicbus/syr827.c) @@ -0,0 +1,354 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016 Jared McNeill + * Copyright (c) 2018 Emmanuel Vadot + * + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "iicbus_if.h" +#include "regdev_if.h" + +#define VSEL0 0x00 +#define VSEL1 0x01 + +#define VSEL_BUCK_EN (1 << 7) +#define VSEL_NSEL_MASK 0x3F +#define VSEL_VOLTAGE_BASE 712500 /* uV */ +#define VSEL_VOLTAGE_STEP 12500 /* uV */ + +#define ID1 0x03 +#define ID1_VENDOR_MASK 0xE0 +#define ID1_VENDOR_SHIFT 5 +#define ID1_DIE_MASK 0xF + +#define ID2 0x4 +#define ID2_DIE_REV_MASK 0xF + +static struct ofw_compat_data compat_data[] = { + { "silergy,syr827", 1 }, + { NULL, 0 } +}; + +struct syr827_reg_sc { + struct regnode *regnode; + device_t base_dev; + phandle_t xref; + struct regnode_std_param *param; + + int volt_reg; + int suspend_reg; +}; + +struct syr827_softc { + uint16_t addr; + struct intr_config_hook intr_hook; + + /* Regulator */ + struct syr827_reg_sc *reg; +}; + +static int +syr827_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + struct syr827_softc *sc; + struct iic_msg msg[2]; + + sc = device_get_softc(dev); + + msg[0].slave = sc->addr; + msg[0].flags = IIC_M_WR; + msg[0].len = 1; + msg[0].buf = ® + + msg[1].slave = sc->addr; + msg[1].flags = IIC_M_RD; + msg[1].len = size; + msg[1].buf = data; + + return (iicbus_transfer(dev, msg, 2)); +} + +static int +syr827_write(device_t dev, uint8_t reg, uint8_t val) +{ + struct syr827_softc *sc; + struct iic_msg msg; + uint8_t buffer[2]; + + sc = device_get_softc(dev); + + buffer[0] = reg; + buffer[1] = val; + + msg.slave = sc->addr; + msg.flags = IIC_M_WR; + msg.len = 2; + msg.buf = buffer; + + return (iicbus_transfer(dev, &msg, 1)); +} + +static int +syr827_regnode_init(struct regnode *regnode) +{ + return (0); +} + +static int +syr827_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct syr827_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + syr827_read(sc->base_dev, sc->volt_reg, &val, 1); + if (enable) + val &= ~VSEL_BUCK_EN; + else + val |= VSEL_BUCK_EN; + syr827_write(sc->base_dev, sc->volt_reg, val); + + *udelay = sc->param->ramp_delay; + + return (0); +} + +static int +syr827_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct syr827_reg_sc *sc; + int cur_uvolt; + uint8_t val; + + sc = regnode_get_softc(regnode); + + /* Get current voltage */ + syr827_read(sc->base_dev, sc->volt_reg, &val, 1); + cur_uvolt = (val & VSEL_NSEL_MASK) * VSEL_VOLTAGE_STEP + + VSEL_VOLTAGE_BASE; + + /* Set new voltage */ + val &= ~VSEL_NSEL_MASK; + val |= ((min_uvolt - VSEL_VOLTAGE_BASE) / VSEL_VOLTAGE_STEP); + syr827_write(sc->base_dev, sc->volt_reg, val); + + /* Time to delay is based on the number of voltage steps */ + *udelay = sc->param->ramp_delay * + (abs(cur_uvolt - min_uvolt) / VSEL_VOLTAGE_STEP); + + return (0); +} + +static int +syr827_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct syr827_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + syr827_read(sc->base_dev, sc->volt_reg, &val, 1); + *uvolt = (val & VSEL_NSEL_MASK) * VSEL_VOLTAGE_STEP + + VSEL_VOLTAGE_BASE; + + return (0); +} + +static regnode_method_t syr827_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, syr827_regnode_init), + REGNODEMETHOD(regnode_enable, syr827_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, syr827_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, syr827_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(syr827_regnode, syr827_regnode_class, syr827_regnode_methods, + sizeof(struct syr827_reg_sc), regnode_class); + +static struct syr827_reg_sc * +syr827_reg_attach(device_t dev, phandle_t node) +{ + struct syr827_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + int suspend_reg; + + memset(&initdef, 0, sizeof(initdef)); + regulator_parse_ofw_stdparam(dev, node, &initdef); + initdef.id = 0; + initdef.ofw_node = node; + regnode = regnode_create(dev, &syr827_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + if (OF_getencprop(node, "fcs,suspend-voltage-selector", &suspend_reg, + sizeof(uint32_t)) <= 0) + suspend_reg = 0; + + switch (suspend_reg) { + case 0: + reg_sc->suspend_reg = VSEL0; + reg_sc->volt_reg = VSEL1; + break; + case 1: + reg_sc->suspend_reg = VSEL1; + reg_sc->volt_reg = VSEL0; + break; + } + + regnode_register(regnode); + + return (reg_sc); +} + +static int +syr827_regdev_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, + intptr_t *num) +{ + struct syr827_softc *sc; + + sc = device_get_softc(dev); + + if (sc->reg->xref != xref) + return (ENXIO); + + *num = 0; + + return (0); +} + +static int +syr827_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Silergy SYR827 regulator"); + + return (BUS_PROBE_DEFAULT); +} + +static void +syr827_start(void *pdev) +{ + struct syr827_softc *sc; + device_t dev; + uint8_t val; + + dev = pdev; + sc = device_get_softc(dev); + + if (bootverbose) { + syr827_read(dev, ID1, &val, 1); + device_printf(dev, "Vendor ID: %x, DIE ID: %x\n", + (val & ID1_VENDOR_MASK) >> ID1_VENDOR_SHIFT, + val & ID1_DIE_MASK); + syr827_read(dev, ID2, &val, 1); + device_printf(dev, "DIE Rev: %x\n", val & ID2_DIE_REV_MASK); + } + + config_intrhook_disestablish(&sc->intr_hook); +} + +static int +syr827_attach(device_t dev) +{ + struct syr827_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + sc->addr = iicbus_get_addr(dev); + + sc->intr_hook.ich_func = syr827_start; + sc->intr_hook.ich_arg = dev; + + if (config_intrhook_establish(&sc->intr_hook) != 0) + return (ENOMEM); + + sc->reg = syr827_reg_attach(dev, node); + if (sc->reg == NULL) { + device_printf(dev, "cannot attach regulator\n"); + return (ENXIO); + } + + return (0); +} + +static device_method_t syr827_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, syr827_probe), + DEVMETHOD(device_attach, syr827_attach), + + /* Regdev interface */ + DEVMETHOD(regdev_map, syr827_regdev_map), + + DEVMETHOD_END +}; + +static driver_t syr827_driver = { + "syr827", + syr827_methods, + sizeof(struct syr827_softc), +}; + +static devclass_t syr827_devclass; + +EARLY_DRIVER_MODULE(syr827, iicbus, syr827_driver, syr827_devclass, 0, 0, + BUS_PASS_RESOURCE); +MODULE_VERSION(syr827, 1); +MODULE_DEPEND(syr827, iicbus, 1, 1, 1); From owner-svn-src-all@freebsd.org Sun Jun 23 16:16:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB3A115D4C43; Sun, 23 Jun 2019 16:16:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9091B91BD5; Sun, 23 Jun 2019 16:16:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74D0724175; Sun, 23 Jun 2019 16:16:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NGGwS8066171; Sun, 23 Jun 2019 16:16:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NGGtMU066157; Sun, 23 Jun 2019 16:16:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231616.x5NGGtMU066157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 16:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349314 - in stable/12/sys/dev: flash iicbus iicbus/twsi ofw spibus X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12/sys/dev: flash iicbus iicbus/twsi ofw spibus X-SVN-Commit-Revision: 349314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9091B91BD5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 16:16:59 -0000 Author: ian Date: Sun Jun 23 16:16:55 2019 New Revision: 349314 URL: https://svnweb.freebsd.org/changeset/base/349314 Log: MFC r348169-r348170, r348172-r348173, r348183-r348184 r348169: Define macros making it easier to define bus-specific pnpinfo for FDT systems. Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO() macro makes it easier to define new FDT-based pnpinfo for busses other than simplebus. Differential Revision: https://reviews.freebsd.org/D20382 r348170: Add pnpinfo for icee(4) on fdt systems. r348172: Use the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO(). Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be other kinds of pnpinfo for other (non-fdt) bus attachments. r348173: Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO. r348183: Add pnpinfo. r348184: Add pnpinfo to all i2c drivers that have FDT compat data. Modified: stable/12/sys/dev/flash/at45d.c stable/12/sys/dev/flash/mx25l.c stable/12/sys/dev/iicbus/ds1307.c stable/12/sys/dev/iicbus/ds13rtc.c stable/12/sys/dev/iicbus/icee.c stable/12/sys/dev/iicbus/iicbus.h stable/12/sys/dev/iicbus/isl12xx.c stable/12/sys/dev/iicbus/nxprtc.c stable/12/sys/dev/iicbus/rtc8583.c stable/12/sys/dev/iicbus/sy8106a.c stable/12/sys/dev/iicbus/syr827.c stable/12/sys/dev/iicbus/twsi/a10_twsi.c stable/12/sys/dev/iicbus/twsi/mv_twsi.c stable/12/sys/dev/ofw/ofw_bus_subr.h stable/12/sys/dev/spibus/spi.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/flash/at45d.c ============================================================================== --- stable/12/sys/dev/flash/at45d.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/flash/at45d.c Sun Jun 23 16:16:55 2019 (r349314) @@ -606,6 +606,6 @@ DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devcl MODULE_DEPEND(at45d, spibus, 1, 1, 1); #ifdef FDT MODULE_DEPEND(at45d, fdt_slicer, 1, 1, 1); -SPIBUS_PNP_INFO(compat_data); +SPIBUS_FDT_PNP_INFO(compat_data); #endif Modified: stable/12/sys/dev/flash/mx25l.c ============================================================================== --- stable/12/sys/dev/flash/mx25l.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/flash/mx25l.c Sun Jun 23 16:16:55 2019 (r349314) @@ -686,5 +686,5 @@ DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devcl MODULE_DEPEND(mx25l, spibus, 1, 1, 1); #ifdef FDT MODULE_DEPEND(mx25l, fdt_slicer, 1, 1, 1); -SPIBUS_PNP_INFO(compat_data); +SPIBUS_FDT_PNP_INFO(compat_data); #endif Modified: stable/12/sys/dev/iicbus/ds1307.c ============================================================================== --- stable/12/sys/dev/iicbus/ds1307.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/ds1307.c Sun Jun 23 16:16:55 2019 (r349314) @@ -435,3 +435,4 @@ static devclass_t ds1307_devclass; DRIVER_MODULE(ds1307, iicbus, ds1307_driver, ds1307_devclass, NULL, NULL); MODULE_VERSION(ds1307, 1); MODULE_DEPEND(ds1307, iicbus, 1, 1, 1); +IICBUS_FDT_PNP_INFO(ds1307_compat_data); Modified: stable/12/sys/dev/iicbus/ds13rtc.c ============================================================================== --- stable/12/sys/dev/iicbus/ds13rtc.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/ds13rtc.c Sun Jun 23 16:16:55 2019 (r349314) @@ -617,3 +617,4 @@ static devclass_t ds13rtc_devclass; DRIVER_MODULE(ds13rtc, iicbus, ds13rtc_driver, ds13rtc_devclass, NULL, NULL); MODULE_VERSION(ds13rtc, 1); MODULE_DEPEND(ds13rtc, iicbus, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/icee.c ============================================================================== --- stable/12/sys/dev/iicbus/icee.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/icee.c Sun Jun 23 16:16:55 2019 (r349314) @@ -392,3 +392,4 @@ static devclass_t icee_devclass; DRIVER_MODULE(icee, iicbus, icee_driver, icee_devclass, 0, 0); MODULE_VERSION(icee, 1); MODULE_DEPEND(icee, iicbus, 1, 1, 1); +IICBUS_FDT_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/iicbus.h ============================================================================== --- stable/12/sys/dev/iicbus/iicbus.h Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/iicbus.h Sun Jun 23 16:16:55 2019 (r349314) @@ -72,6 +72,12 @@ IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) #define IICBUS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED) +#ifdef FDT +#define IICBUS_FDT_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, iicbus) +#else +#define IICBUS_FDT_PNP_INFO(t) +#endif + int iicbus_generic_intr(device_t dev, int event, char *buf); void iicbus_init_frequency(device_t dev, u_int bus_freq); Modified: stable/12/sys/dev/iicbus/isl12xx.c ============================================================================== --- stable/12/sys/dev/iicbus/isl12xx.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/isl12xx.c Sun Jun 23 16:16:55 2019 (r349314) @@ -356,3 +356,4 @@ static devclass_t isl12xx_devclass; DRIVER_MODULE(isl12xx, iicbus, isl12xx_driver, isl12xx_devclass, NULL, NULL); MODULE_VERSION(isl12xx, 1); MODULE_DEPEND(isl12xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/nxprtc.c ============================================================================== --- stable/12/sys/dev/iicbus/nxprtc.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/nxprtc.c Sun Jun 23 16:16:55 2019 (r349314) @@ -826,3 +826,4 @@ static devclass_t nxprtc_devclass; DRIVER_MODULE(nxprtc, iicbus, nxprtc_driver, nxprtc_devclass, NULL, NULL); MODULE_VERSION(nxprtc, 1); MODULE_DEPEND(nxprtc, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/rtc8583.c ============================================================================== --- stable/12/sys/dev/iicbus/rtc8583.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/rtc8583.c Sun Jun 23 16:16:55 2019 (r349314) @@ -300,3 +300,4 @@ static devclass_t rtc8583_devclass; DRIVER_MODULE(rtc8583, iicbus, rtc8583_driver, rtc8583_devclass, NULL, NULL); MODULE_VERSION(rtc8583, 1); MODULE_DEPEND(rtc8583, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/sy8106a.c ============================================================================== --- stable/12/sys/dev/iicbus/sy8106a.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/sy8106a.c Sun Jun 23 16:16:55 2019 (r349314) @@ -300,3 +300,4 @@ EARLY_DRIVER_MODULE(sy8106a, iicbus, sy8106a_driver, s BUS_PASS_RESOURCE); MODULE_VERSION(sy8106a, 1); MODULE_DEPEND(sy8106a, iicbus, 1, 1, 1); +IICBUS_FDT_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/syr827.c ============================================================================== --- stable/12/sys/dev/iicbus/syr827.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/syr827.c Sun Jun 23 16:16:55 2019 (r349314) @@ -352,3 +352,4 @@ EARLY_DRIVER_MODULE(syr827, iicbus, syr827_driver, syr BUS_PASS_RESOURCE); MODULE_VERSION(syr827, 1); MODULE_DEPEND(syr827, iicbus, 1, 1, 1); +IICBUS_FDT_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/a10_twsi.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/twsi/a10_twsi.c Sun Jun 23 16:16:55 2019 (r349314) @@ -158,3 +158,4 @@ EARLY_DRIVER_MODULE(a10_twsi, simplebus, a10_twsi_driv EARLY_DRIVER_MODULE(iicbus, a10_twsi, iicbus_driver, iicbus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_DEPEND(a10_twsi, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/twsi/mv_twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/mv_twsi.c Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/iicbus/twsi/mv_twsi.c Sun Jun 23 16:16:55 2019 (r349314) @@ -120,6 +120,7 @@ static devclass_t mv_twsi_devclass; DRIVER_MODULE(twsi, simplebus, mv_twsi_driver, mv_twsi_devclass, 0, 0); DRIVER_MODULE(iicbus, twsi, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(twsi, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); static phandle_t mv_twsi_get_node(device_t bus, device_t dev) Modified: stable/12/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- stable/12/sys/dev/ofw/ofw_bus_subr.h Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/ofw/ofw_bus_subr.h Sun Jun 23 16:16:55 2019 (r349314) @@ -65,9 +65,11 @@ struct intr_map_data_fdt { }; #endif -#define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;" -#define SIMPLEBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / sizeof(t[0])); +#define FDTCOMPAT_PNP_DESCR "Z:compat;P:#;" +#define FDTCOMPAT_PNP_INFO(t, busname) \ + MODULE_PNP_INFO(FDTCOMPAT_PNP_DESCR, busname, t, t, sizeof(t) / sizeof(t[0])); + +#define SIMPLEBUS_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, simplebus) /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); Modified: stable/12/sys/dev/spibus/spi.h ============================================================================== --- stable/12/sys/dev/spibus/spi.h Sun Jun 23 16:05:53 2019 (r349313) +++ stable/12/sys/dev/spibus/spi.h Sun Jun 23 16:16:55 2019 (r349314) @@ -41,6 +41,8 @@ struct spi_command { #define SPI_CHIP_SELECT_HIGH 0x1 /* Chip select high (else low) */ -#define SPIBUS_PNP_DESCR "Z:compat;P:#;" -#define SPIBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t) / sizeof(t[0])); +#ifdef FDT +#define SPIBUS_FDT_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, spibus) +#else +#define SPIBUS_FDT_PNP_INFO(t) +#endif From owner-svn-src-all@freebsd.org Sun Jun 23 16:59:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB5915D53AF; Sun, 23 Jun 2019 16:59:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5D2A93ABC; Sun, 23 Jun 2019 16:59:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B121F24855; Sun, 23 Jun 2019 16:59:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NGx7Wn086816; Sun, 23 Jun 2019 16:59:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NGx7hd086815; Sun, 23 Jun 2019 16:59:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231659.x5NGx7hd086815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 16:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349315 - in stable/12/sys: dev/hwpmc modules/hwpmc X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12/sys: dev/hwpmc modules/hwpmc X-SVN-Commit-Revision: 349315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5D2A93ABC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 16:59:08 -0000 Author: ian Date: Sun Jun 23 16:59:06 2019 New Revision: 349315 URL: https://svnweb.freebsd.org/changeset/base/349315 Log: MFC r348740-r348741, r348995 r348740: Don't refer to the cpu variable in a KASSERT before initializing it. r348741: For armv6 and armv7, build hwpmc_armv7.c as well as the base hwpmc_arm.c. Submitted by: Arnaud YSMAL r348995: Don't attempt to include hwpmc support for armv6, we're missing some of the necessary support functions in cpu-v6.h, and it may be that the only armv6 platform we support (RPi, the bcm2835 SOC) is incapable of supporting hwpmc. Reported by: dim@ Modified: stable/12/sys/dev/hwpmc/hwpmc_armv7.c stable/12/sys/modules/hwpmc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/hwpmc/hwpmc_armv7.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_armv7.c Sun Jun 23 16:16:55 2019 (r349314) +++ stable/12/sys/dev/hwpmc/hwpmc_armv7.c Sun Jun 23 16:59:06 2019 (r349315) @@ -315,11 +315,11 @@ armv7_intr(struct trapframe *tf) int error; int reg, cpu; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] CPU %d out of range", __LINE__, cpu)); retval = 0; - cpu = curcpu; pc = armv7_pcpu[cpu]; for (ri = 0; ri < armv7_npmcs; ri++) { Modified: stable/12/sys/modules/hwpmc/Makefile ============================================================================== --- stable/12/sys/modules/hwpmc/Makefile Sun Jun 23 16:16:55 2019 (r349314) +++ stable/12/sys/modules/hwpmc/Makefile Sun Jun 23 16:59:06 2019 (r349315) @@ -22,6 +22,10 @@ SRCS+= device_if.h bus_if.h SRCS+= hwpmc_arm.c .endif +.if ${MACHINE_ARCH} == "armv7" +SRCS+= hwpmc_armv7.c +.endif + .if ${MACHINE_CPUARCH} == "i386" SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c SRCS+= hwpmc_tsc.c hwpmc_x86.c hwpmc_uncore.c From owner-svn-src-all@freebsd.org Sun Jun 23 17:20:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8619015D5ABF; Sun, 23 Jun 2019 17:20:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26A05947C7; Sun, 23 Jun 2019 17:20:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1821924BB2; Sun, 23 Jun 2019 17:20:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NHKdoi097602; Sun, 23 Jun 2019 17:20:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NHKdSD097601; Sun, 23 Jun 2019 17:20:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231720.x5NHKdSD097601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 17:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349316 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 349316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26A05947C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 17:20:40 -0000 Author: ian Date: Sun Jun 23 17:20:39 2019 New Revision: 349316 URL: https://svnweb.freebsd.org/changeset/base/349316 Log: Remove some unused header files from the ad7418 driver. Modified: head/sys/dev/iicbus/ad7418.c Modified: head/sys/dev/iicbus/ad7418.c ============================================================================== --- head/sys/dev/iicbus/ad7418.c Sun Jun 23 16:59:06 2019 (r349315) +++ head/sys/dev/iicbus/ad7418.c Sun Jun 23 17:20:39 2019 (r349316) @@ -35,17 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include - -#include -#include -#include -#include -#include -#include #include From owner-svn-src-all@freebsd.org Sun Jun 23 17:23:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5554A15D5CB3; Sun, 23 Jun 2019 17:23:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC2BB94D2B; Sun, 23 Jun 2019 17:23:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3B9F24D47; Sun, 23 Jun 2019 17:23:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NHNuhf002525; Sun, 23 Jun 2019 17:23:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NHNuAf002523; Sun, 23 Jun 2019 17:23:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231723.x5NHNuAf002523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 17:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349317 - in head/sys: arm/allwinner conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/allwinner conf X-SVN-Commit-Revision: 349317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC2BB94D2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 17:23:57 -0000 Author: ian Date: Sun Jun 23 17:23:56 2019 New Revision: 349317 URL: https://svnweb.freebsd.org/changeset/base/349317 Log: Add the rtc8583 driver to conf/files. Also, move sy8106a from file.allwinner to conf/files... it's not allwinner-specific, some day other platforms could use the same regulator chip. Modified: head/sys/arm/allwinner/files.allwinner head/sys/conf/files Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun Jun 23 17:20:39 2019 (r349316) +++ head/sys/arm/allwinner/files.allwinner Sun Jun 23 17:23:56 2019 (r349317) @@ -28,7 +28,6 @@ dev/usb/controller/generic_ohci.c optional ohci dev/usb/controller/generic_usb_if.m optional ohci arm/allwinner/aw_sid.c optional aw_sid arm/allwinner/aw_thermal.c optional aw_thermal -dev/iicbus/sy8106a.c optional sy8106a arm/allwinner/aw_cir.c optional aw_cir evdev arm/allwinner/aw_reset.c standard Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jun 23 17:20:39 2019 (r349316) +++ head/sys/conf/files Sun Jun 23 17:23:56 2019 (r349317) @@ -1792,7 +1792,9 @@ dev/iicbus/isl12xx.c optional isl12xx dev/iicbus/lm75.c optional lm75 dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus +dev/iicbus/rtc8583.c optional rtc8583 dev/iicbus/s35390a.c optional s35390a +dev/iicbus/sy8106a.c optional sy8106a dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci From owner-svn-src-all@freebsd.org Sun Jun 23 17:38:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6770E15D5F54; Sun, 23 Jun 2019 17:38:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08903953E9; Sun, 23 Jun 2019 17:38:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBA7D24F3D; Sun, 23 Jun 2019 17:38:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NHcU21007905; Sun, 23 Jun 2019 17:38:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NHcUcb007904; Sun, 23 Jun 2019 17:38:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231738.x5NHcUcb007904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 17:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349318 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08903953E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 17:38:31 -0000 Author: ian Date: Sun Jun 23 17:38:30 2019 New Revision: 349318 URL: https://svnweb.freebsd.org/changeset/base/349318 Log: The sy8106a and syr827 drviers require FDT and the ext_resources subsystem. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jun 23 17:23:56 2019 (r349317) +++ head/sys/conf/files Sun Jun 23 17:38:30 2019 (r349318) @@ -1775,7 +1775,7 @@ dev/iicbus/ds13rtc.c optional ds13rtc | ds133x | ds13 dev/iicbus/ds1672.c optional ds1672 dev/iicbus/ds3231.c optional ds3231 dev/iicbus/rtc8583.c optional rtc8583 -dev/iicbus/syr827.c optional ext_resources syr827 +dev/iicbus/syr827.c optional syr827 ext_resources fdt dev/iicbus/icee.c optional icee dev/iicbus/if_ic.c optional ic dev/iicbus/iic.c optional iic @@ -1794,7 +1794,7 @@ dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus dev/iicbus/rtc8583.c optional rtc8583 dev/iicbus/s35390a.c optional s35390a -dev/iicbus/sy8106a.c optional sy8106a +dev/iicbus/sy8106a.c optional sy8106a ext_resources fdt dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci From owner-svn-src-all@freebsd.org Sun Jun 23 17:39:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C4B315D5FB4; Sun, 23 Jun 2019 17:39:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A509B95539; Sun, 23 Jun 2019 17:39:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EF8F24F3E; Sun, 23 Jun 2019 17:39:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NHdDcR007974; Sun, 23 Jun 2019 17:39:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NHdD2u007973; Sun, 23 Jun 2019 17:39:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906231739.x5NHdD2u007973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 17:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349319 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A509B95539 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 17:39:14 -0000 Author: ian Date: Sun Jun 23 17:39:13 2019 New Revision: 349319 URL: https://svnweb.freebsd.org/changeset/base/349319 Log: Add some i2c slave-device drivers that were missing from NOTES. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jun 23 17:38:30 2019 (r349318) +++ head/sys/conf/NOTES Sun Jun 23 17:39:13 2019 (r349319) @@ -2421,14 +2421,19 @@ device iicoc # OpenCores I2C controller support # I2C peripheral devices # +device ad7418 # Analog Devices temp and voltage sensor device ds1307 # Dallas DS1307 RTC and compatible device ds13rtc # All Dallas/Maxim ds13xx chips device ds1672 # Dallas DS1672 RTC device ds3231 # Dallas DS3231 RTC + temperature device icee # AT24Cxxx and compatible EEPROMs +device isl12xx # Intersil ISL12xx RTC device lm75 # LM75 compatible temperature sensor device nxprtc # NXP RTCs: PCA/PFC212x PCA/PCF85xx +device rtc8583 # Epson RTC-8583 device s35390a # Seiko Instruments S-35390A RTC +device sy8106a # Silergy Corp. SY8106A buck regulator +device syr827 # Silergy Corp. DC/DC regulator # Parallel-Port Bus # From owner-svn-src-all@freebsd.org Sun Jun 23 18:35:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C7CB15D70D2; Sun, 23 Jun 2019 18:35:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAD4997279; Sun, 23 Jun 2019 18:35:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94F8625971; Sun, 23 Jun 2019 18:35:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NIZBtY038781; Sun, 23 Jun 2019 18:35:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NIZBYb038780; Sun, 23 Jun 2019 18:35:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906231835.x5NIZBYb038780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 18:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349320 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EAD4997279 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 18:35:20 -0000 Author: kib Date: Sun Jun 23 18:35:11 2019 New Revision: 349320 URL: https://svnweb.freebsd.org/changeset/base/349320 Log: coredump: avoid writing to core files not owned by the real user. Reported by: blake frantz PR: 68905 admbugs: 358 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jun 23 17:39:13 2019 (r349319) +++ head/sys/kern/kern_sig.c Sun Jun 23 18:35:11 2019 (r349320) @@ -3597,10 +3597,11 @@ coredump(struct thread *td) /* * Don't dump to non-regular files or files with links. - * Do not dump into system files. + * Do not dump into system files. Real user must own the corefile. */ if (vp->v_type != VREG || VOP_GETATTR(vp, &vattr, cred) != 0 || - vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0) { + vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0 || + vattr.va_uid != cred->cr_ruid) { VOP_UNLOCK(vp, 0); error = EFAULT; goto out; From owner-svn-src-all@freebsd.org Sun Jun 23 19:05:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C9215D7868; Sun, 23 Jun 2019 19:05:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC17B6843F; Sun, 23 Jun 2019 19:05:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C147C25E71; Sun, 23 Jun 2019 19:05:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NJ53rI054406; Sun, 23 Jun 2019 19:05:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NJ51Fl054396; Sun, 23 Jun 2019 19:05:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906231905.x5NJ51Fl054396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 23 Jun 2019 19:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349321 - in head/sys: cam/scsi dev/ahci X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: cam/scsi dev/ahci X-SVN-Commit-Revision: 349321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC17B6843F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 19:05:04 -0000 Author: mav Date: Sun Jun 23 19:05:01 2019 New Revision: 349321 URL: https://svnweb.freebsd.org/changeset/base/349321 Log: Improve AHCI Enclosure Management and SES interoperation. Since SES specs do not define mechanism to map enclosure slots to SATA disks, AHCI EM code I written many years ago appeared quite useless, that always bugged me. I was thinking whether it was a good idea, but if LSI HBAs do that, why I shouldn't? This change introduces simple non-standard mechanism for the mapping into both AHCI EM and SES code, that makes AHCI EM on capable controllers (most of Intel's) a first-class SES citizen, allowing it to report disk physical path to GEOM, show devices inserted into each enclosure slot in `sesutil map` and `getencstat`, control locate and fault LEDs for specific devices with `sesutil locate adaX on` and `sesutil fault adaX on`, etc. I've successfully tested this on Supermicro X10DRH-i motherboard connected with sideband cable of its S-SATA Mini-SAS connector to SAS815TQ backplane. It can indicate with LEDs Locate, Fault and Rebuild/Remap SES statuses for each disk identical to real SES of Supermicro SAS2 backplanes. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_enc.h head/sys/cam/scsi/scsi_enc_internal.h head/sys/cam/scsi/scsi_enc_safte.c head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_ses.h head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/ahci/ahciem.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/cam/scsi/scsi_all.c Sun Jun 23 19:05:01 2019 (r349321) @@ -5574,6 +5574,7 @@ scsi_devid_is_naa_ieee_reg(uint8_t *bufp) { struct scsi_vpd_id_descriptor *descr; struct scsi_vpd_id_naa_basic *naa; + int n; descr = (struct scsi_vpd_id_descriptor *)bufp; naa = (struct scsi_vpd_id_naa_basic *)descr->identifier; @@ -5581,7 +5582,8 @@ scsi_devid_is_naa_ieee_reg(uint8_t *bufp) return 0; if (descr->length < sizeof(struct scsi_vpd_id_naa_ieee_reg)) return 0; - if ((naa->naa >> SVPD_ID_NAA_NAA_SHIFT) != SVPD_ID_NAA_IEEE_REG) + n = naa->naa >> SVPD_ID_NAA_NAA_SHIFT; + if (n != SVPD_ID_NAA_LOCAL_REG && n != SVPD_ID_NAA_IEEE_REG) return 0; return 1; } Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/cam/scsi/scsi_enc.c Sun Jun 23 19:05:01 2019 (r349321) @@ -89,6 +89,9 @@ int enc_verbose = 0; SYSCTL_INT(_kern_cam_enc, OID_AUTO, verbose, CTLFLAG_RWTUN, &enc_verbose, 0, "Enable verbose logging"); +const char *elm_type_names[] = ELM_TYPE_NAMES; +CTASSERT(nitems(elm_type_names) - 1 == ELMTYP_LAST); + static struct periph_driver encdriver = { enc_init, "ses", TAILQ_HEAD_INITIALIZER(encdriver.units), /* generation */ 0 @@ -240,13 +243,19 @@ enc_async(void *callback_arg, uint32_t code, struct ca struct enc_softc *softc; softc = (struct enc_softc *)periph->softc; - if (xpt_path_path_id(periph->path) != path_id - || softc == NULL - || (softc->enc_flags & ENC_FLAG_INITIALIZED) - == 0 - || softc->enc_vec.device_found == NULL) + + /* Check this SEP is ready. */ + if (softc == NULL || (softc->enc_flags & + ENC_FLAG_INITIALIZED) == 0 || + softc->enc_vec.device_found == NULL) continue; + /* Check this SEP may manage this device. */ + if (xpt_path_path_id(periph->path) != path_id && + (softc->enc_type != ENC_SEMB_SES || + cgd->protocol != PROTO_ATA)) + continue; + softc->enc_vec.device_found(softc); } xpt_unlock_buses(); @@ -440,7 +449,7 @@ enc_ioctl(struct cdev *dev, u_long cmd, caddr_t arg_ad encioc_element_t kelm; kelm.elm_idx = i; kelm.elm_subenc_id = cache->elm_map[i].subenclosure; - kelm.elm_type = cache->elm_map[i].enctype; + kelm.elm_type = cache->elm_map[i].elm_type; error = copyout(&kelm, &uelm[i], sizeof(kelm)); if (error) break; Modified: head/sys/cam/scsi/scsi_enc.h ============================================================================== --- head/sys/cam/scsi/scsi_enc.h Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/cam/scsi/scsi_enc.h Sun Jun 23 19:05:01 2019 (r349321) @@ -120,9 +120,41 @@ typedef enum { ELMTYP_SCSI_INI = 0x15, ELMTYP_SUBENC = 0x16, ELMTYP_ARRAY_DEV = 0x17, - ELMTYP_SAS_EXP = 0x18, /* SAS expander */ - ELMTYP_SAS_CONN = 0x19 /* SAS connector */ + ELMTYP_SAS_EXP = 0x18, /* SAS Expander */ + ELMTYP_SAS_CONN = 0x19, /* SAS Connector */ + ELMTYP_LAST = ELMTYP_SAS_CONN } elm_type_t; + +#define ELM_TYPE_NAMES { \ + "Unspecified", \ + "Device Slot", \ + "Power Supply", \ + "Cooling", \ + "Temperature Sensors", \ + "Door", \ + "Audible alarm", \ + "Enclosure Services Controller Electronics", \ + "SCC Controller Electronics", \ + "Nonvolatile Cache", \ + "Invalid Operation Reason", \ + "Uninterruptible Power Supply", \ + "Display", \ + "Key Pad Entry", \ + "Enclosure", \ + "SCSI Port/Transceiver", \ + "Language", \ + "Communication Port", \ + "Voltage Sensor", \ + "Current Sensor", \ + "SCSI Target Port", \ + "SCSI Initiator Port", \ + "Simple Subenclosure", \ + "Array Device Slot", \ + "SAS Expander", \ + "SAS Connector" \ +} + +extern const char *elm_type_names[]; typedef struct encioc_element { /* Element Index */ Modified: head/sys/cam/scsi/scsi_enc_internal.h ============================================================================== --- head/sys/cam/scsi/scsi_enc_internal.h Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/cam/scsi/scsi_enc_internal.h Sun Jun 23 19:05:01 2019 (r349321) @@ -39,16 +39,12 @@ #include typedef struct enc_element { - uint32_t - enctype : 8, /* enclosure type */ - subenclosure : 8, /* subenclosure id */ - svalid : 1, /* enclosure information valid */ - overall_status_elem: 1,/* - * This object represents generic - * status about all objects of this - * type. - */ - priv : 14; /* private data, per object */ + uint8_t elm_idx; /* index of element */ + uint8_t elm_type; /* element type */ + uint8_t subenclosure; /* subenclosure id */ + uint8_t type_elm_idx; /* index of element within type */ + uint8_t svalid; /* enclosure information valid */ + uint16_t priv; /* private data, per object */ uint8_t encstat[4]; /* state && stats */ uint8_t *physical_path; /* Device physical path data. */ u_int physical_path_len; /* Length of device path data. */ Modified: head/sys/cam/scsi/scsi_enc_safte.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_safte.c Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/cam/scsi/scsi_enc_safte.c Sun Jun 23 19:05:01 2019 (r349321) @@ -301,21 +301,21 @@ safte_process_config(enc_softc_t *enc, struct enc_fsm_ * in later fetches of status. */ for (i = 0; i < cfg->Nfans; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_FAN; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_FAN; cfg->pwroff = (uint8_t) r; for (i = 0; i < cfg->Npwr; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_POWER; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_POWER; for (i = 0; i < cfg->DoorLock; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_DOORLOCK; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_DOORLOCK; if (cfg->Nspkrs > 0) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_ALARM; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_ALARM; for (i = 0; i < cfg->Ntherm; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_THERM; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_THERM; for (i = 0; i <= cfg->Ntstats; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_THERM; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_THERM; cfg->slotoff = (uint8_t) r; for (i = 0; i < cfg->Nslots; i++) - enc->enc_cache.elm_map[r++].enctype = + enc->enc_cache.elm_map[r++].elm_type = emulate_array_devices ? ELMTYP_ARRAY_DEV : ELMTYP_DEVICE; @@ -505,7 +505,7 @@ safte_process_status(enc_softc_t *enc, struct enc_fsm_ */ for (i = 0; i < cfg->Nslots; i++) { SAFT_BAIL(r, xfer_len); - if (cache->elm_map[cfg->slotoff + i].enctype == ELMTYP_DEVICE) + if (cache->elm_map[cfg->slotoff + i].elm_type == ELMTYP_DEVICE) cache->elm_map[cfg->slotoff + i].encstat[1] = buf[r]; r++; } @@ -678,7 +678,7 @@ safte_process_slotstatus(enc_softc_t *enc, struct enc_ oid = cfg->slotoff; for (r = i = 0; i < cfg->Nslots; i++, r += 4) { SAFT_BAIL(r+3, xfer_len); - if (cache->elm_map[oid].enctype == ELMTYP_ARRAY_DEV) + if (cache->elm_map[oid].elm_type == ELMTYP_ARRAY_DEV) cache->elm_map[oid].encstat[1] = 0; cache->elm_map[oid].encstat[2] &= SESCTL_RQSID; cache->elm_map[oid].encstat[3] = 0; @@ -705,7 +705,7 @@ safte_process_slotstatus(enc_softc_t *enc, struct enc_ cache->elm_map[oid].encstat[3] |= SESCTL_RQSFLT; if (buf[r+0] & 0x40) cache->elm_map[oid].encstat[0] |= SESCTL_PRDFAIL; - if (cache->elm_map[oid].enctype == ELMTYP_ARRAY_DEV) { + if (cache->elm_map[oid].elm_type == ELMTYP_ARRAY_DEV) { if (buf[r+0] & 0x01) cache->elm_map[oid].encstat[1] |= 0x80; if (buf[r+0] & 0x04) @@ -771,7 +771,7 @@ safte_fill_control_request(enc_softc_t *enc, struct en } else { ep = &enc->enc_cache.elm_map[idx]; - switch (ep->enctype) { + switch (ep->elm_type) { case ELMTYP_DEVICE: case ELMTYP_ARRAY_DEV: switch (cfg->current_request_stage) { @@ -781,7 +781,7 @@ safte_fill_control_request(enc_softc_t *enc, struct en ep->priv |= 0x40; if (req->elm_stat[3] & SESCTL_RQSFLT) ep->priv |= 0x02; - if (ep->enctype == ELMTYP_ARRAY_DEV) { + if (ep->elm_type == ELMTYP_ARRAY_DEV) { if (req->elm_stat[1] & 0x01) ep->priv |= 0x200; if (req->elm_stat[1] & 0x02) @@ -970,7 +970,7 @@ safte_process_control_request(enc_softc_t *enc, struct if (idx == SES_SETSTATUS_ENC_IDX) type = -1; else - type = enc->enc_cache.elm_map[idx].enctype; + type = enc->enc_cache.elm_map[idx].elm_type; if (type == ELMTYP_DEVICE || type == ELMTYP_ARRAY_DEV) enc_update_request(enc, SAFTE_UPDATE_READSLOTSTATUS); else Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/cam/scsi/scsi_enc_ses.c Sun Jun 23 19:05:01 2019 (r349321) @@ -102,6 +102,7 @@ typedef struct ses_addl_status { union { union ses_fcobj_hdr *fc; union ses_elm_sas_hdr *sas; + struct ses_elm_ata_hdr *ata; } proto_hdr; union ses_addl_data proto_data; /* array sizes stored in header */ } ses_add_status_t; @@ -825,14 +826,6 @@ ses_devids_iter(enc_softc_t *enc, enc_element_t *elm, elmpriv = elm->elm_private; addl = &(elmpriv->addl); - /* - * Don't assume this object has additional status information, or - * that it is a SAS device, or that it is a device slot device. - */ - if (addl->hdr == NULL || addl->proto_hdr.sas == NULL - || addl->proto_data.sasdev_phys == NULL) - return; - devid_record_size = SVPD_DEVICE_ID_DESC_HDR_LEN + sizeof(struct scsi_vpd_id_naa_ieee_reg); for (i = 0; i < addl->proto_hdr.sas->base_hdr.num_phys; i++) { @@ -950,11 +943,40 @@ static void ses_paths_iter(enc_softc_t *enc, enc_element_t *elm, ses_path_callback_t *callback, void *callback_arg) { - ses_path_iter_args_t args; + ses_element_t *elmpriv; + struct ses_addl_status *addl; - args.callback = callback; - args.callback_arg = callback_arg; - ses_devids_iter(enc, elm, ses_path_iter_devid_callback, &args); + elmpriv = elm->elm_private; + addl = &(elmpriv->addl); + + if (addl->hdr == NULL) + return; + + if (addl->proto_hdr.sas != NULL && + addl->proto_data.sasdev_phys != NULL) { + ses_path_iter_args_t args; + + args.callback = callback; + args.callback_arg = callback_arg; + ses_devids_iter(enc, elm, ses_path_iter_devid_callback, &args); + } else if (addl->proto_hdr.ata != NULL) { + struct cam_path *path; + struct ccb_getdev cgd; + + if (xpt_create_path(&path, /*periph*/NULL, + scsi_4btoul(addl->proto_hdr.ata->bus), + scsi_4btoul(addl->proto_hdr.ata->target), 0) + != CAM_REQ_CMP) + return; + + xpt_setup_ccb(&cgd.ccb_h, path, CAM_PRIORITY_NORMAL); + cgd.ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)&cgd); + if (cgd.ccb_h.status == CAM_REQ_CMP) + callback(enc, elm, path, callback_arg); + + xpt_free_path(path); + } } /** @@ -1059,6 +1081,10 @@ ses_set_physpath(enc_softc_t *enc, enc_element_t *elm, ret = EIO; devid = NULL; + elmpriv = elm->elm_private; + if (elmpriv->addl.hdr == NULL) + goto out; + /* * Assemble the components of the physical path starting with * the device ID of the enclosure itself. @@ -1091,7 +1117,6 @@ ses_set_physpath(enc_softc_t *enc, enc_element_t *elm, scsi_8btou64(idd->identifier), iter->type_index, iter->type_element_index); /* Append the element descriptor if one exists */ - elmpriv = elm->elm_private; if (elmpriv->descr != NULL && elmpriv->descr_len > 0) { sbuf_cat(&sb, "/elmdesc@"); for (i = 0, c = elmpriv->descr; i < elmpriv->descr_len; @@ -1457,9 +1482,10 @@ ses_process_config(enc_softc_t *enc, struct enc_fsm_st iter.global_element_index, iter.type_index, nelm, iter.type_element_index); thdr = ses_cache->ses_types[iter.type_index].hdr; + element->elm_idx = iter.global_element_index; + element->elm_type = thdr->etype_elm_type; element->subenclosure = thdr->etype_subenc; - element->enctype = thdr->etype_elm_type; - element->overall_status_elem = iter.type_element_index == 0; + element->type_elm_idx = iter.type_element_index; element->elm_private = malloc(sizeof(ses_element_t), M_SCSIENC, M_WAITOK|M_ZERO); ENC_DLOG(enc, "%s: creating elmpriv %d(%d,%d) subenc %d " @@ -1663,6 +1689,8 @@ static int ses_get_elm_addlstatus_fc(enc_softc_t *, en uint8_t *, int); static int ses_get_elm_addlstatus_sas(enc_softc_t *, enc_cache_t *, uint8_t *, int, int, int, int); +static int ses_get_elm_addlstatus_ata(enc_softc_t *, enc_cache_t *, uint8_t *, + int, int, int, int); /** * \brief Parse the additional status element data for each object. @@ -1818,7 +1846,6 @@ badindex: } } elmpriv = element->elm_private; - elmpriv->addl.hdr = elm_hdr; ENC_DLOG(enc, "%s: global element index=%d, type index=%d " "type element index=%d, offset=0x%x, " "byte0=0x%x, length=0x%x\n", __func__, @@ -1842,6 +1869,7 @@ badindex: offset += elm_hdr->length; continue; } + elmpriv->addl.hdr = elm_hdr; /* Advance to the protocol data, skipping eip bytes if needed */ offset += (eip * SES_EIP_HDR_EXTRA_LEN); @@ -1865,6 +1893,13 @@ badindex: eip, iter.type_index, iter.global_element_index); break; + case SPSP_PROTO_ATA: + ses_get_elm_addlstatus_ata(enc, enc_cache, + &buf[offset], + proto_info_len, + eip, iter.type_index, + iter.global_element_index); + break; default: ENC_VLOG(enc, "Element %d: Unknown Additional Element " "Protocol 0x%x\n", iter.global_element_index, @@ -2193,18 +2228,16 @@ ses_get_elm_addlstatus_fc(enc_softc_t *enc, enc_cache_ } #define SES_PRINT_PORTS(p, type) do { \ - sbuf_printf(sbp, " %s(", type); \ - if (((p) & SES_SASOBJ_DEV_PHY_PROTOMASK) == 0) \ - sbuf_printf(sbp, " None"); \ - else { \ + if (((p) & SES_SASOBJ_DEV_PHY_PROTOMASK) != 0) { \ + sbuf_printf(sbp, " %s (", type); \ if ((p) & SES_SASOBJ_DEV_PHY_SMP) \ sbuf_printf(sbp, " SMP"); \ if ((p) & SES_SASOBJ_DEV_PHY_STP) \ sbuf_printf(sbp, " STP"); \ if ((p) & SES_SASOBJ_DEV_PHY_SSP) \ sbuf_printf(sbp, " SSP"); \ + sbuf_printf(sbp, " )"); \ } \ - sbuf_printf(sbp, " )"); \ } while(0) /** @@ -2214,11 +2247,10 @@ ses_get_elm_addlstatus_fc(enc_softc_t *enc, enc_cache_ * \param sesname SES device name associated with the object. * \param sbp Sbuf to print to. * \param obj The object to print the data for. - * \param periph_name Peripheral string associated with the object. */ static void ses_print_addl_data_sas_type0(char *sesname, struct sbuf *sbp, - enc_element_t *obj, char *periph_name) + enc_element_t *obj) { int i; ses_element_t *elmpriv; @@ -2227,16 +2259,12 @@ ses_print_addl_data_sas_type0(char *sesname, struct sb elmpriv = obj->elm_private; addl = &(elmpriv->addl); - if (addl->proto_hdr.sas == NULL) - return; - sbuf_printf(sbp, "%s: %s: SAS Device Slot Element:", - sesname, periph_name); - sbuf_printf(sbp, " %d Phys", addl->proto_hdr.sas->base_hdr.num_phys); + sbuf_printf(sbp, ", SAS Slot: %d%s phys", + addl->proto_hdr.sas->base_hdr.num_phys, + ses_elm_sas_type0_not_all_phys(addl->proto_hdr.sas) ? "+" : ""); if (ses_elm_addlstatus_eip(addl->hdr)) - sbuf_printf(sbp, " at Slot %d", + sbuf_printf(sbp, " at slot %d", addl->proto_hdr.sas->type0_eip.dev_slot_num); - if (ses_elm_sas_type0_not_all_phys(addl->proto_hdr.sas)) - sbuf_printf(sbp, ", Not All Phys"); sbuf_printf(sbp, "\n"); if (addl->proto_data.sasdev_phys == NULL) return; @@ -2247,9 +2275,8 @@ ses_print_addl_data_sas_type0(char *sesname, struct sb /* Spec says all other fields are specific values */ sbuf_printf(sbp, " SATA device\n"); else { - sbuf_printf(sbp, " SAS device type %d id %d\n", + sbuf_printf(sbp, " SAS device type %d phy %d", ses_elm_sas_dev_phy_dev_type(phy), phy->phy_id); - sbuf_printf(sbp, "%s: phy %d: protocols:", sesname, i); SES_PRINT_PORTS(phy->initiator_ports, "Initiator"); SES_PRINT_PORTS(phy->target_ports, "Target"); sbuf_printf(sbp, "\n"); @@ -2263,32 +2290,16 @@ ses_print_addl_data_sas_type0(char *sesname, struct sb #undef SES_PRINT_PORTS /** - * \brief Report whether a given enclosure object is an expander. - * - * \param enc SES softc associated with object. - * \param obj Enclosure object to report for. - * - * \return 1 if true, 0 otherwise. - */ -static int -ses_obj_is_expander(enc_softc_t *enc, enc_element_t *obj) -{ - return (obj->enctype == ELMTYP_SAS_EXP); -} - -/** * \brief Print the additional element status data for this object, for SAS * type 1 objects. See SES2 r20 Sections 6.1.13.3.3 and 6.1.13.3.4. * - * \param enc SES enclosure, needed for type identification. * \param sesname SES device name associated with the object. * \param sbp Sbuf to print to. * \param obj The object to print the data for. - * \param periph_name Peripheral string associated with the object. */ static void -ses_print_addl_data_sas_type1(enc_softc_t *enc, char *sesname, - struct sbuf *sbp, enc_element_t *obj, char *periph_name) +ses_print_addl_data_sas_type1(char *sesname, struct sbuf *sbp, + enc_element_t *obj) { int i, num_phys; ses_element_t *elmpriv; @@ -2298,12 +2309,10 @@ ses_print_addl_data_sas_type1(enc_softc_t *enc, char * elmpriv = obj->elm_private; addl = &(elmpriv->addl); - if (addl->proto_hdr.sas == NULL) - return; - sbuf_printf(sbp, "%s: %s: SAS ", sesname, periph_name); - if (ses_obj_is_expander(enc, obj)) { + sbuf_printf(sbp, ", SAS "); + if (obj->elm_type == ELMTYP_SAS_EXP) { num_phys = addl->proto_hdr.sas->base_hdr.num_phys; - sbuf_printf(sbp, "Expander: %d Phys", num_phys); + sbuf_printf(sbp, "Expander: %d phys", num_phys); if (addl->proto_data.sasexp_phys == NULL) return; for (i = 0;i < num_phys;i++) { @@ -2314,7 +2323,7 @@ ses_print_addl_data_sas_type1(enc_softc_t *enc, char * } } else { num_phys = addl->proto_hdr.sas->base_hdr.num_phys; - sbuf_printf(sbp, "Port: %d Phys", num_phys); + sbuf_printf(sbp, "Port: %d phys", num_phys); if (addl->proto_data.sasport_phys == NULL) return; for (i = 0;i < num_phys;i++) { @@ -2330,6 +2339,24 @@ ses_print_addl_data_sas_type1(enc_softc_t *enc, char * } /** + * \brief Print the additional element status data for this object, for + * ATA objects. + * + * \param sbp Sbuf to print to. + * \param obj The object to print the data for. + */ +static void +ses_print_addl_data_ata(struct sbuf *sbp, enc_element_t *obj) +{ + ses_element_t *elmpriv = obj->elm_private; + struct ses_addl_status *addl = &elmpriv->addl; + struct ses_elm_ata_hdr *ata = addl->proto_hdr.ata; + + sbuf_printf(sbp, ", SATA Slot: scbus%d target %d\n", + scsi_4btoul(ata->bus), scsi_4btoul(ata->target)); +} + +/** * \brief Print the additional element status data for this object. * * \param enc SES softc associated with the object. @@ -2360,27 +2387,45 @@ ses_print_addl_data(enc_softc_t *enc, enc_element_t *o sbuf_printf(&sesname, "%s%d", enc->periph->periph_name, enc->periph->unit_number); sbuf_finish(&sesname); + sbuf_printf(&out, "%s: %s in ", sbuf_data(&sesname), sbuf_data(&name)); if (elmpriv->descr != NULL) - sbuf_printf(&out, "%s: %s: Element descriptor: '%s'\n", - sbuf_data(&sesname), sbuf_data(&name), elmpriv->descr); + sbuf_printf(&out, "'%s'", elmpriv->descr); + else { + if (obj->elm_type <= ELMTYP_LAST) + sbuf_cat(&out, elm_type_names[obj->elm_type]); + else + sbuf_printf(&out, "", obj->elm_type); + sbuf_printf(&out, " %d", obj->type_elm_idx); + if (obj->subenclosure != 0) + sbuf_printf(&out, " of subenc %d", obj->subenclosure); + } switch(ses_elm_addlstatus_proto(addl->hdr)) { + case SPSP_PROTO_FC: + goto noaddl; /* stubbed for now */ case SPSP_PROTO_SAS: + if (addl->proto_hdr.sas == NULL) + goto noaddl; switch(ses_elm_sas_descr_type(addl->proto_hdr.sas)) { case SES_SASOBJ_TYPE_SLOT: ses_print_addl_data_sas_type0(sbuf_data(&sesname), - &out, obj, sbuf_data(&name)); + &out, obj); break; case SES_SASOBJ_TYPE_OTHER: - ses_print_addl_data_sas_type1(enc, sbuf_data(&sesname), - &out, obj, sbuf_data(&name)); + ses_print_addl_data_sas_type1(sbuf_data(&sesname), + &out, obj); break; default: - break; + goto noaddl; } break; - case SPSP_PROTO_FC: /* stubbed for now */ + case SPSP_PROTO_ATA: + if (addl->proto_hdr.ata == NULL) + goto noaddl; + ses_print_addl_data_ata(&out, obj); break; default: +noaddl: + sbuf_cat(&out, "\n"); break; } sbuf_finish(&out); @@ -2485,7 +2530,7 @@ ses_get_elm_addlstatus_sas_type1(enc_softc_t *enc, enc goto out; /* Process expanders differently from other type1 cases */ - if (ses_obj_is_expander(enc, obj)) { + if (obj->elm_type == ELMTYP_SAS_EXP) { offset += sizeof(struct ses_elm_sas_type1_expander_hdr); physz = addl->proto_hdr.sas->base_hdr.num_phys * sizeof(struct ses_elm_sas_expander_phy); @@ -2588,6 +2633,53 @@ ses_get_elm_addlstatus_sas(enc_softc_t *enc, enc_cache err = ENODEV; break; } + +out: + return (err); +} + +/** + * \brief Update the softc with the additional element status data for this + * object, for ATA objects. + * + * \param enc SES softc to be updated. + * \param buf The additional element status response buffer. + * \param bufsiz Size of the response buffer. + * \param eip The EIP bit value. + * \param tidx Type index for this object. + * \param nobj Number of objects attached to the SES softc. + * + * \return 0 on success, errno otherwise. + */ +static int +ses_get_elm_addlstatus_ata(enc_softc_t *enc, enc_cache_t *enc_cache, + uint8_t *buf, int bufsiz, int eip, int tidx, + int nobj) +{ + int err; + ses_cache_t *ses_cache; + + if (bufsiz < sizeof(struct ses_elm_ata_hdr)) { + err = EIO; + goto out; + } + + ses_cache = enc_cache->private; + switch(ses_cache->ses_types[tidx].hdr->etype_elm_type) { + case ELMTYP_DEVICE: + case ELMTYP_ARRAY_DEV: + break; + default: + ENC_VLOG(enc, "Element %d has Additional Status, " + "invalid for SES element type 0x%x\n", nobj, + ses_cache->ses_types[tidx].hdr->etype_elm_type); + err = ENODEV; + goto out; + } + + ((ses_element_t *)enc_cache->elm_map[nobj].elm_private) + ->addl.proto_hdr.ata = (struct ses_elm_ata_hdr *)buf; + err = 0; out: return (err); Modified: head/sys/cam/scsi/scsi_ses.h ============================================================================== --- head/sys/cam/scsi/scsi_ses.h Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/cam/scsi/scsi_ses.h Sun Jun 23 19:05:01 2019 (r349321) @@ -2181,15 +2181,27 @@ struct ses_status_page_hdr { #define SESCTL_DISABLE 0x20 #define SESCTL_RSTSWAP 0x10 - -/* Control bits, Device Elements, byte 2 */ -#define SESCTL_DRVLCK 0x40 /* "DO NOT REMOVE" */ +/* Control bits, Array Device Slot Elements, byte 1 */ +#define SESCTL_RQSOK 0x80 /* RQST OK */ +#define SESCTL_RQSRSV 0x40 /* RQST RSVD DEVICE */ +#define SESCTL_RQSSPR 0x20 /* RQST HOT SPARE */ +#define SESCTL_RQSCCH 0x10 /* RQST CONS CHECK */ +#define SESCTL_RQSCRA 0x08 /* RQST IN CRIT ARRAY */ +#define SESCTL_RQSFAA 0x04 /* RQST IN FAILED ARRAY */ +#define SESCTL_RQSRR 0x02 /* RQST REBUI/REMAP */ +#define SESCTL_RQSRRA 0x01 /* RQST R/R ABORT */ +/* Control bits, [Array] Device Slot Elements, byte 2 */ +#define SESCTL_RQSACT 0x80 /* RQST ACTIVE */ +#define SESCTL_DRVLCK 0x40 /* DO NOT REMOVE */ +#define SESCTL_RQSMSN 0x10 /* RQST MISSING */ #define SESCTL_RQSINS 0x08 /* RQST INSERT */ #define SESCTL_RQSRMV 0x04 /* RQST REMOVE */ #define SESCTL_RQSID 0x02 /* RQST IDENT */ -/* Control bits, Device Elements, byte 3 */ +/* Control bits, [Array] Device Slot Elements, byte 3 */ #define SESCTL_RQSFLT 0x20 /* RQST FAULT */ #define SESCTL_DEVOFF 0x10 /* DEVICE OFF */ +#define SESCTL_ENBYPA 0x08 /* ENABLE BYP A */ +#define SESCTL_ENBYPB 0x04 /* ENABLE BYP B */ /* Control bits, Generic, byte 3 */ #define SESCTL_RQSTFAIL 0x40 @@ -2398,6 +2410,17 @@ union ses_elm_sas_hdr { }; int ses_elm_sas_type0_not_all_phys(union ses_elm_sas_hdr *); int ses_elm_sas_descr_type(union ses_elm_sas_hdr *); + +/* + * This structure for SPSP_PROTO_ATA is not defined by SES specs, + * but purely my own design to make AHCI EM interoperate with SES. + * Since no other software I know can talk to SEMB, and we do not + * expose this this outside, it should be safe to do what we want. + */ +struct ses_elm_ata_hdr { + uint8_t bus[4]; + uint8_t target[4]; +}; struct ses_elm_addlstatus_base_hdr { uint8_t byte0; Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/dev/ahci/ahci.c Sun Jun 23 19:05:01 2019 (r349321) @@ -186,6 +186,7 @@ ahci_attach(device_t dev) ctlr->ccc = 0; resource_int_value(device_get_name(dev), device_get_unit(dev), "ccc", &ctlr->ccc); + mtx_init(&ctlr->ch_mtx, "AHCI channels lock", NULL, MTX_DEF); /* Setup our own memory management for channels. */ ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); @@ -379,6 +380,7 @@ ahci_detach(device_t dev) /* Free memory. */ rman_fini(&ctlr->sc_iomem); ahci_free_mem(dev); + mtx_destroy(&ctlr->ch_mtx); return (0); } @@ -666,6 +668,50 @@ ahci_get_dma_tag(device_t dev, device_t child) return (ctlr->dma_tag); } +void +ahci_attached(device_t dev, struct ahci_channel *ch) +{ + struct ahci_controller *ctlr = device_get_softc(dev); + + mtx_lock(&ctlr->ch_mtx); + ctlr->ch[ch->unit] = ch; + mtx_unlock(&ctlr->ch_mtx); +} + +void +ahci_detached(device_t dev, struct ahci_channel *ch) +{ + struct ahci_controller *ctlr = device_get_softc(dev); + + mtx_lock(&ctlr->ch_mtx); + mtx_lock(&ch->mtx); + ctlr->ch[ch->unit] = NULL; + mtx_unlock(&ch->mtx); + mtx_unlock(&ctlr->ch_mtx); +} + +struct ahci_channel * +ahci_getch(device_t dev, int n) +{ + struct ahci_controller *ctlr = device_get_softc(dev); + struct ahci_channel *ch; + + KASSERT(n >= 0 && n < AHCI_MAX_PORTS, ("Bad channel number %d", n)); + mtx_lock(&ctlr->ch_mtx); + ch = ctlr->ch[n]; + if (ch != NULL) + mtx_lock(&ch->mtx); + mtx_unlock(&ctlr->ch_mtx); + return (ch); +} + +void +ahci_putch(struct ahci_channel *ch) +{ + + mtx_unlock(&ch->mtx); +} + static int ahci_ch_probe(device_t dev) { @@ -824,6 +870,7 @@ ahci_ch_attach(device_t dev) ahci_ch_pm, ch); } mtx_unlock(&ch->mtx); + ahci_attached(device_get_parent(dev), ch); ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "disable_phy", @@ -849,6 +896,7 @@ ahci_ch_detach(device_t dev) { struct ahci_channel *ch = device_get_softc(dev); + ahci_detached(device_get_parent(dev), ch); mtx_lock(&ch->mtx); xpt_async(AC_LOST_DEVICE, ch->path, NULL); /* Forget about reset. */ Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/dev/ahci/ahci.h Sun Jun 23 19:05:01 2019 (r349321) @@ -524,6 +524,8 @@ struct ahci_controller { } interrupt[AHCI_MAX_PORTS]; void (*ch_start)(struct ahci_channel *); int dma_coherent; /* DMA is cache-coherent */ + struct mtx ch_mtx; /* Lock for attached channels */ + struct ahci_channel *ch[AHCI_MAX_PORTS]; /* Attached channels */ }; enum ahci_err_type { @@ -653,6 +655,12 @@ bus_dma_tag_t ahci_get_dma_tag(device_t dev, device_t int ahci_ctlr_reset(device_t dev); int ahci_ctlr_setup(device_t dev); void ahci_free_mem(device_t dev); + +/* Functions to allow AHCI EM to access other channels. */ +void ahci_attached(device_t dev, struct ahci_channel *ch); +void ahci_detached(device_t dev, struct ahci_channel *ch); +struct ahci_channel * ahci_getch(device_t dev, int n); +void ahci_putch(struct ahci_channel *ch); extern devclass_t ahci_devclass; Modified: head/sys/dev/ahci/ahciem.c ============================================================================== --- head/sys/dev/ahci/ahciem.c Sun Jun 23 18:35:11 2019 (r349320) +++ head/sys/dev/ahci/ahciem.c Sun Jun 23 19:05:01 2019 (r349321) @@ -294,14 +294,14 @@ ahci_em_setleds(device_t dev, int c) enc = device_get_softc(dev); val = 0; - if (enc->status[c][2] & 0x80) /* Activity */ + if (enc->status[c][2] & SESCTL_RQSACT) /* Activity */ val |= (1 << 0); - if (enc->status[c][2] & SESCTL_RQSID) /* Identification */ + if (enc->status[c][1] & SESCTL_RQSRR) /* Rebuild */ + val |= (1 << 6) | (1 << 3); + else if (enc->status[c][2] & SESCTL_RQSID) /* Identification */ val |= (1 << 3); else if (enc->status[c][3] & SESCTL_RQSFLT) /* Fault */ val |= (1 << 6); - else if (enc->status[c][1] & 0x02) /* Rebuild */ - val |= (1 << 6) | (1 << 3); timeout = 10000; while (ATA_INL(enc->r_memc, 0) & (AHCI_EM_TM | AHCI_EM_RST) && @@ -366,9 +366,12 @@ static void ahci_em_emulate_ses_on_led(device_t dev, union ccb *ccb) { struct ahci_enclosure *enc; + struct ahci_channel *ch; struct ses_status_page *page; struct ses_status_array_dev_slot *ads, *ads0; struct ses_elm_desc_hdr *elmd; + struct ses_elm_addlstatus_eip_hdr *elma; + struct ses_elm_ata_hdr *elmb; uint8_t *buf; int i; @@ -391,7 +394,7 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc strncpy(&buf[3], device_get_nameunit(dev), 7); strncpy(&buf[10], "AHCI ", SID_VENDOR_SIZE); strncpy(&buf[18], "SGPIO Enclosure ", SID_PRODUCT_SIZE); - strncpy(&buf[34], "1.00", SID_REVISION_SIZE); + strncpy(&buf[34], "2.00", SID_REVISION_SIZE); strncpy(&buf[39], "0001", 4); strncpy(&buf[43], "S-E-S ", 6); strncpy(&buf[49], "2.00", 4); @@ -403,14 +406,15 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc page = (struct ses_status_page *)buf; if (ccb->ataio.cmd.lba_low == 0x02 && ccb->ataio.cmd.features == 0x00 && - ccb->ataio.cmd.sector_count >= 2) { + ccb->ataio.cmd.sector_count >= 3) { bzero(buf, ccb->ataio.dxfer_len); page->hdr.page_code = 0; - scsi_ulto2b(4, page->hdr.length); - buf[4] = 0; - buf[5] = 1; - buf[6] = 2; - buf[7] = 7; + scsi_ulto2b(5, page->hdr.length); + buf[4] = 0x00; + buf[5] = 0x01; + buf[6] = 0x02; + buf[7] = 0x07; + buf[8] = 0x0a; ccb->ccb_h.status = CAM_REQ_CMP; goto out; } @@ -418,26 +422,30 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc /* SEMB RECEIVE DIAGNOSTIC RESULT (1) */ if (ccb->ataio.cmd.lba_low == 0x02 && ccb->ataio.cmd.features == 0x01 && - ccb->ataio.cmd.sector_count >= 13) { + ccb->ataio.cmd.sector_count >= 16) { struct ses_enc_desc *ed; struct ses_elm_type_desc *td; bzero(buf, ccb->ataio.dxfer_len); page->hdr.page_code = 0x01; - scsi_ulto2b(4 + 4 + 36 + 4, page->hdr.length); + scsi_ulto2b(4 + sizeof(*ed) + sizeof(*td) + 11, + page->hdr.length); ed = (struct ses_enc_desc *)&buf[8]; ed->byte0 = 0x11; ed->subenc_id = 0; ed->num_types = 1; ed->length = 36; + ed->logical_id[0] = 0x30; /* NAA Locally Assigned. */ + strncpy(&ed->logical_id[1], device_get_nameunit(dev), 7); strncpy(ed->vendor_id, "AHCI ", SID_VENDOR_SIZE); strncpy(ed->product_id, "SGPIO Enclosure ", SID_PRODUCT_SIZE); - strncpy(ed->product_rev, " ", SID_REVISION_SIZE); + strncpy(ed->product_rev, "2.00", SID_REVISION_SIZE); td = (struct ses_elm_type_desc *)ses_enc_desc_next(ed); td->etype_elm_type = 0x17; td->etype_maxelt = enc->channels; td->etype_subenc = 0; - td->etype_txt_len = 0; + td->etype_txt_len = 11; + snprintf((char *)(td + 1), 12, "Drive Slots"); ccb->ccb_h.status = CAM_REQ_CMP; goto out; } @@ -453,10 +461,22 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc for (i = 0; i < enc->channels; i++) { ads = &page->elements[i + 1].array_dev_slot; memcpy(ads, enc->status[i], 4); - ads->common.bytes[0] |= - (enc->ichannels & (1 << i)) ? - SES_OBJSTAT_UNKNOWN : - SES_OBJSTAT_NOTINSTALLED; + ch = ahci_getch(device_get_parent(dev), i); + if (ch == NULL) { + ads->common.bytes[0] |= SES_OBJSTAT_UNKNOWN; + continue; + } + if (ch->pm_present) + ads->common.bytes[0] |= SES_OBJSTAT_UNKNOWN; + else if (ch->devices) + ads->common.bytes[0] |= SES_OBJSTAT_OK; + else if (ch->disablephy) + ads->common.bytes[0] |= SES_OBJSTAT_NOTAVAIL; + else + ads->common.bytes[0] |= SES_OBJSTAT_NOTINSTALLED; + if (ch->disablephy) + ads->common.bytes[3] |= SESCTL_DEVOFF; + ahci_putch(ch); } ccb->ccb_h.status = CAM_REQ_CMP; goto out; @@ -471,21 +491,21 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc ads = &page->elements[i + 1].array_dev_slot; if (ads->common.bytes[0] & SESCTL_CSEL) { enc->status[i][0] = 0; - enc->status[i][1] = - ads->bytes[0] & 0x02; - enc->status[i][2] = - ads->bytes[1] & (0x80 | SESCTL_RQSID); - enc->status[i][3] = - ads->bytes[2] & SESCTL_RQSFLT; + enc->status[i][1] = ads->bytes[0] & + SESCTL_RQSRR; + enc->status[i][2] = ads->bytes[1] & + (SESCTL_RQSACT | SESCTL_RQSID); + enc->status[i][3] = ads->bytes[2] & + SESCTL_RQSFLT; ahci_em_setleds(dev, i); } else if (ads0->common.bytes[0] & SESCTL_CSEL) { enc->status[i][0] = 0; - enc->status[i][1] = - ads0->bytes[0] & 0x02; - enc->status[i][2] = - ads0->bytes[1] & (0x80 | SESCTL_RQSID); - enc->status[i][3] = - ads0->bytes[2] & SESCTL_RQSFLT; + enc->status[i][1] = ads0->bytes[0] & + SESCTL_RQSRR; + enc->status[i][2] = ads0->bytes[1] & + (SESCTL_RQSACT | SESCTL_RQSID); + enc->status[i][3] = ads0->bytes[2] & + SESCTL_RQSFLT; ahci_em_setleds(dev, i); } } @@ -496,15 +516,48 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc /* SEMB RECEIVE DIAGNOSTIC RESULT (7) */ if (ccb->ataio.cmd.lba_low == 0x02 && ccb->ataio.cmd.features == 0x07 && - ccb->ataio.cmd.sector_count >= (3 + 3 * enc->channels)) { + ccb->ataio.cmd.sector_count >= (6 + 3 * enc->channels)) { bzero(buf, ccb->ataio.dxfer_len); page->hdr.page_code = 0x07; - scsi_ulto2b(4 + 4 + 12 * enc->channels, + scsi_ulto2b(4 + 15 + 11 * enc->channels, page->hdr.length); + elmd = (struct ses_elm_desc_hdr *)&buf[8]; + scsi_ulto2b(11, elmd->length); + snprintf((char *)(elmd + 1), 12, "Drive Slots"); + for (i = 0; i < enc->channels; i++) { + elmd = (struct ses_elm_desc_hdr *)&buf[8 + 15 + 11 * i]; + scsi_ulto2b(7, elmd->length); + snprintf((char *)(elmd + 1), 8, "Slot %02d", i); + } + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + /* SEMB RECEIVE DIAGNOSTIC RESULT (a) */ + if (ccb->ataio.cmd.lba_low == 0x02 && + ccb->ataio.cmd.features == 0x0a && + ccb->ataio.cmd.sector_count >= (2 + 3 * enc->channels)) { + bzero(buf, ccb->ataio.dxfer_len); + page->hdr.page_code = 0x0a; + scsi_ulto2b(4 + (sizeof(*elma) + sizeof(*elmb)) * enc->channels, page->hdr.length); for (i = 0; i < enc->channels; i++) { - elmd = (struct ses_elm_desc_hdr *)&buf[8 + 4 + 12 * i]; - scsi_ulto2b(8, elmd->length); - snprintf((char *)(elmd + 1), 9, "SLOT %03d", i); + elma = (struct ses_elm_addlstatus_eip_hdr *)&buf[ + 8 + (sizeof(*elma) + sizeof(*elmb)) * i]; + elma->base.byte0 = 0x10 | SPSP_PROTO_ATA; + elma->base.length = 2 + sizeof(*elmb); + elma->byte2 = 0x01; + elma->element_index = 1 + i; + ch = ahci_getch(device_get_parent(dev), i); + if (ch == NULL) { + elma->base.byte0 |= 0x80; + continue; + } + if (ch->devices == 0 || ch->pm_present) + elma->base.byte0 |= 0x80; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jun 23 19:37:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8519515D8CD5; Sun, 23 Jun 2019 19:37:13 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DED2C6C4B0; Sun, 23 Jun 2019 19:37:12 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA972263C6; Sun, 23 Jun 2019 19:37:12 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NJbCC0073338; Sun, 23 Jun 2019 19:37:12 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NJbCb7073337; Sun, 23 Jun 2019 19:37:12 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201906231937.x5NJbCb7073337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sun, 23 Jun 2019 19:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349322 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 349322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DED2C6C4B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 19:37:13 -0000 Author: lwhsu Date: Sun Jun 23 19:37:12 2019 New Revision: 349322 URL: https://svnweb.freebsd.org/changeset/base/349322 Log: Skip sys.netinet.socket_afinet.socket_afinet_bind_zero temporarily because it doesn't work when mac_portacl(4) loaded PR: 238781 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet/socket_afinet.c Modified: head/tests/sys/netinet/socket_afinet.c ============================================================================== --- head/tests/sys/netinet/socket_afinet.c Sun Jun 23 19:05:01 2019 (r349321) +++ head/tests/sys/netinet/socket_afinet.c Sun Jun 23 19:37:12 2019 (r349322) @@ -51,6 +51,8 @@ ATF_TC_BODY(socket_afinet_bind_zero, tc) int sd, rc; struct sockaddr_in sin; + atf_tc_skip("doesn't work when mac_portacl(4) loaded (bug238781)"); + sd = socket(PF_INET, SOCK_DGRAM, 0); ATF_CHECK(sd >= 0); From owner-svn-src-all@freebsd.org Sun Jun 23 21:06:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D42115DB366; Sun, 23 Jun 2019 21:06:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A70186FD8F; Sun, 23 Jun 2019 21:06:56 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 954AA27386; Sun, 23 Jun 2019 21:06:56 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NL6u6m020225; Sun, 23 Jun 2019 21:06:56 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NL6u1i020224; Sun, 23 Jun 2019 21:06:56 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906232106.x5NL6u1i020224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 23 Jun 2019 21:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349323 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A70186FD8F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 21:06:57 -0000 Author: alc Date: Sun Jun 23 21:06:56 2019 New Revision: 349323 URL: https://svnweb.freebsd.org/changeset/base/349323 Log: pmap_enter_quick_locked() never replaces a valid mapping, so it need not perform a TLB invalidation. A barrier suffices. (See r343876.) Add a comment to pmap_enter_quick_locked() in order to highlight the fact that it does not replace valid mappings. Correct a typo in one of pmap_enter()'s comments. MFC after: 1 week Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Jun 23 19:37:12 2019 (r349322) +++ head/sys/arm64/arm64/pmap.c Sun Jun 23 21:06:56 2019 (r349323) @@ -3408,7 +3408,7 @@ validate: __func__, pmap, va, new_l3); } } else { - /* New mappig */ + /* New mapping */ pmap_load_store(l3, new_l3); dsb(ishst); } @@ -3706,6 +3706,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v l3 = pmap_l2_to_l3(pde, va); } + /* + * Abort if a mapping already exists. + */ if (pmap_load(l3) != 0) { if (mpte != NULL) { mpte->wire_count--; @@ -3755,7 +3758,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v cpu_icache_sync_range(PHYS_TO_DMAP(pa), PAGE_SIZE); pmap_load_store(l3, l3_val); - pmap_invalidate_page(pmap, va); + dsb(ishst); return (mpte); } From owner-svn-src-all@freebsd.org Sun Jun 23 21:15:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65D9215DB955; Sun, 23 Jun 2019 21:15:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5F5704FB; Sun, 23 Jun 2019 21:15:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D814027524; Sun, 23 Jun 2019 21:15:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NLFVMC025390; Sun, 23 Jun 2019 21:15:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NLFVJG025389; Sun, 23 Jun 2019 21:15:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906232115.x5NLFVJG025389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 21:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349324 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C5F5704FB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 21:15:32 -0000 Author: kib Date: Sun Jun 23 21:15:31 2019 New Revision: 349324 URL: https://svnweb.freebsd.org/changeset/base/349324 Log: Switch to check for effective user id in r349320, and disable dumping into existing files for sugid processes. Despite using real user id pronounces the intent, it actually breaks suid coredumps, while not making any difference for non-sugid processes. The reason for the breakage is that non-existent core file is created with the effective uid (unless weird hacks like SUIDDIR are configured). Then, if user enabled kern.sugid_coredump, core dumping should not overwrite core files owned by effective uid, but we cannot pretend to use real uid for dumping. PR: 68905 admbugs: 358 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jun 23 21:06:56 2019 (r349323) +++ head/sys/kern/kern_sig.c Sun Jun 23 21:15:31 2019 (r349324) @@ -3398,10 +3398,16 @@ corefile_open_last(struct thread *td, char *name, int } if (oldvp != NULL) { - if (nextvp == NULL) - nextvp = oldvp; - else + if (nextvp == NULL) { + if ((td->td_proc->p_flag & P_SUGID) != 0) { + error = EFAULT; + vnode_close_locked(td, oldvp); + } else { + nextvp = oldvp; + } + } else { vnode_close_locked(td, oldvp); + } } if (error != 0) { if (nextvp != NULL) @@ -3521,6 +3527,8 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, oflags = VN_OPEN_NOAUDIT | VN_OPEN_NAMECACHE | (capmode_coredump ? VN_OPEN_NOCAPCHECK : 0); flags = O_CREAT | FWRITE | O_NOFOLLOW; + if ((td->td_proc->p_flag & P_SUGID) != 0) + flags |= O_EXCL; NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, @@ -3597,11 +3605,11 @@ coredump(struct thread *td) /* * Don't dump to non-regular files or files with links. - * Do not dump into system files. Real user must own the corefile. + * Do not dump into system files. Effective user must own the corefile. */ if (vp->v_type != VREG || VOP_GETATTR(vp, &vattr, cred) != 0 || vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0 || - vattr.va_uid != cred->cr_ruid) { + vattr.va_uid != cred->cr_uid) { VOP_UNLOCK(vp, 0); error = EFAULT; goto out; From owner-svn-src-all@freebsd.org Sun Jun 23 21:17:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1097015DBA1E; Sun, 23 Jun 2019 21:17:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A856A7068E; Sun, 23 Jun 2019 21:17:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7535827529; Sun, 23 Jun 2019 21:17:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NLHgPv025541; Sun, 23 Jun 2019 21:17:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NLHgLU025540; Sun, 23 Jun 2019 21:17:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906232117.x5NLHgLU025540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jun 2019 21:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349325 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A856A7068E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 21:17:43 -0000 Author: ian Date: Sun Jun 23 21:17:41 2019 New Revision: 349325 URL: https://svnweb.freebsd.org/changeset/base/349325 Log: Allow compiling ukbdmap.h on arm, since it appears to work fine. Modified: head/sys/conf/files.arm Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sun Jun 23 21:15:31 2019 (r349324) +++ head/sys/conf/files.arm Sun Jun 23 21:17:41 2019 (r349325) @@ -166,6 +166,12 @@ cloudabi32_vdso_blob.o optional compat_cloudabi32 \ clean "cloudabi32_vdso_blob.o" # +# +ukbdmap.h optional ukbd_dflt_keymap \ + compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + no-obj no-implicit-rule before-depend \ + clean "ukbdmap.h" + # Annapurna support arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt From owner-svn-src-all@freebsd.org Sun Jun 23 21:21:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 222BE15DBB5B; Sun, 23 Jun 2019 21:21:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B980F70BBA; Sun, 23 Jun 2019 21:21:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95DAE27563; Sun, 23 Jun 2019 21:21:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5NLLBLm028823; Sun, 23 Jun 2019 21:21:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5NLLBDP028822; Sun, 23 Jun 2019 21:21:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906232121.x5NLLBDP028822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Jun 2019 21:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349326 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 349326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B980F70BBA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jun 2019 21:21:12 -0000 Author: kib Date: Sun Jun 23 21:21:11 2019 New Revision: 349326 URL: https://svnweb.freebsd.org/changeset/base/349326 Log: amd64 pmap: block on turnstile for lock-less DI. Port the code to block on turnstile instead of yielding, to lock-less delayed invalidation. The yield might cause tight loop due to priority inversion. Since it is impossible to avoid race between block and wake-up, arm 1-tick callout to wakeup when thread blocks itself. Reported and tested by: mjg Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 2 months Differential revision: https://reviews.freebsd.org/D20636 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jun 23 21:17:41 2019 (r349325) +++ head/sys/amd64/amd64/pmap.c Sun Jun 23 21:21:11 2019 (r349326) @@ -484,6 +484,9 @@ static struct pmap_invl_gen pmap_invl_gen_head = { .next = NULL, }; static u_long pmap_invl_gen = 1; +static int pmap_invl_waiters; +static struct callout pmap_invl_callout; +static bool pmap_invl_callout_inited; #define PMAP_ASSERT_NOT_IN_DI() \ KASSERT(pmap_not_in_di(), ("DI already started")) @@ -538,6 +541,34 @@ pmap_thread_init_invl_gen_l(struct thread *td) invl_gen->gen = 0; } +static void +pmap_delayed_invl_wait_block(u_long *m_gen, u_long *invl_gen) +{ + struct turnstile *ts; + + ts = turnstile_trywait(&invl_gen_ts); + if (*m_gen > atomic_load_long(invl_gen)) + turnstile_wait(ts, NULL, TS_SHARED_QUEUE); + else + turnstile_cancel(ts); +} + +static void +pmap_delayed_invl_finish_unblock(u_long new_gen) +{ + struct turnstile *ts; + + turnstile_chain_lock(&invl_gen_ts); + ts = turnstile_lookup(&invl_gen_ts); + if (new_gen != 0) + pmap_invl_gen = new_gen; + if (ts != NULL) { + turnstile_broadcast(ts, TS_SHARED_QUEUE); + turnstile_unpend(ts); + } + turnstile_chain_unlock(&invl_gen_ts); +} + /* * Start a new Delayed Invalidation (DI) block of code, executed by * the current thread. Within a DI block, the current thread may @@ -582,24 +613,15 @@ static void pmap_delayed_invl_finish_l(void) { struct pmap_invl_gen *invl_gen, *next; - struct turnstile *ts; invl_gen = &curthread->td_md.md_invl_gen; KASSERT(invl_gen->gen != 0, ("missed invl_start")); mtx_lock(&invl_gen_mtx); next = LIST_NEXT(invl_gen, link); - if (next == NULL) { - turnstile_chain_lock(&invl_gen_ts); - ts = turnstile_lookup(&invl_gen_ts); - pmap_invl_gen = invl_gen->gen; - if (ts != NULL) { - turnstile_broadcast(ts, TS_SHARED_QUEUE); - turnstile_unpend(ts); - } - turnstile_chain_unlock(&invl_gen_ts); - } else { + if (next == NULL) + pmap_delayed_invl_finish_unblock(invl_gen->gen); + else next->gen = invl_gen->gen; - } LIST_REMOVE(invl_gen, link); mtx_unlock(&invl_gen_mtx); invl_gen->gen = 0; @@ -856,6 +878,8 @@ again: goto again; } critical_exit(); + if (atomic_load_int(&pmap_invl_waiters) > 0) + pmap_delayed_invl_finish_unblock(0); if (invl_gen->saved_pri != 0) { thread_lock(td); sched_prio(td, invl_gen->saved_pri); @@ -888,6 +912,9 @@ DB_SHOW_COMMAND(di_queue, pmap_di_queue) static long invl_wait; SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait, CTLFLAG_RD, &invl_wait, 0, "Number of times DI invalidation blocked pmap_remove_all/write"); +static long invl_wait_slow; +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait_slow, CTLFLAG_RD, &invl_wait_slow, 0, + "Number of slow invalidation waits for lockless DI"); #endif static u_long * @@ -897,6 +924,27 @@ pmap_delayed_invl_genp(vm_page_t m) return (&pv_invl_gen[pa_index(VM_PAGE_TO_PHYS(m)) % NPV_LIST_LOCKS]); } +static void +pmap_delayed_invl_callout_func(void *arg __unused) +{ + + if (atomic_load_int(&pmap_invl_waiters) == 0) + return; + pmap_delayed_invl_finish_unblock(0); +} + +static void +pmap_delayed_invl_callout_init(void *arg __unused) +{ + + if (pmap_di_locked()) + return; + callout_init(&pmap_invl_callout, 1); + pmap_invl_callout_inited = true; +} +SYSINIT(pmap_di_callout, SI_SUB_CPU + 1, SI_ORDER_ANY, + pmap_delayed_invl_callout_init, NULL); + /* * Ensure that all currently executing DI blocks, that need to flush * TLB for the given page m, actually flushed the TLB at the time the @@ -914,7 +962,6 @@ pmap_delayed_invl_genp(vm_page_t m) static void pmap_delayed_invl_wait_l(vm_page_t m) { - struct turnstile *ts; u_long *m_gen; #ifdef PV_STATS bool accounted = false; @@ -928,11 +975,7 @@ pmap_delayed_invl_wait_l(vm_page_t m) accounted = true; } #endif - ts = turnstile_trywait(&invl_gen_ts); - if (*m_gen > pmap_invl_gen) - turnstile_wait(ts, NULL, TS_SHARED_QUEUE); - else - turnstile_cancel(ts); + pmap_delayed_invl_wait_block(m_gen, &pmap_invl_gen); } } @@ -940,19 +983,53 @@ static void pmap_delayed_invl_wait_u(vm_page_t m) { u_long *m_gen; -#ifdef PV_STATS - bool accounted = false; -#endif + struct lock_delay_arg lda; + bool fast; + fast = true; m_gen = pmap_delayed_invl_genp(m); + lock_delay_arg_init(&lda, &di_delay); while (*m_gen > atomic_load_long(&pmap_invl_gen_head.gen)) { -#ifdef PV_STATS - if (!accounted) { - atomic_add_long(&invl_wait, 1); - accounted = true; + if (fast || !pmap_invl_callout_inited) { + PV_STAT(atomic_add_long(&invl_wait, 1)); + lock_delay(&lda); + fast = false; + } else { + /* + * The page's invalidation generation number + * is still below the current thread's number. + * Prepare to block so that we do not waste + * CPU cycles or worse, suffer livelock. + * + * Since it is impossible to block without + * racing with pmap_delayed_invl_finish_u(), + * prepare for the race by incrementing + * pmap_invl_waiters and arming a 1-tick + * callout which will unblock us if we lose + * the race. + */ + atomic_add_int(&pmap_invl_waiters, 1); + + /* + * Re-check the current thread's invalidation + * generation after incrementing + * pmap_invl_waiters, so that there is no race + * with pmap_delayed_invl_finish_u() setting + * the page generation and checking + * pmap_invl_waiters. The only race allowed + * is for a missed unblock, which is handled + * by the callout. + */ + if (*m_gen > + atomic_load_long(&pmap_invl_gen_head.gen)) { + callout_reset(&pmap_invl_callout, 1, + pmap_delayed_invl_callout_func, NULL); + PV_STAT(atomic_add_long(&invl_wait_slow, 1)); + pmap_delayed_invl_wait_block(m_gen, + &pmap_invl_gen_head.gen); + } + atomic_add_int(&pmap_invl_waiters, -1); } -#endif - kern_yield(PRI_USER); } } From owner-svn-src-all@freebsd.org Mon Jun 24 01:42:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01A6F15BB340; Mon, 24 Jun 2019 01:42:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 994E3802B5; Mon, 24 Jun 2019 01:42:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FDF52A0D7; Mon, 24 Jun 2019 01:42:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5O1gA07062385; Mon, 24 Jun 2019 01:42:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5O1g9LA062382; Mon, 24 Jun 2019 01:42:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906240142.x5O1g9LA062382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 24 Jun 2019 01:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349327 - in head/sys: arm/conf conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/conf conf X-SVN-Commit-Revision: 349327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 994E3802B5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 01:42:11 -0000 Author: ian Date: Mon Jun 24 01:42:09 2019 New Revision: 349327 URL: https://svnweb.freebsd.org/changeset/base/349327 Log: Build an armv7 LINT kernel in addition to armv5 LINT. You might think this had been done years ago. I did. All this time we've only compiled a LINT kernel for TARGET_ARCH=arm. Now separate LINT-V5 and LINT-V7 configs are generated and built. There are two new files in arm/conf, NOTES.armv5 and NOTES.armv7, containing some of what used to be in the arm NOTES file. That file now contains only the bits that are common to v5 and v7. The makeLINT.mk file now creates the LINT-V5 and LINT-V7 files by concatening sys/conf/NOTES, arm/conf/NOTES, and arm/conf/NOTES.armv{5,7} in that order. Added: head/sys/arm/conf/NOTES.armv5 (contents, props changed) head/sys/arm/conf/NOTES.armv7 (contents, props changed) Modified: head/sys/arm/conf/NOTES head/sys/conf/makeLINT.mk Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Sun Jun 23 21:21:11 2019 (r349326) +++ head/sys/arm/conf/NOTES Mon Jun 24 01:42:09 2019 (r349327) @@ -1,44 +1,22 @@ # $FreeBSD$ -machine arm - -cpu CPU_ARM9E - -files "../mv/files.mv" -files "../mv/discovery/files.db78xxx" -files "../mv/kirkwood/files.kirkwood" -files "../mv/orion/files.db88f5xxx" -files "../mv/orion/files.ts7800" - -makeoptions CONF_CFLAGS+="-march=armv5te" -makeoptions LDFLAGS="-zmuldefs" -makeoptions KERNPHYSADDR=0x00000000 - options FDT -options SOC_MV_DISCOVERY -options SOC_MV_KIRKWOOD -options SOC_MV_ORION +# Undo options from sys/conf/NOTES that we do not want... -options ARM_MANY_BOARD -device nand - -# IIC -device twsi - -nooptions SMP -nooptions MAXCPU - nooptions COMPAT_FREEBSD4 nooptions COMPAT_FREEBSD5 nooptions COMPAT_FREEBSD6 nooptions COMPAT_FREEBSD7 nooptions COMPAT_FREEBSD9 -nooption PPC_PROBE_CHIPSET +nooptions PPC_PROBE_CHIPSET +nooptions MAXCPU # value is set in machine/param.h +# Devices in sys/conf/NOTES for which no such hardware exists on arm, +# or the drivers don't compile... + nodevice fdc nodevice sym -nodevice ukbd nodevice sc nodevice blank_saver @@ -58,28 +36,9 @@ nodevice cxgbe nodevice cxgbev nodevice snd_cmi -# -# Enable the kernel DTrace hooks which are required to load the DTrace -# kernel modules. -# -options KDTRACE_HOOKS - -# DTrace core -# NOTE: introduces CDDL-licensed components into the kernel -#device dtrace - -# DTrace modules -#device dtrace_profile -#device dtrace_sdt -#device dtrace_fbt -#device dtrace_systrace -#device dtrace_prototype -#device dtnfscl -#device dtmalloc - -# Alternatively include all the DTrace modules -#device dtraceall - -# These aren't known to work on arm and/or don't compile nodevice mpr nodevice mps + +# Add devices which are specific to various arm platforms... + +device twsi # i2c controller on Marvel and Allwinner Added: head/sys/arm/conf/NOTES.armv5 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/NOTES.armv5 Mon Jun 24 01:42:09 2019 (r349327) @@ -0,0 +1,38 @@ +# armv5-specific changes for doing a LINT build. +# +# The contents of sys/conf/NOTES, sys/arm/conf/NOTES, and this file are +# concatenated (in that order) to create the LINT-V5 kernel config file. +# +# $FreeBSD$ + +#NO_UNIVERSE + +machine arm arm +cpu CPU_ARM9E + +files "../mv/files.mv" +files "../mv/discovery/files.db78xxx" +files "../mv/kirkwood/files.kirkwood" +files "../mv/orion/files.db88f5xxx" +files "../mv/orion/files.ts7800" + +makeoptions CONF_CFLAGS+="-march=armv5te" +makeoptions LDFLAGS="-zmuldefs" +makeoptions KERNPHYSADDR=0x00000000 + +# Undo options from sys/conf/NOTES that we do not want... + +nooptions SMP # All armv5 are single-core + +# Add options for armv5 that are not in sys/conf/NOTES... + +options ARM_MANY_BOARD + +options SOC_MV_DISCOVERY +options SOC_MV_KIRKWOOD +options SOC_MV_ORION + +# Add devices which are specific to various arm platforms... + +device nand + Added: head/sys/arm/conf/NOTES.armv7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/NOTES.armv7 Mon Jun 24 01:42:09 2019 (r349327) @@ -0,0 +1,64 @@ +# armv7-specific changes for doing a LINT build. +# +# The contents of sys/conf/NOTES, sys/arm/conf/NOTES, and this file are +# concatenated (in that order) to create the LINT-V7 kernel config file. +# +# $FreeBSD$ + + +#NO_UNIVERSE + +machine arm armv7 +cpu CPU_CORTEXA +cpu CPU_MV_PJ4B +makeoptions CONF_CFLAGS+="-march=armv7a" + +# Add options for armv7 that are not in sys/conf/NOTES... + +options ARM_L2_PIPT # Only L2 PIPT is supported +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) +options INTRNG # Include INTRNG framework +options LINUX_BOOT_ABI # Process metadata passed from U-Boot +options PLATFORM # Include platform_if support +options SMP # Most v7 SoCs are multicore +options VFP # Enable floating point hardware support + +# NOTE: dtrace introduces CDDL-licensed components into the kernel +device dtrace # dtrace core +device dtraceall # include all dtrace modules +options KDTRACE_HOOKS + +# Add misc devices which are specific to various arm platforms... + +device generic_timer # ARM Generic Timer +device gic # Interrupt controller +device gpio # gpio interface and bus +device mpcore_timer # ARM MPCore Timer +device pl310 # PL310 L2 cache controller +device pmu # PMU support (for CCNT). + +# Add EXT_RESOURCES pseudo devices... + +options EXT_RESOURCES +device clk +device phy +device hwreset +device nvmem +device regulator +device syscon + +# Build SOC-specific modules... + +makeoptions MODULES_EXTRA+="allwinner" +makeoptions MODULES_EXTRA+="arm_ti" +makeoptions MODULES_EXTRA+="imx" + +# Build dtb files... + +makeoptions MODULES_EXTRA+="dtb/allwinner" +makeoptions MODULES_EXTRA+="dtb/am335x" +makeoptions MODULES_EXTRA+="dtb/imx6" +makeoptions MODULES_EXTRA+="dtb/nvidia" +makeoptions MODULES_EXTRA+="dtb/omap4" +makeoptions MODULES_EXTRA+="dtb/rpi" +makeoptions MODULES_EXTRA+="dtb/zynq" Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Sun Jun 23 21:21:11 2019 (r349326) +++ head/sys/conf/makeLINT.mk Mon Jun 24 01:42:09 2019 (r349327) @@ -47,6 +47,11 @@ LINT: ${NOTES} ${MAKELINT_SED} echo "nodevice txp" >> ${.TARGET}-NOIP echo "nodevice netmap" >> ${.TARGET}-NOIP .endif +.if ${TARGET} == "arm" + cat ${.TARGET} ${.CURDIR}/NOTES.armv5 > ${.TARGET}-V5 + cat ${.TARGET} ${.CURDIR}/NOTES.armv7 > ${.TARGET}-V7 + rm ${.TARGET} +.endif .if ${TARGET} == "mips" echo "machine ${TARGET} ${TARGET_ARCH}" >> ${.TARGET} .endif From owner-svn-src-all@freebsd.org Mon Jun 24 02:27:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51CA115BC279; Mon, 24 Jun 2019 02:27:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8C1E815C3; Mon, 24 Jun 2019 02:27:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF0422A8B1; Mon, 24 Jun 2019 02:27:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5O2RHHN086248; Mon, 24 Jun 2019 02:27:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5O2RHKO086247; Mon, 24 Jun 2019 02:27:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906240227.x5O2RHKO086247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 24 Jun 2019 02:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349328 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8C1E815C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 02:27:18 -0000 Author: ian Date: Mon Jun 24 02:27:17 2019 New Revision: 349328 URL: https://svnweb.freebsd.org/changeset/base/349328 Log: The gpiopps(4) driver currently has probe and attach code only for FDT based systems, so conditionalize it accordingly in conf/files. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 24 01:42:09 2019 (r349327) +++ head/sys/conf/files Mon Jun 24 02:27:17 2019 (r349328) @@ -1751,7 +1751,7 @@ dev/gpio/gpiospi.c optional gpiospi dev/gpio/gpioths.c optional gpioths dev/gpio/gpio_if.m optional gpio dev/gpio/gpiobus_if.m optional gpio -dev/gpio/gpiopps.c optional gpiopps +dev/gpio/gpiopps.c optional gpiopps fdt dev/gpio/ofw_gpiobus.c optional fdt gpio dev/hifn/hifn7751.c optional hifn dev/hme/if_hme.c optional hme From owner-svn-src-all@freebsd.org Mon Jun 24 02:30:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D4C915BC369; Mon, 24 Jun 2019 02:30:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B31418175B; Mon, 24 Jun 2019 02:30:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 890442A8B6; Mon, 24 Jun 2019 02:30:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5O2U5DJ086416; Mon, 24 Jun 2019 02:30:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5O2U5o3086415; Mon, 24 Jun 2019 02:30:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906240230.x5O2U5o3086415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 24 Jun 2019 02:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349329 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B31418175B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 02:30:06 -0000 Author: ian Date: Mon Jun 24 02:30:05 2019 New Revision: 349329 URL: https://svnweb.freebsd.org/changeset/base/349329 Log: Add gpio(4) and related drivers to NOTES. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jun 24 02:27:17 2019 (r349328) +++ head/sys/conf/NOTES Mon Jun 24 02:30:05 2019 (r349329) @@ -2481,6 +2481,18 @@ device pps device lpbb device pcfclock +# General Purpose I/O pins +device gpio # gpio interfaces and bus support +device gpiobacklight # sysctl control of gpio-based backlight +device gpioiic # i2c via gpio bitbang +device gpiokeys # kbd(4) glue for gpio-based key input +device gpioled # led(4) gpio glue +device gpiopower # event handler for gpio-based powerdown +device gpiopps # Pulse per second input from gpio pin +device gpioregulator # extres/regulator glue for gpio pin +device gpiospi # SPI via gpio bitbang +device gpioths # 1-wire temp/humidity sensor on gpio pin + # # Etherswitch framework and drivers # From owner-svn-src-all@freebsd.org Mon Jun 24 02:39:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 364CE15BC6C9; Mon, 24 Jun 2019 02:39:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2E8D81D8C; Mon, 24 Jun 2019 02:39:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A99762AA57; Mon, 24 Jun 2019 02:39:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5O2duI7091358; Mon, 24 Jun 2019 02:39:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5O2duDX091357; Mon, 24 Jun 2019 02:39:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906240239.x5O2duDX091357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 24 Jun 2019 02:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349330 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2E8D81D8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 02:39:57 -0000 Author: ian Date: Mon Jun 24 02:39:56 2019 New Revision: 349330 URL: https://svnweb.freebsd.org/changeset/base/349330 Log: Add pwm devices to NOTES. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jun 24 02:30:05 2019 (r349329) +++ head/sys/conf/NOTES Mon Jun 24 02:39:56 2019 (r349330) @@ -2493,6 +2493,10 @@ device gpioregulator # extres/regulator glue for gpi device gpiospi # SPI via gpio bitbang device gpioths # 1-wire temp/humidity sensor on gpio pin +# Pulse width modulation +device pwmbus # pwm interface and bus support +device pwmc # userland control access to pwm outputs + # # Etherswitch framework and drivers # From owner-svn-src-all@freebsd.org Mon Jun 24 02:58:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EB0615BCCE8; Mon, 24 Jun 2019 02:58:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E07582786; Mon, 24 Jun 2019 02:58:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DACAC2ADAE; Mon, 24 Jun 2019 02:58:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5O2w2oO002078; Mon, 24 Jun 2019 02:58:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5O2w2iE002077; Mon, 24 Jun 2019 02:58:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906240258.x5O2w2iE002077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 24 Jun 2019 02:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349331 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E07582786 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 02:58:03 -0000 Author: cy Date: Mon Jun 24 02:58:02 2019 New Revision: 349331 URL: https://svnweb.freebsd.org/changeset/base/349331 Log: Clean out duplicate definitions of TCP macros also found in netinet/tcp.h. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Mon Jun 24 02:39:56 2019 (r349330) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Mon Jun 24 02:58:02 2019 (r349331) @@ -829,37 +829,6 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -#ifndef TCPOPT_EOL -# define TCPOPT_EOL 0 -#endif -#ifndef TCPOPT_NOP -# define TCPOPT_NOP 1 -#endif -#ifndef TCPOPT_MAXSEG -# define TCPOPT_MAXSEG 2 -#endif -#ifndef TCPOLEN_MAXSEG -# define TCPOLEN_MAXSEG 4 -#endif -#ifndef TCPOPT_WINDOW -# define TCPOPT_WINDOW 3 -#endif -#ifndef TCPOLEN_WINDOW -# define TCPOLEN_WINDOW 3 -#endif -#ifndef TCPOPT_SACK_PERMITTED -# define TCPOPT_SACK_PERMITTED 4 -#endif -#ifndef TCPOLEN_SACK_PERMITTED -# define TCPOLEN_SACK_PERMITTED 2 -#endif -#ifndef TCPOPT_SACK -# define TCPOPT_SACK 5 -#endif -#ifndef TCPOPT_TIMESTAMP -# define TCPOPT_TIMESTAMP 8 -#endif - #ifndef ICMP_MINLEN # define ICMP_MINLEN 8 #endif From owner-svn-src-all@freebsd.org Mon Jun 24 02:59:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E25C15BCDB6; Mon, 24 Jun 2019 02:59:24 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD61828EC; Mon, 24 Jun 2019 02:59:23 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x5O2xDEX088048 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jun 2019 12:59:19 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x5O2x8iZ087966 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 Jun 2019 12:59:08 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x5O2x8t8087965; Mon, 24 Jun 2019 12:59:08 +1000 (AEST) (envelope-from peter) Date: Mon, 24 Jun 2019 12:59:08 +1000 From: Peter Jeremy To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker... Message-ID: <20190624025908.GA87860@server.rulingia.com> References: <201906171949.x5HJn9Ed091108@repo.freebsd.org> <20190622071703.GA71146@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline In-Reply-To: <20190622071703.GA71146@server.rulingia.com> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.0 (2019-05-25) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 02:59:24 -0000 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Jun-22 17:17:03 +1000, Peter Jeremy wro= te: >On 2019-Jun-17 19:49:09 +0000, Xin LI wrote: >>Author: delphij >>Date: Mon Jun 17 19:49:08 2019 >>New Revision: 349151 >>URL: https://svnweb.freebsd.org/changeset/base/349151 >> >>Log: >> Separate kernel crc32() implementation to its own header (gsb_crc32.h) = and >> rename the source to gsb_crc32.c. > >I'm not sure how but this breaks my Rock64. r349150 boots without problem >but r349151 panics during the probe: >... And the problem went away somewhere between r349269 and r349288. Since the= re's nothing obvious there either, I presume this is something more subtle like a race condition that has been provoked by the code changes. --=20 Peter Jeremy --BOKacYhQ+x31HxR3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl0QPGtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQPyhAAmU38utmmqCxwiN+yNYib5hOThLLMIoJTe14iJamxa0Ubrcw5c1FSxZlG 1XgOxR40vNIx7QNiGIZGd0L0rdIf7znmNRj/idqX2o/ZnKk9d6YHbNkr4SQghdu2 YGE1cSNIH6yVhpEAUw9AdGAgAfZmMAj212igWilyO+UdXLzwT4knyBF65+Ud1cuT yt6rHGfRv/i7EgObLAbJpOxbzMmbq3il/GLC/Egp7j+Ujkr5WUj69hDtljuOn4oh FFNriIAUlSZDrWyp5i7Tepl2Qv6RvlSaZBxq8xW8whWVMU41yN2MO0QMmXtceOMQ Ie45W5I8l1+MXQ+BzzLYoVyw28bJVFAIxhCLJpdaHNtsG+L8/cFiOpp6iQ2Dr9jr h9eiBHcbdz6d/aFoSez5TTLzNLEXy0eJ8XQ56x6nWpKSSWGk7gcvemaalchtDUZR c4iFsmVZRajZIFyarWuUaf70cKjP4Fl6yHxrD+Q8j1vbzgozRRy8gDaHlI3ZvzkK GesE538jGf4Tzl9AIIfG/mjREWAdw7iJIUynNLRwZBchXL7majFr6GSLdS331aOq Iar59CpwpXj3jVXjuURWmiQ8RXrvBF1ImGBZkPFIpa3CqzRs1MAioWgVn8L443nm hnFvy2hKpUnGxbdiMN9zvc5xeGbrN6Hg2MuadC3EZP9WW01FOZ0= =rkFC -----END PGP SIGNATURE----- --BOKacYhQ+x31HxR3-- From owner-svn-src-all@freebsd.org Mon Jun 24 17:25:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C40415D38C3; Mon, 24 Jun 2019 17:25:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C197977664; Mon, 24 Jun 2019 17:25:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 986E3434F; Mon, 24 Jun 2019 17:25:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OHPEfW057349; Mon, 24 Jun 2019 17:25:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OHPE3f057348; Mon, 24 Jun 2019 17:25:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906241725.x5OHPE3f057348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 24 Jun 2019 17:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349333 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C197977664 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 17:25:15 -0000 Author: emaste Date: Mon Jun 24 17:25:14 2019 New Revision: 349333 URL: https://svnweb.freebsd.org/changeset/base/349333 Log: vtfontcvt: improve .bdf validation Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing or invalid values and and failed sscanf, we would proceeded with partially initialized bounding box / device width variables. Reported by: afl (FONTBOUNDINGBOX) MFC with: r349100 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jun 24 17:05:31 2019 (r349332) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jun 24 17:25:14 2019 (r349333) @@ -335,9 +335,11 @@ parse_bdf(FILE *fp, unsigned int map_idx) break; } } - } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0 && - sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, - &fbboy) == 4) { + } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0) { + if (sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, + &fbboy) != 4) + errx(1, "invalid FONTBOUNDINGBOX at line %u", + linenum); set_width(fbbw); set_height(fbbh); break; @@ -353,8 +355,9 @@ parse_bdf(FILE *fp, unsigned int map_idx) linenum++; ln[length - 1] = '\0'; - if (strncmp(ln, "DWIDTH ", 7) == 0 && - sscanf(ln + 7, "%d %d", &dwidth, &dwy) == 2) { + if (strncmp(ln, "DWIDTH ", 7) == 0) { + if (sscanf(ln + 7, "%d %d", &dwidth, &dwy) != 2) + errx(1, "invalid DWIDTH at line %u", linenum); if (dwy != 0 || (dwidth != fbbw && dwidth * 2 != fbbw)) errx(1, "bitmap with unsupported DWIDTH %d %d at line %u", dwidth, dwy, linenum); From owner-svn-src-all@freebsd.org Mon Jun 24 19:19:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7386615D6CDB; Mon, 24 Jun 2019 19:19:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1978A8405E; Mon, 24 Jun 2019 19:19:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E33655622; Mon, 24 Jun 2019 19:19:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OJJbq8016464; Mon, 24 Jun 2019 19:19:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OJJbKv016463; Mon, 24 Jun 2019 19:19:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906241919.x5OJJbKv016463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 24 Jun 2019 19:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349334 - head/sys/fs/smbfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/smbfs X-SVN-Commit-Revision: 349334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1978A8405E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 19:19:38 -0000 Author: markj Date: Mon Jun 24 19:19:37 2019 New Revision: 349334 URL: https://svnweb.freebsd.org/changeset/base/349334 Log: Remove a lingering use of splbio(). The buffer must be locked by the caller. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/smbfs/smbfs_io.c Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Mon Jun 24 17:25:14 2019 (r349333) +++ head/sys/fs/smbfs/smbfs_io.c Mon Jun 24 19:19:37 2019 (r349334) @@ -375,9 +375,6 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc */ if (error == EINTR || (!error && (bp->b_flags & B_NEEDCOMMIT))) { - int s; - - s = splbio(); bp->b_flags &= ~(B_INVAL|B_NOCACHE); if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; @@ -387,7 +384,6 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc } if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; - splx(s); } else { if (error) { bp->b_ioflags |= BIO_ERROR; From owner-svn-src-all@freebsd.org Mon Jun 24 19:31:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D02B15D7245; Mon, 24 Jun 2019 19:31:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E94B84AA0; Mon, 24 Jun 2019 19:31:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17ADF5820; Mon, 24 Jun 2019 19:31:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OJVXvk025288; Mon, 24 Jun 2019 19:31:33 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OJVWVs025283; Mon, 24 Jun 2019 19:31:32 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201906241931.x5OJVWVs025283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 24 Jun 2019 19:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349335 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E94B84AA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 19:31:33 -0000 Author: scottl Date: Mon Jun 24 19:31:32 2019 New Revision: 349335 URL: https://svnweb.freebsd.org/changeset/base/349335 Log: Add the PCI HDAudio device model from the 2016 GSoC. Detailed information can be found at https://wiki.freebsd.org/SummerOfCode2016/HDAudioEmulationForBhyve This commit has evolved from the original work to include Capsicum integration. As part of that, it only opens the host audio devices once and leaves them open, instead of opening and closing them on each guest access. Thanks to Peter Grehan and Marcelo Araujo for their help in bringing the work forward and providing some of the final techncial push. Submitted by: Alex Teaca Differential Revision: D7840, D12419 Added: head/usr.sbin/bhyve/audio.c (contents, props changed) head/usr.sbin/bhyve/audio.h (contents, props changed) head/usr.sbin/bhyve/hda_codec.c (contents, props changed) head/usr.sbin/bhyve/hda_reg.h (contents, props changed) head/usr.sbin/bhyve/hdac_reg.h (contents, props changed) head/usr.sbin/bhyve/pci_hda.c (contents, props changed) head/usr.sbin/bhyve/pci_hda.h (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Mon Jun 24 19:19:37 2019 (r349334) +++ head/usr.sbin/bhyve/Makefile Mon Jun 24 19:31:32 2019 (r349335) @@ -16,6 +16,7 @@ BHYVE_SYSDIR?=${SRCTOP} SRCS= \ atkbdc.c \ acpi.c \ + audio.c \ bhyvegc.c \ bhyverun.c \ block_if.c \ @@ -27,6 +28,7 @@ SRCS= \ dbgport.c \ fwctl.c \ gdb.c \ + hda_codec.c \ inout.c \ ioapic.c \ mem.c \ @@ -36,6 +38,7 @@ SRCS= \ pci_ahci.c \ pci_e82545.c \ pci_emul.c \ + pci_hda.c \ pci_fbuf.c \ pci_hostbridge.c \ pci_irq.c \ Added: head/usr.sbin/bhyve/audio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/audio.c Mon Jun 24 19:31:32 2019 (r349335) @@ -0,0 +1,282 @@ +/*- + * Copyright (c) 2016 Alex Teaca + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifndef WITHOUT_CAPSICUM +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "audio.h" +#include "pci_hda.h" + +/* + * Audio Player internal data structures + */ + +struct audio { + int fd; + uint8_t dir; + uint8_t inited; + char dev_name[64]; +}; + +/* + * Audio Player module function definitions + */ + +/* + * audio_init - initialize an instance of audio player + * @dev_name - the backend sound device used to play / capture + * @dir - dir = 1 for write mode, dir = 0 for read mode + */ +struct audio * +audio_init(const char *dev_name, uint8_t dir) +{ + struct audio *aud = NULL; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { + SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_CHANNELS, + SNDCTL_DSP_SPEED, +#ifdef DEBUG_HDA + SNDCTL_DSP_GETOSPACE, SNDCTL_DSP_GETISPACE, +#endif + }; +#endif + + assert(dev_name); + + aud = calloc(1, sizeof(*aud)); + if (!aud) + return NULL; + + if (strlen(dev_name) < sizeof(aud->dev_name)) + memcpy(aud->dev_name, dev_name, strlen(dev_name) + 1); + else { + DPRINTF("dev_name too big\n"); + free(aud); + return NULL; + } + + aud->dir = dir; + + aud->fd = open(aud->dev_name, aud->dir ? O_WRONLY : O_RDONLY, 0); + if (aud->fd == -1) { + DPRINTF("Failed to open dev: %s, errno: %d\n", + aud->dev_name, errno); + return (NULL); + } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (caph_rights_limit(aud->fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (caph_ioctls_limit(aud->fd, cmds, nitems(cmds)) == -1) + errx(EX_OSERR, "Unable to limit ioctl rights for sandbox"); +#endif + + return aud; +} + +/* + * audio_set_params - reset the sound device and set the audio params + * @aud - the audio player to be configured + * @params - the audio parameters to be set + */ +int +audio_set_params(struct audio *aud, struct audio_params *params) +{ + int audio_fd; + int format, channels, rate; + int err; +#if DEBUG_HDA == 1 + audio_buf_info info; +#endif + + assert(aud); + assert(params); + + if ((audio_fd = aud->fd) < 0) { + DPRINTF("Incorrect audio device descriptor for %s\n", + aud->dev_name); + return (-1); + } + + /* Reset the device if it was previously opened */ + if (aud->inited) { + err = ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); + if (err == -1) { + DPRINTF("Failed to reset fd: %d, errno: %d\n", + aud->fd, errno); + return (-1); + } + } else + aud->inited = 1; + + /* Set the Format (Bits per Sample) */ + format = params->format; + err = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &format); + if (err == -1) { + DPRINTF("Fail to set fmt: 0x%x errno: %d\n", + params->format, errno); + return -1; + } + + /* The device does not support the requested audio format */ + if (format != params->format) { + DPRINTF("Mismatch format: 0x%x params->format: 0x%x\n", + format, params->format); + return -1; + } + + /* Set the Number of Channels */ + channels = params->channels; + err = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &channels); + if (err == -1) { + DPRINTF("Fail to set channels: %d errno: %d\n", + params->channels, errno); + return -1; + } + + /* The device does not support the requested no. of channels */ + if (channels != params->channels) { + DPRINTF("Mismatch channels: %d params->channels: %d\n", + channels, params->channels); + return -1; + } + + /* Set the Sample Rate / Speed */ + rate = params->rate; + err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &rate); + if (err == -1) { + DPRINTF("Fail to set speed: %d errno: %d\n", + params->rate, errno); + return -1; + } + + /* The device does not support the requested rate / speed */ + if (rate != params->rate) { + DPRINTF("Mismatch rate: %d params->rate: %d\n", + rate, params->rate); + return -1; + } + +#if DEBUG_HDA == 1 + err = ioctl(audio_fd, aud->dir ? SNDCTL_DSP_GETOSPACE : + SNDCTL_DSP_GETISPACE, &info); + if (err == -1) { + DPRINTF("Fail to get audio buf info errno: %d\n", errno); + return -1; + } + DPRINTF("fragstotal: 0x%x fragsize: 0x%x\n", + info.fragstotal, info.fragsize); +#endif + return 0; +} + +/* + * audio_playback - plays samples to the sound device using blocking operations + * @aud - the audio player used to play the samples + * @buf - the buffer containing the samples + * @count - the number of bytes in buffer + */ +int +audio_playback(struct audio *aud, const void *buf, size_t count) +{ + int audio_fd = -1; + ssize_t len = 0, total = 0; + + assert(aud); + assert(aud->dir); + assert(buf); + + audio_fd = aud->fd; + assert(audio_fd != -1); + + total = 0; + while (total < count) { + len = write(audio_fd, buf + total, count - total); + if (len == -1) { + DPRINTF("Fail to write to fd: %d, errno: %d\n", + audio_fd, errno); + return -1; + } + + total += len; + } + + return 0; +} + +/* + * audio_record - records samples from the sound device using + * blocking operations. + * @aud - the audio player used to capture the samples + * @buf - the buffer to receive the samples + * @count - the number of bytes to capture in buffer + * Returns -1 on error and 0 on success + */ +int +audio_record(struct audio *aud, void *buf, size_t count) +{ + int audio_fd = -1; + ssize_t len = 0, total = 0; + + assert(aud); + assert(!aud->dir); + assert(buf); + + audio_fd = aud->fd; + assert(audio_fd != -1); + + total = 0; + while (total < count) { + len = read(audio_fd, buf + total, count - total); + if (len == -1) { + DPRINTF("Fail to write to fd: %d, errno: %d\n", + audio_fd, errno); + return -1; + } + + total += len; + } + + return 0; +} Added: head/usr.sbin/bhyve/audio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/audio.h Mon Jun 24 19:31:32 2019 (r349335) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2016 Alex Teaca + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _AUDIO_EMUL_H_ +#define _AUDIO_EMUL_H_ + +#include +#include + +/* + * Audio Player data structures + */ + +struct audio; + +struct audio_params { + int channels; + int format; + int rate; +}; + +/* + * Audio Player API + */ + +/* + * audio_init - initialize an instance of audio player + * @dev_name - the backend sound device used to play / capture + * @dir - dir = 1 for write mode, dir = 0 for read mode + * Returns NULL on error and the address of the audio player instance + */ +struct audio *audio_init(const char *dev_name, uint8_t dir); + +/* + * audio_set_params - reset the sound device and set the audio params + * @aud - the audio player to be configured + * @params - the audio parameters to be set + * Returns -1 on error and 0 on success + */ +int audio_set_params(struct audio *aud, struct audio_params *params); + +/* + * audio_playback - plays samples to the sound device using blocking operations + * @aud - the audio player used to play the samples + * @buf - the buffer containing the samples + * @count - the number of bytes in buffer + * Returns -1 on error and 0 on success + */ +int audio_playback(struct audio *aud, const void *buf, size_t count); + +/* + * audio_record - records samples from the sound device using blocking + * operations. + * @aud - the audio player used to capture the samples + * @buf - the buffer to receive the samples + * @count - the number of bytes to capture in buffer + * Returns -1 on error and 0 on success + */ +int audio_record(struct audio *aud, void *buf, size_t count); + +#endif /* _AUDIO_EMUL_H_ */ Added: head/usr.sbin/bhyve/hda_codec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/hda_codec.c Mon Jun 24 19:31:32 2019 (r349335) @@ -0,0 +1,950 @@ +/*- + * Copyright (c) 2016 Alex Teaca + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "pci_hda.h" +#include "audio.h" + +/* + * HDA Codec defines + */ +#define INTEL_VENDORID 0x8086 + +#define HDA_CODEC_SUBSYSTEM_ID ((INTEL_VENDORID << 16) | 0x01) +#define HDA_CODEC_ROOT_NID 0x00 +#define HDA_CODEC_FG_NID 0x01 +#define HDA_CODEC_AUDIO_OUTPUT_NID 0x02 +#define HDA_CODEC_PIN_OUTPUT_NID 0x03 +#define HDA_CODEC_AUDIO_INPUT_NID 0x04 +#define HDA_CODEC_PIN_INPUT_NID 0x05 + +#define HDA_CODEC_STREAMS_COUNT 0x02 +#define HDA_CODEC_STREAM_OUTPUT 0x00 +#define HDA_CODEC_STREAM_INPUT 0x01 + +#define HDA_CODEC_PARAMS_COUNT 0x14 +#define HDA_CODEC_CONN_LIST_COUNT 0x01 +#define HDA_CODEC_RESPONSE_EX_UNSOL 0x10 +#define HDA_CODEC_RESPONSE_EX_SOL 0x00 +#define HDA_CODEC_AMP_NUMSTEPS 0x4a + +#define HDA_CODEC_SUPP_STREAM_FORMATS_PCM \ + (1 << HDA_PARAM_SUPP_STREAM_FORMATS_PCM_SHIFT) + +#define HDA_CODEC_FMT_BASE_MASK (0x01 << 14) + +#define HDA_CODEC_FMT_MULT_MASK (0x07 << 11) +#define HDA_CODEC_FMT_MULT_2 (0x01 << 11) +#define HDA_CODEC_FMT_MULT_3 (0x02 << 11) +#define HDA_CODEC_FMT_MULT_4 (0x03 << 11) + +#define HDA_CODEC_FMT_DIV_MASK 0x07 +#define HDA_CODEC_FMT_DIV_SHIFT 8 + +#define HDA_CODEC_FMT_BITS_MASK (0x07 << 4) +#define HDA_CODEC_FMT_BITS_8 (0x00 << 4) +#define HDA_CODEC_FMT_BITS_16 (0x01 << 4) +#define HDA_CODEC_FMT_BITS_24 (0x03 << 4) +#define HDA_CODEC_FMT_BITS_32 (0x04 << 4) + +#define HDA_CODEC_FMT_CHAN_MASK (0x0f << 0) + +#define HDA_CODEC_AUDIO_WCAP_OUTPUT \ + (0x00 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_INPUT \ + (0x01 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_PIN \ + (0x04 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_CONN_LIST \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_CONN_LIST_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_FORMAT_OVR \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_FORMAT_OVR_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_AMP_OVR \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_AMP_OVR_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_OUT_AMP \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_OUT_AMP_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_IN_AMP \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_IN_AMP_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_STEREO \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_SHIFT) + +#define HDA_CODEC_PIN_CAP_OUTPUT \ + (1 << HDA_PARAM_PIN_CAP_OUTPUT_CAP_SHIFT) +#define HDA_CODEC_PIN_CAP_INPUT \ + (1 << HDA_PARAM_PIN_CAP_INPUT_CAP_SHIFT) +#define HDA_CODEC_PIN_CAP_PRESENCE_DETECT \ + (1 << HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP_SHIFT) + +#define HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP \ + (1 << HDA_PARAM_OUTPUT_AMP_CAP_MUTE_CAP_SHIFT) +#define HDA_CODEC_OUTPUT_AMP_CAP_STEPSIZE \ + (0x03 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) +#define HDA_CODEC_OUTPUT_AMP_CAP_NUMSTEPS \ + (HDA_CODEC_AMP_NUMSTEPS << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) +#define HDA_CODEC_OUTPUT_AMP_CAP_OFFSET \ + (HDA_CODEC_AMP_NUMSTEPS << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT) + +#define HDA_CODEC_SET_AMP_GAIN_MUTE_MUTE 0x80 +#define HDA_CODEC_SET_AMP_GAIN_MUTE_GAIN_MASK 0x7f + +#define HDA_CODEC_PIN_SENSE_PRESENCE_PLUGGED (1 << 31) +#define HDA_CODEC_PIN_WIDGET_CTRL_OUT_ENABLE \ + (1 << HDA_CMD_GET_PIN_WIDGET_CTRL_OUT_ENABLE_SHIFT) +#define HDA_CODEC_PIN_WIDGET_CTRL_IN_ENABLE \ + (1 << HDA_CMD_GET_PIN_WIDGET_CTRL_IN_ENABLE_SHIFT) + +#define HDA_CONFIG_DEFAULTCONF_COLOR_BLACK \ + (0x01 << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT) +#define HDA_CONFIG_DEFAULTCONF_COLOR_RED \ + (0x05 << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT) + +#define HDA_CODEC_BUF_SIZE HDA_FIFO_SIZE + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + + +/* + * HDA Audio Context data structures + */ + +typedef void (*transfer_func_t)(void *arg); +typedef int (*setup_func_t)(void *arg); + +struct hda_audio_ctxt { + char name[64]; + uint8_t run; + uint8_t started; + void *priv; + pthread_t tid; + pthread_mutex_t mtx; + pthread_cond_t cond; + setup_func_t do_setup; + transfer_func_t do_transfer; +}; + +/* + * HDA Audio Context module function declarations + */ + +static void *hda_audio_ctxt_thr(void *arg); +static int hda_audio_ctxt_init(struct hda_audio_ctxt *actx, const char *tname, + transfer_func_t do_transfer, setup_func_t do_setup, void *priv); +static int hda_audio_ctxt_start(struct hda_audio_ctxt *actx); +static int hda_audio_ctxt_stop(struct hda_audio_ctxt *actx); + +/* + * HDA Codec data structures + */ + +struct hda_codec_softc; + +typedef uint32_t (*verb_func_t)(struct hda_codec_softc *sc, uint16_t verb, + uint16_t payload); + +struct hda_codec_stream { + uint8_t buf[HDA_CODEC_BUF_SIZE]; + uint8_t channel; + uint16_t fmt; + uint8_t stream; + + uint8_t left_gain; + uint8_t right_gain; + uint8_t left_mute; + uint8_t right_mute; + + struct audio *aud; + struct hda_audio_ctxt actx; +}; + +struct hda_codec_softc { + uint32_t no_nodes; + uint32_t subsystem_id; + const uint32_t (*get_parameters)[HDA_CODEC_PARAMS_COUNT]; + const uint8_t (*conn_list)[HDA_CODEC_CONN_LIST_COUNT]; + const uint32_t *conf_default; + const uint8_t *pin_ctrl_default; + const verb_func_t *verb_handlers; + + struct hda_codec_inst *hci; + struct hda_codec_stream streams[HDA_CODEC_STREAMS_COUNT]; +}; + +/* + * HDA Codec module function declarations + */ +static int hda_codec_init(struct hda_codec_inst *hci, const char *play, + const char *rec, const char *opts); +static int hda_codec_reset(struct hda_codec_inst *hci); +static int hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data); +static int hda_codec_notify(struct hda_codec_inst *hci, uint8_t run, + uint8_t stream, uint8_t dir); + +static int hda_codec_parse_format(uint16_t fmt, struct audio_params *params); + +static uint32_t hda_codec_audio_output_nid(struct hda_codec_softc *sc, + uint16_t verb, uint16_t payload); +static void hda_codec_audio_output_do_transfer(void *arg); +static int hda_codec_audio_output_do_setup(void *arg); +static uint32_t hda_codec_audio_input_nid(struct hda_codec_softc *sc, + uint16_t verb, uint16_t payload); +static void hda_codec_audio_input_do_transfer(void *arg); +static int hda_codec_audio_input_do_setup(void *arg); + +static uint32_t hda_codec_audio_inout_nid(struct hda_codec_stream *st, + uint16_t verb, uint16_t payload); + +/* + * HDA Codec global data + */ + +#define HDA_CODEC_ROOT_DESC \ + [HDA_CODEC_ROOT_NID] = { \ + [HDA_PARAM_VENDOR_ID] = INTEL_VENDORID, \ + [HDA_PARAM_REVISION_ID] = 0xffff, \ + /* 1 Subnode, StartNid = 1 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00010001, \ + }, \ + +#define HDA_CODEC_FG_COMMON_DESC \ + [HDA_PARAM_FCT_GRP_TYPE] = HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO,\ + /* B8 - B32, 8.0 - 192.0kHz */ \ + [HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x1f << 16) | 0x7ff, \ + [HDA_PARAM_SUPP_STREAM_FORMATS] = HDA_CODEC_SUPP_STREAM_FORMATS_PCM,\ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_GPIO_COUNT] = 0x00, \ + +#define HDA_CODEC_FG_OUTPUT_DESC \ + [HDA_CODEC_FG_NID] = { \ + /* 2 Subnodes, StartNid = 2 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00020002, \ + HDA_CODEC_FG_COMMON_DESC \ + }, \ + +#define HDA_CODEC_FG_INPUT_DESC \ + [HDA_CODEC_FG_NID] = { \ + /* 2 Subnodes, StartNid = 4 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00040002, \ + HDA_CODEC_FG_COMMON_DESC \ + }, \ + +#define HDA_CODEC_FG_DUPLEX_DESC \ + [HDA_CODEC_FG_NID] = { \ + /* 4 Subnodes, StartNid = 2 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00020004, \ + HDA_CODEC_FG_COMMON_DESC \ + }, \ + +#define HDA_CODEC_OUTPUT_DESC \ + [HDA_CODEC_AUDIO_OUTPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_OUTPUT | \ + HDA_CODEC_AUDIO_WCAP_FORMAT_OVR | \ + HDA_CODEC_AUDIO_WCAP_AMP_OVR | \ + HDA_CODEC_AUDIO_WCAP_OUT_AMP | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + /* B16, 16.0 - 192.0kHz */ \ + [HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x02 << 16) | 0x7fc, \ + [HDA_PARAM_SUPP_STREAM_FORMATS] = \ + HDA_CODEC_SUPP_STREAM_FORMATS_PCM, \ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_CONN_LIST_LENGTH] = 0x00, \ + [HDA_PARAM_OUTPUT_AMP_CAP] = \ + HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP | \ + HDA_CODEC_OUTPUT_AMP_CAP_STEPSIZE | \ + HDA_CODEC_OUTPUT_AMP_CAP_NUMSTEPS | \ + HDA_CODEC_OUTPUT_AMP_CAP_OFFSET, \ + }, \ + [HDA_CODEC_PIN_OUTPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_PIN | \ + HDA_CODEC_AUDIO_WCAP_CONN_LIST | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + [HDA_PARAM_PIN_CAP] = HDA_CODEC_PIN_CAP_OUTPUT | \ + HDA_CODEC_PIN_CAP_PRESENCE_DETECT,\ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_CONN_LIST_LENGTH] = 0x01, \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + }, \ + +#define HDA_CODEC_INPUT_DESC \ + [HDA_CODEC_AUDIO_INPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_INPUT | \ + HDA_CODEC_AUDIO_WCAP_CONN_LIST | \ + HDA_CODEC_AUDIO_WCAP_FORMAT_OVR | \ + HDA_CODEC_AUDIO_WCAP_AMP_OVR | \ + HDA_CODEC_AUDIO_WCAP_IN_AMP | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + /* B16, 16.0 - 192.0kHz */ \ + [HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x02 << 16) | 0x7fc, \ + [HDA_PARAM_SUPP_STREAM_FORMATS] = \ + HDA_CODEC_SUPP_STREAM_FORMATS_PCM, \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_CONN_LIST_LENGTH] = 0x01, \ + [HDA_PARAM_INPUT_AMP_CAP] = \ + HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP | \ + HDA_CODEC_OUTPUT_AMP_CAP_STEPSIZE | \ + HDA_CODEC_OUTPUT_AMP_CAP_NUMSTEPS | \ + HDA_CODEC_OUTPUT_AMP_CAP_OFFSET, \ + }, \ + [HDA_CODEC_PIN_INPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_PIN | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + [HDA_PARAM_PIN_CAP] = HDA_CODEC_PIN_CAP_INPUT | \ + HDA_CODEC_PIN_CAP_PRESENCE_DETECT, \ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + }, \ + +static const uint32_t +hda_codec_output_parameters[][HDA_CODEC_PARAMS_COUNT] = { + HDA_CODEC_ROOT_DESC + HDA_CODEC_FG_OUTPUT_DESC + HDA_CODEC_OUTPUT_DESC +}; + +static const uint32_t +hda_codec_input_parameters[][HDA_CODEC_PARAMS_COUNT] = { + HDA_CODEC_ROOT_DESC + HDA_CODEC_FG_INPUT_DESC + HDA_CODEC_INPUT_DESC +}; + +static const uint32_t +hda_codec_duplex_parameters[][HDA_CODEC_PARAMS_COUNT] = { + HDA_CODEC_ROOT_DESC + HDA_CODEC_FG_DUPLEX_DESC + HDA_CODEC_OUTPUT_DESC + HDA_CODEC_INPUT_DESC +}; + +#define HDA_CODEC_NODES_COUNT (ARRAY_SIZE(hda_codec_duplex_parameters)) + +static const uint8_t +hda_codec_conn_list[HDA_CODEC_NODES_COUNT][HDA_CODEC_CONN_LIST_COUNT] = { + [HDA_CODEC_PIN_OUTPUT_NID] = {HDA_CODEC_AUDIO_OUTPUT_NID}, + [HDA_CODEC_AUDIO_INPUT_NID] = {HDA_CODEC_PIN_INPUT_NID}, +}; + +static const uint32_t +hda_codec_conf_default[HDA_CODEC_NODES_COUNT] = { + [HDA_CODEC_PIN_OUTPUT_NID] = \ + HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_JACK | + HDA_CONFIG_DEFAULTCONF_DEVICE_LINE_OUT | + HDA_CONFIG_DEFAULTCONF_COLOR_BLACK | + (0x01 << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT), + [HDA_CODEC_PIN_INPUT_NID] = HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_JACK | + HDA_CONFIG_DEFAULTCONF_DEVICE_LINE_IN | + HDA_CONFIG_DEFAULTCONF_COLOR_RED | + (0x02 << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT), +}; + +static const uint8_t +hda_codec_pin_ctrl_default[HDA_CODEC_NODES_COUNT] = { + [HDA_CODEC_PIN_OUTPUT_NID] = HDA_CODEC_PIN_WIDGET_CTRL_OUT_ENABLE, + [HDA_CODEC_PIN_INPUT_NID] = HDA_CODEC_PIN_WIDGET_CTRL_IN_ENABLE, +}; + +static const +verb_func_t hda_codec_verb_handlers[HDA_CODEC_NODES_COUNT] = { + [HDA_CODEC_AUDIO_OUTPUT_NID] = hda_codec_audio_output_nid, + [HDA_CODEC_AUDIO_INPUT_NID] = hda_codec_audio_input_nid, +}; + +/* + * HDA Codec module function definitions + */ + +static int +hda_codec_init(struct hda_codec_inst *hci, const char *play, + const char *rec, const char *opts) +{ + struct hda_codec_softc *sc = NULL; + struct hda_codec_stream *st = NULL; + int err; + + if (!(play || rec)) + return (-1); + + DPRINTF("cad: 0x%x opts: %s\n", hci->cad, opts); + + sc = calloc(1, sizeof(*sc)); + if (!sc) + return (-1); + + if (play && rec) + sc->get_parameters = hda_codec_duplex_parameters; + else { + if (play) + sc->get_parameters = hda_codec_output_parameters; + else + sc->get_parameters = hda_codec_input_parameters; + } + sc->subsystem_id = HDA_CODEC_SUBSYSTEM_ID; + sc->no_nodes = HDA_CODEC_NODES_COUNT; + sc->conn_list = hda_codec_conn_list; + sc->conf_default = hda_codec_conf_default; + sc->pin_ctrl_default = hda_codec_pin_ctrl_default; + sc->verb_handlers = hda_codec_verb_handlers; + DPRINTF("HDA Codec nodes: %d\n", sc->no_nodes); + + /* + * Initialize the Audio Output stream + */ + if (play) { + st = &sc->streams[HDA_CODEC_STREAM_OUTPUT]; + + err = hda_audio_ctxt_init(&st->actx, "hda-audio-output", + hda_codec_audio_output_do_transfer, + hda_codec_audio_output_do_setup, sc); + assert(!err); + + st->aud = audio_init(play, 1); + if (!st->aud) { + DPRINTF("Fail to init the output audio player\n"); + return (-1); + } + } + + /* + * Initialize the Audio Input stream + */ + if (rec) { + st = &sc->streams[HDA_CODEC_STREAM_INPUT]; + + err = hda_audio_ctxt_init(&st->actx, "hda-audio-input", + hda_codec_audio_input_do_transfer, + hda_codec_audio_input_do_setup, sc); + assert(!err); + + st->aud = audio_init(rec, 0); + if (!st->aud) { + DPRINTF("Fail to init the input audio player\n"); + return (-1); + } + } + + sc->hci = hci; + hci->priv = sc; + + return (0); +} + +static int +hda_codec_reset(struct hda_codec_inst *hci) +{ + struct hda_ops *hops = NULL; + struct hda_codec_softc *sc = NULL; + struct hda_codec_stream *st = NULL; + int i; + + assert(hci); + + hops = hci->hops; + assert(hops); + + sc = (struct hda_codec_softc *)hci->priv; + assert(sc); + + for (i = 0; i < HDA_CODEC_STREAMS_COUNT; i++) { + st = &sc->streams[i]; + st->left_gain = HDA_CODEC_AMP_NUMSTEPS; + st->right_gain = HDA_CODEC_AMP_NUMSTEPS; + st->left_mute = HDA_CODEC_SET_AMP_GAIN_MUTE_MUTE; + st->right_mute = HDA_CODEC_SET_AMP_GAIN_MUTE_MUTE; + } + + DPRINTF("cad: 0x%x\n", hci->cad); + + if (!hops->signal) { + DPRINTF("The controller ops does not implement \ + the signal function\n"); + return (-1); + } + + return (hops->signal(hci)); +} + +static int +hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) +{ + struct hda_codec_softc *sc = NULL; + struct hda_ops *hops = NULL; + uint8_t cad = 0, nid = 0; + uint16_t verb = 0, payload = 0; + uint32_t res = 0; + + /* 4 bits */ + cad = (cmd_data >> HDA_CMD_CAD_SHIFT) & 0x0f; + /* 8 bits */ + nid = (cmd_data >> HDA_CMD_NID_SHIFT) & 0xff; + + if ((cmd_data & 0x70000) == 0x70000) { + /* 12 bits */ + verb = (cmd_data >> HDA_CMD_VERB_12BIT_SHIFT) & 0x0fff; + /* 8 bits */ + payload = cmd_data & 0xff; + } else { + /* 4 bits */ + verb = (cmd_data >> HDA_CMD_VERB_4BIT_SHIFT) & 0x0f; + /* 16 bits */ + payload = cmd_data & 0xffff; + } + + assert(cad == hci->cad); + assert(hci); + + hops = hci->hops; + assert(hops); + + sc = (struct hda_codec_softc *)hci->priv; + assert(sc); + + assert(nid < sc->no_nodes); + + if (!hops->response) { + DPRINTF("The controller ops does not implement \ + the response function\n"); + return (-1); + } + + switch (verb) { + case HDA_CMD_VERB_GET_PARAMETER: + res = sc->get_parameters[nid][payload]; + break; + case HDA_CMD_VERB_GET_CONN_LIST_ENTRY: + res = sc->conn_list[nid][0]; + break; + case HDA_CMD_VERB_GET_PIN_WIDGET_CTRL: + res = sc->pin_ctrl_default[nid]; + break; + case HDA_CMD_VERB_GET_PIN_SENSE: + res = HDA_CODEC_PIN_SENSE_PRESENCE_PLUGGED; + break; + case HDA_CMD_VERB_GET_CONFIGURATION_DEFAULT: + res = sc->conf_default[nid]; + break; + case HDA_CMD_VERB_GET_SUBSYSTEM_ID: + res = sc->subsystem_id; + break; + default: + assert(sc->verb_handlers); + if (sc->verb_handlers[nid]) + res = sc->verb_handlers[nid](sc, verb, payload); + else + DPRINTF("Unknown VERB: 0x%x\n", verb); + break; + } + + DPRINTF("cad: 0x%x nid: 0x%x verb: 0x%x payload: 0x%x response: 0x%x\n", + cad, nid, verb, payload, res); + + return (hops->response(hci, res, HDA_CODEC_RESPONSE_EX_SOL)); +} + +static int +hda_codec_notify(struct hda_codec_inst *hci, uint8_t run, + uint8_t stream, uint8_t dir) +{ + struct hda_codec_softc *sc = NULL; + struct hda_codec_stream *st = NULL; + struct hda_audio_ctxt *actx = NULL; + int i; + int err; + + assert(hci); + assert(stream); + + sc = (struct hda_codec_softc *)hci->priv; + assert(sc); + + i = dir ? HDA_CODEC_STREAM_OUTPUT : HDA_CODEC_STREAM_INPUT; + st = &sc->streams[i]; + + DPRINTF("run: %d, stream: 0x%x, st->stream: 0x%x dir: %d\n", + run, stream, st->stream, dir); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 24 19:42:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912C815D76C3; Mon, 24 Jun 2019 19:42:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32D79851FD; Mon, 24 Jun 2019 19:42:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 218F15B34; Mon, 24 Jun 2019 19:42:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OJgXam032280; Mon, 24 Jun 2019 19:42:33 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OJgX5B032279; Mon, 24 Jun 2019 19:42:33 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201906241942.x5OJgX5B032279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 24 Jun 2019 19:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349336 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32D79851FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 19:42:33 -0000 Author: scottl Date: Mon Jun 24 19:42:32 2019 New Revision: 349336 URL: https://svnweb.freebsd.org/changeset/base/349336 Log: Add a section about the HD Audio module support Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon Jun 24 19:31:32 2019 (r349335) +++ head/usr.sbin/bhyve/bhyve.8 Mon Jun 24 19:42:32 2019 (r349336) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2018 +.Dd June 24, 2019 .Dt BHYVE 8 .Os .Sh NAME @@ -248,6 +248,8 @@ Raw framebuffer device attached to VNC server. eXtensible Host Controller Interface (xHCI) USB controller. .It Li nvme NVM Express (NVMe) controller. +.It Li hda +High Definition Audio Controller. .El .It Op Ar conf This optional parameter describes the backend for device emulations. @@ -474,6 +476,16 @@ Max number of concurrent I/O requests. Sector size (defaults to blockif sector size). .It Li ser Serial number with maximum 20 characters. +.El +.Pp +HD Audio devices: +.Bl -tag -width 10n +.It Li play +Playback device, typically +.Ar /dev/dsp0 . +.It Li rec +Recording device, typically +.Ar /dev/dsp0 . .El .El .It Fl S From owner-svn-src-all@freebsd.org Mon Jun 24 19:52:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC1EA15D7A12; Mon, 24 Jun 2019 19:52:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6305F85732; Mon, 24 Jun 2019 19:52:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35F1E5BC0; Mon, 24 Jun 2019 19:52:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OJq9ZT037376; Mon, 24 Jun 2019 19:52:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OJq9Nt037375; Mon, 24 Jun 2019 19:52:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906241952.x5OJq9Nt037375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 24 Jun 2019 19:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349337 - releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 349337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6305F85732 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 19:52:10 -0000 Author: gjb Date: Mon Jun 24 19:52:08 2019 New Revision: 349337 URL: https://svnweb.freebsd.org/changeset/base/349337 Log: Release notes documentation: - r347037, virtual machine image reduction, and note how to resize the images. - r346479, init_exec kenv(1) variable addition. - r346518, spi(8) addition. - r348482, deprecated IPSec algorithm warnings. - r347962, driver deprecations. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 24 19:42:32 2019 (r349336) +++ releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 24 19:52:08 2019 (r349337) @@ -176,6 +176,12 @@ The default &man.devd.conf.5; has been updated to prevent duplicated &man.hostapd.8; and &man.wpa.supplicant.8; startup via &man.devd.8;. + + A new variable, + init_exec, has been added to &man.kenv.1;, + allowing &man.init.8; to run an executable file after opening + the console, replacing &man.init.8; as PID + 1. @@ -253,6 +259,10 @@ The &man.patch.1; utility has been updated to exit successfully if the input patch file is zero-length. + + The &man.spi.8; utility has been added, + which is used to communicate with devices on an + SPI bus through the userland. @@ -456,6 +466,18 @@ The &man.random.4; driver has been updated to improve performance during expensive reseeding. + + The ae(4), + bm(4), cs(4), + de(4), dme(4), + ed(4), ep(4), + ex(4), fe(4), + pcn(4), sf(4), + sn(4), tl(4), + tx(4), txp(4), + vx(4), wb(4), and + xe(4) drivers have been marked as + deprecated, and are not present in &os; 13.0. @@ -616,6 +638,10 @@ sponsor="&yandex;">Support for NAT64 CLAT has been added, as defined in RFC6877. + + Warnings have been added for + IPSec algorithms deprecated in + RFC 8221. @@ -673,7 +699,14 @@ Integration Changes -   + The + default size of virtual machine disk images has been reduced + from 30GB to 3GB. The raw disk images may + be resized with &man.truncate.1;, after which the + growfs &man.rc.8; script will resize the + filesystem within the virtual machine. Other disk image + formats should be resized with the appropriate tool provided + by the hypervisor being used. From owner-svn-src-all@freebsd.org Mon Jun 24 20:18:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B479415D853A; Mon, 24 Jun 2019 20:18:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8C186B33; Mon, 24 Jun 2019 20:18:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35B976073; Mon, 24 Jun 2019 20:18:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKIo6N048558; Mon, 24 Jun 2019 20:18:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKIoCw048557; Mon, 24 Jun 2019 20:18:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242018.x5OKIoCw048557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349339 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 349339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B8C186B33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:18:51 -0000 Author: imp Date: Mon Jun 24 20:18:49 2019 New Revision: 349339 URL: https://svnweb.freebsd.org/changeset/base/349339 Log: Go ahead and completely fix the ata_params before calling the veto function. This breaks nothing that uses it in the tree since ata_params is ignored in storvsc_ada_probe_veto which is the only in-tree consumer. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Jun 24 20:08:28 2019 (r349338) +++ head/sys/cam/ata/ata_xpt.c Mon Jun 24 20:18:49 2019 (r349339) @@ -896,22 +896,14 @@ noerror: int16_t *ptr; int veto = 0; + /* + * Convert to host byte order, and fix the strings. + */ ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { *ptr = le16toh(*ptr); } - - /* - * Allow others to veto this ATA disk attachment. This - * is mainly used by VMs, whose disk controllers may - * share the disks with the simulated ATA controllers. - */ - EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); - if (veto) { - goto device_fail; - } - if (strncmp(ident_buf->model, "FX", 2) && strncmp(ident_buf->model, "NEC", 3) && strncmp(ident_buf->model, "Pioneer", 7) && @@ -926,6 +918,17 @@ noerror: ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + + /* + * Allow others to veto this ATA disk attachment. This + * is mainly used by VMs, whose disk controllers may + * share the disks with the simulated ATA controllers. + */ + EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); + if (veto) { + goto device_fail; + } + /* Device may need spin-up before IDENTIFY become valid. */ if ((ident_buf->specconf == 0x37c8 || ident_buf->specconf == 0x738c) && From owner-svn-src-all@freebsd.org Mon Jun 24 20:19:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B863C15D8580; Mon, 24 Jun 2019 20:19:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCFA86C16; Mon, 24 Jun 2019 20:19:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 378626074; Mon, 24 Jun 2019 20:18:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKIx0u048616; Mon, 24 Jun 2019 20:18:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKIwEL048611; Mon, 24 Jun 2019 20:18:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242018.x5OKIwEL048611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349340 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 349340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FCFA86C16 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:19:02 -0000 Author: imp Date: Mon Jun 24 20:18:58 2019 New Revision: 349340 URL: https://svnweb.freebsd.org/changeset/base/349340 Log: Create ata_param_fixup Create a common fixup routine to do the canonical fixup of the ata_param fixup. Call it from both the ATA and the ATA over SCSI paths. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_xpt.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Mon Jun 24 20:18:49 2019 (r349339) +++ head/sys/cam/ata/ata_all.c Mon Jun 24 20:18:58 2019 (r349340) @@ -1238,3 +1238,28 @@ ata_zac_mgmt_in(struct ccb_ataio *ataio, uint32_t retr ataio->aux = auxiliary; } } + +void +ata_param_fixup(struct ata_params *ident_buf) +{ + int16_t *ptr; + + for (ptr = (int16_t *)ident_buf; + ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { + *ptr = le16toh(*ptr); + } + if (strncmp(ident_buf->model, "FX", 2) && + strncmp(ident_buf->model, "NEC", 3) && + strncmp(ident_buf->model, "Pioneer", 7) && + strncmp(ident_buf->model, "SHARP", 5)) { + ata_bswap(ident_buf->model, sizeof(ident_buf->model)); + ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); + } + ata_btrim(ident_buf->model, sizeof(ident_buf->model)); + ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); + ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); + ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); + ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); +} Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Mon Jun 24 20:18:49 2019 (r349339) +++ head/sys/cam/ata/ata_all.h Mon Jun 24 20:18:58 2019 (r349340) @@ -135,6 +135,7 @@ void ata_read_log(struct ccb_ataio *ataio, uint32_t re uint16_t block_count, uint32_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint32_t timeout); +void ata_param_fixup(struct ata_params *ident_buf); void ata_bswap(int8_t *buf, int len); void ata_btrim(int8_t *buf, int len); void ata_bpack(int8_t *src, int8_t *dst, int len); Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Jun 24 20:18:49 2019 (r349339) +++ head/sys/cam/ata/ata_xpt.c Mon Jun 24 20:18:58 2019 (r349340) @@ -893,31 +893,13 @@ noerror: case PROBE_IDENTIFY: { struct ccb_pathinq cpi; - int16_t *ptr; int veto = 0; /* * Convert to host byte order, and fix the strings. */ ident_buf = &softc->ident_data; - for (ptr = (int16_t *)ident_buf; - ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { - *ptr = le16toh(*ptr); - } - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + ata_param_fixup(ident_buf); /* * Allow others to veto this ATA disk attachment. This Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jun 24 20:18:49 2019 (r349339) +++ head/sys/cam/scsi/scsi_da.c Mon Jun 24 20:18:58 2019 (r349340) @@ -5192,7 +5192,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * struct da_softc *softc; u_int32_t priority; int continue_probe; - int error, i; + int error; int16_t *ptr; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone_probeata\n")); @@ -5210,8 +5210,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint16_t old_rate; - for (i = 0; i < sizeof(*ata_params) / 2; i++) - ptr[i] = le16toh(ptr[i]); + ata_param_fixup(ata_params); if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM && (softc->quirks & DA_Q_NO_UNMAP) == 0) { dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1); From owner-svn-src-all@freebsd.org Mon Jun 24 20:19:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F2C715D85AB; Mon, 24 Jun 2019 20:19:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45F3886C39; Mon, 24 Jun 2019 20:19:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15ADB6075; Mon, 24 Jun 2019 20:19:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKJ3VL048673; Mon, 24 Jun 2019 20:19:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKJ3Rl048672; Mon, 24 Jun 2019 20:19:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242019.x5OKJ3Rl048672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349341 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 349341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45F3886C39 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:19:05 -0000 Author: imp Date: Mon Jun 24 20:19:03 2019 New Revision: 349341 URL: https://svnweb.freebsd.org/changeset/base/349341 Log: Use ata_param_fixup instead of a custom copy here Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jun 24 20:18:58 2019 (r349340) +++ head/sbin/camcontrol/camcontrol.c Mon Jun 24 20:19:03 2019 (r349341) @@ -2326,9 +2326,11 @@ ata_do_identify(struct cam_device *device, int retry_c } } + ident_buf = (struct ata_params *)ptr; + ata_param_fixup(ident_buf); + error = 1; for (i = 0; i < sizeof(struct ata_params) / 2; i++) { - ptr[i] = le16toh(ptr[i]); if (ptr[i] != 0) error = 0; } @@ -2345,26 +2347,6 @@ ata_do_identify(struct cam_device *device, int retry_c free(ptr); return (error); } - - ident_buf = (struct ata_params *)ptr; - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bswap(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); - ata_btrim(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - ata_bpack(ident_buf->media_serial, ident_buf->media_serial, - sizeof(ident_buf->media_serial)); *ident_bufp = ident_buf; From owner-svn-src-all@freebsd.org Mon Jun 24 20:23:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B24315D88A5; Mon, 24 Jun 2019 20:23:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F1C787254; Mon, 24 Jun 2019 20:23:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E40806212; Mon, 24 Jun 2019 20:23:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKNJ2h053553; Mon, 24 Jun 2019 20:23:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKNJJ2053552; Mon, 24 Jun 2019 20:23:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242023.x5OKNJJ2053552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349342 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 349342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F1C787254 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:23:20 -0000 Author: imp Date: Mon Jun 24 20:23:19 2019 New Revision: 349342 URL: https://svnweb.freebsd.org/changeset/base/349342 Log: Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jun 24 20:19:03 2019 (r349341) +++ head/sys/cam/scsi/scsi_da.c Mon Jun 24 20:23:19 2019 (r349342) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3613,16 +3616,8 @@ out: break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + ata_params = &periph->path->device->ident_data; - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } - scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone_probeata, @@ -5294,7 +5289,6 @@ dadone_probeata(struct cam_periph *periph, union ccb * } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /* From owner-svn-src-all@freebsd.org Mon Jun 24 20:34:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C9515D8D79; Mon, 24 Jun 2019 20:34:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FB0887A2E; Mon, 24 Jun 2019 20:34:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B64D63B6; Mon, 24 Jun 2019 20:34:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKYs8R058612; Mon, 24 Jun 2019 20:34:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKYshA058608; Mon, 24 Jun 2019 20:34:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242034.x5OKYshA058608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349343 - in head: stand/common stand/efi/loader sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: stand/common stand/efi/loader sys/kern sys/sys X-SVN-Commit-Revision: 349343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FB0887A2E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:34:56 -0000 Author: imp Date: Mon Jun 24 20:34:53 2019 New Revision: 349343 URL: https://svnweb.freebsd.org/changeset/base/349343 Log: Move to using a common kernel path between the boot / laoder bits and the kernel. Modified: head/stand/common/paths.h head/stand/efi/loader/main.c head/sys/kern/kern_mib.c head/sys/sys/boot.h Modified: head/stand/common/paths.h ============================================================================== --- head/stand/common/paths.h Mon Jun 24 20:23:19 2019 (r349342) +++ head/stand/common/paths.h Mon Jun 24 20:34:53 2019 (r349343) @@ -29,11 +29,14 @@ #ifndef _PATHS_H_ #define _PATHS_H_ +#include /* To get kernel path */ + #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" #define PATH_LOADER "/boot/loader" #define PATH_LOADER_EFI "/boot/loader.efi" #define PATH_LOADER_ZFS "/boot/zfsloader" -#define PATH_KERNEL "/boot/kernel/kernel" +#define PATH_LOADER_CONF "/boot/loader.conf" +#define PATH_DEFAULTS_LOADER_CONF "/boot/defaults/loader.conf" #endif /* _PATHS_H_ */ Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Jun 24 20:23:19 2019 (r349342) +++ head/stand/efi/loader/main.c Mon Jun 24 20:34:53 2019 (r349343) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -237,8 +238,8 @@ sanity_check_currdev(void) { struct stat st; - return (stat("/boot/defaults/loader.conf", &st) == 0 || - stat("/boot/kernel/kernel", &st) == 0); + return (stat(PATH_DEFAULTS_LOADER_CONF, &st) == 0 || + stat(PATH_KERNEL, &st) == 0); } #ifdef EFI_ZFS_BOOT Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Jun 24 20:23:19 2019 (r349342) +++ head/sys/kern/kern_mib.c Mon Jun 24 20:34:53 2019 (r349343) @@ -136,7 +136,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available"); #endif -char kernelname[MAXPATHLEN] = "/boot/kernel/kernel"; /* XXX bloat */ +char kernelname[MAXPATHLEN] = PATH_KERNEL; /* XXX bloat */ SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE, kernelname, sizeof kernelname, "Name of kernel file booted"); Modified: head/sys/sys/boot.h ============================================================================== --- head/sys/sys/boot.h Mon Jun 24 20:23:19 2019 (r349342) +++ head/sys/sys/boot.h Mon Jun 24 20:34:53 2019 (r349343) @@ -32,6 +32,8 @@ #ifndef _SYS_BOOT_H_ #define _SYS_BOOT_H_ +#define PATH_KERNEL "/boot/kernel/kernel" + int boot_env_to_howto(void); void boot_howto_to_env(int howto); int boot_parse_arg(char *v); From owner-svn-src-all@freebsd.org Mon Jun 24 20:44:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACBF15D929E for ; Mon, 24 Jun 2019 20:44:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B931788198 for ; Mon, 24 Jun 2019 20:44:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x72d.google.com with SMTP id r6so10887071qkc.0 for ; Mon, 24 Jun 2019 13:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jZI1WbodNi0p3e1efnWDEt2m2239z+KkGue9gDQ8WTM=; b=TzS+R5u/vhRC6uGTswn3TI7V8YrpldBkKlShmyHXbfB7LDSY+9yWCXBx1E8XcI624p p7gH2Pdf73PixmyHvyoUQUw/5HtF3irlT5erU7K4wFyrOFbrRKZ7aKyEBcZBc40b4YUJ lUyjwLqEALRBN7F4YUkdu+wm9eA0KIDb7JPSp6n63+Pm1phwkP4u7ECfI2+wOPutCnVH UGFUblVtKUnil1HugUwuzXpzw0Wtn7S9hKfgWiNSJGLmJebE7tka+8X2GTMHYI/sRk4J QcBJyffkLUASZ4uupt/rRpb+Ra/IRkjIh0SiW6/VpunVYENqv4YiOy77pioaXUvMnmn1 A9Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jZI1WbodNi0p3e1efnWDEt2m2239z+KkGue9gDQ8WTM=; b=SOiodjONLUW+MlGVma7nvDGRrgNDdfTujJCgVyn+pOaDXJ6R+KKMRiSdUuSYEkORP2 ZoLjxWECtk1lN7MSJWAAT2aRzXWfEvCfHrTsz775w/v1YOnf4AHpadbPj0o0l+Gi13yW 54FVKrHWmPUCGGovibRqQAxmTCmWuOxqWTq2m2oZNVwS2mLouDLBkjB6gZVkgZeV75UO gbIgZqHlIEPF26n8tyta3NadmGBUwmSNIfbLZr0msXbY8ukH5V9u0PYC8IF4JT8B4c0p 2Kqb0GvZXgr0KRr28oqi78/NOTDe1IkuG07WyTUWqiy5ENVKS0wcnMW7mlDOnl5yN3q7 /TQg== X-Gm-Message-State: APjAAAWlVnVBhDv4I3o7Vdl3aRfdgOQJL0kwMPNQYnR7qunALvzN+jrG YcD6DUdZxLbYcwF8ALz4rW2NFQ== X-Google-Smtp-Source: APXvYqz548AxRsjfr7kk+XRX4491xfYtQa89F8KFjhqPzU8jNvWzBUodbaevbTOJtHB7nee3CiXW+A== X-Received: by 2002:a37:9144:: with SMTP id t65mr19580033qkd.367.1561409060942; Mon, 24 Jun 2019 13:44:20 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id c23sm5692319qke.111.2019.06.24.13.44.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 13:44:20 -0700 (PDT) Date: Mon, 24 Jun 2019 16:44:19 -0400 From: Shawn Webb To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349343 - in head: stand/common stand/efi/loader sys/kern sys/sys Message-ID: <20190624204419.lawtrrobvi4fs2ft@mutt-hbsd> References: <201906242034.x5OKYshA058608@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="okxixvphn4tlnukw" Content-Disposition: inline In-Reply-To: <201906242034.x5OKYshA058608@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: B931788198 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:44:22 -0000 --okxixvphn4tlnukw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 24, 2019 at 08:34:54PM +0000, Warner Losh wrote: > Author: imp > Date: Mon Jun 24 20:34:53 2019 > New Revision: 349343 > URL: https://svnweb.freebsd.org/changeset/base/349343 >=20 > Log: > Move to using a common kernel path between the boot / laoder bits and > the kernel. I wonder if there'd be any advantage to wrapping these macros in #ifdef and providing the plumbing such that users could overwrite these defaults in their kernel configuration files. I'm just thinking out loud. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --okxixvphn4tlnukw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl0RNh4ACgkQ/y5nonf4 4foiEQ//U6cGPjt+z7g+fQMuNQbwgnzjOvBeXQrwomBPFXPubgd0xWvRw7fqmd6J mkTQCVNL69gYrbpJS46mrWrfAGHWHBRAMTPzAPvgfcccFYUpbUFkPGXwkZQ9e7Nb VH0suIdwoxtKo9MQ1Kpm/PVheQqNMnRu/pBqGxD4QCkjx4JblS8nCY64TbDgdYUq gF3mxxk39yfBMbyeq6TXdAFC8DWUXsIGc7YeNzX88biTeJqIfxZK2X4izcoFHdq6 J6/krXlFB+IkxFifKIbcWoZu0vCSqotJmGVaHoJDrF4e7aDTUZtiWxA9459sRLZ3 +XZwVRrBI7I9uAE1J+Kz7Z772ifeVFzq/AVbJV6oTeg3jI4HR8ERVjU56oAxWWps GdvNGBgW60ikwvaGpyk+xo6OtUrD46v7bSVIMxibFQN3Sqm50BI80IMOb+fPwKPe vOOJGjWkk+dVZzNzk5wjriaiSb/2fLIepvMY4DOfLoyoHjxuoBel37rDB7s+kZdT gsLclG5Nsgpy3H4tTYnmT17Xn56pwgiNeJvHhxWTjwZMwwbsHsKge+cFDQ3d52m3 GBXzOswuV8k+5UbtrUl6HRMOBvkTicqhtffU4PDmPxSrUl+4OrRWbCsVk4huyAac 6iNgRB5FO/BOUuFBJHYQ2owQ10g23KZdlE1uViRuw9RNVDEfNtM= =cPmM -----END PGP SIGNATURE----- --okxixvphn4tlnukw-- From owner-svn-src-all@freebsd.org Mon Jun 24 20:52:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F4815D9543; Mon, 24 Jun 2019 20:52:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADA32886A8; Mon, 24 Jun 2019 20:52:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A30FC672E; Mon, 24 Jun 2019 20:52:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKqLaH069127; Mon, 24 Jun 2019 20:52:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKqLRW069126; Mon, 24 Jun 2019 20:52:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242052.x5OKqLRW069126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349344 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADA32886A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:52:22 -0000 Author: imp Date: Mon Jun 24 20:52:21 2019 New Revision: 349344 URL: https://svnweb.freebsd.org/changeset/base/349344 Log: Add missing include of sys/boot.h This change was dropped out in a rebase and I didn't catch that before I committed. Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Jun 24 20:34:53 2019 (r349343) +++ head/sys/kern/kern_mib.c Mon Jun 24 20:52:21 2019 (r349344) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "opt_config.h" #include +#include #include #include #include From owner-svn-src-all@freebsd.org Mon Jun 24 21:00:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31D1B15D969B; Mon, 24 Jun 2019 21:00:29 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB4DB88969; Mon, 24 Jun 2019 21:00:28 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A62B86753; Mon, 24 Jun 2019 21:00:28 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OL0S4G069553; Mon, 24 Jun 2019 21:00:28 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OL0SCN069551; Mon, 24 Jun 2019 21:00:28 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201906242100.x5OL0SCN069551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 24 Jun 2019 21:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349345 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB4DB88969 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 21:00:29 -0000 Author: jchandra Date: Mon Jun 24 21:00:28 2019 New Revision: 349345 URL: https://svnweb.freebsd.org/changeset/base/349345 Log: arm64 gic: Drop unused GICV3_IVAR_REDIST_VADDR Now that GICV3_IVAR_REDIST is available, GICV3_IVAR_REDIST_VADDR is unused and can be removed. Drop the define and add a comment. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D20454 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_var.h Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Mon Jun 24 20:52:21 2019 (r349344) +++ head/sys/arm64/arm64/gic_v3.c Mon Jun 24 21:00:28 2019 (r349345) @@ -390,10 +390,6 @@ gic_v3_read_ivar(device_t dev, device_t child, int whi case GICV3_IVAR_NIRQS: *result = (NIRQ - sc->gic_nirqs) / sc->gic_nchildren; return (0); - case GICV3_IVAR_REDIST_VADDR: - *result = (uintptr_t)rman_get_virtual( - &sc->gic_redists.pcpu[PCPU_GET(cpuid)]->res); - return (0); case GICV3_IVAR_REDIST: *result = (uintptr_t)sc->gic_redists.pcpu[PCPU_GET(cpuid)]; return (0); Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Mon Jun 24 20:52:21 2019 (r349344) +++ head/sys/arm64/arm64/gic_v3_var.h Mon Jun 24 21:00:28 2019 (r349345) @@ -94,11 +94,10 @@ MALLOC_DECLARE(M_GIC_V3); /* ivars */ #define GICV3_IVAR_NIRQS 1000 -#define GICV3_IVAR_REDIST_VADDR 1001 +/* 1001 was GICV3_IVAR_REDIST_VADDR */ #define GICV3_IVAR_REDIST 1002 __BUS_ACCESSOR(gicv3, nirqs, GICV3, NIRQS, u_int); -__BUS_ACCESSOR(gicv3, redist_vaddr, GICV3, REDIST_VADDR, void *); __BUS_ACCESSOR(gicv3, redist, GICV3, REDIST, void *); /* Device methods */ From owner-svn-src-all@freebsd.org Mon Jun 24 21:05:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B22BD15D9975; Mon, 24 Jun 2019 21:05:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A66488FC5; Mon, 24 Jun 2019 21:05:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 003AF68FD; Mon, 24 Jun 2019 21:05:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OL5EYI074615; Mon, 24 Jun 2019 21:05:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OL5Erv074614; Mon, 24 Jun 2019 21:05:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242105.x5OL5Erv074614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 21:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349346 - head/usr.sbin/kbdcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/kbdcontrol X-SVN-Commit-Revision: 349346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A66488FC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 21:05:15 -0000 Author: imp Date: Mon Jun 24 21:05:14 2019 New Revision: 349346 URL: https://svnweb.freebsd.org/changeset/base/349346 Log: kbdcontrol -h prints two error messages. We loop through getopt(3) twice. Once for -P args and once for the rest. Catch '?' and print usage when that happens. Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Mon Jun 24 21:00:28 2019 (r349345) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Mon Jun 24 21:05:14 2019 (r349346) @@ -1220,9 +1220,12 @@ main(int argc, char **argv) int opt; /* Collect any -P arguments, regardless of where they appear. */ - while ((opt = getopt(argc, argv, optstring)) != -1) + while ((opt = getopt(argc, argv, optstring)) != -1) { if (opt == 'P') add_keymap_path(optarg); + if (opt == '?') + usage(); + } optind = optreset = 1; while ((opt = getopt(argc, argv, optstring)) != -1) From owner-svn-src-all@freebsd.org Mon Jun 24 21:13:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B06BC15D9BA0; Mon, 24 Jun 2019 21:13:46 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2139B8944F; Mon, 24 Jun 2019 21:13:46 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F02FA6AAA; Mon, 24 Jun 2019 21:13:45 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OLDjQJ079776; Mon, 24 Jun 2019 21:13:45 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OLDjTh079775; Mon, 24 Jun 2019 21:13:45 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201906242113.x5OLDjTh079775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 24 Jun 2019 21:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349347 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2139B8944F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 21:13:46 -0000 Author: jchandra Date: Mon Jun 24 21:13:45 2019 New Revision: 349347 URL: https://svnweb.freebsd.org/changeset/base/349347 Log: arm64 gicv3_its: enable all ITS blocks for a CPU We now support multiple ITS blocks raising interrupts to a CPU. Add all available CPUs to the ITS when no NUMA information is available. This reverts the check added in r340602, at that tim we did not suppport multiple ITS blocks for a CPU. Differential Revision: https://reviews.freebsd.org/D20417 Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Jun 24 21:05:14 2019 (r349346) +++ head/sys/arm64/arm64/gicv3_its.c Mon Jun 24 21:13:45 2019 (r349347) @@ -747,9 +747,7 @@ gicv3_its_attach(device_t dev) if (domain < MAXMEMDOM) CPU_COPY(&cpuset_domain[domain], &sc->sc_cpus); } else { - /* XXX : cannot handle more than one ITS per cpu */ - if (device_get_unit(dev) == 0) - CPU_COPY(&all_cpus, &sc->sc_cpus); + CPU_COPY(&all_cpus, &sc->sc_cpus); } /* Allocate the command circular buffer */ From owner-svn-src-all@freebsd.org Mon Jun 24 21:24:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4E0A15D9EB5; Mon, 24 Jun 2019 21:24:56 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4288089A29; Mon, 24 Jun 2019 21:24:56 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0291C6C55; Mon, 24 Jun 2019 21:24:56 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OLOtO6085320; Mon, 24 Jun 2019 21:24:55 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OLOtUl085319; Mon, 24 Jun 2019 21:24:55 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201906242124.x5OLOtUl085319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 24 Jun 2019 21:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349348 - head/sys/arm64/acpica X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/acpica X-SVN-Commit-Revision: 349348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4288089A29 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 21:24:57 -0000 Author: jchandra Date: Mon Jun 24 21:24:55 2019 New Revision: 349348 URL: https://svnweb.freebsd.org/changeset/base/349348 Log: arm64 acpi_iort: add some error handling Print warnings for some bad kernel configurations (like NUMA disabled with multiple domains). Check and report some firmware errors (like incorrect proximity domain entries). Differential Revision: https://reviews.freebsd.org/D20416 Modified: head/sys/arm64/acpica/acpi_iort.c Modified: head/sys/arm64/acpica/acpi_iort.c ============================================================================== --- head/sys/arm64/acpica/acpi_iort.c Mon Jun 24 21:13:45 2019 (r349347) +++ head/sys/arm64/acpica/acpi_iort.c Mon Jun 24 21:24:55 2019 (r349348) @@ -370,19 +370,44 @@ srat_resolve_its_pxm(ACPI_SUBTABLE_HEADER *entry, void ACPI_SRAT_GIC_ITS_AFFINITY *gicits; struct iort_node *its_node; struct iort_its_entry *its_entry; - int i, matches; + int *map_counts; + int i, matches, dom; if (entry->Type != ACPI_SRAT_TYPE_GIC_ITS_AFFINITY) return; matches = 0; + map_counts = arg; gicits = (ACPI_SRAT_GIC_ITS_AFFINITY *)entry; + dom = acpi_map_pxm_to_vm_domainid(gicits->ProximityDomain); + + /* + * Catch firmware and config errors. map_counts keeps a + * count of ProximityDomain values mapping to a domain ID + */ +#if MAXMEMDOM > 1 + if (dom == -1) + printf("Firmware Error: Proximity Domain %d could not be" + " mapped for GIC ITS ID %d!\n", + gicits->ProximityDomain, gicits->ItsId); +#endif + /* use dom + 1 as index to handle the case where dom == -1 */ + i = ++map_counts[dom + 1]; + if (i > 1) { +#ifdef NUMA + if (dom != -1) + printf("ERROR: Multiple Proximity Domains map to the" + " same NUMA domain %d!\n", dom); +#else + printf("WARNING: multiple Proximity Domains in SRAT but NUMA" + " NOT enabled!\n"); +#endif + } TAILQ_FOREACH(its_node, &its_groups, next) { its_entry = its_node->entries.its; for (i = 0; i < its_node->nentries; i++, its_entry++) { if (its_entry->its_id == gicits->ItsId) { - its_entry->pxm = acpi_map_pxm_to_vm_domainid( - gicits->ProximityDomain); + its_entry->pxm = dom; matches++; } } @@ -401,6 +426,7 @@ iort_post_process_its(void) ACPI_TABLE_MADT *madt; ACPI_TABLE_SRAT *srat; vm_paddr_t madt_pa, srat_pa; + int map_counts[MAXMEMDOM + 1] = { 0 }; /* Check ITS block in MADT */ madt_pa = acpi_find_table(ACPI_SIG_MADT); @@ -417,7 +443,7 @@ iort_post_process_its(void) srat = acpi_map_table(srat_pa, ACPI_SIG_SRAT); KASSERT(srat != NULL, ("can't map SRAT!")); acpi_walk_subtables(srat + 1, (char *)srat + srat->Header.Length, - srat_resolve_its_pxm, NULL); + srat_resolve_its_pxm, map_counts); acpi_unmap_table(srat); } return (0); From owner-svn-src-all@freebsd.org Mon Jun 24 21:25:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E16C15D9F24 for ; Mon, 24 Jun 2019 21:25:50 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4452289BB3; Mon, 24 Jun 2019 21:25:48 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x5OLPeTK072090 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 24 Jun 2019 14:25:40 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x5OLPeeN072089; Mon, 24 Jun 2019 14:25:40 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 24 Jun 2019 14:25:40 -0700 From: Gleb Smirnoff To: Gordon Tetlow Cc: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r349198 - releng/12.0/sys/net Message-ID: <20190624212540.GQ67242@FreeBSD.org> References: <201906191641.x5JGfIsY027804@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906191641.x5JGfIsY027804@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 4452289BB3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 21:25:50 -0000 Hi, On Wed, Jun 19, 2019 at 04:41:18PM +0000, Gordon Tetlow wrote: G> Author: gordon G> Date: Wed Jun 19 16:41:18 2019 G> New Revision: 349198 G> URL: https://svnweb.freebsd.org/changeset/base/349198 G> G> Log: G> Fix incorrect locking in networking stack. G> G> Approved by: so G> Security: FreeBSD-EN-19:11.net do I understand correct that problem isn't applicable to head, since it was accidentially covered in r340413? Either fix for stable or r340413 aren't a good looking code. My general comment about if_addr_rlock/if_maddr_lock is that they are my most hated functions, since they are one of biggest obstacles on making NIC drivers less aware of what's inside struct ifnet. In my non-finished projects/ifnet branch, there is a different KPI to achieve traversal of address lists: /* * Traversing through interface address lists. */ typedef void ifaddr_cb_t(void *, struct sockaddr *, struct sockaddr *, struct sockaddr *); typedef void ifmaddr_cb_t(void *, struct sockaddr *); void if_foreach_addr(if_t, ifaddr_cb_t, void *); void if_foreach_maddr(if_t, ifmaddr_cb_t, void *); The functions are internal to if.c and do whatever locking is approprite in our kernel. Mutexes before, and epoch now. And in the driver side this would look like this: static void bge_hash_maddr(void *arg, struct sockaddr *maddr) { struct sockaddr_dl *sdl = (struct sockaddr_dl *)maddr; uint32_t *hashes = arg; int h; if (sdl->sdl_family != AF_LINK) return; h = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN) & 0x7F; hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F); } static void bge_setmulti(struct bge_softc *sc) { uint32_t hashes[4] = { 0, 0, 0, 0 }; int i; BGE_LOCK_ASSERT(sc); if (sc->bge_if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { for (i = 0; i < 4; i++) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0xFFFFFFFF); return; } /* First, zot all the existing filters. */ for (i = 0; i < 4; i++) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0); if_foreach_maddr(sc->bge_ifp, bge_hash_maddr, hashes); for (i = 0; i < 4; i++) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), hashes[i]); } IMHO, much cleaner and independent of struct ifnet than if_maddr_lock() + traversal, and better than if_multiaddr_count + if_multiaddr_array since doesn't require allocating memory. I'd say that there have been enough pain around interface address traversal, so I would like to go forward with the following plan: 1) Introduce if_foreach_addr/if_foreach_maddr 2) Convert all drivers to this KPI. 3) Declare if_addr_lock/if_maddr_lock and if_multiaddr_count+if_multiaddr_array gone in 14.0 4) Indeed make them gone in head once stable/13 is forked. Any objections? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Mon Jun 24 22:23:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01E2315DB0E1 for ; Mon, 24 Jun 2019 22:23:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD7C8BB1A; Mon, 24 Jun 2019 22:23:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd33.google.com with SMTP id u19so248489ior.9; Mon, 24 Jun 2019 15:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Mk3PPn/mQ44iK6OMfDFPSOGw/NsiV7I/wJJ7hoAZFNI=; b=RFGh4Idtc2wcFnCmZAvttZ0at+Qoo98B+evtVC5zfm7O92TFyLnjgARLT5os5Fm7wo oSglGzkFgjnL22Kwn3vs6vjUvX22xYLsnhXfcZrZUDR/CEVK+RFQZZCP63J/ZiLoyEZU tzCqQfjWgzxVJbGpnRCJNbCUv4jRO/1VxZCEQLBT9t+1mAdFuR7fqy90bQihV2o4wMNs yW+m6Ix4BABJfVESbJnDqDn7Iga9In+8WqICIxEb/hEHSnA5YJGHPvmoqo6m4KREvTms Rn06XswomlukGnc3dsTySkGDx5i7JywZwp12i6uQP6Z/MuZjDLmRaYZpGNoTJl9lSYXo 7ctg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Mk3PPn/mQ44iK6OMfDFPSOGw/NsiV7I/wJJ7hoAZFNI=; b=QDwSUmHg/w7wRRKuddBeIVEOnMhMvQ7DVhqI7vuMcspNzcf7gxYIDDqbnO1FM9UmVU Y155yeSLbj/bGyppPPx8+Qlj7fRIlXAi1vJfghK9ICIfvz0znhEvKDkOVMNZg0ll2Y6o GjkdD/iteTRDNa18fW6Sjn1SoksvN36RGfynG7OnVlbl1KmoXDIsB/Fh8ly9ykvTBxTO 8pgGbQr8Pbn36qzn2DsPANi7mOc0UErCGzPVp46k2dzVa/d5mYRsKuNzkdxpqKcgO4bQ eiXSufgWOuaAW8W0G4zN4zHnKZtmoGLd+inqGlihYkhePqHLs9Hp8Q0t8tBujSbjFBd3 LEjA== X-Gm-Message-State: APjAAAVtLGflvzIBSd/5SNFY4z/i3XGuwEjkmwnV+vvsuJGhXSScD7fy btRLsyz9uMS4ulRAa2ixKjlmZK4EOL0= X-Google-Smtp-Source: APXvYqxhN6zNg5DlX6b/BufPyTvByYS0uSijiJ5B3c1muhIOR+XJdV03nBikFG/YKLeHG1/5OOBF8Q== X-Received: by 2002:a5d:80c3:: with SMTP id h3mr36625355ior.167.1561415025291; Mon, 24 Jun 2019 15:23:45 -0700 (PDT) Received: from raichu (toroon0560w-lp140-05-70-29-85-38.dsl.bell.ca. [70.29.85.38]) by smtp.gmail.com with ESMTPSA id p63sm31989235iof.45.2019.06.24.15.23.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:23:43 -0700 (PDT) Sender: Mark Johnston Date: Mon, 24 Jun 2019 18:23:41 -0400 From: Mark Johnston To: Gleb Smirnoff Cc: Gordon Tetlow , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r349198 - releng/12.0/sys/net Message-ID: <20190624222341.GB37940@raichu> References: <201906191641.x5JGfIsY027804@repo.freebsd.org> <20190624212540.GQ67242@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190624212540.GQ67242@FreeBSD.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Rspamd-Queue-Id: 8DD7C8BB1A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 22:23:47 -0000 On Mon, Jun 24, 2019 at 02:25:40PM -0700, Gleb Smirnoff wrote: > Hi, > > On Wed, Jun 19, 2019 at 04:41:18PM +0000, Gordon Tetlow wrote: > G> Author: gordon > G> Date: Wed Jun 19 16:41:18 2019 > G> New Revision: 349198 > G> URL: https://svnweb.freebsd.org/changeset/base/349198 > G> > G> Log: > G> Fix incorrect locking in networking stack. > G> > G> Approved by: so > G> Security: FreeBSD-EN-19:11.net > > do I understand correct that problem isn't applicable to head, since > it was accidentially covered in r340413? Either fix for stable or > r340413 aren't a good looking code. I don't know about "accidentally," but yes. The problem was that r340413 could not easily be MFCed. See D17996 and D19764. From owner-svn-src-all@freebsd.org Mon Jun 24 23:18:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89EE215DBBD6; Mon, 24 Jun 2019 23:18:44 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0578CF38; Mon, 24 Jun 2019 23:18:44 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9837EBB; Mon, 24 Jun 2019 23:18:43 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5ONIh0G043529; Mon, 24 Jun 2019 23:18:43 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ONIhlS043523; Mon, 24 Jun 2019 23:18:43 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906242318.x5ONIhlS043523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 24 Jun 2019 23:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa X-SVN-Commit-Revision: 349349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B0578CF38 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 23:18:45 -0000 Author: bcran Date: Mon Jun 24 23:18:42 2019 New Revision: 349349 URL: https://svnweb.freebsd.org/changeset/base/349349 Log: loader: add HTTP support using UEFI Add support for an HTTP "network filesystem" using the UEFI's HTTP stack. This also supports HTTPS, but TianoCore EDK2 implementations currently crash while fetching loader files. Only IPv4 is supported at the moment. IPv6 support is planned for a follow-up changeset. Note that we include some headers from the TianoCore EDK II project in stand/efi/include/Protocol verbatim, including links to the license instead of including the full text because that's their preferred way of communicating it, despite not being normal FreeBSD project practice. Submitted by: scottph Reviewed by: imp, bcran Differential Revision: https://reviews.freebsd.org/D20643 Added: head/stand/efi/include/Protocol/Http.h (contents, props changed) head/stand/efi/include/Protocol/Ip4Config2.h (contents, props changed) head/stand/efi/include/Protocol/ServiceBinding.h (contents, props changed) head/stand/efi/libefi/efihttp.c (contents, props changed) Modified: head/stand/efi/include/efidevp.h head/stand/efi/include/efilib.h head/stand/efi/libefi/Makefile head/stand/efi/loader/conf.c head/stand/libsa/stand.h Added: head/stand/efi/include/Protocol/Http.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/Http.h Mon Jun 24 23:18:42 2019 (r349349) @@ -0,0 +1,523 @@ +/* $FreeBSD$ */ +/** @file + This file defines the EFI HTTP Protocol interface. It is split into + the following two main sections: + HTTP Service Binding Protocol (HTTPSB) + HTTP Protocol (HTTP) + + Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + @par Revision Reference: + This Protocol is introduced in UEFI Specification 2.5 + +**/ + +#ifndef __EFI_HTTP_PROTOCOL_H__ +#define __EFI_HTTP_PROTOCOL_H__ + +#define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID \ + { \ + 0xbdc8e6af, 0xd9bc, 0x4379, {0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c } \ + } + +#define EFI_HTTP_PROTOCOL_GUID \ + { \ + 0x7a59b29b, 0x910b, 0x4171, {0x82, 0x42, 0xa8, 0x5a, 0x0d, 0xf2, 0x5b, 0x5b } \ + } + +typedef struct _EFI_HTTP_PROTOCOL EFI_HTTP_PROTOCOL; + +/// +/// EFI_HTTP_VERSION +/// +typedef enum { + HttpVersion10, + HttpVersion11, + HttpVersionUnsupported +} EFI_HTTP_VERSION; + +/// +/// EFI_HTTP_METHOD +/// +typedef enum { + HttpMethodGet, + HttpMethodPost, + HttpMethodPatch, + HttpMethodOptions, + HttpMethodConnect, + HttpMethodHead, + HttpMethodPut, + HttpMethodDelete, + HttpMethodTrace, + HttpMethodMax +} EFI_HTTP_METHOD; + +/// +/// EFI_HTTP_STATUS_CODE +/// +typedef enum { + HTTP_STATUS_UNSUPPORTED_STATUS = 0, + HTTP_STATUS_100_CONTINUE, + HTTP_STATUS_101_SWITCHING_PROTOCOLS, + HTTP_STATUS_200_OK, + HTTP_STATUS_201_CREATED, + HTTP_STATUS_202_ACCEPTED, + HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION, + HTTP_STATUS_204_NO_CONTENT, + HTTP_STATUS_205_RESET_CONTENT, + HTTP_STATUS_206_PARTIAL_CONTENT, + HTTP_STATUS_300_MULTIPLE_CHOICES, + HTTP_STATUS_301_MOVED_PERMANENTLY, + HTTP_STATUS_302_FOUND, + HTTP_STATUS_303_SEE_OTHER, + HTTP_STATUS_304_NOT_MODIFIED, + HTTP_STATUS_305_USE_PROXY, + HTTP_STATUS_307_TEMPORARY_REDIRECT, + HTTP_STATUS_400_BAD_REQUEST, + HTTP_STATUS_401_UNAUTHORIZED, + HTTP_STATUS_402_PAYMENT_REQUIRED, + HTTP_STATUS_403_FORBIDDEN, + HTTP_STATUS_404_NOT_FOUND, + HTTP_STATUS_405_METHOD_NOT_ALLOWED, + HTTP_STATUS_406_NOT_ACCEPTABLE, + HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED, + HTTP_STATUS_408_REQUEST_TIME_OUT, + HTTP_STATUS_409_CONFLICT, + HTTP_STATUS_410_GONE, + HTTP_STATUS_411_LENGTH_REQUIRED, + HTTP_STATUS_412_PRECONDITION_FAILED, + HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE, + HTTP_STATUS_414_REQUEST_URI_TOO_LARGE, + HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE, + HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED, + HTTP_STATUS_417_EXPECTATION_FAILED, + HTTP_STATUS_500_INTERNAL_SERVER_ERROR, + HTTP_STATUS_501_NOT_IMPLEMENTED, + HTTP_STATUS_502_BAD_GATEWAY, + HTTP_STATUS_503_SERVICE_UNAVAILABLE, + HTTP_STATUS_504_GATEWAY_TIME_OUT, + HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED, + HTTP_STATUS_308_PERMANENT_REDIRECT +} EFI_HTTP_STATUS_CODE; + +/// +/// EFI_HTTPv4_ACCESS_POINT +/// +typedef struct { + /// + /// Set to TRUE to instruct the EFI HTTP instance to use the default address + /// information in every TCP connection made by this instance. In addition, when set + /// to TRUE, LocalAddress and LocalSubnet are ignored. + /// + BOOLEAN UseDefaultAddress; + /// + /// If UseDefaultAddress is set to FALSE, this defines the local IP address to be + /// used in every TCP connection opened by this instance. + /// + EFI_IPv4_ADDRESS LocalAddress; + /// + /// If UseDefaultAddress is set to FALSE, this defines the local subnet to be used + /// in every TCP connection opened by this instance. + /// + EFI_IPv4_ADDRESS LocalSubnet; + /// + /// This defines the local port to be used in + /// every TCP connection opened by this instance. + /// + UINT16 LocalPort; +} EFI_HTTPv4_ACCESS_POINT; + +/// +/// EFI_HTTPv6_ACCESS_POINT +/// +typedef struct { + /// + /// Local IP address to be used in every TCP connection opened by this instance. + /// + EFI_IPv6_ADDRESS LocalAddress; + /// + /// Local port to be used in every TCP connection opened by this instance. + /// + UINT16 LocalPort; +} EFI_HTTPv6_ACCESS_POINT; + +/// +/// EFI_HTTP_CONFIG_DATA_ACCESS_POINT +/// + + +typedef struct { + /// + /// HTTP version that this instance will support. + /// + EFI_HTTP_VERSION HttpVersion; + /// + /// Time out (in milliseconds) when blocking for requests. + /// + UINT32 TimeOutMillisec; + /// + /// Defines behavior of EFI DNS and TCP protocols consumed by this instance. If + /// FALSE, this instance will use EFI_DNS4_PROTOCOL and EFI_TCP4_PROTOCOL. If TRUE, + /// this instance will use EFI_DNS6_PROTOCOL and EFI_TCP6_PROTOCOL. + /// + BOOLEAN LocalAddressIsIPv6; + + union { + /// + /// When LocalAddressIsIPv6 is FALSE, this points to the local address, subnet, and + /// port used by the underlying TCP protocol. + /// + EFI_HTTPv4_ACCESS_POINT *IPv4Node; + /// + /// When LocalAddressIsIPv6 is TRUE, this points to the local IPv6 address and port + /// used by the underlying TCP protocol. + /// + EFI_HTTPv6_ACCESS_POINT *IPv6Node; + } AccessPoint; +} EFI_HTTP_CONFIG_DATA; + +/// +/// EFI_HTTP_REQUEST_DATA +/// +typedef struct { + /// + /// The HTTP method (e.g. GET, POST) for this HTTP Request. + /// + EFI_HTTP_METHOD Method; + /// + /// The URI of a remote host. From the information in this field, the HTTP instance + /// will be able to determine whether to use HTTP or HTTPS and will also be able to + /// determine the port number to use. If no port number is specified, port 80 (HTTP) + /// is assumed. See RFC 3986 for more details on URI syntax. + /// + CHAR16 *Url; +} EFI_HTTP_REQUEST_DATA; + +/// +/// EFI_HTTP_RESPONSE_DATA +/// +typedef struct { + /// + /// Response status code returned by the remote host. + /// + EFI_HTTP_STATUS_CODE StatusCode; +} EFI_HTTP_RESPONSE_DATA; + +/// +/// EFI_HTTP_HEADER +/// +typedef struct { + /// + /// Null terminated string which describes a field name. See RFC 2616 Section 14 for + /// detailed information about field names. + /// + CHAR8 *FieldName; + /// + /// Null terminated string which describes the corresponding field value. See RFC 2616 + /// Section 14 for detailed information about field values. + /// + CHAR8 *FieldValue; +} EFI_HTTP_HEADER; + +/// +/// EFI_HTTP_MESSAGE +/// +typedef struct { + /// + /// HTTP message data. + /// + union { + /// + /// When the token is used to send a HTTP request, Request is a pointer to storage that + /// contains such data as URL and HTTP method. + /// + EFI_HTTP_REQUEST_DATA *Request; + /// + /// When used to await a response, Response points to storage containing HTTP response + /// status code. + /// + EFI_HTTP_RESPONSE_DATA *Response; + } Data; + /// + /// Number of HTTP header structures in Headers list. On request, this count is + /// provided by the caller. On response, this count is provided by the HTTP driver. + /// + UINTN HeaderCount; + /// + /// Array containing list of HTTP headers. On request, this array is populated by the + /// caller. On response, this array is allocated and populated by the HTTP driver. It + /// is the responsibility of the caller to free this memory on both request and + /// response. + /// + EFI_HTTP_HEADER *Headers; + /// + /// Length in bytes of the HTTP body. This can be zero depending on the HttpMethod type. + /// + UINTN BodyLength; + /// + /// Body associated with the HTTP request or response. This can be NULL depending on + /// the HttpMethod type. + /// + VOID *Body; +} EFI_HTTP_MESSAGE; + + +/// +/// EFI_HTTP_TOKEN +/// +typedef struct { + /// + /// This Event will be signaled after the Status field is updated by the EFI HTTP + /// Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL. The Task Priority + /// Level (TPL) of Event must be lower than or equal to TPL_CALLBACK. + /// + EFI_EVENT Event; + /// + /// Status will be set to one of the following value if the HTTP request is + /// successfully sent or if an unexpected error occurs: + /// EFI_SUCCESS: The HTTP request was successfully sent to the remote host. + /// EFI_HTTP_ERROR: The response message was successfully received but contains a + /// HTTP error. The response status code is returned in token. + /// EFI_ABORTED: The HTTP request was cancelled by the caller and removed from + /// the transmit queue. + /// EFI_TIMEOUT: The HTTP request timed out before reaching the remote host. + /// EFI_DEVICE_ERROR: An unexpected system or network error occurred. + /// + EFI_STATUS Status; + /// + /// Pointer to storage containing HTTP message data. + /// + EFI_HTTP_MESSAGE *Message; +} EFI_HTTP_TOKEN; + +/** + Returns the operational parameters for the current HTTP child instance. + + The GetModeData() function is used to read the current mode data (operational + parameters) for this HTTP protocol instance. + + @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. + @param[out] HttpConfigData Point to buffer for operational parameters of this + HTTP instance. It is the responsibility of the caller + to allocate the memory for HttpConfigData and + HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact, + it is recommended to allocate sufficient memory to record + IPv6Node since it is big enough for all possibilities. + + @retval EFI_SUCCESS Operation succeeded. + @retval EFI_INVALID_PARAMETER This is NULL. + HttpConfigData is NULL. + HttpConfigData->AccessPoint.IPv4Node or + HttpConfigData->AccessPoint.IPv6Node is NULL. + @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HTTP_GET_MODE_DATA)( + IN EFI_HTTP_PROTOCOL *This, + OUT EFI_HTTP_CONFIG_DATA *HttpConfigData + ); + +/** + Initialize or brutally reset the operational parameters for this EFI HTTP instance. + + The Configure() function does the following: + When HttpConfigData is not NULL Initialize this EFI HTTP instance by configuring + timeout, local address, port, etc. + When HttpConfigData is NULL, reset this EFI HTTP instance by closing all active + connections with remote hosts, canceling all asynchronous tokens, and flush request + and response buffers without informing the appropriate hosts. + + No other EFI HTTP function can be executed by this instance until the Configure() + function is executed and returns successfully. + + @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. + @param[in] HttpConfigData Pointer to the configure data to configure the instance. + + @retval EFI_SUCCESS Operation succeeded. + @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: + This is NULL. + HttpConfigData->LocalAddressIsIPv6 is FALSE and + HttpConfigData->AccessPoint.IPv4Node is NULL. + HttpConfigData->LocalAddressIsIPv6 is TRUE and + HttpConfigData->AccessPoint.IPv6Node is NULL. + @retval EFI_ALREADY_STARTED Reinitialize this HTTP instance without calling + Configure() with NULL to reset it. + @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. + @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when + executing Configure(). + @retval EFI_UNSUPPORTED One or more options in ConfigData are not supported + in the implementation. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HTTP_CONFIGURE)( + IN EFI_HTTP_PROTOCOL *This, + IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL + ); + +/** + The Request() function queues an HTTP request to this HTTP instance, + similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent + successfully, or if there is an error, Status in token will be updated and Event will + be signaled. + + @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. + @param[in] Token Pointer to storage containing HTTP request token. + + @retval EFI_SUCCESS Outgoing data was processed. + @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started. + @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. + @retval EFI_TIMEOUT Data was dropped out of the transmit or receive queue. + @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: + This is NULL. + Token is NULL. + Token->Message is NULL. + Token->Message->Body is not NULL, + Token->Message->BodyLength is non-zero, and + Token->Message->Data is NULL, but a previous call to + Request()has not been completed successfully. + @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources. + @retval EFI_UNSUPPORTED The HTTP method is not supported in current implementation. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HTTP_REQUEST) ( + IN EFI_HTTP_PROTOCOL *This, + IN EFI_HTTP_TOKEN *Token + ); + +/** + Abort an asynchronous HTTP request or response token. + + The Cancel() function aborts a pending HTTP request or response transaction. If + Token is not NULL and the token is in transmit or receive queues when it is being + cancelled, its Token->Status will be set to EFI_ABORTED and then Token->Event will + be signaled. If the token is not in one of the queues, which usually means that the + asynchronous operation has completed, EFI_NOT_FOUND is returned. If Token is NULL, + all asynchronous tokens issued by Request() or Response() will be aborted. + + @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. + @param[in] Token Point to storage containing HTTP request or response + token. + + @retval EFI_SUCCESS Request and Response queues are successfully flushed. + @retval EFI_INVALID_PARAMETER This is NULL. + @retval EFI_NOT_STARTED This instance hasn't been configured. + @retval EFI_NOT_FOUND The asynchronous request or response token is not + found. + @retval EFI_UNSUPPORTED The implementation does not support this function. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HTTP_CANCEL)( + IN EFI_HTTP_PROTOCOL *This, + IN EFI_HTTP_TOKEN *Token + ); + +/** + The Response() function queues an HTTP response to this HTTP instance, similar to + Receive() function in the EFI TCP driver. When the HTTP Response is received successfully, + or if there is an error, Status in token will be updated and Event will be signaled. + + The HTTP driver will queue a receive token to the underlying TCP instance. When data + is received in the underlying TCP instance, the data will be parsed and Token will + be populated with the response data. If the data received from the remote host + contains an incomplete or invalid HTTP header, the HTTP driver will continue waiting + (asynchronously) for more data to be sent from the remote host before signaling + Event in Token. + + It is the responsibility of the caller to allocate a buffer for Body and specify the + size in BodyLength. If the remote host provides a response that contains a content + body, up to BodyLength bytes will be copied from the receive buffer into Body and + BodyLength will be updated with the amount of bytes received and copied to Body. This + allows the client to download a large file in chunks instead of into one contiguous + block of memory. Similar to HTTP request, if Body is not NULL and BodyLength is + non-zero and all other fields are NULL or 0, the HTTP driver will queue a receive + token to underlying TCP instance. If data arrives in the receive buffer, up to + BodyLength bytes of data will be copied to Body. The HTTP driver will then update + BodyLength with the amount of bytes received and copied to Body. + + If the HTTP driver does not have an open underlying TCP connection with the host + specified in the response URL, Request() will return EFI_ACCESS_DENIED. This is + consistent with RFC 2616 recommendation that HTTP clients should attempt to maintain + an open TCP connection between client and host. + + @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. + @param[in] Token Pointer to storage containing HTTP response token. + + @retval EFI_SUCCESS Allocation succeeded. + @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been + initialized. + @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: + This is NULL. + Token is NULL. + Token->Message->Headers is NULL. + Token->Message is NULL. + Token->Message->Body is not NULL, + Token->Message->BodyLength is non-zero, and + Token->Message->Data is NULL, but a previous call to + Response() has not been completed successfully. + @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources. + @retval EFI_ACCESS_DENIED An open TCP connection is not present with the host + specified by response URL. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HTTP_RESPONSE) ( + IN EFI_HTTP_PROTOCOL *This, + IN EFI_HTTP_TOKEN *Token + ); + +/** + The Poll() function can be used by network drivers and applications to increase the + rate that data packets are moved between the communication devices and the transmit + and receive queues. + + In some systems, the periodic timer event in the managed network driver may not poll + the underlying communications device fast enough to transmit and/or receive all data + packets without missing incoming packets or dropping outgoing packets. Drivers and + applications that are experiencing packet loss should try calling the Poll() function + more often. + + @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. + + @retval EFI_SUCCESS Incoming or outgoing data was processed.. + @retval EFI_DEVICE_ERROR An unexpected system or network error occurred + @retval EFI_INVALID_PARAMETER This is NULL. + @retval EFI_NOT_READY No incoming or outgoing data is processed. + @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HTTP_POLL) ( + IN EFI_HTTP_PROTOCOL *This + ); + +/// +/// The EFI HTTP protocol is designed to be used by EFI drivers and applications to +/// create and transmit HTTP Requests, as well as handle HTTP responses that are +/// returned by a remote host. This EFI protocol uses and relies on an underlying EFI +/// TCP protocol. +/// +struct _EFI_HTTP_PROTOCOL { + EFI_HTTP_GET_MODE_DATA GetModeData; + EFI_HTTP_CONFIGURE Configure; + EFI_HTTP_REQUEST Request; + EFI_HTTP_CANCEL Cancel; + EFI_HTTP_RESPONSE Response; + EFI_HTTP_POLL Poll; +}; + +extern EFI_GUID gEfiHttpServiceBindingProtocolGuid; +extern EFI_GUID gEfiHttpProtocolGuid; + +#endif Added: head/stand/efi/include/Protocol/Ip4Config2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/Ip4Config2.h Mon Jun 24 23:18:42 2019 (r349349) @@ -0,0 +1,324 @@ +/* $FreeBSD$ */ +/** @file + This file provides a definition of the EFI IPv4 Configuration II + Protocol. + +Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +@par Revision Reference: +This Protocol is introduced in UEFI Specification 2.5 + +**/ +#ifndef __EFI_IP4CONFIG2_PROTOCOL_H__ +#define __EFI_IP4CONFIG2_PROTOCOL_H__ + +/* #include */ + +#define EFI_IP4_CONFIG2_PROTOCOL_GUID \ + { \ + 0x5b446ed1, 0xe30b, 0x4faa, {0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \ + } + +typedef struct _EFI_IP4_CONFIG2_PROTOCOL EFI_IP4_CONFIG2_PROTOCOL; + + +/// +/// EFI_IP4_CONFIG2_DATA_TYPE +/// +typedef enum { + /// + /// The interface information of the communication device this EFI + /// IPv4 Configuration II Protocol instance manages. This type of + /// data is read only. The corresponding Data is of type + /// EFI_IP4_CONFIG2_INTERFACE_INFO. + /// + Ip4Config2DataTypeInterfaceInfo, + /// + /// The general configuration policy for the EFI IPv4 network stack + /// running on the communication device this EFI IPv4 + /// Configuration II Protocol instance manages. The policy will + /// affect other configuration settings. The corresponding Data is of + /// type EFI_IP4_CONFIG2_POLICY. + /// + Ip4Config2DataTypePolicy, + /// + /// The station addresses set manually for the EFI IPv4 network + /// stack. It is only configurable when the policy is + /// Ip4Config2PolicyStatic. The corresponding Data is of + /// type EFI_IP4_CONFIG2_MANUAL_ADDRESS. When DataSize + /// is 0 and Data is NULL, the existing configuration is cleared + /// from the EFI IPv4 Configuration II Protocol instance. + /// + Ip4Config2DataTypeManualAddress, + /// + /// The gateway addresses set manually for the EFI IPv4 network + /// stack running on the communication device this EFI IPv4 + /// Configuration II Protocol manages. It is not configurable when + /// the policy is Ip4Config2PolicyDhcp. The gateway + /// addresses must be unicast IPv4 addresses. The corresponding + /// Data is a pointer to an array of EFI_IPv4_ADDRESS instances. + /// When DataSize is 0 and Data is NULL, the existing configuration + /// is cleared from the EFI IPv4 Configuration II Protocol instance. + /// + Ip4Config2DataTypeGateway, + /// + /// The DNS server list for the EFI IPv4 network stack running on + /// the communication device this EFI IPv4 Configuration II + /// Protocol manages. It is not configurable when the policy is + /// Ip4Config2PolicyDhcp. The DNS server addresses must be + /// unicast IPv4 addresses. The corresponding Data is a pointer to + /// an array of EFI_IPv4_ADDRESS instances. When DataSize + /// is 0 and Data is NULL, the existing configuration is cleared + /// from the EFI IPv4 Configuration II Protocol instance. + /// + Ip4Config2DataTypeDnsServer, + Ip4Config2DataTypeMaximum +} EFI_IP4_CONFIG2_DATA_TYPE; + +/// +/// EFI_IP4_CONFIG2_INTERFACE_INFO related definitions +/// +#define EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE 32 + +/// +/// EFI_IP4_CONFIG2_INTERFACE_INFO +/// +typedef struct { + /// + /// The name of the interface. It is a NULL-terminated Unicode string. + /// + CHAR16 Name[EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE]; + /// + /// The interface type of the network interface. See RFC 1700, + /// section "Number Hardware Type". + /// + UINT8 IfType; + /// + /// The size, in bytes, of the network interface's hardware address. + /// + UINT32 HwAddressSize; + /// + /// The hardware address for the network interface. + /// + EFI_MAC_ADDRESS HwAddress; + /// + /// The station IPv4 address of this EFI IPv4 network stack. + /// + EFI_IPv4_ADDRESS StationAddress; + /// + /// The subnet address mask that is associated with the station address. + /// + EFI_IPv4_ADDRESS SubnetMask; + /// + /// Size of the following RouteTable, in bytes. May be zero. + /// + UINT32 RouteTableSize; + /// + /// The route table of the IPv4 network stack runs on this interface. + /// Set to NULL if RouteTableSize is zero. Type EFI_IP4_ROUTE_TABLE is defined in + /// EFI_IP4_PROTOCOL.GetModeData(). + /// + EFI_IP4_ROUTE_TABLE *RouteTable OPTIONAL; +} EFI_IP4_CONFIG2_INTERFACE_INFO; + +/// +/// EFI_IP4_CONFIG2_POLICY +/// +typedef enum { + /// + /// Under this policy, the Ip4Config2DataTypeManualAddress, + /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration + /// data are required to be set manually. The EFI IPv4 Protocol will get all + /// required configuration such as IPv4 address, subnet mask and + /// gateway settings from the EFI IPv4 Configuration II protocol. + /// + Ip4Config2PolicyStatic, + /// + /// Under this policy, the Ip4Config2DataTypeManualAddress, + /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration data are + /// not allowed to set via SetData(). All of these configurations are retrieved from DHCP + /// server or other auto-configuration mechanism. + /// + Ip4Config2PolicyDhcp, + Ip4Config2PolicyMax +} EFI_IP4_CONFIG2_POLICY; + +/// +/// EFI_IP4_CONFIG2_MANUAL_ADDRESS +/// +typedef struct { + /// + /// The IPv4 unicast address. + /// + EFI_IPv4_ADDRESS Address; + /// + /// The subnet mask. + /// + EFI_IPv4_ADDRESS SubnetMask; +} EFI_IP4_CONFIG2_MANUAL_ADDRESS; + +/** + Set the configuration for the EFI IPv4 network stack running on the communication device this EFI + IPv4 Configuration II Protocol instance manages. + + This function is used to set the configuration data of type DataType for the EFI IPv4 network stack + running on the communication device this EFI IPv4 Configuration II Protocol instance manages. + The successfully configured data is valid after system reset or power-off. + The DataSize is used to calculate the count of structure instances in the Data for some + DataType that multiple structure instances are allowed. + This function is always non-blocking. When setting some typeof configuration data, an + asynchronous process is invoked to check the correctness of the data, such as doing address conflict + detection on the manually set local IPv4 address. EFI_NOT_READY is returned immediately to + indicate that such an asynchronous process is invoked and the process is not finished yet. The caller + willing to get the result of the asynchronous process is required to call RegisterDataNotify() + to register an event on the specified configuration data. Once the event is signaled, the caller can call + GetData()to get back the configuration data in order to know the result. For other types of + configuration data that do not require an asynchronous configuration process, the result of the + operation is immediately returned. + + @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. + @param[in] DataType The type of data to set. + @param[in] DataSize Size of the buffer pointed to by Data in bytes. + @param[in] Data The data buffer to set. The type ofthe data buffer is associated + with the DataType. + + @retval EFI_SUCCESS The specified configuration data for the EFI IPv4 network stack is set + successfully. + @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: + This is NULL. + One or more fields in Data and DataSize do not match the + requirement of the data type indicated by DataType. + @retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified configuration + data can not be set under the current policy. + @retval EFI_ACCESS_DENIED Another set operation on the specified configuration data is already in process. + @retval EFI_NOT_READY An asynchronous process is invoked to set the specified configuration data and + the process is not finished yet. + @retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type indicated by DataType. + @retval EFI_UNSUPPORTED This DataType is not supported. + @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. + @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_IP4_CONFIG2_SET_DATA) ( + IN EFI_IP4_CONFIG2_PROTOCOL *This, + IN EFI_IP4_CONFIG2_DATA_TYPE DataType, + IN UINTN DataSize, + IN VOID *Data + ); + +/** + Get the configuration data for the EFI IPv4 network stack running on the communication device this + EFI IPv4 Configuration II Protocol instance manages. + + This function returns the configuration data of type DataType for the EFI IPv4 network stack + running on the communication device this EFI IPv4 Configuration II Protocol instance manages. + The caller is responsible for allocating the buffer usedto return the specified configuration data and + the required size will be returned to the caller if the size of the buffer is too small. + EFI_NOT_READY is returned if the specified configuration data is not ready due to an already in + progress asynchronous configuration process. The caller can call RegisterDataNotify() to + register an event on the specified configuration data. Once the asynchronous configuration process is + finished, the event will be signaled and a subsequent GetData() call will return the specified + configuration data. + + @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. + @param[in] DataType The type of data to get. + @param[out] DataSize On input, in bytes, the size of Data. On output, in bytes, the size + of buffer required to store the specified configuration data. + @param[in] Data The data buffer in which the configuration data is returned. The + type of the data buffer is associated with the DataType. Ignored + if DataSize is 0. + + @retval EFI_SUCCESS The specified configuration data is got successfully. + @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE: + This is NULL. + DataSize is NULL. + Data is NULL if *DataSizeis not zero. + @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data + and the required size is returned in DataSize. + @retval EFI_NOT_READY The specified configuration data is not ready due to an already in + progress asynchronous configuration process. + @retval EFI_NOT_FOUND The specified configuration data is not found. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_IP4_CONFIG2_GET_DATA) ( + IN EFI_IP4_CONFIG2_PROTOCOL *This, + IN EFI_IP4_CONFIG2_DATA_TYPE DataType, + IN OUT UINTN *DataSize, + IN VOID *Data OPTIONAL + ); + +/** + Register an event that is to be signaled whenever a configuration process on the specified + configuration data is done. + + This function registers an event that is to be signaled whenever a configuration process on the + specified configuration data is done. An event can be registered for different DataType + simultaneously and the caller is responsible for determining which type of configuration data causes + the signaling of the event in such case. + + @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. + @param[in] DataType The type of data to unregister the event for. + @param[in] Event The event to register. + + @retval EFI_SUCCESS The notification event for the specified configuration data is + registered. + @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL. + @retval EFI_UNSUPPORTED The configuration data type specified by DataType is not supported. + @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. + @retval EFI_ACCESS_DENIED The Event is already registered for the DataType. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_IP4_CONFIG2_REGISTER_NOTIFY) ( + IN EFI_IP4_CONFIG2_PROTOCOL *This, + IN EFI_IP4_CONFIG2_DATA_TYPE DataType, + IN EFI_EVENT Event + ); + +/** + Remove a previously registered event for the specified configuration data. + + This function removes a previously registeredevent for the specified configuration data. + + @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. + @param[in] DataType The type of data to remove the previously registered event for. + @param[in] Event The event to unregister. + + @retval EFI_SUCCESS The event registered for the specified configuration data is removed. + @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL. + @retval EFI_NOT_FOUND The Eventhas not been registered for the specified DataType. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_IP4_CONFIG2_UNREGISTER_NOTIFY) ( + IN EFI_IP4_CONFIG2_PROTOCOL *This, + IN EFI_IP4_CONFIG2_DATA_TYPE DataType, + IN EFI_EVENT Event + ); + +/// +/// The EFI_IP4_CONFIG2_PROTOCOL is designed to be the central repository for the common +/// configurations and the administrator configurable settings for the EFI IPv4 network stack. +/// An EFI IPv4 Configuration II Protocol instance will be installed on each communication device that +/// the EFI IPv4 network stack runs on. +/// +struct _EFI_IP4_CONFIG2_PROTOCOL { + EFI_IP4_CONFIG2_SET_DATA SetData; + EFI_IP4_CONFIG2_GET_DATA GetData; + EFI_IP4_CONFIG2_REGISTER_NOTIFY RegisterDataNotify; + EFI_IP4_CONFIG2_UNREGISTER_NOTIFY UnregisterDataNotify; +}; + +extern EFI_GUID gEfiIp4Config2ProtocolGuid; + +#endif + Added: head/stand/efi/include/Protocol/ServiceBinding.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/ServiceBinding.h Mon Jun 24 23:18:42 2019 (r349349) @@ -0,0 +1,95 @@ +/* $FreeBSD$ */ +/** @file + UEFI Service Binding Protocol is defined in UEFI specification. + + The file defines the generic Service Binding Protocol functions. + It provides services that are required to create and destroy child + handles that support a given set of protocols. + + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __EFI_SERVICE_BINDING_H__ +#define __EFI_SERVICE_BINDING_H__ + +/// +/// Forward reference for pure ANSI compatibility +/// +typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL; + +/** + Creates a child handle and installs a protocol. + + The CreateChild() function installs a protocol on ChildHandle. + If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. + If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle. + + @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance. + @param ChildHandle Pointer to the handle of the child to create. If it is NULL, + then a new handle is created. If it is a pointer to an existing UEFI handle, + then the protocol is added to the existing UEFI handle. + + @retval EFI_SUCCES The protocol was added to ChildHandle. + @retval EFI_INVALID_PARAMETER ChildHandle is NULL. + @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create + the child + @retval other The child handle was not created + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)( + IN EFI_SERVICE_BINDING_PROTOCOL *This, + IN OUT EFI_HANDLE *ChildHandle + ); + +/** + Destroys a child handle with a protocol installed on it. + + The DestroyChild() function does the opposite of CreateChild(). It removes a protocol + that was installed by CreateChild() from ChildHandle. If the removed protocol is the + last protocol on ChildHandle, then ChildHandle is destroyed. + + @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance. + @param ChildHandle Handle of the child to destroy + + @retval EFI_SUCCES The protocol was removed from ChildHandle. + @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed. + @retval EFI_INVALID_PARAMETER Child handle is NULL. + @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle + because its services are being used. + @retval other The child handle was not destroyed + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)( + IN EFI_SERVICE_BINDING_PROTOCOL *This, + IN EFI_HANDLE ChildHandle + ); + +/// +/// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy +/// child handles. A driver is responsible for adding protocols to the child handle +/// in CreateChild() and removing protocols in DestroyChild(). It is also required +/// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER +/// to establish the parent-child relationship, and closes the protocol in DestroyChild(). +/// The pseudo code for CreateChild() and DestroyChild() is provided to specify the +/// required behavior, not to specify the required implementation. Each consumer of +/// a software protocol is responsible for calling CreateChild() when it requires the +/// protocol and calling DestroyChild() when it is finished with that protocol. +/// +struct _EFI_SERVICE_BINDING_PROTOCOL { + EFI_SERVICE_BINDING_CREATE_CHILD CreateChild; + EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild; +}; + +#endif Modified: head/stand/efi/include/efidevp.h ============================================================================== --- head/stand/efi/include/efidevp.h Mon Jun 24 21:24:55 2019 (r349348) +++ head/stand/efi/include/efidevp.h Mon Jun 24 23:18:42 2019 (r349349) @@ -232,6 +232,8 @@ typedef struct _IPv4_DEVICE_PATH { UINT16 RemotePort; UINT16 Protocol; BOOLEAN StaticIpAddress; + EFI_IPv4_ADDRESS GatewayIpAddress; + EFI_IPv4_ADDRESS SubnetMask; } IPv4_DEVICE_PATH; #define MSG_IPv6_DP 0x0d @@ -293,6 +295,26 @@ typedef struct _SATA_DEVICE_PATH { UINT16 PortMultiplierPortNumber; UINT16 Lun; } SATA_DEVICE_PATH; + + +/* DNS Device Path SubType */ +#define MSG_DNS_DP 0x1F +typedef struct { + EFI_DEVICE_PATH Header; + /* Indicates the DNS server address is IPv4 or IPv6 address. */ + UINT8 IsIPv6; + /* Instance of the DNS server address. */ + /* XXX: actually EFI_IP_ADDRESS */ + EFI_IPv4_ADDRESS DnsServerIp[]; +} DNS_DEVICE_PATH; + +/* Uniform Resource Identifiers (URI) Device Path SubType */ +#define MSG_URI_DP 0x18 +typedef struct { + EFI_DEVICE_PATH Header; + /* Instance of the URI pursuant to RFC 3986. */ + CHAR8 Uri[]; +} URI_DEVICE_PATH; #define MEDIA_DEVICE_PATH 0x04 Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Mon Jun 24 21:24:55 2019 (r349348) +++ head/stand/efi/include/efilib.h Mon Jun 24 23:18:42 2019 (r349349) @@ -42,6 +42,7 @@ extern EFI_RUNTIME_SERVICES *RS; extern struct devsw efipart_fddev; extern struct devsw efipart_cddev; extern struct devsw efipart_hddev; +extern struct devsw efihttp_dev; extern struct devsw efinet_dev; extern struct netif_driver efinetif; Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Mon Jun 24 21:24:55 2019 (r349348) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 25 00:40:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBAA15DD969; Tue, 25 Jun 2019 00:40:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30FE88F4BB; Tue, 25 Jun 2019 00:40:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D94C28C38; Tue, 25 Jun 2019 00:40:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P0ek9s087300; Tue, 25 Jun 2019 00:40:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P0ejJP086572; Tue, 25 Jun 2019 00:40:45 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906250040.x5P0ejJP086572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 25 Jun 2019 00:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349350 - in head: contrib/gcc/config/rs6000 lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc/sys libexec/rtld-elf libexec/rtld-elf/powerpc sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: contrib/gcc/config/rs6000 lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc/sys libexec/rtld-elf libexec/rtld-elf/powerpc sys/powerpc/powerpc X-SVN-Commit-Revision: 349350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 30FE88F4BB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 00:40:47 -0000 Author: jhibbits Date: Tue Jun 25 00:40:44 2019 New Revision: 349350 URL: https://svnweb.freebsd.org/changeset/base/349350 Log: powerpc: Transition to Secure-PLT, like most other OSs Summary: PowerPC has two PLT models: BSS-PLT and Secure-PLT. BSS-PLT uses runtime code generation to generate the PLT stubs. Secure-PLT was introduced with GCC 4.1 and Binutils 2.17 (base has GCC 4.2.1 and Binutils 2.17), and is a more secure PLT format, using a read-only linkage table, with the dynamic linker populating a non-executable index table. This is the libc, rtld, and kernel support only. The toolchain and build parts will be updated separately. Reviewed By: nwhitehorn, bdragon, pfg Differential Revision: https://reviews.freebsd.org/D20598 MFC after: 1 month Modified: head/contrib/gcc/config/rs6000/tramp.asm head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc/gen/_ctx_start.S head/lib/libc/powerpc/sys/cerror.S head/libexec/rtld-elf/powerpc/reloc.c head/libexec/rtld-elf/powerpc/rtld_start.S head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/sys/powerpc/powerpc/machdep.c Modified: head/contrib/gcc/config/rs6000/tramp.asm ============================================================================== --- head/contrib/gcc/config/rs6000/tramp.asm Mon Jun 24 23:18:42 2019 (r349349) +++ head/contrib/gcc/config/rs6000/tramp.asm Tue Jun 25 00:40:44 2019 (r349350) @@ -38,6 +38,7 @@ .file "tramp.asm" .section ".text" #include "ppc-asm.h" + #include "auto-host.h" #ifndef __powerpc64__ .type trampoline_initial,@object @@ -105,7 +106,7 @@ FUNC_START(__trampoline_setup) blr .Labort: -#if defined SHARED && defined HAVE_AS_REL16 +#if (defined(__PIC__) || defined(__pic__)) && defined HAVE_AS_REL16 bcl 20,31,1f 1: mflr r30 addis r30,r30,_GLOBAL_OFFSET_TABLE_-1b@ha Modified: head/lib/libc/powerpc/SYS.h ============================================================================== --- head/lib/libc/powerpc/SYS.h Mon Jun 24 23:18:42 2019 (r349349) +++ head/lib/libc/powerpc/SYS.h Tue Jun 25 00:40:44 2019 (r349350) @@ -44,7 +44,7 @@ #define SYSCALL(name) \ .text; \ .align 2; \ -2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ +2: b CNAME(HIDENAME(cerror)); \ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ @@ -58,15 +58,14 @@ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bnslr; \ - b PIC_PLT(CNAME(HIDENAME(cerror))) + b CNAME(HIDENAME(cerror)) #define RSYSCALL(name) \ .text; \ .align 2; \ -2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bnslr; \ - b PIC_PLT(CNAME(HIDENAME(cerror))) + b CNAME(HIDENAME(cerror)) Modified: head/lib/libc/powerpc/gen/_ctx_start.S ============================================================================== --- head/lib/libc/powerpc/gen/_ctx_start.S Mon Jun 24 23:18:42 2019 (r349349) +++ head/lib/libc/powerpc/gen/_ctx_start.S Tue Jun 25 00:40:44 2019 (r349350) @@ -35,11 +35,18 @@ mtlr %r14 blrl /* branch to start function */ mr %r3,%r15 /* pass pointer to ucontext as argument */ - bl PIC_PLT(CNAME(_ctx_done)) /* branch to ctxt completion func */ + bl CNAME(_ctx_done) /* branch to ctxt completion func */ + /* * we should never return from the * above branch. */ + /* Don't bother saving off %r30, we're already in a bad state. */ + bcl 20,31,1f +1: mflr %r30 + mr %r3,%r30 # save for _DYNAMIC + addis %r30,%r30,_GLOBAL_OFFSET_TABLE_-1b@ha + addi %r30,%r30,_GLOBAL_OFFSET_TABLE_-1b@l bl PIC_PLT(CNAME(abort)) /* abort */ END(_cts_start) Modified: head/lib/libc/powerpc/sys/cerror.S ============================================================================== --- head/lib/libc/powerpc/sys/cerror.S Mon Jun 24 23:18:42 2019 (r349349) +++ head/lib/libc/powerpc/sys/cerror.S Tue Jun 25 00:40:44 2019 (r349350) @@ -40,16 +40,27 @@ __FBSDID("$FreeBSD$"); */ HIDENAME(cerror): mflr %r0 - stwu %r1,-16(%r1) /* allocate new stack frame */ - stw %r0,20(%r1) /* and save lr, r31 */ - stw %r31,8(%r1) + stwu %r1,-20(%r1) /* allocate new stack frame */ + stw %r0,24(%r1) /* and save lr, r31 */ + stw %r31,12(%r1) +#ifdef __PIC__ + stw %r30,8(%r1) + bcl 20,31,1f +1: + mflr %r30 + addis %r30,%r30,_GLOBAL_OFFSET_TABLE_-1b@ha + addi %r30,%r30,_GLOBAL_OFFSET_TABLE_-1b@l +#endif mr %r31,%r3 /* stash errval in callee-saved register */ bl PIC_PLT(CNAME(__error)) stw %r31,0(%r3) /* store errval into &errno */ - lwz %r0,20(%r1) - lwz %r31,8(%r1) + lwz %r0,24(%r1) + lwz %r31,12(%r1) +#ifdef __PIC__ + lwz %r30,8(%r1) +#endif mtlr %r0 - la %r1,16(%r1) + la %r1,20(%r1) li %r3,-1 li %r4,-1 blr /* return to callers caller */ Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Mon Jun 24 23:18:42 2019 (r349349) +++ head/libexec/rtld-elf/powerpc/reloc.c Tue Jun 25 00:40:44 2019 (r349350) @@ -57,6 +57,8 @@ #define JMPTAB_BASE(N) (18 + N*2 + ((N > PLT_EXTENDED_BEGIN) ? \ (N - PLT_EXTENDED_BEGIN)*2 : 0)) +void _rtld_bind_secureplt_start(void); + /* * Process the R_PPC_COPY relocations */ @@ -361,6 +363,11 @@ reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela) if (reloff < 0) return (-1); + if (obj->gotptr != NULL) { + *where += (Elf_Addr)obj->relocbase; + return (0); + } + pltlongresolve = obj->pltgot + 5; pltresolve = pltlongresolve + 5; @@ -425,7 +432,7 @@ reloc_plt(Obj_Entry *obj, int flags __unused, RtldLock * Sync the icache for the byte range represented by the * trampoline routines and call slots. */ - if (obj->pltgot != NULL) + if (obj->pltgot != NULL && obj->gotptr == NULL) __syncicache(obj->pltgot, JMPTAB_BASE(N)*4); return (0); @@ -501,6 +508,14 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, */ offset = target - (Elf_Addr)wherep; + if (obj->gotptr != NULL) { + assert(wherep >= (Elf_Word *)obj->pltgot); + assert(wherep < + (Elf_Word *)obj->pltgot + obj->pltrelasize); + *wherep = target; + goto out; + } + if (abs((int)offset) < 32*1024*1024) { /* inside 32MB? */ /* b value # branch directly */ *wherep = 0x48000000 | (offset & 0x03fffffc); @@ -576,6 +591,16 @@ init_pltgot(Obj_Entry *obj) pltcall = obj->pltgot; if (pltcall == NULL) { + return; + } + + /* Handle Secure-PLT first, if applicable. */ + if (obj->gotptr != NULL) { + obj->gotptr[1] = (Elf_Addr)_rtld_bind_secureplt_start; + obj->gotptr[2] = (Elf_Addr)obj; + dbg("obj %s secure-plt gotptr=%p start=%p obj=%p", + obj->path, obj->gotptr, + (void *)obj->gotptr[1], (void *)obj->gotptr[2]); return; } Modified: head/libexec/rtld-elf/powerpc/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_start.S Mon Jun 24 23:18:42 2019 (r349349) +++ head/libexec/rtld-elf/powerpc/rtld_start.S Tue Jun 25 00:40:44 2019 (r349350) @@ -52,36 +52,23 @@ _ENTRY(.rtld_start) * - use link-time constants to determine offset to the * _DYNAMIC section and the GOT. Add these to the PC to * convert to absolute addresses. - * - sync icache to allow execution of the SVR4 ABI-specified - * blrl instruction preceding the GOT - * - Use this instruction to determine the GOT absolute address * - read GOT[0], which is the SVR4 ABI-specified link-time * value of _DYNAMIC. Subtract this value from the absolute * value to determine the load address * - call reloc_non_plt_self() to fix up ld-elf.so's relocations */ - bl 1f - .long _DYNAMIC-. - .long _GLOBAL_OFFSET_TABLE_-. /* branch lr + 4 */ -1: - mflr %r3 /* PC value at .long */ - lwz %r4,4(%r3) - add %r4,%r4,%r3 /* &_GLOBAL_OFFSET_TABLE-4, blrl insn. */ - dcbst %r0,%r4 /* sync i-cache with d-cache */ - sync - icbi %r0,%r4 - isync + bcl 20,31,1f +1: mflr %r30 + mr %r3,%r30 # save for _DYNAMIC + addis %r30,%r30,_GLOBAL_OFFSET_TABLE_-1b@ha + addi %r30,%r30,_GLOBAL_OFFSET_TABLE_-1b@l + addis %r3,%r3,_DYNAMIC-1b@ha # get _DYNAMIC actual address + addi %r3,%r3,_DYNAMIC-1b@l + lwz %r28,0(%r30) # get base-relative &_DYNAMIC + sub %r28,%r3,%r28 # r28 = relocbase + mr %r4,%r28 # r4 = relocbase + bl reloc_non_plt_self /* reloc_non_plt_self(&_DYNAMIC,base) */ - lwz %r4,0(%r3) /* offset to _DYNAMIC */ - add %r3,%r4,%r3 /* r3 = &_DYNAMIC, absolute value */ - - bl _GLOBAL_OFFSET_TABLE_@local-4 - mflr %r4 /* &_GLOBAL_OFFSET_TABLE_, absolute value */ - lwz %r4,0(%r4) /* linker &_DYNAMIC, from got[0] */ - subf %r4,%r4,%r3 /* subtract to calculate relocbase */ - - bl reloc_non_plt_self@plt /* reloc_non_plt_self(&_DYNAMIC,base) */ - /* * The _rtld() function likes to see a stack layout containing * { argc, argv[0], argv[1] ... argv[N], 0, env[0], ... , env[N] } @@ -95,7 +82,7 @@ _ENTRY(.rtld_start) addi %r4,%r1,8 /* &exit_proc on stack */ addi %r5,%r1,12 /* &obj_main on stack */ - bl _rtld@plt /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ + bl _rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ mtlr %r3 /* @@ -115,6 +102,29 @@ _ENTRY(.rtld_start) sc /* + * _rtld_bind_secureplt_start() + * + * Call into the MI binder (Secure-PLT stub). + * secure-plt expects %r11 to be the offset to the rela entry. + * bss-plt expects %r11 to be index of the rela entry. + * So for bss-plt, we multiply the index by 12 to get the offset. + */ +_ENTRY(_rtld_bind_secureplt_start) + stwu %r1,-160(%r1) # stack space for 29 regs + r0/lr/cr + stw %r0,20(%r1) # save r0 + + /* + * Instead of division which is costly we will use multiplicative + * inverse. a / n = ((a * inv(n)) >> 32) + * where inv(n) = (0x100000000 + n - 1) / n + */ + mr %r0,%r11 + lis %r11,0x15555556@h # load multiplicative inverse of 12 + ori %r11,%r11,0x15555556@l + mulhwu %r11,%r11,%r0 # get high half of multiplication + b 1f + +/* * _rtld_bind_start() * * Call into the MI binder. This routine is reached via the PLT call cell, @@ -129,6 +139,7 @@ _ENTRY(.rtld_start) _ENTRY(_rtld_bind_start) stwu %r1,-160(%r1) # stack space for 29 regs + r0/lr/cr stw %r0,20(%r1) # save r0 +1: mflr %r0 stw %r0,16(%r1) # save lr mfcr %r0 @@ -137,7 +148,7 @@ _ENTRY(_rtld_bind_start) mr %r3,%r12 # obj mulli %r4,%r11,12 # rela index * sizeof(Elf_Rela) - bl _rtld_bind@PLT # target addr = _rtld_bind(obj, reloff) + bl _rtld_bind # target addr = _rtld_bind(obj, reloff) mtctr %r3 # move absolute target addr into ctr lmw %r3,24(%r1) # restore r3-r31 Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Jun 24 23:18:42 2019 (r349349) +++ head/libexec/rtld-elf/rtld.c Tue Jun 25 00:40:44 2019 (r349350) @@ -1286,10 +1286,16 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D #endif +#ifdef __powerpc__ #ifdef __powerpc64__ case DT_PPC64_GLINK: obj->glink = (Elf_Addr)(obj->relocbase + dynp->d_un.d_ptr); break; +#else + case DT_PPC_GOT: + obj->gotptr = (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr); + break; +#endif #endif case DT_FLAGS_1: Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Mon Jun 24 23:18:42 2019 (r349349) +++ head/libexec/rtld-elf/rtld.h Tue Jun 25 00:40:44 2019 (r349350) @@ -190,8 +190,12 @@ typedef struct Struct_Obj_Entry { Elf_Word gotsym; /* First dynamic symbol in GOT */ Elf_Addr *mips_pltgot; /* Second PLT GOT */ #endif +#ifdef __powerpc__ #ifdef __powerpc64__ Elf_Addr glink; /* GLINK PLT call stub section */ +#else + Elf_Addr *gotptr; /* GOT pointer (secure-plt only) */ +#endif #endif const Elf_Verneed *verneed; /* Required versions. */ Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Mon Jun 24 23:18:42 2019 (r349349) +++ head/sys/powerpc/powerpc/machdep.c Tue Jun 25 00:40:44 2019 (r349350) @@ -595,3 +595,16 @@ bzero(void *buf, size_t len) len--; } } + +/* __stack_chk_fail_local() is called in secure-plt (32-bit). */ +#if !defined(__powerpc64__) +extern void __stack_chk_fail(void); +void __stack_chk_fail_local(void); + +void +__stack_chk_fail_local(void) +{ + + __stack_chk_fail(); +} +#endif From owner-svn-src-all@freebsd.org Tue Jun 25 00:45:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12B8715DDC03; Tue, 25 Jun 2019 00:45:55 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 8C5EE8FAF2; Tue, 25 Jun 2019 00:45:54 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5P0jqHv046648; Mon, 24 Jun 2019 17:45:52 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5P0jqiw046647; Mon, 24 Jun 2019 17:45:52 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906250045.x5P0jqiw046647@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa In-Reply-To: <201906242318.x5ONIhlS043523@repo.freebsd.org> To: Rebecca Cran Date: Mon, 24 Jun 2019 17:45:52 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 8C5EE8FAF2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 00:45:55 -0000 > Author: bcran > Date: Mon Jun 24 23:18:42 2019 > New Revision: 349349 > URL: https://svnweb.freebsd.org/changeset/base/349349 > > Log: > loader: add HTTP support using UEFI > > Add support for an HTTP "network filesystem" using the UEFI's HTTP > stack. > > This also supports HTTPS, but TianoCore EDK2 implementations currently > crash while fetching loader files. > Only IPv4 is supported at the moment. IPv6 support is planned for a > follow-up changeset. > > Note that we include some headers from the TianoCore EDK II project in > stand/efi/include/Protocol verbatim, including links to the license instead > of including the full text because that's their preferred way of > communicating it, despite not being normal FreeBSD project practice. Please read the license text below and understand why I might have a conflict with the above statement when infact the text included says "which accompanies this distribution." > Submitted by: scottph > Reviewed by: imp, bcran > Differential Revision: https://reviews.freebsd.org/D20643 > > Added: > head/stand/efi/include/Protocol/Http.h (contents, props changed) > head/stand/efi/include/Protocol/Ip4Config2.h (contents, props changed) > head/stand/efi/include/Protocol/ServiceBinding.h (contents, props changed) > head/stand/efi/libefi/efihttp.c (contents, props changed) > Modified: > head/stand/efi/include/efidevp.h > head/stand/efi/include/efilib.h > head/stand/efi/libefi/Makefile > head/stand/efi/loader/conf.c > head/stand/libsa/stand.h > > Added: head/stand/efi/include/Protocol/Http.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/stand/efi/include/Protocol/Http.h Mon Jun 24 23:18:42 2019 (r349349) > @@ -0,0 +1,523 @@ > +/* $FreeBSD$ */ > +/** @file > + This file defines the EFI HTTP Protocol interface. It is split into > + the following two main sections: > + HTTP Service Binding Protocol (HTTPSB) > + HTTP Protocol (HTTP) > + > + Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> + (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> + This program and the accompanying materials > + are licensed and made available under the terms and conditions of the BSD License > + which accompanies this distribution. The full text of the license may be found at It sys accompanies, that means not a pointer to... > + http://opensource.org/licenses/bsd-license.php Also shouldn't it say 2 clause license, as that is what is pointed at? Is the above text exactly as it appeared in the file from Tianocore or has it been edited in any way? > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Hum oh my, what has happend to the disclaimer? > + > + @par Revision Reference: > + This Protocol is introduced in UEFI Specification 2.5 > + > +**/ > + > +#ifndef __EFI_HTTP_PROTOCOL_H__ > +#define __EFI_HTTP_PROTOCOL_H__ ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 25 00:53:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7103015DDFBE; Tue, 25 Jun 2019 00:53:29 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bluestop.org (muon.bluestop.org [65.103.231.193]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCFF1680E7; Tue, 25 Jun 2019 00:53:28 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bluestop.org (localhost [127.0.0.1]) by muon.bluestop.org (Postfix) with ESMTP id 65A915ACC7; Mon, 24 Jun 2019 18:57:45 -0600 (MDT) Received: from muon.bluestop.org ([127.0.0.1]) by muon.bluestop.org (muon.bluestop.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yqa0TERhG2CE; Mon, 24 Jun 2019 18:57:45 -0600 (MDT) Received: from photon.int.bluestop.org (unknown [10.0.10.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTPSA; Mon, 24 Jun 2019 18:57:44 -0600 (MDT) Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906250045.x5P0jqiw046647@gndrsh.dnsmgr.net> From: Rebecca Cran Openpgp: preference=signencrypt Autocrypt: addr=bcran@freebsd.org; keydata= mQINBFrUMZ4BEADI1yUEGeZeXeTCPay1ZpTBdDEpGPAw1dq2VCSTc1VhsnrEBa1iZxAfaeSv Uu5Ti7jlhQ/3sQMl0bJMKGB/RtmIW7k8h2w476oZmG8gChk8su5ZEx/pV1gdqInyFmmJKTYc gabJz8pL+m82w07qPv+oalepZ4dbj+HF++RAK/iEju+q9UHlsjj8e3mMNsvtrOz1K6bnpveO jZ+ms/2H3Hs5a4k8y6buwe2RvwhJQaXa13cR3LhzL+nwj4B9PHZZEa2WpEyYpw/bI0V9YSQN QgC1CYRzDyakZge6BCM6wHOgZSUzRPufGilrNKUwIVbRoIBR9/85+0wR+PlFUOUOfOc6ox7T dWcIx6PuPhek48rh4uwmmwsPtPiH4Z3T5p+GmWQ9NLFZKA1YnEdaSkWtYZsDxwVZZeYG2plt MfhXP0Hj4rf9Y3eoUenCaGioxAbUOBCtXdTGNAhNjz1g5NGDBVyhjKkzwJQvt9UrYTseERit 5dX2CMTy8hYLvSXd/Ivy+HylUS5IslfZxW5z9LgWX7Z97kILgkH3N0ewtLkygkG+Y+x7uaAV dFqp9ASOyzaiwKbJdeOI+WxRSh+AqeCR0S+bpkcLudLmbjrPmaFwjKycy1H85Z5R2J3YHyXY oT6OYjD8vLbUU2GWp6Onkcy1Pu8EMbRuzKil6HnpYg3BexbPFwARAQABtCBSZWJlY2NhIENy YW4gPGJjcmFuQGZyZWVic2Qub3JnPokCVAQTAQgAPhYhBB+5fZtkTdO940Yr4g0CK1MRvhAg BQJa2B8pAhsjBQkJZgGABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEA0CK1MRvhAgAe0P /R65umdPBVFCYKPZ91HMqlZtn0EWOGwycWEK/feWI+jaYOa+8+VVxFau4gwnBmgCdf5XOAJW QugUlPte9T+dP9QXmgm8z3KMLCj2PATYlmqmQfvIleJPf8w7BFBw/kkd6ZxoEQXaEyZwWuJc vY58uFYizZ8s1gMjD7uV3eg2UuGYd4loBZ3MSanWrhE6mmxAjzcYYb0KTsaTH9ON4uctcTYG 4FN0KzRx5d4nAhnS/yaL+3OI23vUDt+XnOCx8tIOczScOEN5NFChgyvTxzwi7hTVNB7uUCha mN6vcjtrrzi03zHXooldE4gRJ5G+SzuH9yHKrrwYXUeKi8sG8uXVoWwzsLbCxHRe7T9Ow7Im 92Aep3DEIE9whG6Fg3hRQ4/d/9OVCGrV3XwRMEstCvamJQc69ZsULo1ssGmPvcLn8fNaLNeP ICCLQj4JLcYvKKfLIQ/Cm0Orsy8rJGhwF4W1mBUbTdR6pk2azEkrhE7KZDylgikpNNqshKV3 1nD/5SNrTDl0P8rTnu0OKT0IbozIsaz9FD2xMPHPUMPnVSTB96+PhgoBIQlHcys19gftotuN 1tlLs4Ny93xWLSjKWoW5l9E9LbIh+M8gD3A7JyyV9DRZkHdbOt3pGjpaozchDPCpRkcsFXp4 9zSbXtxnbAWfZwoSYQTvznmXpzHMzoLMWf/guQINBFrUMZ4BEADkc4mvMcMcDF1tdNxNQuIB E1F243oZamG3LACCKfc1Yur3CPzHwIk5LXCUmbq23iE5bowxMWw3mlVT0p5xM0WnUidIBwCK u4kRyy/fY4NyWWBuwy9srpTdmUcKRBRNB8zEZE8xIlidD1ijjgqLBfeM7n9ylawAxHLxwU96 sdpdHFzb7Z0yKY2e/bzDaHiG0fUvcCmkgLf+uwKKZid1j8zR5PzKpgPqfy/PF01eKyGV3MNu 8Y90xMoiEMWfCI2IB1m+hTuzZoboFvGV54SiMuvfWK/VMQjhsL6K2ddOqwVuy2nIMI4G3xDQ W/v8KVyn43OSIAyW1eaklhzu0Ir2sO60PXRkvbTUrouvmSvpJfIQS49rU0M/X6FSDgXQLKrZ 3my94+g8ptz9KoVml6s4OAwYVz+sb49nuSxipFKkU5FwhKOLmzbsBxCtytcUJoLmjuJPJPDQ ue6YJiIXyc86GVY2pH3DjemKdbB4dSgqAJIp+lCzKSJzz7bgueh2Ox8vzx1tSxKj7V8Nal+U TKKbkxPmMh+e20YZ4esAVifO3bS6IJP/aDnfagghB71vA7+aWGXPbjPlc2UHpCBiRSsl+Igo QXvdvZBsKRyfBx8neODa2C6JIE5vcaCjilSeKF8SzsFXvimnndhQNhAPU/DwQwSXdCl4gTsF Vi5d8Oxq1sce+wARAQABiQI8BBgBCAAmFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAlrUMZ4C GwwFCQlmAYAACgkQDQIrUxG+ECAWnRAAsmZX+KgNxW3v7R/76Tz4Wjmh4AGeE+Ji3p5QsdTY ny1B6vYBL9vCzPJ/AK8pgKMDRaweUP5eZQpfrdWC8Q7SNGgi4Q+97KEs+i2xZLQ+WJb8a+WE EIc716u0y4ITiHfOgM5jWcFO4MXQATbJgv0drLLesa+LQCvZgPBqupt307EsCubQs+Sxt+RV jf6rOUolp1GJXEQYwGsKklVd6yqLC8M1BSG53/WE5tSv5GzBZ8fp6EtmjT7leuidFtEvKYHQ z4DqG9ELpHUF0X0UUCBK/MgXe3kCVLKE060UrJ4M6uPSx57rmVFA2MvwQR8M7GsWC5UsSM4P YwPWBhwxE7vcx0691YKAHT/5q8LxRVBdUyzPSprMhSQFttsBt+ygm6wRi3Pi3TuCEARNubPk QefyeC34yr40SAUCkOl3eWxSXPF4NfXFQb4AAzZSE5hv3qbDuwo3lrL0LqpIpEQPAz+JZ1QZ 6mMFQ5/JD9Gukj54kZc0X8w3sQt0a8vyE/qrJg8vKgv2rCHrPc5MeDkEUEFiiJiCEDdkJtMy oRlU3S4NrnbyLOLEcHE8fGe3hStPX8hY62id2ecdQ5WZ7vLZW5SFeLarbUciuHIkVL6MHnUj bV7XlY50N7ebeFCIdlCWhdum2FJs/Ni+SSxbZC564vrokwlBBGSo6WTPQTa8IWx1DtU= Message-ID: <9046989b-f45a-12a9-954f-799ade5b08a2@freebsd.org> Date: Mon, 24 Jun 2019 18:53:13 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <201906250045.x5P0jqiw046647@gndrsh.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LpRjN50aGs9nR7wDkGN1wBsnJhxV4BX8k" X-Rspamd-Queue-Id: DCFF1680E7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 00:53:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LpRjN50aGs9nR7wDkGN1wBsnJhxV4BX8k Content-Type: multipart/mixed; boundary="niyZcG6eKMvkdIqT1vNXpAcYlpJEpY7ZN"; protected-headers="v1" From: Rebecca Cran To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <9046989b-f45a-12a9-954f-799ade5b08a2@freebsd.org> Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa References: <201906250045.x5P0jqiw046647@gndrsh.dnsmgr.net> In-Reply-To: <201906250045.x5P0jqiw046647@gndrsh.dnsmgr.net> --niyZcG6eKMvkdIqT1vNXpAcYlpJEpY7ZN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-06-24 18:45, Rodney W. Grimes wrote: > It sys accompanies, that means not a pointer to.... > Hum oh my, what has happend to the disclaimer? Huh. It turns out the _latest_ version of that file just contains: /** @file This file defines the EFI HTTP Protocol interface. It is split into the following two main sections: HTTP Service Binding Protocol (HTTPSB) HTTP Protocol (HTTP) Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent @par Revision Reference: This Protocol is introduced in UEFI Specification 2.5 **/ I think I should update the copy in the tree with this version, which makes more sense. Do you agree? --=20 Rebecca Cran --niyZcG6eKMvkdIqT1vNXpAcYlpJEpY7ZN-- --LpRjN50aGs9nR7wDkGN1wBsnJhxV4BX8k Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAl0RcIAACgkQDQIrUxG+ ECCBGRAAtO1oS6GeUozlL/ZdCJpiV8y6ZgkvDdzqM+nDVXV0eFfbzCVR5DAPtIKi qRGna9PIAu/zbSCEOvHtIkzYuuj5JcJ3R09O6t923l7h3g/JGh1Z7A/c4PHlmQ8h aQNfUT/FLTN3WsM0bG5uphp+MBv2B6JJjhD7qhrgL9pm1AXNLGd/CEfbfp5a4w7v jYqxbKLs8zoGziyk1xYXppcbD6wmnBBoU8U6gufge1fmWSvhlW13mZNv2stwIRiw A/g+vHWdVgiHhq2okAvkRwCHTyZUFNj4/VCqicvOTezfALaV1KMBenwEXJohE0kL dTIQVheKlEnjc3FWcIDWMnWPNNyKph85Q5fv4jiuKdd87Y6wFP3ILkVbZTLaEkVx aFSJBinXa4dwELSQFTl3uI9vQt8sIIYCzWcUM2mCBJFiBVkt51VsxY/42hCD0cCz VBGsv3FLlyedCbWu16m+BUlNtVR1KX7vo7CIc74XqzRy0TEbfXM+1ZY+wsuuQyJX +sTGCwqmH1ccZ4HwL7H6P6Ux1mYbQZDRVt5VdQMcBHZi4JKgAr1VLE95t8Iefksq TGaUqdRnyd11dtnBdgOkaww5lNbP93KpnsDA8tnCqxyozrpZSXnw5tj7LWa9Dtg6 RH2vJGD5dGFeqvV66KsId5k5uSVeHqMC5BHvmtf6ikmiakzel+E= =BLg4 -----END PGP SIGNATURE----- --LpRjN50aGs9nR7wDkGN1wBsnJhxV4BX8k-- From owner-svn-src-all@freebsd.org Tue Jun 25 01:11:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7466A15B36EF; Tue, 25 Jun 2019 01:11:41 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 EB4F969D5E; Tue, 25 Jun 2019 01:11:40 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5P1Bc0k046754; Mon, 24 Jun 2019 18:11:38 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5P1Bc9I046753; Mon, 24 Jun 2019 18:11:38 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906250111.x5P1Bc9I046753@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa In-Reply-To: <9046989b-f45a-12a9-954f-799ade5b08a2@freebsd.org> To: Rebecca Cran Date: Mon, 24 Jun 2019 18:11:38 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: EB4F969D5E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 01:11:41 -0000 -- Start of PGP signed section. [ Charset UTF-8 unsupported, converting... ] > On 2019-06-24 18:45, Rodney W. Grimes wrote: > > > It sys accompanies, that means not a pointer to.... > > Hum oh my, what has happend to the disclaimer? > > Huh. It turns out the _latest_ version of that file just contains: > > /** @file > This file defines the EFI HTTP Protocol interface. It is split into > the following two main sections: > HTTP Service Binding Protocol (HTTPSB) > HTTP Protocol (HTTP) > > Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> SPDX-License-Identifier: BSD-2-Clause-Patent > > @par Revision Reference: > This Protocol is introduced in UEFI Specification 2.5 > > **/ > > > I think I should update the copy in the tree with this version, which > makes more sense. Do you agree? If that is how the vendor is distributing it now, yes, that would be safer as the above removes the conflict between what the file says and what was done. Please note that -Patent has not been addressed by core@ to my knowledge, and that may or may not be an issue. I shringe when I see these clauses being blanket added to software though. > Rebecca Cran -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 25 01:51:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9166515B440A for ; Tue, 25 Jun 2019 01:51:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 333646ADC9 for ; Tue, 25 Jun 2019 01:51:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x732.google.com with SMTP id g18so11380126qkl.3 for ; Mon, 24 Jun 2019 18:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OgSPO8SK7DQ2XMKh6EoaprmD8nOC94xfFVIxQIeCIIg=; b=HfxUH3VZy4sBQTfspmnYrgv458fASKMfl+DSP6gfUQz6KiEvuYN1iUZ+Zafde8hGux sDw5wizWScHWBYlygGxXNTauEqLaJJY7oC/obHxsH1OUoaqhiB/9fhlhu5q+aV/DLY6G 3j1SrLUAmTE2jedpeqXsUuxEGBeGuCZ6NqfIP+YY7wbyXwbvDEAcsQIdKFD5GDNh8EPt sDvStFuWqlo2nRnhjLriKpcQsJa1/D4uLdE1TmkP3MhTFvzubWWEnCvobw+gb/O0C5Fp qXlGb3ossOK+R/N9JD5BGWKbxo+Fk4QtdUmz9WALOsgL+REAU6wJY9jAD4YbcXtGWH/B icyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OgSPO8SK7DQ2XMKh6EoaprmD8nOC94xfFVIxQIeCIIg=; b=p045GgNiF9lAQ2iSI0TM3PIEBsaf4usrTDkSUWniQbYwvbLBo8pt/HQE6oIyV9Ur3Q cGByS1zxp73+no/x1NBI5YkGTxrirEsIeb5bpxuGjkTwOFQSdbL/ZnNWAZ8RjZbbCMwL caxewI1pu6slkhD93te9GNbbiS7ycJjRzOTPx82dyR7bf6SVjEdr7lfWDmANorv3JEd5 scCJjSDpG5+kowPjfh3On4d8mvLxtDVCb6DJ7LVK1GAiBO4SQ60udpFLeNhxBCSPmck4 JfIE4uhSoC+pz3WmPGGhpD0wwYTqRg2rAmxZPFqHtzn46p41SAGYx7MjkwBgf6icmeaJ TEPQ== X-Gm-Message-State: APjAAAXui8Jdq76jlmawC4QNYrOdl4LtR3336PVFhRboPPMpJ4PL0OSH F5bFe9P38kzLAV491TBlrkbUIypJSC92O1suBxqpIg== X-Google-Smtp-Source: APXvYqwey3xGVcdttZM26xmned+Lr4GjyBVRKHVHa8HSWdNiKEX3zq2FyKN510RhFPR3M5UDete81oaBLCJ3fgfOT5Y= X-Received: by 2002:a37:83c4:: with SMTP id f187mr19331830qkd.380.1561427491267; Mon, 24 Jun 2019 18:51:31 -0700 (PDT) MIME-Version: 1.0 References: <9046989b-f45a-12a9-954f-799ade5b08a2@freebsd.org> <201906250111.x5P1Bc9I046753@gndrsh.dnsmgr.net> In-Reply-To: <201906250111.x5P1Bc9I046753@gndrsh.dnsmgr.net> From: Warner Losh Date: Mon, 24 Jun 2019 19:51:19 -0600 Message-ID: Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa To: "Rodney W. Grimes" Cc: Rebecca Cran , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 333646ADC9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 01:51:32 -0000 Hey Rod, On Mon, Jun 24, 2019 at 7:11 PM Rodney W. Grimes wrote: > -- Start of PGP signed section. > [ Charset UTF-8 unsupported, converting... ] > > On 2019-06-24 18:45, Rodney W. Grimes wrote: > > > > > It sys accompanies, that means not a pointer to.... > > > Hum oh my, what has happend to the disclaimer? > > > > Huh. It turns out the _latest_ version of that file just contains: > > > > /** @file > > This file defines the EFI HTTP Protocol interface. It is split into > > the following two main sections: > > HTTP Service Binding Protocol (HTTPSB) > > HTTP Protocol (HTTP) > > > > Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> > (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @par Revision Reference: > > This Protocol is introduced in UEFI Specification 2.5 > > > > **/ > > > > > > I think I should update the copy in the tree with this version, which > > makes more sense. Do you agree? > Rebecca: I think it frankly doesn't matter. There's no need to go fetch a stone just to keep Rod happy. The version you committed is fine: it is a verbatim copy of the vendor source at some point in the past. I looked at and approved that license. This newer one, I'm less sure about, so please hold off on that. > If that is how the vendor is distributing it now, yes, that would > be safer as the above removes the conflict between what the file says > and what was done. > > Please note that -Patent has not been addressed by core@ to my > knowledge, and that may or may not be an issue. I shringe when > I see these clauses being blanket added to software though. > > Again with the scolding? Rebecca doesn't deserve this level of nit-picking. It is demotivating. She did a great job getting this code into the tree and you wag your finger at her for committing code verbatim from the vendor? It's totally not cool. Please stop this sort of nonsense. The rest of the project stopped this level of nit-picking back in the 90's when we all agreed it was counter productive. Warner From owner-svn-src-all@freebsd.org Tue Jun 25 02:07:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D483615B48A1 for ; Tue, 25 Jun 2019 02:07:25 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 43AEA6B8A0; Tue, 25 Jun 2019 02:07:24 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x5P27M9F073081 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 24 Jun 2019 19:07:22 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x5P27M9r073080; Mon, 24 Jun 2019 19:07:22 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 24 Jun 2019 19:07:22 -0700 From: Gleb Smirnoff To: Mark Johnston Cc: Gordon Tetlow , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r349198 - releng/12.0/sys/net Message-ID: <20190625020722.GS67242@FreeBSD.org> References: <201906191641.x5JGfIsY027804@repo.freebsd.org> <20190624212540.GQ67242@FreeBSD.org> <20190624222341.GB37940@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190624222341.GB37940@raichu> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 43AEA6B8A0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 02:07:26 -0000 Mark, On Mon, Jun 24, 2019 at 06:23:41PM -0400, Mark Johnston wrote: M> > On Wed, Jun 19, 2019 at 04:41:18PM +0000, Gordon Tetlow wrote: M> > G> Author: gordon M> > G> Date: Wed Jun 19 16:41:18 2019 M> > G> New Revision: 349198 M> > G> URL: https://svnweb.freebsd.org/changeset/base/349198 M> > G> M> > G> Log: M> > G> Fix incorrect locking in networking stack. M> > G> M> > G> Approved by: so M> > G> Security: FreeBSD-EN-19:11.net M> > M> > do I understand correct that problem isn't applicable to head, since M> > it was accidentially covered in r340413? Either fix for stable or M> > r340413 aren't a good looking code. M> M> I don't know about "accidentally," but yes. The problem was that M> r340413 could not easily be MFCed. See D17996 and D19764. Copy-pasted my text to old one, if that makes any sense. What do you think about my plan suggested in previous email? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Jun 25 02:35:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEEE215B8477; Tue, 25 Jun 2019 02:35:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 667E46C5C7; Tue, 25 Jun 2019 02:35:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E90BA046; Tue, 25 Jun 2019 02:35:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P2ZNoL047081; Tue, 25 Jun 2019 02:35:23 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P2ZMgg047077; Tue, 25 Jun 2019 02:35:22 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906250235.x5P2ZMgg047077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 25 Jun 2019 02:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349351 - in head: contrib/llvm/lib/Target/PowerPC contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch gnu/usr.bin/cc/cc_tools share/mk X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: contrib/llvm/lib/Target/PowerPC contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch gnu/usr.bin/cc/cc_tools share/mk X-SVN-Commit-Revision: 349351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 667E46C5C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 02:35:24 -0000 Author: jhibbits Date: Tue Jun 25 02:35:22 2019 New Revision: 349351 URL: https://svnweb.freebsd.org/changeset/base/349351 Log: powerpc: Transition to Secure-PLT, like most other OSs (Toolchain part) Summary: Toolchain follow-up to r349350. LLVM patches will be submitted upstream for 9.0 as well. The bsd.cpu.mk change is required because GNU ld assumes BSS-PLT if it cannot determine for certain that it needs Secure-PLT, and some binaries do not compile in such a way to make it know to use Secure-PLT. Reviewed By: nwhitehorn, bdragon, pfg Differential Revision: https://reviews.freebsd.org/D20598 Modified: head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs head/share/mk/bsd.cpu.mk Modified: head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Tue Jun 25 00:40:44 2019 (r349350) +++ head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Tue Jun 25 02:35:22 2019 (r349351) @@ -138,7 +138,8 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU if (isDarwin()) HasLazyResolverStubs = true; - if (TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD()) + if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) + || TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD()) SecurePlt = true; if (HasSPE && IsPPC64) Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp Tue Jun 25 00:40:44 2019 (r349350) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp Tue Jun 25 02:35:22 2019 (r349351) @@ -116,7 +116,8 @@ ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Dr const ArgList &Args) { if (Args.getLastArg(options::OPT_msecure_plt)) return ppc::ReadGOTPtrMode::SecurePlt; - if (Triple.isOSOpenBSD()) + if ((Triple.isOSFreeBSD() && Triple.getOSMajorVersion() >= 13) || + Triple.isOSOpenBSD()) return ppc::ReadGOTPtrMode::SecurePlt; else return ppc::ReadGOTPtrMode::Bss; Modified: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs Tue Jun 25 00:40:44 2019 (r349350) +++ head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs Tue Jun 25 02:35:22 2019 (r349351) @@ -21,6 +21,9 @@ TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h TARGET_INC+= ${GCC_CPU}/unix.h TARGET_INC+= ${GCC_CPU}/att.h .endif +.if ${TARGET_CPUARCH} == "powerpc" +TARGET_INC+= ${GCC_CPU}/secureplt.h +.endif TARGET_INC+= dbxelf.h TARGET_INC+= elfos-undef.h TARGET_INC+= elfos.h Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Tue Jun 25 00:40:44 2019 (r349350) +++ head/share/mk/bsd.cpu.mk Tue Jun 25 02:35:22 2019 (r349351) @@ -369,6 +369,10 @@ CFLAGS += -mfloat-abi=softfp .endif .endif +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" +LDFLAGS+= -Wl,--secure-plt +.endif + .if ${MACHINE_ARCH} == "powerpcspe" CFLAGS += -mcpu=8548 -Wa,-me500 -mspe=yes -mabi=spe -mfloat-gprs=double .endif From owner-svn-src-all@freebsd.org Tue Jun 25 04:50:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6D0715BC56B; Tue, 25 Jun 2019 04:50:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85E667029D; Tue, 25 Jun 2019 04:50:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A135B656; Tue, 25 Jun 2019 04:50:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P4oKmF015994; Tue, 25 Jun 2019 04:50:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P4o9oR015946; Tue, 25 Jun 2019 04:50:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250450.x5P4o9oR015946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 04:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349352 - in head: etc/mtree include lib lib/libnandfs sbin sbin/camcontrol sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk stand stand/arm/uboot stand/common stand... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: etc/mtree include lib lib/libnandfs sbin sbin/camcontrol sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk stand stand/arm/uboot stand/common stand/i386/loader stand/libsa ... X-SVN-Commit-Revision: 349352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85E667029D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 04:50:21 -0000 Author: imp Date: Tue Jun 25 04:50:09 2019 New Revision: 349352 URL: https://svnweb.freebsd.org/changeset/base/349352 Log: Remove NAND and NANDFS support NANDFS has been broken for years. Remove it. The NAND drivers that remain are for ancient parts that are no longer relevant. They are polled, have terrible performance and just for ancient arm hardware. NAND parts have evolved significantly from this early work and little to none of it would be relevant should someone need to update to support raw nand. This code has been off by default for years and has violated the vnode protocol leading to panics since it was committed. Numerous posts to arch@ and other locations have found no actual users for this software. Relnotes: Yes No Objection From: arch@ Differential Revision: https://reviews.freebsd.org/D20745 Deleted: head/lib/libnandfs/Makefile head/lib/libnandfs/Makefile.depend head/lib/libnandfs/libnandfs.h head/lib/libnandfs/nandfs.c head/sbin/nandfs/Makefile head/sbin/nandfs/Makefile.depend head/sbin/nandfs/lssnap.c head/sbin/nandfs/mksnap.c head/sbin/nandfs/nandfs.8 head/sbin/nandfs/nandfs.c head/sbin/nandfs/nandfs.h head/sbin/nandfs/rmsnap.c head/sbin/newfs_nandfs/Makefile head/sbin/newfs_nandfs/Makefile.depend head/sbin/newfs_nandfs/newfs_nandfs.8 head/sbin/newfs_nandfs/newfs_nandfs.c head/share/man/man4/nand.4 head/share/man/man4/nandsim.4 head/share/man/man5/nandfs.5 head/stand/libsa/nandfs.c head/sys/arm/freescale/vybrid/vf_nfc.c head/sys/dev/nand/nand.c head/sys/dev/nand/nand.h head/sys/dev/nand/nand_bbt.c head/sys/dev/nand/nand_cdev.c head/sys/dev/nand/nand_dev.h head/sys/dev/nand/nand_ecc_pos.h head/sys/dev/nand/nand_generic.c head/sys/dev/nand/nand_geom.c head/sys/dev/nand/nand_id.c head/sys/dev/nand/nand_if.m head/sys/dev/nand/nandbus.c head/sys/dev/nand/nandbus.h head/sys/dev/nand/nandbus_if.m head/sys/dev/nand/nandsim.c head/sys/dev/nand/nandsim.h head/sys/dev/nand/nandsim_chip.c head/sys/dev/nand/nandsim_chip.h head/sys/dev/nand/nandsim_ctrl.c head/sys/dev/nand/nandsim_log.c head/sys/dev/nand/nandsim_log.h head/sys/dev/nand/nandsim_swap.c head/sys/dev/nand/nandsim_swap.h head/sys/dev/nand/nfc_fsl.c head/sys/dev/nand/nfc_fsl.h head/sys/dev/nand/nfc_if.m head/sys/dev/nand/nfc_mv.c head/sys/dev/nand/nfc_rb.c head/sys/fs/nandfs/bmap.c head/sys/fs/nandfs/bmap.h head/sys/fs/nandfs/nandfs.h head/sys/fs/nandfs/nandfs_alloc.c head/sys/fs/nandfs/nandfs_bmap.c head/sys/fs/nandfs/nandfs_buffer.c head/sys/fs/nandfs/nandfs_cleaner.c head/sys/fs/nandfs/nandfs_cpfile.c head/sys/fs/nandfs/nandfs_dat.c head/sys/fs/nandfs/nandfs_dir.c head/sys/fs/nandfs/nandfs_fs.h head/sys/fs/nandfs/nandfs_ifile.c head/sys/fs/nandfs/nandfs_mount.h head/sys/fs/nandfs/nandfs_segment.c head/sys/fs/nandfs/nandfs_subr.c head/sys/fs/nandfs/nandfs_subr.h head/sys/fs/nandfs/nandfs_sufile.c head/sys/fs/nandfs/nandfs_vfsops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/modules/nand/Makefile head/sys/modules/nandfs/Makefile head/sys/modules/nandsim/Makefile head/usr.sbin/bhyve/audio.c head/usr.sbin/bhyve/audio.h head/usr.sbin/bhyve/hda_codec.c head/usr.sbin/bhyve/hda_reg.h head/usr.sbin/bhyve/hdac_reg.h head/usr.sbin/bhyve/pci_hda.c head/usr.sbin/bhyve/pci_hda.h head/usr.sbin/nandsim/Makefile head/usr.sbin/nandsim/Makefile.depend head/usr.sbin/nandsim/nandsim.8 head/usr.sbin/nandsim/nandsim.c head/usr.sbin/nandsim/nandsim_cfgparse.c head/usr.sbin/nandsim/nandsim_cfgparse.h head/usr.sbin/nandsim/nandsim_rcfile.c head/usr.sbin/nandsim/nandsim_rcfile.h head/usr.sbin/nandsim/sample.conf head/usr.sbin/nandtool/Makefile head/usr.sbin/nandtool/Makefile.depend head/usr.sbin/nandtool/nand_erase.c head/usr.sbin/nandtool/nand_info.c head/usr.sbin/nandtool/nand_read.c head/usr.sbin/nandtool/nand_readoob.c head/usr.sbin/nandtool/nand_write.c head/usr.sbin/nandtool/nand_writeoob.c head/usr.sbin/nandtool/nandtool.8 head/usr.sbin/nandtool/nandtool.c head/usr.sbin/nandtool/nandtool.h head/usr.sbin/nandtool/usage.h Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/lib/Makefile head/sbin/Makefile head/sbin/camcontrol/camcontrol.c head/share/man/man4/Makefile head/share/man/man5/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/share/mk/src.opts.mk head/stand/arm/uboot/conf.c head/stand/arm/uboot/version head/stand/common/part.c head/stand/common/part.h head/stand/i386/loader/conf.c head/stand/libsa/Makefile head/stand/libsa/stand.h head/stand/loader.mk head/stand/mips/uboot/conf.c head/stand/mips/uboot/version head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/NOTES.armv5 head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/VYBRID head/sys/arm/mv/files.arm7 head/sys/arm/mv/files.mv head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_xpt.c head/sys/cam/scsi/scsi_da.c head/sys/conf/files head/sys/conf/files.powerpc head/sys/conf/kern.opts.mk head/sys/fs/smbfs/smbfs_io.c head/sys/geom/geom_flashmap.c head/sys/modules/Makefile head/sys/sys/param.h head/targets/pseudo/userland/Makefile.depend head/targets/pseudo/userland/lib/Makefile.depend head/usr.bin/vtfontcvt/vtfontcvt.c head/usr.sbin/Makefile head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Tue Jun 25 02:35:22 2019 (r349351) +++ head/etc/mtree/BSD.include.dist Tue Jun 25 04:50:09 2019 (r349352) @@ -138,8 +138,6 @@ mpilib .. .. - nand - .. nvme .. ofw @@ -183,8 +181,6 @@ fdescfs .. msdosfs - .. - nandfs .. nfs .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/include/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -48,7 +48,7 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ - fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ + fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ @@ -158,7 +158,7 @@ copies: .PHONY .META done; \ fi .endfor -.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci:Ndev/veriexec} ${LSUBSUBDIRS} +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/pci:Ndev/veriexec} ${LSUBSUBDIRS} cd ${SRCTOP}/sys; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${SDESTDIR}${INCLUDEDIR}/$i @@ -174,13 +174,6 @@ copies: .PHONY .META cd ${SRCTOP}/sys/dev/bktr; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ ${SDESTDIR}${INCLUDEDIR}/dev/bktr -.if ${MK_NAND} != "no" - cd ${SRCTOP}/sys/dev/nand; \ - ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nandsim.h \ - ${SDESTDIR}${INCLUDEDIR}/dev/nand; \ - ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \ - ${SDESTDIR}${INCLUDEDIR}/dev/nand -.endif cd ${SRCTOP}/sys/dev/evdev; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input.h \ ${SDESTDIR}${INCLUDEDIR}/dev/evdev; \ @@ -268,7 +261,7 @@ symlinks: .PHONY .META ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \ done .endfor -.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci:Ndev/veriexec} +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/pci:Ndev/veriexec} cd ${SRCTOP}/sys/$i; \ for h in *.h; do \ ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \ @@ -289,13 +282,6 @@ symlinks: .PHONY .META ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/bktr/$$h \ ${SDESTDIR}${INCLUDEDIR}/dev/bktr; \ done -.if ${MK_NAND} != "no" - cd ${SRCTOP}/sys/dev/nand; \ - for h in nandsim.h nand_dev.h; do \ - ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/nand/$$h \ - ${SDESTDIR}${INCLUDEDIR}/dev/nand; \ - done -.endif cd ${SRCTOP}/sys/dev/evdev; \ for h in input.h input-event-codes.h uinput.h; do \ ln -fs ../../../../sys/dev/evdev/$$h \ Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/lib/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -174,7 +174,6 @@ SUBDIR.${MK_GOOGLETEST}+= googletest SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s -SUBDIR.${MK_NAND}+= libnandfs SUBDIR.${MK_NETGRAPH}+= libnetgraph SUBDIR.${MK_NIS}+= libypclnt Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/sbin/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -79,8 +79,6 @@ SUBDIR.${MK_IPFILTER}+= ipf SUBDIR.${MK_IPFW}+= ipfw SUBDIR.${MK_IPFW}+= natd SUBDIR.${MK_ISCSI}+= iscontrol -SUBDIR.${MK_NAND}+= nandfs -SUBDIR.${MK_NAND}+= newfs_nandfs SUBDIR.${MK_NVME}+= nvmecontrol SUBDIR.${MK_OPENSSL}+= decryptcore SUBDIR.${MK_PF}+= pfctl Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/sbin/camcontrol/camcontrol.c Tue Jun 25 04:50:09 2019 (r349352) @@ -2326,11 +2326,9 @@ ata_do_identify(struct cam_device *device, int retry_c } } - ident_buf = (struct ata_params *)ptr; - ata_param_fixup(ident_buf); - error = 1; for (i = 0; i < sizeof(struct ata_params) / 2; i++) { + ptr[i] = le16toh(ptr[i]); if (ptr[i] != 0) error = 0; } @@ -2347,6 +2345,26 @@ ata_do_identify(struct cam_device *device, int retry_c free(ptr); return (error); } + + ident_buf = (struct ata_params *)ptr; + if (strncmp(ident_buf->model, "FX", 2) && + strncmp(ident_buf->model, "NEC", 3) && + strncmp(ident_buf->model, "Pioneer", 7) && + strncmp(ident_buf->model, "SHARP", 5)) { + ata_bswap(ident_buf->model, sizeof(ident_buf->model)); + ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); + ata_bswap(ident_buf->media_serial, sizeof(ident_buf->media_serial)); + } + ata_btrim(ident_buf->model, sizeof(ident_buf->model)); + ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); + ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); + ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); + ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + ata_btrim(ident_buf->media_serial, sizeof(ident_buf->media_serial)); + ata_bpack(ident_buf->media_serial, ident_buf->media_serial, + sizeof(ident_buf->media_serial)); *ident_bufp = ident_buf; Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/share/man/man4/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -303,8 +303,6 @@ MAN= aac.4 \ mx25l.4 \ mxge.4 \ my.4 \ - nand.4 \ - nandsim.4 \ ${_ndis.4} \ net80211.4 \ netdump.4 \ Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/share/man/man5/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -101,10 +101,6 @@ MAN+= freebsd-update.conf.5 MAN+= hesiod.conf.5 .endif -.if ${MK_NAND} != "no" -MAN+= nandfs.5 -.endif - .if ${MK_PF} != "no" MAN+= pf.conf.5 \ pf.os.5 Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Tue Jun 25 02:35:22 2019 (r349351) +++ head/share/mk/bsd.libnames.mk Tue Jun 25 04:50:09 2019 (r349352) @@ -104,7 +104,6 @@ LIBMLX4?= ${LIBDESTDIR}${LIBDIR_BASE}/libmlx4.a LIBMLX5?= ${LIBDESTDIR}${LIBDIR_BASE}/libmlx5.a LIBMP?= ${LIBDESTDIR}${LIBDIR_BASE}/libmp.a LIBMT?= ${LIBDESTDIR}${LIBDIR_BASE}/libmt.a -LIBNANDFS?= ${LIBDESTDIR}${LIBDIR_BASE}/libnandfs.a LIBNCURSES?= ${LIBDESTDIR}${LIBDIR_BASE}/libncurses.a LIBNCURSESW?= ${LIBDESTDIR}${LIBDIR_BASE}/libncursesw.a LIBNETGRAPH?= ${LIBDESTDIR}${LIBDIR_BASE}/libnetgraph.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Jun 25 02:35:22 2019 (r349351) +++ head/share/mk/src.libnames.mk Tue Jun 25 04:50:09 2019 (r349352) @@ -135,7 +135,6 @@ _LIBRARIES= \ memstat \ mp \ mt \ - nandfs \ ncurses \ ncursesw \ netgraph \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Jun 25 02:35:22 2019 (r349351) +++ head/share/mk/src.opts.mk Tue Jun 25 04:50:09 2019 (r349352) @@ -206,7 +206,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FORCE_LE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ - NAND \ OFED_EXTRA \ OPENLDAP \ RPCBIND_WARMSTART_SUPPORT \ Modified: head/stand/arm/uboot/conf.c ============================================================================== --- head/stand/arm/uboot/conf.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/arm/uboot/conf.c Tue Jun 25 04:50:09 2019 (r349352) @@ -59,9 +59,6 @@ struct fs_ops *file_system[] = { #if defined(LOADER_EXT2FS_SUPPORT) &ext2fs_fsops, #endif -#if defined(LOADER_NANDFS_SUPPORT) - &nandfs_fsops, -#endif #if defined(LOADER_NFS_SUPPORT) &nfs_fsops, #endif Modified: head/stand/arm/uboot/version ============================================================================== --- head/stand/arm/uboot/version Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/arm/uboot/version Tue Jun 25 04:50:09 2019 (r349352) @@ -3,6 +3,7 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +1.3: Remove NAND FS support. 1.2: Extended with NAND FS support. 1.1: Flattened Device Tree blob support. 1.0: Added storage support. Booting from HDD, USB, etc. is now possible. Modified: head/stand/common/part.c ============================================================================== --- head/stand/common/part.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/common/part.c Tue Jun 25 04:50:09 2019 (r349352) @@ -57,7 +57,6 @@ static const uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYP static const uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; static const uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static const uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; -static const uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; static const uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; static const uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; static const uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; @@ -91,7 +90,6 @@ static struct parttypes { { PART_EFI, "EFI" }, { PART_FREEBSD, "FreeBSD" }, { PART_FREEBSD_BOOT, "FreeBSD boot" }, - { PART_FREEBSD_NANDFS, "FreeBSD nandfs" }, { PART_FREEBSD_UFS, "FreeBSD UFS" }, { PART_FREEBSD_ZFS, "FreeBSD ZFS" }, { PART_FREEBSD_SWAP, "FreeBSD swap" }, @@ -141,8 +139,6 @@ gpt_parttype(uuid_t type) return (PART_FREEBSD_SWAP); else if (uuid_equal(&type, &gpt_uuid_freebsd_vinum, NULL)) return (PART_FREEBSD_VINUM); - else if (uuid_equal(&type, &gpt_uuid_freebsd_nandfs, NULL)) - return (PART_FREEBSD_NANDFS); else if (uuid_equal(&type, &gpt_uuid_freebsd, NULL)) return (PART_FREEBSD); return (PART_UNKNOWN); @@ -445,8 +441,6 @@ bsd_parttype(uint8_t type) { switch (type) { - case FS_NANDFS: - return (PART_FREEBSD_NANDFS); case FS_SWAP: return (PART_FREEBSD_SWAP); case FS_BSDFFS: @@ -527,8 +521,6 @@ vtoc8_parttype(uint16_t type) { switch (type) { - case VTOC_TAG_FREEBSD_NANDFS: - return (PART_FREEBSD_NANDFS); case VTOC_TAG_FREEBSD_SWAP: return (PART_FREEBSD_SWAP); case VTOC_TAG_FREEBSD_UFS: Modified: head/stand/common/part.h ============================================================================== --- head/stand/common/part.h Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/common/part.h Tue Jun 25 04:50:09 2019 (r349352) @@ -45,7 +45,6 @@ enum partition_type { PART_EFI, PART_FREEBSD, PART_FREEBSD_BOOT, - PART_FREEBSD_NANDFS, PART_FREEBSD_UFS, PART_FREEBSD_ZFS, PART_FREEBSD_SWAP, Modified: head/stand/i386/loader/conf.c ============================================================================== --- head/stand/i386/loader/conf.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/i386/loader/conf.c Tue Jun 25 04:50:09 2019 (r349352) @@ -84,9 +84,6 @@ struct fs_ops *file_system[] = { #if defined(LOADER_CD9660_SUPPORT) &cd9660_fsops, #endif -#if defined(LOADER_NANDFS_SUPPORT) - &nandfs_fsops, -#endif #ifdef LOADER_NFS_SUPPORT &nfs_fsops, #endif Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/libsa/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -145,9 +145,6 @@ SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c SRCS+= dosfs.c ext2fs.c SRCS+= splitfs.c SRCS+= pkgfs.c -.if ${MK_NAND} != "no" -SRCS+= nandfs.c -.endif # kernel ufs support .PATH: ${SRCTOP}/sys/ufs/ffs Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/libsa/stand.h Tue Jun 25 04:50:09 2019 (r349352) @@ -119,7 +119,6 @@ extern struct fs_ops ufs_fsops; extern struct fs_ops tftp_fsops; extern struct fs_ops nfs_fsops; extern struct fs_ops cd9660_fsops; -extern struct fs_ops nandfs_fsops; extern struct fs_ops gzipfs_fsops; extern struct fs_ops bzipfs_fsops; extern struct fs_ops dosfs_fsops; Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/loader.mk Tue Jun 25 04:50:09 2019 (r349352) @@ -99,9 +99,6 @@ CFLAGS+= -DLOADER_EXT2FS_SUPPORT .if ${LOADER_MSDOS_SUPPORT:Uno} == "yes" CFLAGS+= -DLOADER_MSDOS_SUPPORT .endif -.if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes" -CFLAGS+= -DLOADER_NANDFS_SUPPORT -.endif .if ${LOADER_UFS_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_UFS_SUPPORT .endif Modified: head/stand/mips/uboot/conf.c ============================================================================== --- head/stand/mips/uboot/conf.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/mips/uboot/conf.c Tue Jun 25 04:50:09 2019 (r349352) @@ -62,9 +62,6 @@ struct fs_ops *file_system[] = { #if defined(LOADER_EXT2FS_SUPPORT) &ext2fs_fsops, #endif -#if defined(LOADER_NANDFS_SUPPORT) - &nandfs_fsops, -#endif #if defined(LOADER_NFS_SUPPORT) &nfs_fsops, #endif Modified: head/stand/mips/uboot/version ============================================================================== --- head/stand/mips/uboot/version Tue Jun 25 02:35:22 2019 (r349351) +++ head/stand/mips/uboot/version Tue Jun 25 04:50:09 2019 (r349352) @@ -3,6 +3,7 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +1.3: Remove NAND FS support. 1.2: Extended with NAND FS support. 1.1: Flattened Device Tree blob support. 1.0: Added storage support. Booting from HDD, USB, etc. is now possible. Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/conf/DB-78XXX Tue Jun 25 04:50:09 2019 (r349352) @@ -74,9 +74,6 @@ device ds133x # SATA device mvs -# NAND -device nand - # GPIO device gpio Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/conf/DB-88F6XXX Tue Jun 25 04:50:09 2019 (r349352) @@ -78,9 +78,6 @@ device twsi # SATA device mvs -# NAND -device nand - # GPIO device gpio Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/conf/DREAMPLUG-1001 Tue Jun 25 04:50:09 2019 (r349352) @@ -157,14 +157,6 @@ options ALTQ_PRIQ # Priority Queueing options ALTQ_NOPCC # Required if the TSC is unusable #options ALTQ_DEBUG -# To use this configuration with the (rare) model 1001N (nand flash), -# create a kernel config file that looks like this: -# -# include DREAMPLUG-1001 -# nomakeoptions FDT_DTS_FILE -# makeoptions FDT_DTS_FILE=dreamplug-1001N.dts -# device nand - # Flattened Device Tree options FDT # Configure using FDT/DTB data options FDT_DTB_STATIC Modified: head/sys/arm/conf/NOTES.armv5 ============================================================================== --- head/sys/arm/conf/NOTES.armv5 Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/conf/NOTES.armv5 Tue Jun 25 04:50:09 2019 (r349352) @@ -31,8 +31,3 @@ options ARM_MANY_BOARD options SOC_MV_DISCOVERY options SOC_MV_KIRKWOOD options SOC_MV_ORION - -# Add devices which are specific to various arm platforms... - -device nand - Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/conf/SHEEVAPLUG Tue Jun 25 04:50:09 2019 (r349352) @@ -72,9 +72,6 @@ device scbus device pass device da -# NAND -device nand - # GPIO device gpio Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/conf/VYBRID Tue Jun 25 04:50:09 2019 (r349352) @@ -37,7 +37,6 @@ options PLATFORM # Platform based SoC #options BOOTP_WIRED_TO=ffec0 #options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" -#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" options ROOTDEVNAME=\"ufs:/dev/da0\" options MUTEX_NOINLINE @@ -79,8 +78,6 @@ device pass #device ata #device atadisk #device mvs - -device nand # Serial ports device uart Modified: head/sys/arm/mv/files.arm7 ============================================================================== --- head/sys/arm/mv/files.arm7 Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/mv/files.arm7 Tue Jun 25 04:50:09 2019 (r349352) @@ -29,7 +29,6 @@ dev/iicbus/twsi/mv_twsi.c optional twsi dev/mge/if_mge.c optional mge dev/neta/if_mvneta_fdt.c optional neta fdt dev/neta/if_mvneta.c optional neta mdio mii -dev/nand/nfc_mv.c optional nand dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/uart/uart_dev_snps.c optional uart Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/arm/mv/files.mv Tue Jun 25 04:50:09 2019 (r349352) @@ -26,7 +26,6 @@ dev/iicbus/twsi/mv_twsi.c optional twsi dev/mge/if_mge.c optional mge dev/neta/if_mvneta_fdt.c optional neta fdt dev/neta/if_mvneta.c optional neta mdio mii -dev/nand/nfc_mv.c optional nand dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/uart/uart_dev_snps.c optional uart Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/cam/ata/ata_all.c Tue Jun 25 04:50:09 2019 (r349352) @@ -1238,28 +1238,3 @@ ata_zac_mgmt_in(struct ccb_ataio *ataio, uint32_t retr ataio->aux = auxiliary; } } - -void -ata_param_fixup(struct ata_params *ident_buf) -{ - int16_t *ptr; - - for (ptr = (int16_t *)ident_buf; - ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { - *ptr = le16toh(*ptr); - } - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); -} Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/cam/ata/ata_all.h Tue Jun 25 04:50:09 2019 (r349352) @@ -135,7 +135,6 @@ void ata_read_log(struct ccb_ataio *ataio, uint32_t re uint16_t block_count, uint32_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint32_t timeout); -void ata_param_fixup(struct ata_params *ident_buf); void ata_bswap(int8_t *buf, int len); void ata_btrim(int8_t *buf, int len); void ata_bpack(int8_t *src, int8_t *dst, int len); Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/cam/ata/ata_xpt.c Tue Jun 25 04:50:09 2019 (r349352) @@ -893,13 +893,14 @@ noerror: case PROBE_IDENTIFY: { struct ccb_pathinq cpi; + int16_t *ptr; int veto = 0; - /* - * Convert to host byte order, and fix the strings. - */ ident_buf = &softc->ident_data; - ata_param_fixup(ident_buf); + for (ptr = (int16_t *)ident_buf; + ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { + *ptr = le16toh(*ptr); + } /* * Allow others to veto this ATA disk attachment. This @@ -911,6 +912,20 @@ noerror: goto device_fail; } + if (strncmp(ident_buf->model, "FX", 2) && + strncmp(ident_buf->model, "NEC", 3) && + strncmp(ident_buf->model, "Pioneer", 7) && + strncmp(ident_buf->model, "SHARP", 5)) { + ata_bswap(ident_buf->model, sizeof(ident_buf->model)); + ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); + } + ata_btrim(ident_buf->model, sizeof(ident_buf->model)); + ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); + ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); + ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); + ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); /* Device may need spin-up before IDENTIFY become valid. */ if ((ident_buf->specconf == 0x37c8 || ident_buf->specconf == 0x738c) && Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 25 04:50:09 2019 (r349352) @@ -64,9 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef _KERNEL -#include -#endif /* _KERNEL */ #include #include @@ -3616,8 +3613,16 @@ out: break; } - ata_params = &periph->path->device->ident_data; + ata_params = (struct ata_params*) + malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + if (ata_params == NULL) { + xpt_print(periph->path, "Couldn't malloc ata_params " + "data\n"); + /* da_free_periph??? */ + break; + } + scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone_probeata, @@ -5187,7 +5192,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * struct da_softc *softc; u_int32_t priority; int continue_probe; - int error; + int error, i; int16_t *ptr; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone_probeata\n")); @@ -5205,7 +5210,8 @@ dadone_probeata(struct cam_periph *periph, union ccb * if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint16_t old_rate; - ata_param_fixup(ata_params); + for (i = 0; i < sizeof(*ata_params) / 2; i++) + ptr[i] = le16toh(ptr[i]); if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM && (softc->quirks & DA_Q_NO_UNMAP) == 0) { dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1); @@ -5289,6 +5295,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * } } + free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /* Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/conf/files Tue Jun 25 04:50:09 2019 (r349352) @@ -1708,7 +1708,7 @@ dev/fdt/fdt_clock_if.m optional fdt fdt_clock dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_pinctrl.c optional fdt fdt_pinctrl dev/fdt/fdt_pinctrl_if.m optional fdt fdt_pinctrl -dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand | fdt mx25l | fdt n25q | fdt at45d +dev/fdt/fdt_slicer.c optional fdt cfi | fdt mx25l | fdt n25q | fdt at45d dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "${FDT_DTS_FILE:T:R}.dtb" dev/fdt/simplebus.c optional fdt @@ -2457,21 +2457,6 @@ dev/mxge/mxge_ethp_z8e.c optional mxge pci dev/mxge/mxge_rss_eth_z8e.c optional mxge pci dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci dev/my/if_my.c optional my -dev/nand/nand.c optional nand -dev/nand/nand_bbt.c optional nand -dev/nand/nand_cdev.c optional nand -dev/nand/nand_generic.c optional nand -dev/nand/nand_geom.c optional nand -dev/nand/nand_id.c optional nand -dev/nand/nandbus.c optional nand -dev/nand/nandbus_if.m optional nand -dev/nand/nand_if.m optional nand -dev/nand/nandsim.c optional nandsim nand -dev/nand/nandsim_chip.c optional nandsim nand -dev/nand/nandsim_ctrl.c optional nandsim nand -dev/nand/nandsim_log.c optional nandsim nand -dev/nand/nandsim_swap.c optional nandsim nand -dev/nand/nfc_if.m optional nand dev/netmap/if_ptnet.c optional netmap inet dev/netmap/netmap.c optional netmap dev/netmap/netmap_bdg.c optional netmap @@ -3499,20 +3484,6 @@ fs/msdosfs/msdosfs_iconv.c optional msdosfs_iconv fs/msdosfs/msdosfs_lookup.c optional msdosfs fs/msdosfs/msdosfs_vfsops.c optional msdosfs fs/msdosfs/msdosfs_vnops.c optional msdosfs -fs/nandfs/bmap.c optional nandfs -fs/nandfs/nandfs_alloc.c optional nandfs -fs/nandfs/nandfs_bmap.c optional nandfs -fs/nandfs/nandfs_buffer.c optional nandfs -fs/nandfs/nandfs_cleaner.c optional nandfs -fs/nandfs/nandfs_cpfile.c optional nandfs -fs/nandfs/nandfs_dat.c optional nandfs -fs/nandfs/nandfs_dir.c optional nandfs -fs/nandfs/nandfs_ifile.c optional nandfs -fs/nandfs/nandfs_segment.c optional nandfs -fs/nandfs/nandfs_subr.c optional nandfs -fs/nandfs/nandfs_sufile.c optional nandfs -fs/nandfs/nandfs_vfsops.c optional nandfs -fs/nandfs/nandfs_vnops.c optional nandfs fs/nfs/nfs_commonkrpc.c optional nfscl | nfsd fs/nfs/nfs_commonsubs.c optional nfscl | nfsd fs/nfs/nfs_commonport.c optional nfscl | nfsd @@ -3600,7 +3571,7 @@ geom/geom_disk.c standard geom/geom_dump.c standard geom/geom_event.c standard geom/geom_fox.c optional geom_fox -geom/geom_flashmap.c optional fdt cfi | fdt nand | fdt mx25l | mmcsd | fdt n25q | fdt at45d +geom/geom_flashmap.c optional fdt cfi | fdt mx25l | mmcsd | fdt n25q | fdt at45d geom/geom_io.c standard geom/geom_kern.c standard geom/geom_map.c optional geom_map Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/conf/files.powerpc Tue Jun 25 04:50:09 2019 (r349352) @@ -43,8 +43,6 @@ dev/iicbus/max6690.c optional max6690 powermac dev/iicbus/ofw_iicbus.c optional iicbus aim dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_opal.c optional powernv ipmi -dev/nand/nfc_fsl.c optional nand mpc85xx -dev/nand/nfc_rb.c optional nand mpc85xx # Most ofw stuff below is brought in by conf/files for options FDT, but # we always want it, even on non-FDT platforms. dev/fdt/simplebus.c standard Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/conf/kern.opts.mk Tue Jun 25 04:50:09 2019 (r349352) @@ -52,7 +52,6 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ - NAND \ OFED \ RATELIMIT Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/fs/smbfs/smbfs_io.c Tue Jun 25 04:50:09 2019 (r349352) @@ -375,6 +375,9 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc */ if (error == EINTR || (!error && (bp->b_flags & B_NEEDCOMMIT))) { + int s; + + s = splbio(); bp->b_flags &= ~(B_INVAL|B_NOCACHE); if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; @@ -384,6 +387,7 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc } if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; + splx(s); } else { if (error) { bp->b_ioflags |= BIO_ERROR; Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/geom/geom_flashmap.c Tue Jun 25 04:50:09 2019 (r349352) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - struct g_flashmap_slice { off_t sl_start; off_t sl_end; @@ -65,7 +63,6 @@ static struct { { "MMC::device", NULL } }; -static g_ioctl_t g_flashmap_ioctl; static g_taste_t g_flashmap_taste; static int g_flashmap_load(device_t dev, struct g_provider *pp, @@ -127,26 +124,6 @@ g_flashmap_modify(struct g_flashmap *gfp, struct g_geo return (0); } -static int -g_flashmap_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, - struct thread *td) -{ - struct g_consumer *cp; - struct g_geom *gp; - - if (cmd != NAND_IO_GET_CHIP_PARAM) - return (ENOIOCTL); - - cp = LIST_FIRST(&pp->geom->consumer); - if (cp == NULL) - return (ENOIOCTL); - gp = cp->provider->geom; - if (gp->ioctl == NULL) - return (ENOIOCTL); - - return (gp->ioctl(cp->provider, cmd, data, fflag, td)); -} - static struct g_geom * g_flashmap_taste(struct g_class *mp, struct g_provider *pp, int flags) { @@ -245,7 +222,6 @@ static struct g_class g_flashmap_class = { .name = FLASHMAP_CLASS_NAME, .version = G_VERSION, .taste = g_flashmap_taste, - .ioctl = g_flashmap_ioctl, }; DECLARE_GEOM_CLASS(g_flashmap_class, g_flashmap); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/modules/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -255,8 +255,6 @@ SUBDIR= \ ${_mwlfw} \ mxge \ my \ - ${_nandfs} \ - ${_nandsim} \ ${_nctgpio} \ ${_ndis} \ ${_netgraph} \ @@ -487,11 +485,6 @@ _mthca= mthca _mlx4ib= mlx4ib _mlx5ib= mlx5ib .endif -.endif - -.if ${MK_NAND} != "no" || defined(ALL_MODULES) -_nandfs= nandfs -_nandsim= nandsim .endif .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jun 25 02:35:22 2019 (r349351) +++ head/sys/sys/param.h Tue Jun 25 04:50:09 2019 (r349352) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300033 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300034 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Tue Jun 25 02:35:22 2019 (r349351) +++ head/targets/pseudo/userland/Makefile.depend Tue Jun 25 04:50:09 2019 (r349352) @@ -772,15 +772,6 @@ DIRDEPS+= \ DIRDEPS+= usr.sbin/efidp .endif -.if ${MK_NAND} != "no" -DIRDEPS+= \ - sbin/nandfs \ - sbin/newfs_nandfs \ - usr.sbin/nandsim \ - usr.sbin/nandtool \ - -.endif - DIRDEPS.amd64= \ sbin/bsdlabel \ sbin/fdisk \ Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Tue Jun 25 02:35:22 2019 (r349351) +++ head/targets/pseudo/userland/lib/Makefile.depend Tue Jun 25 04:50:09 2019 (r349352) @@ -215,10 +215,6 @@ DIRDEPS+= \ DIRDEPS+= stand/libsa32 .endif -.if ${MK_NAND} != "no" -DIRDEPS+= lib/libnandfs -.endif - .if ${MK_CASPER} != "no" DIRDEPS+= \ lib/libcasper/libcasper \ Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 25 02:35:22 2019 (r349351) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 25 04:50:09 2019 (r349352) @@ -335,11 +335,9 @@ parse_bdf(FILE *fp, unsigned int map_idx) break; } } - } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0) { - if (sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, - &fbboy) != 4) - errx(1, "invalid FONTBOUNDINGBOX at line %u", - linenum); + } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0 && + sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, + &fbboy) == 4) { set_width(fbbw); set_height(fbbh); break; @@ -355,9 +353,8 @@ parse_bdf(FILE *fp, unsigned int map_idx) linenum++; ln[length - 1] = '\0'; - if (strncmp(ln, "DWIDTH ", 7) == 0) { - if (sscanf(ln + 7, "%d %d", &dwidth, &dwy) != 2) - errx(1, "invalid DWIDTH at line %u", linenum); + if (strncmp(ln, "DWIDTH ", 7) == 0 && + sscanf(ln + 7, "%d %d", &dwidth, &dwy) == 2) { if (dwy != 0 || (dwidth != fbbw && dwidth * 2 != fbbw)) errx(1, "bitmap with unsupported DWIDTH %d %d at line %u", dwidth, dwy, linenum); Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/usr.sbin/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -166,8 +166,6 @@ SUBDIR.${MK_NS_CACHING}+= nscd SUBDIR.${MK_LPR}+= lpr SUBDIR.${MK_MAN_UTILS}+= manctl SUBDIR.${MK_MLX5TOOL}+= mlx5tool -SUBDIR.${MK_NAND}+= nandsim -SUBDIR.${MK_NAND}+= nandtool SUBDIR.${MK_NETGRAPH}+= flowctl SUBDIR.${MK_NETGRAPH}+= ngctl SUBDIR.${MK_NETGRAPH}+= nghook Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue Jun 25 02:35:22 2019 (r349351) +++ head/usr.sbin/bhyve/Makefile Tue Jun 25 04:50:09 2019 (r349352) @@ -16,7 +16,6 @@ BHYVE_SYSDIR?=${SRCTOP} SRCS= \ atkbdc.c \ acpi.c \ - audio.c \ bhyvegc.c \ bhyverun.c \ block_if.c \ @@ -28,7 +27,6 @@ SRCS= \ dbgport.c \ fwctl.c \ gdb.c \ - hda_codec.c \ inout.c \ ioapic.c \ mem.c \ @@ -38,7 +36,6 @@ SRCS= \ pci_ahci.c \ pci_e82545.c \ pci_emul.c \ - pci_hda.c \ pci_fbuf.c \ pci_hostbridge.c \ pci_irq.c \ Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Tue Jun 25 02:35:22 2019 (r349351) +++ head/usr.sbin/bhyve/bhyve.8 Tue Jun 25 04:50:09 2019 (r349352) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2019 +.Dd December 11, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -248,8 +248,6 @@ Raw framebuffer device attached to VNC server. eXtensible Host Controller Interface (xHCI) USB controller. .It Li nvme NVM Express (NVMe) controller. -.It Li hda -High Definition Audio Controller. .El .It Op Ar conf This optional parameter describes the backend for device emulations. @@ -476,16 +474,6 @@ Max number of concurrent I/O requests. Sector size (defaults to blockif sector size). .It Li ser Serial number with maximum 20 characters. -.El -.Pp -HD Audio devices: -.Bl -tag -width 10n -.It Li play -Playback device, typically -.Ar /dev/dsp0 . -.It Li rec -Recording device, typically -.Ar /dev/dsp0 . .El .El .It Fl S From owner-svn-src-all@freebsd.org Tue Jun 25 06:13:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDFA15C158E; Tue, 25 Jun 2019 06:13:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF5D372868; Tue, 25 Jun 2019 06:13:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC997C70D; Tue, 25 Jun 2019 06:13:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6Du3g062133; Tue, 25 Jun 2019 06:13:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6DuHS062132; Tue, 25 Jun 2019 06:13:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250613.x5P6DuHS062132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349353 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF5D372868 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:13:57 -0000 Author: imp Date: Tue Jun 25 06:13:56 2019 New Revision: 349353 URL: https://svnweb.freebsd.org/changeset/base/349353 Log: Replay r349333 by emaste accidentally reverted by r349352 vtfontcvt: improve .bdf validation Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing or invalid values and and failed sscanf, we would proceeded with partially initialized bounding box / device width variables. Reported by: afl (FONTBOUNDINGBOX) MFC with: r349100 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 25 04:50:09 2019 (r349352) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 25 06:13:56 2019 (r349353) @@ -335,9 +335,11 @@ parse_bdf(FILE *fp, unsigned int map_idx) break; } } - } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0 && - sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, - &fbboy) == 4) { + } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0) { + if (sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, + &fbboy) != 4) + errx(1, "invalid FONTBOUNDINGBOX at line %u", + linenum); set_width(fbbw); set_height(fbbh); break; @@ -353,8 +355,9 @@ parse_bdf(FILE *fp, unsigned int map_idx) linenum++; ln[length - 1] = '\0'; - if (strncmp(ln, "DWIDTH ", 7) == 0 && - sscanf(ln + 7, "%d %d", &dwidth, &dwy) == 2) { + if (strncmp(ln, "DWIDTH ", 7) == 0) { + if (sscanf(ln + 7, "%d %d", &dwidth, &dwy) != 2) + errx(1, "invalid DWIDTH at line %u", linenum); if (dwy != 0 || (dwidth != fbbw && dwidth * 2 != fbbw)) errx(1, "bitmap with unsupported DWIDTH %d %d at line %u", dwidth, dwy, linenum); From owner-svn-src-all@freebsd.org Tue Jun 25 06:14:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A70415C15CA; Tue, 25 Jun 2019 06:14:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 987F172895; Tue, 25 Jun 2019 06:14:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50BB0C70E; Tue, 25 Jun 2019 06:14:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6E1W9062191; Tue, 25 Jun 2019 06:14:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6E1Dh062190; Tue, 25 Jun 2019 06:14:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250614.x5P6E1Dh062190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349354 - head/sys/fs/smbfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/fs/smbfs X-SVN-Commit-Revision: 349354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 987F172895 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:14:02 -0000 Author: imp Date: Tue Jun 25 06:14:00 2019 New Revision: 349354 URL: https://svnweb.freebsd.org/changeset/base/349354 Log: Replay r349334 by markj accidentally reverted by r349352 Remove a lingering use of splbio(). The buffer must be locked by the caller. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/smbfs/smbfs_io.c Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Tue Jun 25 06:13:56 2019 (r349353) +++ head/sys/fs/smbfs/smbfs_io.c Tue Jun 25 06:14:00 2019 (r349354) @@ -375,9 +375,6 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc */ if (error == EINTR || (!error && (bp->b_flags & B_NEEDCOMMIT))) { - int s; - - s = splbio(); bp->b_flags &= ~(B_INVAL|B_NOCACHE); if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; @@ -387,7 +384,6 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc } if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; - splx(s); } else { if (error) { bp->b_ioflags |= BIO_ERROR; From owner-svn-src-all@freebsd.org Tue Jun 25 06:14:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F2815C1609; Tue, 25 Jun 2019 06:14:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C66372958; Tue, 25 Jun 2019 06:14:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AC1AC70F; Tue, 25 Jun 2019 06:14:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6E6wC062249; Tue, 25 Jun 2019 06:14:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6E6N4062242; Tue, 25 Jun 2019 06:14:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250614.x5P6E6N4062242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349355 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C66372958 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:14:09 -0000 Author: imp Date: Tue Jun 25 06:14:05 2019 New Revision: 349355 URL: https://svnweb.freebsd.org/changeset/base/349355 Log: Replay r349335 by scottl accidentally reverted by r349352 Add the PCI HDAudio device model from the 2016 GSoC. Detailed information can be found at https://wiki.freebsd.org/SummerOfCode2016/HDAudioEmulationForBhyve This commit has evolved from the original work to include Capsicum integration. As part of that, it only opens the host audio devices once and leaves them open, instead of opening and closing them on each guest access. Thanks to Peter Grehan and Marcelo Araujo for their help in bringing the work forward and providing some of the final techncial push. Submitted by: Alex Teaca Differential Revision: D7840, D12419 Added: head/usr.sbin/bhyve/audio.c (contents, props changed) head/usr.sbin/bhyve/audio.h (contents, props changed) head/usr.sbin/bhyve/hda_codec.c (contents, props changed) head/usr.sbin/bhyve/hda_reg.h (contents, props changed) head/usr.sbin/bhyve/hdac_reg.h (contents, props changed) head/usr.sbin/bhyve/pci_hda.c (contents, props changed) head/usr.sbin/bhyve/pci_hda.h (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue Jun 25 06:14:00 2019 (r349354) +++ head/usr.sbin/bhyve/Makefile Tue Jun 25 06:14:05 2019 (r349355) @@ -16,6 +16,7 @@ BHYVE_SYSDIR?=${SRCTOP} SRCS= \ atkbdc.c \ acpi.c \ + audio.c \ bhyvegc.c \ bhyverun.c \ block_if.c \ @@ -27,6 +28,7 @@ SRCS= \ dbgport.c \ fwctl.c \ gdb.c \ + hda_codec.c \ inout.c \ ioapic.c \ mem.c \ @@ -36,6 +38,7 @@ SRCS= \ pci_ahci.c \ pci_e82545.c \ pci_emul.c \ + pci_hda.c \ pci_fbuf.c \ pci_hostbridge.c \ pci_irq.c \ Added: head/usr.sbin/bhyve/audio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/audio.c Tue Jun 25 06:14:05 2019 (r349355) @@ -0,0 +1,282 @@ +/*- + * Copyright (c) 2016 Alex Teaca + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifndef WITHOUT_CAPSICUM +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "audio.h" +#include "pci_hda.h" + +/* + * Audio Player internal data structures + */ + +struct audio { + int fd; + uint8_t dir; + uint8_t inited; + char dev_name[64]; +}; + +/* + * Audio Player module function definitions + */ + +/* + * audio_init - initialize an instance of audio player + * @dev_name - the backend sound device used to play / capture + * @dir - dir = 1 for write mode, dir = 0 for read mode + */ +struct audio * +audio_init(const char *dev_name, uint8_t dir) +{ + struct audio *aud = NULL; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { + SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_CHANNELS, + SNDCTL_DSP_SPEED, +#ifdef DEBUG_HDA + SNDCTL_DSP_GETOSPACE, SNDCTL_DSP_GETISPACE, +#endif + }; +#endif + + assert(dev_name); + + aud = calloc(1, sizeof(*aud)); + if (!aud) + return NULL; + + if (strlen(dev_name) < sizeof(aud->dev_name)) + memcpy(aud->dev_name, dev_name, strlen(dev_name) + 1); + else { + DPRINTF("dev_name too big\n"); + free(aud); + return NULL; + } + + aud->dir = dir; + + aud->fd = open(aud->dev_name, aud->dir ? O_WRONLY : O_RDONLY, 0); + if (aud->fd == -1) { + DPRINTF("Failed to open dev: %s, errno: %d\n", + aud->dev_name, errno); + return (NULL); + } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (caph_rights_limit(aud->fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (caph_ioctls_limit(aud->fd, cmds, nitems(cmds)) == -1) + errx(EX_OSERR, "Unable to limit ioctl rights for sandbox"); +#endif + + return aud; +} + +/* + * audio_set_params - reset the sound device and set the audio params + * @aud - the audio player to be configured + * @params - the audio parameters to be set + */ +int +audio_set_params(struct audio *aud, struct audio_params *params) +{ + int audio_fd; + int format, channels, rate; + int err; +#if DEBUG_HDA == 1 + audio_buf_info info; +#endif + + assert(aud); + assert(params); + + if ((audio_fd = aud->fd) < 0) { + DPRINTF("Incorrect audio device descriptor for %s\n", + aud->dev_name); + return (-1); + } + + /* Reset the device if it was previously opened */ + if (aud->inited) { + err = ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); + if (err == -1) { + DPRINTF("Failed to reset fd: %d, errno: %d\n", + aud->fd, errno); + return (-1); + } + } else + aud->inited = 1; + + /* Set the Format (Bits per Sample) */ + format = params->format; + err = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &format); + if (err == -1) { + DPRINTF("Fail to set fmt: 0x%x errno: %d\n", + params->format, errno); + return -1; + } + + /* The device does not support the requested audio format */ + if (format != params->format) { + DPRINTF("Mismatch format: 0x%x params->format: 0x%x\n", + format, params->format); + return -1; + } + + /* Set the Number of Channels */ + channels = params->channels; + err = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &channels); + if (err == -1) { + DPRINTF("Fail to set channels: %d errno: %d\n", + params->channels, errno); + return -1; + } + + /* The device does not support the requested no. of channels */ + if (channels != params->channels) { + DPRINTF("Mismatch channels: %d params->channels: %d\n", + channels, params->channels); + return -1; + } + + /* Set the Sample Rate / Speed */ + rate = params->rate; + err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &rate); + if (err == -1) { + DPRINTF("Fail to set speed: %d errno: %d\n", + params->rate, errno); + return -1; + } + + /* The device does not support the requested rate / speed */ + if (rate != params->rate) { + DPRINTF("Mismatch rate: %d params->rate: %d\n", + rate, params->rate); + return -1; + } + +#if DEBUG_HDA == 1 + err = ioctl(audio_fd, aud->dir ? SNDCTL_DSP_GETOSPACE : + SNDCTL_DSP_GETISPACE, &info); + if (err == -1) { + DPRINTF("Fail to get audio buf info errno: %d\n", errno); + return -1; + } + DPRINTF("fragstotal: 0x%x fragsize: 0x%x\n", + info.fragstotal, info.fragsize); +#endif + return 0; +} + +/* + * audio_playback - plays samples to the sound device using blocking operations + * @aud - the audio player used to play the samples + * @buf - the buffer containing the samples + * @count - the number of bytes in buffer + */ +int +audio_playback(struct audio *aud, const void *buf, size_t count) +{ + int audio_fd = -1; + ssize_t len = 0, total = 0; + + assert(aud); + assert(aud->dir); + assert(buf); + + audio_fd = aud->fd; + assert(audio_fd != -1); + + total = 0; + while (total < count) { + len = write(audio_fd, buf + total, count - total); + if (len == -1) { + DPRINTF("Fail to write to fd: %d, errno: %d\n", + audio_fd, errno); + return -1; + } + + total += len; + } + + return 0; +} + +/* + * audio_record - records samples from the sound device using + * blocking operations. + * @aud - the audio player used to capture the samples + * @buf - the buffer to receive the samples + * @count - the number of bytes to capture in buffer + * Returns -1 on error and 0 on success + */ +int +audio_record(struct audio *aud, void *buf, size_t count) +{ + int audio_fd = -1; + ssize_t len = 0, total = 0; + + assert(aud); + assert(!aud->dir); + assert(buf); + + audio_fd = aud->fd; + assert(audio_fd != -1); + + total = 0; + while (total < count) { + len = read(audio_fd, buf + total, count - total); + if (len == -1) { + DPRINTF("Fail to write to fd: %d, errno: %d\n", + audio_fd, errno); + return -1; + } + + total += len; + } + + return 0; +} Added: head/usr.sbin/bhyve/audio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/audio.h Tue Jun 25 06:14:05 2019 (r349355) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2016 Alex Teaca + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _AUDIO_EMUL_H_ +#define _AUDIO_EMUL_H_ + +#include +#include + +/* + * Audio Player data structures + */ + +struct audio; + +struct audio_params { + int channels; + int format; + int rate; +}; + +/* + * Audio Player API + */ + +/* + * audio_init - initialize an instance of audio player + * @dev_name - the backend sound device used to play / capture + * @dir - dir = 1 for write mode, dir = 0 for read mode + * Returns NULL on error and the address of the audio player instance + */ +struct audio *audio_init(const char *dev_name, uint8_t dir); + +/* + * audio_set_params - reset the sound device and set the audio params + * @aud - the audio player to be configured + * @params - the audio parameters to be set + * Returns -1 on error and 0 on success + */ +int audio_set_params(struct audio *aud, struct audio_params *params); + +/* + * audio_playback - plays samples to the sound device using blocking operations + * @aud - the audio player used to play the samples + * @buf - the buffer containing the samples + * @count - the number of bytes in buffer + * Returns -1 on error and 0 on success + */ +int audio_playback(struct audio *aud, const void *buf, size_t count); + +/* + * audio_record - records samples from the sound device using blocking + * operations. + * @aud - the audio player used to capture the samples + * @buf - the buffer to receive the samples + * @count - the number of bytes to capture in buffer + * Returns -1 on error and 0 on success + */ +int audio_record(struct audio *aud, void *buf, size_t count); + +#endif /* _AUDIO_EMUL_H_ */ Added: head/usr.sbin/bhyve/hda_codec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/hda_codec.c Tue Jun 25 06:14:05 2019 (r349355) @@ -0,0 +1,950 @@ +/*- + * Copyright (c) 2016 Alex Teaca + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "pci_hda.h" +#include "audio.h" + +/* + * HDA Codec defines + */ +#define INTEL_VENDORID 0x8086 + +#define HDA_CODEC_SUBSYSTEM_ID ((INTEL_VENDORID << 16) | 0x01) +#define HDA_CODEC_ROOT_NID 0x00 +#define HDA_CODEC_FG_NID 0x01 +#define HDA_CODEC_AUDIO_OUTPUT_NID 0x02 +#define HDA_CODEC_PIN_OUTPUT_NID 0x03 +#define HDA_CODEC_AUDIO_INPUT_NID 0x04 +#define HDA_CODEC_PIN_INPUT_NID 0x05 + +#define HDA_CODEC_STREAMS_COUNT 0x02 +#define HDA_CODEC_STREAM_OUTPUT 0x00 +#define HDA_CODEC_STREAM_INPUT 0x01 + +#define HDA_CODEC_PARAMS_COUNT 0x14 +#define HDA_CODEC_CONN_LIST_COUNT 0x01 +#define HDA_CODEC_RESPONSE_EX_UNSOL 0x10 +#define HDA_CODEC_RESPONSE_EX_SOL 0x00 +#define HDA_CODEC_AMP_NUMSTEPS 0x4a + +#define HDA_CODEC_SUPP_STREAM_FORMATS_PCM \ + (1 << HDA_PARAM_SUPP_STREAM_FORMATS_PCM_SHIFT) + +#define HDA_CODEC_FMT_BASE_MASK (0x01 << 14) + +#define HDA_CODEC_FMT_MULT_MASK (0x07 << 11) +#define HDA_CODEC_FMT_MULT_2 (0x01 << 11) +#define HDA_CODEC_FMT_MULT_3 (0x02 << 11) +#define HDA_CODEC_FMT_MULT_4 (0x03 << 11) + +#define HDA_CODEC_FMT_DIV_MASK 0x07 +#define HDA_CODEC_FMT_DIV_SHIFT 8 + +#define HDA_CODEC_FMT_BITS_MASK (0x07 << 4) +#define HDA_CODEC_FMT_BITS_8 (0x00 << 4) +#define HDA_CODEC_FMT_BITS_16 (0x01 << 4) +#define HDA_CODEC_FMT_BITS_24 (0x03 << 4) +#define HDA_CODEC_FMT_BITS_32 (0x04 << 4) + +#define HDA_CODEC_FMT_CHAN_MASK (0x0f << 0) + +#define HDA_CODEC_AUDIO_WCAP_OUTPUT \ + (0x00 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_INPUT \ + (0x01 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_PIN \ + (0x04 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_CONN_LIST \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_CONN_LIST_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_FORMAT_OVR \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_FORMAT_OVR_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_AMP_OVR \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_AMP_OVR_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_OUT_AMP \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_OUT_AMP_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_IN_AMP \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_IN_AMP_SHIFT) +#define HDA_CODEC_AUDIO_WCAP_STEREO \ + (1 << HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_SHIFT) + +#define HDA_CODEC_PIN_CAP_OUTPUT \ + (1 << HDA_PARAM_PIN_CAP_OUTPUT_CAP_SHIFT) +#define HDA_CODEC_PIN_CAP_INPUT \ + (1 << HDA_PARAM_PIN_CAP_INPUT_CAP_SHIFT) +#define HDA_CODEC_PIN_CAP_PRESENCE_DETECT \ + (1 << HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP_SHIFT) + +#define HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP \ + (1 << HDA_PARAM_OUTPUT_AMP_CAP_MUTE_CAP_SHIFT) +#define HDA_CODEC_OUTPUT_AMP_CAP_STEPSIZE \ + (0x03 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) +#define HDA_CODEC_OUTPUT_AMP_CAP_NUMSTEPS \ + (HDA_CODEC_AMP_NUMSTEPS << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) +#define HDA_CODEC_OUTPUT_AMP_CAP_OFFSET \ + (HDA_CODEC_AMP_NUMSTEPS << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT) + +#define HDA_CODEC_SET_AMP_GAIN_MUTE_MUTE 0x80 +#define HDA_CODEC_SET_AMP_GAIN_MUTE_GAIN_MASK 0x7f + +#define HDA_CODEC_PIN_SENSE_PRESENCE_PLUGGED (1 << 31) +#define HDA_CODEC_PIN_WIDGET_CTRL_OUT_ENABLE \ + (1 << HDA_CMD_GET_PIN_WIDGET_CTRL_OUT_ENABLE_SHIFT) +#define HDA_CODEC_PIN_WIDGET_CTRL_IN_ENABLE \ + (1 << HDA_CMD_GET_PIN_WIDGET_CTRL_IN_ENABLE_SHIFT) + +#define HDA_CONFIG_DEFAULTCONF_COLOR_BLACK \ + (0x01 << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT) +#define HDA_CONFIG_DEFAULTCONF_COLOR_RED \ + (0x05 << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT) + +#define HDA_CODEC_BUF_SIZE HDA_FIFO_SIZE + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + + +/* + * HDA Audio Context data structures + */ + +typedef void (*transfer_func_t)(void *arg); +typedef int (*setup_func_t)(void *arg); + +struct hda_audio_ctxt { + char name[64]; + uint8_t run; + uint8_t started; + void *priv; + pthread_t tid; + pthread_mutex_t mtx; + pthread_cond_t cond; + setup_func_t do_setup; + transfer_func_t do_transfer; +}; + +/* + * HDA Audio Context module function declarations + */ + +static void *hda_audio_ctxt_thr(void *arg); +static int hda_audio_ctxt_init(struct hda_audio_ctxt *actx, const char *tname, + transfer_func_t do_transfer, setup_func_t do_setup, void *priv); +static int hda_audio_ctxt_start(struct hda_audio_ctxt *actx); +static int hda_audio_ctxt_stop(struct hda_audio_ctxt *actx); + +/* + * HDA Codec data structures + */ + +struct hda_codec_softc; + +typedef uint32_t (*verb_func_t)(struct hda_codec_softc *sc, uint16_t verb, + uint16_t payload); + +struct hda_codec_stream { + uint8_t buf[HDA_CODEC_BUF_SIZE]; + uint8_t channel; + uint16_t fmt; + uint8_t stream; + + uint8_t left_gain; + uint8_t right_gain; + uint8_t left_mute; + uint8_t right_mute; + + struct audio *aud; + struct hda_audio_ctxt actx; +}; + +struct hda_codec_softc { + uint32_t no_nodes; + uint32_t subsystem_id; + const uint32_t (*get_parameters)[HDA_CODEC_PARAMS_COUNT]; + const uint8_t (*conn_list)[HDA_CODEC_CONN_LIST_COUNT]; + const uint32_t *conf_default; + const uint8_t *pin_ctrl_default; + const verb_func_t *verb_handlers; + + struct hda_codec_inst *hci; + struct hda_codec_stream streams[HDA_CODEC_STREAMS_COUNT]; +}; + +/* + * HDA Codec module function declarations + */ +static int hda_codec_init(struct hda_codec_inst *hci, const char *play, + const char *rec, const char *opts); +static int hda_codec_reset(struct hda_codec_inst *hci); +static int hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data); +static int hda_codec_notify(struct hda_codec_inst *hci, uint8_t run, + uint8_t stream, uint8_t dir); + +static int hda_codec_parse_format(uint16_t fmt, struct audio_params *params); + +static uint32_t hda_codec_audio_output_nid(struct hda_codec_softc *sc, + uint16_t verb, uint16_t payload); +static void hda_codec_audio_output_do_transfer(void *arg); +static int hda_codec_audio_output_do_setup(void *arg); +static uint32_t hda_codec_audio_input_nid(struct hda_codec_softc *sc, + uint16_t verb, uint16_t payload); +static void hda_codec_audio_input_do_transfer(void *arg); +static int hda_codec_audio_input_do_setup(void *arg); + +static uint32_t hda_codec_audio_inout_nid(struct hda_codec_stream *st, + uint16_t verb, uint16_t payload); + +/* + * HDA Codec global data + */ + +#define HDA_CODEC_ROOT_DESC \ + [HDA_CODEC_ROOT_NID] = { \ + [HDA_PARAM_VENDOR_ID] = INTEL_VENDORID, \ + [HDA_PARAM_REVISION_ID] = 0xffff, \ + /* 1 Subnode, StartNid = 1 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00010001, \ + }, \ + +#define HDA_CODEC_FG_COMMON_DESC \ + [HDA_PARAM_FCT_GRP_TYPE] = HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO,\ + /* B8 - B32, 8.0 - 192.0kHz */ \ + [HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x1f << 16) | 0x7ff, \ + [HDA_PARAM_SUPP_STREAM_FORMATS] = HDA_CODEC_SUPP_STREAM_FORMATS_PCM,\ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_GPIO_COUNT] = 0x00, \ + +#define HDA_CODEC_FG_OUTPUT_DESC \ + [HDA_CODEC_FG_NID] = { \ + /* 2 Subnodes, StartNid = 2 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00020002, \ + HDA_CODEC_FG_COMMON_DESC \ + }, \ + +#define HDA_CODEC_FG_INPUT_DESC \ + [HDA_CODEC_FG_NID] = { \ + /* 2 Subnodes, StartNid = 4 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00040002, \ + HDA_CODEC_FG_COMMON_DESC \ + }, \ + +#define HDA_CODEC_FG_DUPLEX_DESC \ + [HDA_CODEC_FG_NID] = { \ + /* 4 Subnodes, StartNid = 2 */ \ + [HDA_PARAM_SUB_NODE_COUNT] = 0x00020004, \ + HDA_CODEC_FG_COMMON_DESC \ + }, \ + +#define HDA_CODEC_OUTPUT_DESC \ + [HDA_CODEC_AUDIO_OUTPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_OUTPUT | \ + HDA_CODEC_AUDIO_WCAP_FORMAT_OVR | \ + HDA_CODEC_AUDIO_WCAP_AMP_OVR | \ + HDA_CODEC_AUDIO_WCAP_OUT_AMP | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + /* B16, 16.0 - 192.0kHz */ \ + [HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x02 << 16) | 0x7fc, \ + [HDA_PARAM_SUPP_STREAM_FORMATS] = \ + HDA_CODEC_SUPP_STREAM_FORMATS_PCM, \ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_CONN_LIST_LENGTH] = 0x00, \ + [HDA_PARAM_OUTPUT_AMP_CAP] = \ + HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP | \ + HDA_CODEC_OUTPUT_AMP_CAP_STEPSIZE | \ + HDA_CODEC_OUTPUT_AMP_CAP_NUMSTEPS | \ + HDA_CODEC_OUTPUT_AMP_CAP_OFFSET, \ + }, \ + [HDA_CODEC_PIN_OUTPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_PIN | \ + HDA_CODEC_AUDIO_WCAP_CONN_LIST | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + [HDA_PARAM_PIN_CAP] = HDA_CODEC_PIN_CAP_OUTPUT | \ + HDA_CODEC_PIN_CAP_PRESENCE_DETECT,\ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_CONN_LIST_LENGTH] = 0x01, \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + }, \ + +#define HDA_CODEC_INPUT_DESC \ + [HDA_CODEC_AUDIO_INPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_INPUT | \ + HDA_CODEC_AUDIO_WCAP_CONN_LIST | \ + HDA_CODEC_AUDIO_WCAP_FORMAT_OVR | \ + HDA_CODEC_AUDIO_WCAP_AMP_OVR | \ + HDA_CODEC_AUDIO_WCAP_IN_AMP | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + /* B16, 16.0 - 192.0kHz */ \ + [HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x02 << 16) | 0x7fc, \ + [HDA_PARAM_SUPP_STREAM_FORMATS] = \ + HDA_CODEC_SUPP_STREAM_FORMATS_PCM, \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_CONN_LIST_LENGTH] = 0x01, \ + [HDA_PARAM_INPUT_AMP_CAP] = \ + HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP | \ + HDA_CODEC_OUTPUT_AMP_CAP_STEPSIZE | \ + HDA_CODEC_OUTPUT_AMP_CAP_NUMSTEPS | \ + HDA_CODEC_OUTPUT_AMP_CAP_OFFSET, \ + }, \ + [HDA_CODEC_PIN_INPUT_NID] = { \ + [HDA_PARAM_AUDIO_WIDGET_CAP] = \ + HDA_CODEC_AUDIO_WCAP_PIN | \ + HDA_CODEC_AUDIO_WCAP_STEREO, \ + [HDA_PARAM_PIN_CAP] = HDA_CODEC_PIN_CAP_INPUT | \ + HDA_CODEC_PIN_CAP_PRESENCE_DETECT, \ + [HDA_PARAM_INPUT_AMP_CAP] = 0x00, /* None */ \ + [HDA_PARAM_OUTPUT_AMP_CAP] = 0x00, /* None */ \ + }, \ + +static const uint32_t +hda_codec_output_parameters[][HDA_CODEC_PARAMS_COUNT] = { + HDA_CODEC_ROOT_DESC + HDA_CODEC_FG_OUTPUT_DESC + HDA_CODEC_OUTPUT_DESC +}; + +static const uint32_t +hda_codec_input_parameters[][HDA_CODEC_PARAMS_COUNT] = { + HDA_CODEC_ROOT_DESC + HDA_CODEC_FG_INPUT_DESC + HDA_CODEC_INPUT_DESC +}; + +static const uint32_t +hda_codec_duplex_parameters[][HDA_CODEC_PARAMS_COUNT] = { + HDA_CODEC_ROOT_DESC + HDA_CODEC_FG_DUPLEX_DESC + HDA_CODEC_OUTPUT_DESC + HDA_CODEC_INPUT_DESC +}; + +#define HDA_CODEC_NODES_COUNT (ARRAY_SIZE(hda_codec_duplex_parameters)) + +static const uint8_t +hda_codec_conn_list[HDA_CODEC_NODES_COUNT][HDA_CODEC_CONN_LIST_COUNT] = { + [HDA_CODEC_PIN_OUTPUT_NID] = {HDA_CODEC_AUDIO_OUTPUT_NID}, + [HDA_CODEC_AUDIO_INPUT_NID] = {HDA_CODEC_PIN_INPUT_NID}, +}; + +static const uint32_t +hda_codec_conf_default[HDA_CODEC_NODES_COUNT] = { + [HDA_CODEC_PIN_OUTPUT_NID] = \ + HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_JACK | + HDA_CONFIG_DEFAULTCONF_DEVICE_LINE_OUT | + HDA_CONFIG_DEFAULTCONF_COLOR_BLACK | + (0x01 << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT), + [HDA_CODEC_PIN_INPUT_NID] = HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_JACK | + HDA_CONFIG_DEFAULTCONF_DEVICE_LINE_IN | + HDA_CONFIG_DEFAULTCONF_COLOR_RED | + (0x02 << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT), +}; + +static const uint8_t +hda_codec_pin_ctrl_default[HDA_CODEC_NODES_COUNT] = { + [HDA_CODEC_PIN_OUTPUT_NID] = HDA_CODEC_PIN_WIDGET_CTRL_OUT_ENABLE, + [HDA_CODEC_PIN_INPUT_NID] = HDA_CODEC_PIN_WIDGET_CTRL_IN_ENABLE, +}; + +static const +verb_func_t hda_codec_verb_handlers[HDA_CODEC_NODES_COUNT] = { + [HDA_CODEC_AUDIO_OUTPUT_NID] = hda_codec_audio_output_nid, + [HDA_CODEC_AUDIO_INPUT_NID] = hda_codec_audio_input_nid, +}; + +/* + * HDA Codec module function definitions + */ + +static int +hda_codec_init(struct hda_codec_inst *hci, const char *play, + const char *rec, const char *opts) +{ + struct hda_codec_softc *sc = NULL; + struct hda_codec_stream *st = NULL; + int err; + + if (!(play || rec)) + return (-1); + + DPRINTF("cad: 0x%x opts: %s\n", hci->cad, opts); + + sc = calloc(1, sizeof(*sc)); + if (!sc) + return (-1); + + if (play && rec) + sc->get_parameters = hda_codec_duplex_parameters; + else { + if (play) + sc->get_parameters = hda_codec_output_parameters; + else + sc->get_parameters = hda_codec_input_parameters; + } + sc->subsystem_id = HDA_CODEC_SUBSYSTEM_ID; + sc->no_nodes = HDA_CODEC_NODES_COUNT; + sc->conn_list = hda_codec_conn_list; + sc->conf_default = hda_codec_conf_default; + sc->pin_ctrl_default = hda_codec_pin_ctrl_default; + sc->verb_handlers = hda_codec_verb_handlers; + DPRINTF("HDA Codec nodes: %d\n", sc->no_nodes); + + /* + * Initialize the Audio Output stream + */ + if (play) { + st = &sc->streams[HDA_CODEC_STREAM_OUTPUT]; + + err = hda_audio_ctxt_init(&st->actx, "hda-audio-output", + hda_codec_audio_output_do_transfer, + hda_codec_audio_output_do_setup, sc); + assert(!err); + + st->aud = audio_init(play, 1); + if (!st->aud) { + DPRINTF("Fail to init the output audio player\n"); + return (-1); + } + } + + /* + * Initialize the Audio Input stream + */ + if (rec) { + st = &sc->streams[HDA_CODEC_STREAM_INPUT]; + + err = hda_audio_ctxt_init(&st->actx, "hda-audio-input", + hda_codec_audio_input_do_transfer, + hda_codec_audio_input_do_setup, sc); + assert(!err); + + st->aud = audio_init(rec, 0); + if (!st->aud) { + DPRINTF("Fail to init the input audio player\n"); + return (-1); + } + } + + sc->hci = hci; + hci->priv = sc; + + return (0); +} + +static int +hda_codec_reset(struct hda_codec_inst *hci) +{ + struct hda_ops *hops = NULL; + struct hda_codec_softc *sc = NULL; + struct hda_codec_stream *st = NULL; + int i; + + assert(hci); + + hops = hci->hops; + assert(hops); + + sc = (struct hda_codec_softc *)hci->priv; + assert(sc); + + for (i = 0; i < HDA_CODEC_STREAMS_COUNT; i++) { + st = &sc->streams[i]; + st->left_gain = HDA_CODEC_AMP_NUMSTEPS; + st->right_gain = HDA_CODEC_AMP_NUMSTEPS; + st->left_mute = HDA_CODEC_SET_AMP_GAIN_MUTE_MUTE; + st->right_mute = HDA_CODEC_SET_AMP_GAIN_MUTE_MUTE; + } + + DPRINTF("cad: 0x%x\n", hci->cad); + + if (!hops->signal) { + DPRINTF("The controller ops does not implement \ + the signal function\n"); + return (-1); + } + + return (hops->signal(hci)); +} + +static int +hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) +{ + struct hda_codec_softc *sc = NULL; + struct hda_ops *hops = NULL; + uint8_t cad = 0, nid = 0; + uint16_t verb = 0, payload = 0; + uint32_t res = 0; + + /* 4 bits */ + cad = (cmd_data >> HDA_CMD_CAD_SHIFT) & 0x0f; + /* 8 bits */ + nid = (cmd_data >> HDA_CMD_NID_SHIFT) & 0xff; + + if ((cmd_data & 0x70000) == 0x70000) { + /* 12 bits */ + verb = (cmd_data >> HDA_CMD_VERB_12BIT_SHIFT) & 0x0fff; + /* 8 bits */ + payload = cmd_data & 0xff; + } else { + /* 4 bits */ + verb = (cmd_data >> HDA_CMD_VERB_4BIT_SHIFT) & 0x0f; + /* 16 bits */ + payload = cmd_data & 0xffff; + } + + assert(cad == hci->cad); + assert(hci); + + hops = hci->hops; + assert(hops); + + sc = (struct hda_codec_softc *)hci->priv; + assert(sc); + + assert(nid < sc->no_nodes); + + if (!hops->response) { + DPRINTF("The controller ops does not implement \ + the response function\n"); + return (-1); + } + + switch (verb) { + case HDA_CMD_VERB_GET_PARAMETER: + res = sc->get_parameters[nid][payload]; + break; + case HDA_CMD_VERB_GET_CONN_LIST_ENTRY: + res = sc->conn_list[nid][0]; + break; + case HDA_CMD_VERB_GET_PIN_WIDGET_CTRL: + res = sc->pin_ctrl_default[nid]; + break; + case HDA_CMD_VERB_GET_PIN_SENSE: + res = HDA_CODEC_PIN_SENSE_PRESENCE_PLUGGED; + break; + case HDA_CMD_VERB_GET_CONFIGURATION_DEFAULT: + res = sc->conf_default[nid]; + break; + case HDA_CMD_VERB_GET_SUBSYSTEM_ID: + res = sc->subsystem_id; + break; + default: + assert(sc->verb_handlers); + if (sc->verb_handlers[nid]) + res = sc->verb_handlers[nid](sc, verb, payload); + else + DPRINTF("Unknown VERB: 0x%x\n", verb); + break; + } + + DPRINTF("cad: 0x%x nid: 0x%x verb: 0x%x payload: 0x%x response: 0x%x\n", + cad, nid, verb, payload, res); + + return (hops->response(hci, res, HDA_CODEC_RESPONSE_EX_SOL)); +} + +static int +hda_codec_notify(struct hda_codec_inst *hci, uint8_t run, + uint8_t stream, uint8_t dir) +{ + struct hda_codec_softc *sc = NULL; + struct hda_codec_stream *st = NULL; + struct hda_audio_ctxt *actx = NULL; + int i; + int err; + + assert(hci); + assert(stream); + + sc = (struct hda_codec_softc *)hci->priv; + assert(sc); + + i = dir ? HDA_CODEC_STREAM_OUTPUT : HDA_CODEC_STREAM_INPUT; + st = &sc->streams[i]; + + DPRINTF("run: %d, stream: 0x%x, st->stream: 0x%x dir: %d\n", + run, stream, st->stream, dir); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 25 06:14:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A9115C1655; Tue, 25 Jun 2019 06:14:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEA1972A26; Tue, 25 Jun 2019 06:14:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0339DC710; Tue, 25 Jun 2019 06:14:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6EBBb062300; Tue, 25 Jun 2019 06:14:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6EBOY062299; Tue, 25 Jun 2019 06:14:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250614.x5P6EBOY062299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349356 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CEA1972A26 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:14:19 -0000 Author: imp Date: Tue Jun 25 06:14:11 2019 New Revision: 349356 URL: https://svnweb.freebsd.org/changeset/base/349356 Log: Replay r349336 by scottl accidentally reverted by r349352 Add a section about the HD Audio module support Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Tue Jun 25 06:14:05 2019 (r349355) +++ head/usr.sbin/bhyve/bhyve.8 Tue Jun 25 06:14:11 2019 (r349356) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2018 +.Dd June 24, 2019 .Dt BHYVE 8 .Os .Sh NAME @@ -248,6 +248,8 @@ Raw framebuffer device attached to VNC server. eXtensible Host Controller Interface (xHCI) USB controller. .It Li nvme NVM Express (NVMe) controller. +.It Li hda +High Definition Audio Controller. .El .It Op Ar conf This optional parameter describes the backend for device emulations. @@ -474,6 +476,16 @@ Max number of concurrent I/O requests. Sector size (defaults to blockif sector size). .It Li ser Serial number with maximum 20 characters. +.El +.Pp +HD Audio devices: +.Bl -tag -width 10n +.It Li play +Playback device, typically +.Ar /dev/dsp0 . +.It Li rec +Recording device, typically +.Ar /dev/dsp0 . .El .El .It Fl S From owner-svn-src-all@freebsd.org Tue Jun 25 06:14:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B06E415C165B; Tue, 25 Jun 2019 06:14:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D82672A74; Tue, 25 Jun 2019 06:14:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1007DC712; Tue, 25 Jun 2019 06:14:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6EGKB062354; Tue, 25 Jun 2019 06:14:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6EGjR062353; Tue, 25 Jun 2019 06:14:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250614.x5P6EGjR062353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349357 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 349357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D82672A74 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:14:20 -0000 Author: imp Date: Tue Jun 25 06:14:16 2019 New Revision: 349357 URL: https://svnweb.freebsd.org/changeset/base/349357 Log: Replay r349339 by imp accidentally reverted by r349352 Go ahead and completely fix the ata_params before calling the veto function. This breaks nothing that uses it in the tree since ata_params is ignored in storvsc_ada_probe_veto which is the only in-tree consumer. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Jun 25 06:14:11 2019 (r349356) +++ head/sys/cam/ata/ata_xpt.c Tue Jun 25 06:14:16 2019 (r349357) @@ -896,22 +896,14 @@ noerror: int16_t *ptr; int veto = 0; + /* + * Convert to host byte order, and fix the strings. + */ ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { *ptr = le16toh(*ptr); } - - /* - * Allow others to veto this ATA disk attachment. This - * is mainly used by VMs, whose disk controllers may - * share the disks with the simulated ATA controllers. - */ - EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); - if (veto) { - goto device_fail; - } - if (strncmp(ident_buf->model, "FX", 2) && strncmp(ident_buf->model, "NEC", 3) && strncmp(ident_buf->model, "Pioneer", 7) && @@ -926,6 +918,17 @@ noerror: ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + + /* + * Allow others to veto this ATA disk attachment. This + * is mainly used by VMs, whose disk controllers may + * share the disks with the simulated ATA controllers. + */ + EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); + if (veto) { + goto device_fail; + } + /* Device may need spin-up before IDENTIFY become valid. */ if ((ident_buf->specconf == 0x37c8 || ident_buf->specconf == 0x738c) && From owner-svn-src-all@freebsd.org Tue Jun 25 06:14:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956D715C16C9; Tue, 25 Jun 2019 06:14:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19DF772B00; Tue, 25 Jun 2019 06:14:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C318C714; Tue, 25 Jun 2019 06:14:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6EMXV062412; Tue, 25 Jun 2019 06:14:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6ELXa062408; Tue, 25 Jun 2019 06:14:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250614.x5P6ELXa062408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349358 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 349358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19DF772B00 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:14:24 -0000 Author: imp Date: Tue Jun 25 06:14:21 2019 New Revision: 349358 URL: https://svnweb.freebsd.org/changeset/base/349358 Log: Replay r349340 by imp accidentally reverted by r349352 Create ata_param_fixup Create a common fixup routine to do the canonical fixup of the ata_param fixup. Call it from both the ATA and the ATA over SCSI paths. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_xpt.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Tue Jun 25 06:14:16 2019 (r349357) +++ head/sys/cam/ata/ata_all.c Tue Jun 25 06:14:21 2019 (r349358) @@ -1238,3 +1238,28 @@ ata_zac_mgmt_in(struct ccb_ataio *ataio, uint32_t retr ataio->aux = auxiliary; } } + +void +ata_param_fixup(struct ata_params *ident_buf) +{ + int16_t *ptr; + + for (ptr = (int16_t *)ident_buf; + ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { + *ptr = le16toh(*ptr); + } + if (strncmp(ident_buf->model, "FX", 2) && + strncmp(ident_buf->model, "NEC", 3) && + strncmp(ident_buf->model, "Pioneer", 7) && + strncmp(ident_buf->model, "SHARP", 5)) { + ata_bswap(ident_buf->model, sizeof(ident_buf->model)); + ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); + } + ata_btrim(ident_buf->model, sizeof(ident_buf->model)); + ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); + ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); + ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); + ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); +} Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Tue Jun 25 06:14:16 2019 (r349357) +++ head/sys/cam/ata/ata_all.h Tue Jun 25 06:14:21 2019 (r349358) @@ -135,6 +135,7 @@ void ata_read_log(struct ccb_ataio *ataio, uint32_t re uint16_t block_count, uint32_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint32_t timeout); +void ata_param_fixup(struct ata_params *ident_buf); void ata_bswap(int8_t *buf, int len); void ata_btrim(int8_t *buf, int len); void ata_bpack(int8_t *src, int8_t *dst, int len); Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Jun 25 06:14:16 2019 (r349357) +++ head/sys/cam/ata/ata_xpt.c Tue Jun 25 06:14:21 2019 (r349358) @@ -893,31 +893,13 @@ noerror: case PROBE_IDENTIFY: { struct ccb_pathinq cpi; - int16_t *ptr; int veto = 0; /* * Convert to host byte order, and fix the strings. */ ident_buf = &softc->ident_data; - for (ptr = (int16_t *)ident_buf; - ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { - *ptr = le16toh(*ptr); - } - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + ata_param_fixup(ident_buf); /* * Allow others to veto this ATA disk attachment. This Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 25 06:14:16 2019 (r349357) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 25 06:14:21 2019 (r349358) @@ -5192,7 +5192,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * struct da_softc *softc; u_int32_t priority; int continue_probe; - int error, i; + int error; int16_t *ptr; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone_probeata\n")); @@ -5210,8 +5210,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint16_t old_rate; - for (i = 0; i < sizeof(*ata_params) / 2; i++) - ptr[i] = le16toh(ptr[i]); + ata_param_fixup(ata_params); if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM && (softc->quirks & DA_Q_NO_UNMAP) == 0) { dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1); From owner-svn-src-all@freebsd.org Tue Jun 25 06:14:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A57A15C1712; Tue, 25 Jun 2019 06:14:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC4872BA2; Tue, 25 Jun 2019 06:14:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7328EC715; Tue, 25 Jun 2019 06:14:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6ERdw062466; Tue, 25 Jun 2019 06:14:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6ERHA062465; Tue, 25 Jun 2019 06:14:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250614.x5P6ERHA062465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349359 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 349359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CC4872BA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:14:30 -0000 Author: imp Date: Tue Jun 25 06:14:26 2019 New Revision: 349359 URL: https://svnweb.freebsd.org/changeset/base/349359 Log: Replay r349341 by imp accidentally reverted by r349352 Use ata_param_fixup instead of a custom copy here Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Jun 25 06:14:21 2019 (r349358) +++ head/sbin/camcontrol/camcontrol.c Tue Jun 25 06:14:26 2019 (r349359) @@ -2326,9 +2326,11 @@ ata_do_identify(struct cam_device *device, int retry_c } } + ident_buf = (struct ata_params *)ptr; + ata_param_fixup(ident_buf); + error = 1; for (i = 0; i < sizeof(struct ata_params) / 2; i++) { - ptr[i] = le16toh(ptr[i]); if (ptr[i] != 0) error = 0; } @@ -2345,26 +2347,6 @@ ata_do_identify(struct cam_device *device, int retry_c free(ptr); return (error); } - - ident_buf = (struct ata_params *)ptr; - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bswap(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); - ata_btrim(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - ata_bpack(ident_buf->media_serial, ident_buf->media_serial, - sizeof(ident_buf->media_serial)); *ident_bufp = ident_buf; From owner-svn-src-all@freebsd.org Tue Jun 25 06:14:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 039E315C1757; Tue, 25 Jun 2019 06:14:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9929A72C44; Tue, 25 Jun 2019 06:14:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 023F9C716; Tue, 25 Jun 2019 06:14:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6EVRQ062520; Tue, 25 Jun 2019 06:14:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6EVrN062519; Tue, 25 Jun 2019 06:14:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906250614.x5P6EVrN062519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 06:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349360 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 349360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9929A72C44 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:14:36 -0000 Author: imp Date: Tue Jun 25 06:14:31 2019 New Revision: 349360 URL: https://svnweb.freebsd.org/changeset/base/349360 Log: Replay r349342 by imp accidentally reverted by r349352 Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 25 06:14:26 2019 (r349359) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 25 06:14:31 2019 (r349360) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3613,16 +3616,8 @@ out: break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + ata_params = &periph->path->device->ident_data; - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } - scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone_probeata, @@ -5294,7 +5289,6 @@ dadone_probeata(struct cam_periph *periph, union ccb * } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /* From owner-svn-src-all@freebsd.org Tue Jun 25 06:21:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08A015C1D64 for ; Tue, 25 Jun 2019 06:21:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4366E735C3 for ; Tue, 25 Jun 2019 06:21:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x731.google.com with SMTP id r6so11719109qkc.0 for ; Mon, 24 Jun 2019 23:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vsLhbqy7eJX8FP/iZsR2j3KazmUDFMQz6SarA0qgVIY=; b=0jNp4WMPZ99Kp4AwMpWTvXhOTjc7eN/3XESzruGBmNP2YtsTwdF8JVLo/kW3SRe0RA Ug7AZJfaONscyyvy0+8Nn4azB7Bu1jqreJjthcjUKEcsnsxjdI1tps6D4HS/dHJ202WH qtwd0PLflwLItwDD2IhCmfCmiFW0EzijjPPwWK/ND1NWF0nc//NVcEJFuBQ/xK4eHuME c+9wL0RfryQYWHX0y0FeIYh7gzTcCC+aJdwWHk7+YeXQ6/lxTrE4o3Z5f4dZayNemBIq j3VdyI4SafAGMsdNnamPbvk5Gy5mXJpAuoP1/KJ8VDryfh6f0w8j9K8oqKh8RjekRV5t ttLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vsLhbqy7eJX8FP/iZsR2j3KazmUDFMQz6SarA0qgVIY=; b=rajhwL0qOzr792slpec0A8Upwu1+rdu/A1+ryX5UEqQOeWinP4Pn6M3ZvY7YunD2Vj avLzomPKYTIBuqmp2FxMEjrLzvBxJWL0nHw0kY21imm9Bqav9dS8jq8mCwl93gCXA41p YD4j/R7Fz76bPlt1Ybi/XpmIYUhr1/Qtkzh5wziDxGqPD4+xLGGNjqz5k4HVcX5qhULd gSf6rP5oI/1cPVzMExu0wWsAC8WCE4+Hn7OTj9iikfEPsujjRZBd+qrcBMFaDgyZh6je 8wZLdVeXgD0QzSMtKvYCAEUuJqcDIO3btHwiKX5B1pJyZZIe8IB6g/Kz+bEbjiGATIBk yxrw== X-Gm-Message-State: APjAAAWhUdG98ynWPlw2lQuH++z6+IrKPy7J21XNkl/pwfmmiZC0x2io PzXMTV3s44NFTEA2dyuBLLROElpWExXF+cY2imGXBoeyS+M= X-Google-Smtp-Source: APXvYqyMWeoYtcbouuAjPBRnow9L5ynJoDkYDb9T1Fv8Zup8wh1EsMyq9+430b/nueLIYnJPaDuZJ3eV7mR378b/U5c= X-Received: by 2002:a37:9307:: with SMTP id v7mr20323348qkd.495.1561443696209; Mon, 24 Jun 2019 23:21:36 -0700 (PDT) MIME-Version: 1.0 References: <201906250450.x5P4o9oR015946@repo.freebsd.org> In-Reply-To: <201906250450.x5P4o9oR015946@repo.freebsd.org> From: Warner Losh Date: Tue, 25 Jun 2019 00:21:25 -0600 Message-ID: Subject: Re: svn commit: r349352 - in head: etc/mtree include lib lib/libnandfs sbin sbin/camcontrol sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk stand stand/arm/uboot stand/common stand... To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4366E735C3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:21:37 -0000 This commit accidentally reverted r349333, r349334, r349335, r349336, r349339, r349340, r349341 and r349342. I rebased after one of the make universes I did to proof this set and something must have gone wrong and I lost these changes. I noticed while committing, but didn't hit ^C fast enough to prevent the damage it seems. I've reapplied those changes rather than revert this commit for two reasons: first, reverting commits that delete things has caused me trouble in the past. Second, I judge that to be less repo-churn than doing the revert, then redoing the nand* removal. Time was of the essence, so I hope my snap-judgement was sound. My apologies both for the 'oops' and for any other fallout. Warner On Mon, Jun 24, 2019 at 10:50 PM Warner Losh wrote: > Author: imp > Date: Tue Jun 25 04:50:09 2019 > New Revision: 349352 > URL: https://svnweb.freebsd.org/changeset/base/349352 > > Log: > Remove NAND and NANDFS support > > NANDFS has been broken for years. Remove it. The NAND drivers that > remain are for ancient parts that are no longer relevant. They are > polled, have terrible performance and just for ancient arm > hardware. NAND parts have evolved significantly from this early work > and little to none of it would be relevant should someone need to > update to support raw nand. This code has been off by default for > years and has violated the vnode protocol leading to panics since it > was committed. > > Numerous posts to arch@ and other locations have found no actual users > for this software. > > Relnotes: Yes > No Objection From: arch@ > Differential Revision: https://reviews.freebsd.org/D20745 > ... From owner-svn-src-all@freebsd.org Tue Jun 25 06:24:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C8515C1E31; Tue, 25 Jun 2019 06:24:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB985737DA; Tue, 25 Jun 2019 06:24:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B059C8B4; Tue, 25 Jun 2019 06:24:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P6Owo7068104; Tue, 25 Jun 2019 06:24:58 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P6OvB3068098; Tue, 25 Jun 2019 06:24:57 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201906250624.x5P6OvB3068098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 25 Jun 2019 06:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349361 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB985737DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 06:24:59 -0000 Author: araujo Date: Tue Jun 25 06:24:56 2019 New Revision: 349361 URL: https://svnweb.freebsd.org/changeset/base/349361 Log: Add SPDX tags to bhyve(8) HD Audio device. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20750 Replaced: head/usr.sbin/bhyve/audio.c - copied, changed from r349351, head/usr.sbin/bhyve/audio.c head/usr.sbin/bhyve/audio.h - copied, changed from r349351, head/usr.sbin/bhyve/audio.h head/usr.sbin/bhyve/hda_codec.c - copied, changed from r349351, head/usr.sbin/bhyve/hda_codec.c head/usr.sbin/bhyve/hda_reg.h - copied, changed from r349351, head/usr.sbin/bhyve/hda_reg.h head/usr.sbin/bhyve/hdac_reg.h - copied, changed from r349351, head/usr.sbin/bhyve/hdac_reg.h head/usr.sbin/bhyve/pci_hda.c - copied, changed from r349351, head/usr.sbin/bhyve/pci_hda.c head/usr.sbin/bhyve/pci_hda.h - copied, changed from r349351, head/usr.sbin/bhyve/pci_hda.h Copied and modified: head/usr.sbin/bhyve/audio.c (from r349351, head/usr.sbin/bhyve/audio.c) ============================================================================== --- head/usr.sbin/bhyve/audio.c Tue Jun 25 02:35:22 2019 (r349351, copy source) +++ head/usr.sbin/bhyve/audio.c Tue Jun 25 06:24:56 2019 (r349361) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Alex Teaca * All rights reserved. * Copied and modified: head/usr.sbin/bhyve/audio.h (from r349351, head/usr.sbin/bhyve/audio.h) ============================================================================== --- head/usr.sbin/bhyve/audio.h Tue Jun 25 02:35:22 2019 (r349351, copy source) +++ head/usr.sbin/bhyve/audio.h Tue Jun 25 06:24:56 2019 (r349361) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Alex Teaca * All rights reserved. * Copied and modified: head/usr.sbin/bhyve/hda_codec.c (from r349351, head/usr.sbin/bhyve/hda_codec.c) ============================================================================== --- head/usr.sbin/bhyve/hda_codec.c Tue Jun 25 02:35:22 2019 (r349351, copy source) +++ head/usr.sbin/bhyve/hda_codec.c Tue Jun 25 06:24:56 2019 (r349361) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Alex Teaca * All rights reserved. * Copied and modified: head/usr.sbin/bhyve/hda_reg.h (from r349351, head/usr.sbin/bhyve/hda_reg.h) ============================================================================== --- head/usr.sbin/bhyve/hda_reg.h Tue Jun 25 02:35:22 2019 (r349351, copy source) +++ head/usr.sbin/bhyve/hda_reg.h Tue Jun 25 06:24:56 2019 (r349361) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2006 Stephane E. Potvin * All rights reserved. * Copied and modified: head/usr.sbin/bhyve/hdac_reg.h (from r349351, head/usr.sbin/bhyve/hdac_reg.h) ============================================================================== --- head/usr.sbin/bhyve/hdac_reg.h Tue Jun 25 02:35:22 2019 (r349351, copy source) +++ head/usr.sbin/bhyve/hdac_reg.h Tue Jun 25 06:24:56 2019 (r349361) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2006 Stephane E. Potvin * All rights reserved. * Copied and modified: head/usr.sbin/bhyve/pci_hda.c (from r349351, head/usr.sbin/bhyve/pci_hda.c) ============================================================================== --- head/usr.sbin/bhyve/pci_hda.c Tue Jun 25 02:35:22 2019 (r349351, copy source) +++ head/usr.sbin/bhyve/pci_hda.c Tue Jun 25 06:24:56 2019 (r349361) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Alex Teaca * All rights reserved. * Copied and modified: head/usr.sbin/bhyve/pci_hda.h (from r349351, head/usr.sbin/bhyve/pci_hda.h) ============================================================================== --- head/usr.sbin/bhyve/pci_hda.h Tue Jun 25 02:35:22 2019 (r349351, copy source) +++ head/usr.sbin/bhyve/pci_hda.h Tue Jun 25 06:24:56 2019 (r349361) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Alex Teaca * All rights reserved. * From owner-svn-src-all@freebsd.org Tue Jun 25 07:04:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1409215C2BC8; Tue, 25 Jun 2019 07:04:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A11B274F0A; Tue, 25 Jun 2019 07:04:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D332CF60; Tue, 25 Jun 2019 07:04:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P74mUg089035; Tue, 25 Jun 2019 07:04:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P74mT4089034; Tue, 25 Jun 2019 07:04:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906250704.x5P74mT4089034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 25 Jun 2019 07:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349362 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A11B274F0A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 07:04:49 -0000 Author: cy Date: Tue Jun 25 07:04:47 2019 New Revision: 349362 URL: https://svnweb.freebsd.org/changeset/base/349362 Log: The definition of icmptypes in ip_compt.h is dead code as it already use the icmptypes in ip_icmp.h. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Jun 25 06:24:56 2019 (r349361) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Jun 25 07:04:47 2019 (r349362) @@ -829,159 +829,9 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -#ifndef ICMP_MINLEN -# define ICMP_MINLEN 8 -#endif -#ifndef ICMP_ECHOREPLY -# define ICMP_ECHOREPLY 0 -#endif -#ifndef ICMP_UNREACH -# define ICMP_UNREACH 3 -#endif -#ifndef ICMP_UNREACH_NET -# define ICMP_UNREACH_NET 0 -#endif -#ifndef ICMP_UNREACH_HOST -# define ICMP_UNREACH_HOST 1 -#endif -#ifndef ICMP_UNREACH_PROTOCOL -# define ICMP_UNREACH_PROTOCOL 2 -#endif -#ifndef ICMP_UNREACH_PORT -# define ICMP_UNREACH_PORT 3 -#endif -#ifndef ICMP_UNREACH_NEEDFRAG -# define ICMP_UNREACH_NEEDFRAG 4 -#endif -#ifndef ICMP_UNREACH_SRCFAIL -# define ICMP_UNREACH_SRCFAIL 5 -#endif -#ifndef ICMP_UNREACH_NET_UNKNOWN -# define ICMP_UNREACH_NET_UNKNOWN 6 -#endif -#ifndef ICMP_UNREACH_HOST_UNKNOWN -# define ICMP_UNREACH_HOST_UNKNOWN 7 -#endif -#ifndef ICMP_UNREACH_ISOLATED -# define ICMP_UNREACH_ISOLATED 8 -#endif -#ifndef ICMP_UNREACH_NET_PROHIB -# define ICMP_UNREACH_NET_PROHIB 9 -#endif -#ifndef ICMP_UNREACH_HOST_PROHIB -# define ICMP_UNREACH_HOST_PROHIB 10 -#endif -#ifndef ICMP_UNREACH_TOSNET -# define ICMP_UNREACH_TOSNET 11 -#endif -#ifndef ICMP_UNREACH_TOSHOST -# define ICMP_UNREACH_TOSHOST 12 -#endif -#ifndef ICMP_UNREACH_ADMIN_PROHIBIT -# define ICMP_UNREACH_ADMIN_PROHIBIT 13 -#endif -#ifndef ICMP_UNREACH_FILTER -# define ICMP_UNREACH_FILTER 13 -#endif -#ifndef ICMP_UNREACH_HOST_PRECEDENCE -# define ICMP_UNREACH_HOST_PRECEDENCE 14 -#endif -#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF -# define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 -#endif -#ifndef ICMP_SOURCEQUENCH -# define ICMP_SOURCEQUENCH 4 -#endif -#ifndef ICMP_REDIRECT_NET -# define ICMP_REDIRECT_NET 0 -#endif -#ifndef ICMP_REDIRECT_HOST -# define ICMP_REDIRECT_HOST 1 -#endif -#ifndef ICMP_REDIRECT_TOSNET -# define ICMP_REDIRECT_TOSNET 2 -#endif -#ifndef ICMP_REDIRECT_TOSHOST -# define ICMP_REDIRECT_TOSHOST 3 -#endif -#ifndef ICMP_ALTHOSTADDR -# define ICMP_ALTHOSTADDR 6 -#endif -#ifndef ICMP_TIMXCEED -# define ICMP_TIMXCEED 11 -#endif -#ifndef ICMP_TIMXCEED_INTRANS -# define ICMP_TIMXCEED_INTRANS 0 -#endif -#ifndef ICMP_TIMXCEED_REASS -# define ICMP_TIMXCEED_REASS 1 -#endif -#ifndef ICMP_PARAMPROB -# define ICMP_PARAMPROB 12 -#endif -#ifndef ICMP_PARAMPROB_ERRATPTR -# define ICMP_PARAMPROB_ERRATPTR 0 -#endif -#ifndef ICMP_PARAMPROB_OPTABSENT -# define ICMP_PARAMPROB_OPTABSENT 1 -#endif -#ifndef ICMP_PARAMPROB_LENGTH -# define ICMP_PARAMPROB_LENGTH 2 -#endif -#ifndef ICMP_TSTAMP -# define ICMP_TSTAMP 13 -#endif -#ifndef ICMP_TSTAMPREPLY -# define ICMP_TSTAMPREPLY 14 -#endif -#ifndef ICMP_IREQ -# define ICMP_IREQ 15 -#endif -#ifndef ICMP_IREQREPLY -# define ICMP_IREQREPLY 16 -#endif -#ifndef ICMP_MASKREQ -# define ICMP_MASKREQ 17 -#endif -#ifndef ICMP_MASKREPLY -# define ICMP_MASKREPLY 18 -#endif -#ifndef ICMP_TRACEROUTE -# define ICMP_TRACEROUTE 30 -#endif -#ifndef ICMP_DATACONVERR -# define ICMP_DATACONVERR 31 -#endif -#ifndef ICMP_MOBILE_REDIRECT -# define ICMP_MOBILE_REDIRECT 32 -#endif -#ifndef ICMP_IPV6_WHEREAREYOU -# define ICMP_IPV6_WHEREAREYOU 33 -#endif -#ifndef ICMP_IPV6_IAMHERE -# define ICMP_IPV6_IAMHERE 34 -#endif -#ifndef ICMP_MOBILE_REGREQUEST -# define ICMP_MOBILE_REGREQUEST 35 -#endif -#ifndef ICMP_MOBILE_REGREPLY -# define ICMP_MOBILE_REGREPLY 36 -#endif -#ifndef ICMP_SKIP -# define ICMP_SKIP 39 -#endif -#ifndef ICMP_PHOTURIS -# define ICMP_PHOTURIS 40 -#endif -#ifndef ICMP_PHOTURIS_UNKNOWN_INDEX -# define ICMP_PHOTURIS_UNKNOWN_INDEX 1 -#endif -#ifndef ICMP_PHOTURIS_AUTH_FAILED -# define ICMP_PHOTURIS_AUTH_FAILED 2 -#endif -#ifndef ICMP_PHOTURIS_DECRYPT_FAILED -# define ICMP_PHOTURIS_DECRYPT_FAILED 3 -#endif +# define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB +# define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB + #ifndef IPVERSION # define IPVERSION 4 #endif From owner-svn-src-all@freebsd.org Tue Jun 25 07:44:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A9C715C3A9B; Tue, 25 Jun 2019 07:44:38 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B50FB76459; Tue, 25 Jun 2019 07:44:37 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EDFCD5F8; Tue, 25 Jun 2019 07:44:37 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P7ibG0009950; Tue, 25 Jun 2019 07:44:37 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P7ibLv009949; Tue, 25 Jun 2019 07:44:37 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906250744.x5P7ibLv009949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 25 Jun 2019 07:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349363 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B50FB76459 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 07:44:38 -0000 Author: dougm Date: Tue Jun 25 07:44:37 2019 New Revision: 349363 URL: https://svnweb.freebsd.org/changeset/base/349363 Log: vm_map_protect may return an INVALID_ARGUMENT or PROTECTION_FAILURE error response after clipping the first map entry in the region to be reserved. This creates a pair of matching entries that should have been "simplified" back into one, or never created. This change defers the clipping of that entry until those two vm_map_protect failure cases have been ruled out. Reviewed by: alc Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D20711 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Jun 25 07:04:47 2019 (r349362) +++ head/sys/vm/vm_map.c Tue Jun 25 07:44:37 2019 (r349363) @@ -2472,11 +2472,8 @@ again: VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry(map, start, &entry)) { - vm_map_clip_start(map, entry, start); - } else { + if (!vm_map_lookup_entry(map, start, &entry)) entry = entry->next; - } /* * Make a first pass to check for protection violations. @@ -2515,6 +2512,7 @@ again: * now will do cow due to allowed write (e.g. debugger sets * breakpoint on text segment) */ + vm_map_clip_start(map, entry, start); for (current = entry; current->start < end; current = current->next) { vm_map_clip_end(map, current, end); From owner-svn-src-all@freebsd.org Tue Jun 25 08:01:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ECBE15C4199; Tue, 25 Jun 2019 08:01:36 +0000 (UTC) (envelope-from dougm@rice.edu) Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 124A676BA6; Tue, 25 Jun 2019 08:01:35 +0000 (UTC) (envelope-from dougm@rice.edu) Received: from pps.filterd (m0102856.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5P7l8Y5010970; Tue, 25 Jun 2019 02:47:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=W+2qOlHxWsb2SGPdAYVz5w42hNFlPcciWxfezAHaXsc=; b=JgUs86n6MHnTQBX38K2ezKbl31au6328G5Y8scudqHwu4UFY5fqp0Tf0jbU/K8ys9fYK uZIY7MjLlYZ/BTLKpywTI5o3npNx7ogzRLXWiKh9xvOl657u7IJayluKQQifWf8aPHuV /iOWTQFookzQduqT253j7Sr5Q3BrmOBlJHJWfRLiP8qhSe9qYHv5m/lzAVLcjwAGOtL+ o2jCFfoeJRqRqWI2vHEEiK47Upb467+Mrfar+5GtlEUxSlm6L9AkB7XnUsoHkU60i4K0 EUNI6MYUffukI9fbC2Nm7B8H3KGS+yWorkxj8MKhpQKQKngo7eBEs8jo0zUk2RQVgBr2 Jw== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 2t9hf32wkf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2019 02:47:07 -0500 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 0C72F460D77; Tue, 25 Jun 2019 02:47:07 -0500 (CDT) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 0ADC2460D6E; Tue, 25 Jun 2019 02:47:07 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id iI9RUYSdNTHe; Tue, 25 Jun 2019 02:47:06 -0500 (CDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net [108.254.203.202]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dougm) by mh1.mail.rice.edu (Postfix) with ESMTPSA id AC313460D6A; Tue, 25 Jun 2019 02:47:06 -0500 (CDT) Subject: Re: svn commit: r349363 - head/sys/vm To: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906250744.x5P7ibLv009949@repo.freebsd.org> From: Doug Moore Openpgp: preference=signencrypt Autocrypt: addr=dougm@rice.edu; keydata= mQENBFy53VQBCAD2UiGSouAAMcSIax5Sp9JtRSd9dYVuAmSraY7x5yOylq8yJ5IDvHZy5q3a FamaCHMpXxieiD/8yTnHIeHP4bg02oDD3ALs0hMAEz00pZlLdxeXRfDzAlMTqFF6USPjDUI8 J/WH+pciNT68bFVXFYVg+bgp4GIdi2Md8X8zQQnHY0xLyKE9FjVN1MlCk+62B6fFhMQIEvd5 RQdbGd+ljuoORD1ajljwP1waXKBfAN5RnIbAXppokgQvnwNRf1eZ7GnqSiwu0eaTHGBatPgr y2v5N19R5WxP2kiN95xdlJEwdUikAhWO1UncDxvXQoM1e68L/J85JSLLIgzuywKpBBtdABEB AAG0IERvdWdsYXMgVyBNb29yZSA8ZG91Z21AcmljZS5lZHU+iQFUBBMBCAA+FiEEeV41MZJW A65Cl96D6I8hU9O51W4FAly53VQCGwMFCQWjmoAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQ6I8hU9O51W58mgf8D9xOhD9/nqtHKUBDJz/m5DLzLyQVci6RrRFK9hSyQ1QdkG4VvvRL G1MpjsM16f42N41lf9Zhln7ydwpeUVNeGwwZu2S4EiSPOEhGpNOYC1lRjsD5ai9aZwzHcrAz 2PnyWxNJNEawrVdPUOaVlE+uzYe1048FaaB5tmYtooWZm5RZx6YBKSbWyWI8OvEO9BRlcwjr ErOlVlW3TNLpBGyvXYMAseWEozzsdaVbsekw6+7atIUYh6z9oBZXmClVdcpLF5/rtYhjwIIE 7AlWyt9tEJjRhA+2ujfbm96IrL5J8Da557IhjfslB8KcWGT+ynA5QzIrwidqllHMGsed4MAo RLkBDQRcud1UAQgA2xw6CEAjLMhRWjY86mW63fJ7WjMKUOoQS+0Z2yyUh2vI3oWWMgHbVlm2 7bclX+uidxABeh8gVxMcPX68ri1PsmXwDSNA93Jpm+dYwhugbvDZ5EEzn9ze3MNbGEEhx9j0 JYVmHOeSW7v2ia8H1ZxHIS3WzfKdsuFl0S34St9ojmkMzDNsRzZNvLF5wFeQ0cUI712OyBu3 E+T369rgIV6jwwwmbDI/YIWd2kMr6+6u40tbs70j7IpjluB3/XyaolcRdpDER9YUDXtSOL+/ UmhbQ10UrmIrxD1enqYn1gE8GOuv1P4zueU6qg8hc/wYPtggqR8smRjPQPn/OlcSxBnO4QAR AQABiQE8BBgBCAAmFiEEeV41MZJWA65Cl96D6I8hU9O51W4FAly53VQCGwwFCQWjmoAACgkQ 6I8hU9O51W5IYgf9ElaumHGMK89Y9ZQVJOwwlD1QC6DUoluIjYmudu6VkHRxrbE1VQohHAeu amaNA0qzLAL7RgkUs1HmyEOqJg0g51pm73l8pK97ztPqXEarCT0CnAE0atl43AY2TCjg+ANl zktrd4QDPqGOBfYbUCGPYJ7yukXU7cmnyaJx6XnjZDAuyhMDxkuocxVNJa32cV0NYqY9EDjo GfGaJjF20leX/BsGElCzDzlZgfWpNGQjqGuOdYdKNx43J654MO6HxSRT25j09s26VzpvT6rI c0wNdJ4CBE5tseI+YlbwhxGziQh/FEMnTSqxhWt1Ac6o9TqMQIIKoQhcekvT7EX5uvvOnLkB DQRcusvzAQgAvlC3Q5iWVbOxhZ6QXSiZ0p1SG19XZBo7tY5L4Pu6QPNsl/tIWbyDodMdz8vG rG36sRZXlcLOfZhhAHuWKUcoPpJ9H3deHrYZSK7H9LBvNm+0C8n/acRrkAZYch74A4HXlBpc +pMm1SfXufXm7TWII7hAvxpX/2+eaZppEl8eRf+JfNhK+34aYjoONp+wi6Jz/gMS7EfC+gIw jg3ncionUqKXHR/HR+kUzfQpiGEj0KvL0YgEawyzb1UB+D0Jb97OAiqj+s0jd4THS5S7b4He lDHcrlisUZNMtFoRmuG2fKCjwqOQ6+qNdjkhL8flHtkAUOu51WOR+kqAqKKRx6JnkQARAQAB iQLSBBgBCgAmFiEEeV41MZJWA65Cl96D6I8hU9O51W4FAly6y/MCGwIFCQWjmoABoAkQ6I8h U9O51W7A1CAEGQEKAH0WIQR+kHbQAKIFA/vka1CjtHtWP6FLrAUCXLrL818UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0N0U5MDc2RDAw MEEyMDUwM0ZCRTQ2QjUwQTNCNDdCNTYzRkExNEJBQwAKCRCjtHtWP6FLrKfwB/9JJhuW8pYI egq4N9O416AkIGb7U4WgfSxpn+e8qVL5368LdZ9BMe3CnEJ70gPtdvNPStdkJkeQ+tQHVPBw WkHaCxY9Kw4t+K2sYAGOeePmIhro/V2oDxCjHm/orr6r4XrQur+yvHl6qWliKMyKRSQphJcR jEp4AI/1epzp5ulw0sn4Gjgpp4zkEanuPblPukeu4G+1AeCflyR4D1pWvdQU6rL9zS3MFyDa j/ooh7YDC5qx9Y9HjYcTpPfkSzX9GG2XBmR3+3lo3CW1nAdd3tIBepkdEXEMQpZvPRFb9qfg jyE6V0wC6yG9fxF/TuG8/Trs3WZORa1gFDR0rQROvjHCc/UH/R7Pmbw4s7r/DTl9mGXikXQa VkrCkS99g5D67qerzA1S9SyH7d0iVy3PqFr8vNnwJtB7hjFx6uO2XG75h1CX50q3YYx0gd+U dwcM2GeP5SDQ0fdFoCsPjSTRK5oiD96D85VTbS7EJgF14wHcrBbqulUltE3JSVSIgYy4Jyr4 dF82pM8XWeaVaYAh8yoIDvud5UYRJECIC00VNG1W/wUJKmvIhsFIQXRneEoMvbMpDvP9QvAK WK7E+dYhu/eemFhteDTgbh16AbHcpwkwFWMEke/u393pzSsxKVCrYACxv7aY186fILDrQUpQ qJr40I2R31nvfny8tsCffMIvKtJ98Rw= Message-ID: <7a398e1a-4bd3-f18c-2b64-1f8987a63cd1@rice.edu> Date: Tue, 25 Jun 2019 02:47:06 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <201906250744.x5P7ibLv009949@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-25_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=405 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906250064 X-Rspamd-Queue-Id: 124A676BA6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 08:01:36 -0000 I regret that I omitted the following from the commit message below: Tested by: pho Doug Moore On 6/25/19 2:44 AM, Doug Moore wrote: > Author: dougm > Date: Tue Jun 25 07:44:37 2019 > New Revision: 349363 > URL: https://svnweb.freebsd.org/changeset/base/349363 > > Log: > vm_map_protect may return an INVALID_ARGUMENT or PROTECTION_FAILURE > error response after clipping the first map entry in the region to be > reserved. This creates a pair of matching entries that should have > been "simplified" back into one, or never created. This change defers > the clipping of that entry until those two vm_map_protect failure > cases have been ruled out. > > Reviewed by: alc > Approved by: markj (mentor) > Differential Revision: https://reviews.freebsd.org/D20711 > > Modified: > head/sys/vm/vm_map.c > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Tue Jun 25 07:04:47 2019 (r349362) > +++ head/sys/vm/vm_map.c Tue Jun 25 07:44:37 2019 (r349363) > @@ -2472,11 +2472,8 @@ again: > > VM_MAP_RANGE_CHECK(map, start, end); > > - if (vm_map_lookup_entry(map, start, &entry)) { > - vm_map_clip_start(map, entry, start); > - } else { > + if (!vm_map_lookup_entry(map, start, &entry)) > entry = entry->next; > - } > > /* > * Make a first pass to check for protection violations. > @@ -2515,6 +2512,7 @@ again: > * now will do cow due to allowed write (e.g. debugger sets > * breakpoint on text segment) > */ > + vm_map_clip_start(map, entry, start); > for (current = entry; current->start < end; current = current->next) { > > vm_map_clip_end(map, current, end); > From owner-svn-src-all@freebsd.org Tue Jun 25 09:08:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8168B15C57CC; Tue, 25 Jun 2019 09:08:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 289BE80EE5; Tue, 25 Jun 2019 09:08:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2821E327; Tue, 25 Jun 2019 09:08:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P98ORe052108; Tue, 25 Jun 2019 09:08:24 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P98O3p052107; Tue, 25 Jun 2019 09:08:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906250908.x5P98O3p052107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 25 Jun 2019 09:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349364 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 349364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 289BE80EE5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 09:08:25 -0000 Author: ae Date: Tue Jun 25 09:08:24 2019 New Revision: 349364 URL: https://svnweb.freebsd.org/changeset/base/349364 Log: Restore ipfw(8)'s compact output support broken after r331668. Also modify it a bit. Now -c option omits only 'from any to any' part and works for different protocols (not just for ip). Reported by: Dmitry Selivanov MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Jun 25 07:44:37 2019 (r349363) +++ head/sbin/ipfw/ipfw2.c Tue Jun 25 09:08:24 2019 (r349364) @@ -2223,6 +2223,8 @@ show_static_rule(struct cmdline_opts *co, struct forma } print_proto(bp, fo, &state); + if (co->do_compact != 0 && (rule->flags & IPFW_RULE_NOOPT)) + goto justopts; /* Print source */ bprintf(bp, " from"); @@ -4395,6 +4397,8 @@ chkarg: } OR_BLOCK(get_proto); + first_cmd = cmd; /* update pointer to use in compact form */ + /* * "from", mandatory */ @@ -4466,6 +4470,8 @@ chkarg: cmd = next_cmd(cmd, &cblen); } } + if (first_cmd == cmd) + rule->flags |= IPFW_RULE_NOOPT; read_options: prev = NULL; From owner-svn-src-all@freebsd.org Tue Jun 25 09:11:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77C215C588A; Tue, 25 Jun 2019 09:11:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0CC81130; Tue, 25 Jun 2019 09:11:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27009E361; Tue, 25 Jun 2019 09:11:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5P9BNqD052333; Tue, 25 Jun 2019 09:11:23 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5P9BNGr052332; Tue, 25 Jun 2019 09:11:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906250911.x5P9BNGr052332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 25 Jun 2019 09:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349365 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 349365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C0CC81130 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 09:11:23 -0000 Author: ae Date: Tue Jun 25 09:11:22 2019 New Revision: 349365 URL: https://svnweb.freebsd.org/changeset/base/349365 Log: Mark default rule with IPFW_RULE_NOOPT flag, so it can be showed in compact form. MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Tue Jun 25 09:08:24 2019 (r349364) +++ head/sys/netpfil/ipfw/ip_fw2.c Tue Jun 25 09:11:22 2019 (r349365) @@ -3364,6 +3364,7 @@ vnet_ipfw_init(const void *unused) /* fill and insert the default rule */ rule = ipfw_alloc_rule(chain, sizeof(struct ip_fw)); + rule->flags |= IPFW_RULE_NOOPT; rule->cmd_len = 1; rule->cmd[0].len = 1; rule->cmd[0].opcode = default_to_accept ? O_ACCEPT : O_DENY; From owner-svn-src-all@freebsd.org Tue Jun 25 11:40:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 028E415C9332; Tue, 25 Jun 2019 11:40:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBA2862A4; Tue, 25 Jun 2019 11:40:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77359FC94; Tue, 25 Jun 2019 11:40:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PBecsX030417; Tue, 25 Jun 2019 11:40:38 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PBectm030416; Tue, 25 Jun 2019 11:40:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906251140.x5PBectm030416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 25 Jun 2019 11:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349366 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 349366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CBA2862A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 11:40:39 -0000 Author: ae Date: Tue Jun 25 11:40:37 2019 New Revision: 349366 URL: https://svnweb.freebsd.org/changeset/base/349366 Log: Follow the RFC 3128 and drop short TCP fragments with offset = 1. Reported by: emaste MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Tue Jun 25 09:11:22 2019 (r349365) +++ head/sys/netpfil/ipfw/ip_fw2.c Tue Jun 25 11:40:37 2019 (r349366) @@ -1719,6 +1719,11 @@ do { \ default: break; } + } else { + if (offset == 1 && proto == IPPROTO_TCP) { + /* RFC 3128 */ + goto pullup_failed; + } } UPDATE_POINTERS(); From owner-svn-src-all@freebsd.org Tue Jun 25 11:42:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0809315C95E0; Tue, 25 Jun 2019 11:42:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4B7F866EB; Tue, 25 Jun 2019 11:42:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F45FFE28; Tue, 25 Jun 2019 11:42:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PBgsSk035283; Tue, 25 Jun 2019 11:42:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PBgsdC035282; Tue, 25 Jun 2019 11:42:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906251142.x5PBgsdC035282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 25 Jun 2019 11:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349367 - head/sys/fs/cuse X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/fs/cuse X-SVN-Commit-Revision: 349367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4B7F866EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 11:42:55 -0000 Author: hselasky Date: Tue Jun 25 11:42:53 2019 New Revision: 349367 URL: https://svnweb.freebsd.org/changeset/base/349367 Log: Fix for deadlock situation in cuse(3) The final server unref should be done by the server thread to prevent deadlock in the client cdevpriv destructor, which cannot destroy itself. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/fs/cuse/cuse.c Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Tue Jun 25 11:40:37 2019 (r349366) +++ head/sys/fs/cuse/cuse.c Tue Jun 25 11:42:53 2019 (r349367) @@ -699,12 +699,38 @@ cuse_server_unref(struct cuse_server *pcs) free(pcs, M_CUSE); } +static int +cuse_server_do_close(struct cuse_server *pcs) +{ + int retval; + + cuse_lock(); + cuse_server_is_closing(pcs); + /* final client wakeup, if any */ + cuse_server_wakeup_all_client_locked(pcs); + + knlist_clear(&pcs->selinfo.si_note, 1); + + retval = pcs->refs; + cuse_unlock(); + + return (retval); +} + static void cuse_server_free(void *arg) { struct cuse_server *pcs = arg; - /* drop refcount */ + /* + * The final server unref should be done by the server thread + * to prevent deadlock in the client cdevpriv destructor, + * which cannot destroy itself. + */ + while (cuse_server_do_close(pcs) != 1) + pause("W", hz); + + /* drop final refcount */ cuse_server_unref(pcs); } @@ -746,21 +772,10 @@ static int cuse_server_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { struct cuse_server *pcs; - int error; - error = cuse_server_get(&pcs); - if (error != 0) - goto done; + if (cuse_server_get(&pcs) == 0) + cuse_server_do_close(pcs); - cuse_lock(); - cuse_server_is_closing(pcs); - /* final client wakeup, if any */ - cuse_server_wakeup_all_client_locked(pcs); - - knlist_clear(&pcs->selinfo.si_note, 1); - cuse_unlock(); - -done: return (0); } From owner-svn-src-all@freebsd.org Tue Jun 25 11:46:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A859D15C974D; Tue, 25 Jun 2019 11:46:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D509868C9; Tue, 25 Jun 2019 11:46:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B591FE2A; Tue, 25 Jun 2019 11:46:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PBk16s035475; Tue, 25 Jun 2019 11:46:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PBk1fM035474; Tue, 25 Jun 2019 11:46:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906251146.x5PBk1fM035474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 25 Jun 2019 11:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349368 - head/sys/fs/cuse X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/fs/cuse X-SVN-Commit-Revision: 349368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D509868C9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 11:46:02 -0000 Author: hselasky Date: Tue Jun 25 11:46:01 2019 New Revision: 349368 URL: https://svnweb.freebsd.org/changeset/base/349368 Log: Free all allocated unit IDs in cuse(3) after the client character devices have been destroyed to avoid creating character devices with identical name. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/fs/cuse/cuse.c Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Tue Jun 25 11:42:53 2019 (r349367) +++ head/sys/fs/cuse/cuse.c Tue Jun 25 11:46:01 2019 (r349368) @@ -671,14 +671,14 @@ cuse_server_unref(struct cuse_server *pcs) TAILQ_REMOVE(&cuse_server_head, pcs, entry); - cuse_free_unit_by_id_locked(pcs, -1); - while ((pcsd = TAILQ_FIRST(&pcs->hdev)) != NULL) { TAILQ_REMOVE(&pcs->hdev, pcsd, entry); cuse_unlock(); cuse_server_free_dev(pcsd); cuse_lock(); } + + cuse_free_unit_by_id_locked(pcs, -1); while ((mem = TAILQ_FIRST(&pcs->hmem)) != NULL) { TAILQ_REMOVE(&pcs->hmem, mem, entry); From owner-svn-src-all@freebsd.org Tue Jun 25 11:54:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D1115C9A2F; Tue, 25 Jun 2019 11:54:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9178586D84; Tue, 25 Jun 2019 11:54:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D460FFC8; Tue, 25 Jun 2019 11:54:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PBshJb040364; Tue, 25 Jun 2019 11:54:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PBsg0I040358; Tue, 25 Jun 2019 11:54:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906251154.x5PBsg0I040358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 25 Jun 2019 11:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349369 - in head/sys: net netinet netinet6 netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: net netinet netinet6 netpfil/pf X-SVN-Commit-Revision: 349369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9178586D84 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 11:54:44 -0000 Author: hselasky Date: Tue Jun 25 11:54:41 2019 New Revision: 349369 URL: https://svnweb.freebsd.org/changeset/base/349369 Log: Convert all IPv4 and IPv6 multicast memberships into using a STAILQ instead of a linear array. The multicast memberships for the inpcb structure are protected by a non-sleepable lock, INP_WLOCK(), which needs to be dropped when calling the underlying possibly sleeping if_ioctl() method. When using a linear array to keep track of multicast memberships, the computed memory location of the multicast filter may suddenly change, due to concurrent insertion or removal of elements in the linear array. This in turn leads to various invalid memory access issues and kernel panics. To avoid this problem, put all multicast memberships on a STAILQ based list. Then the memory location of the IPv4 and IPv6 multicast filters become fixed during their lifetime and use after free and memory leak issues are easier to track, for example by: vmstat -m | grep multi All list manipulation has been factored into inline functions including some macros, to easily allow for a future hash-list implementation, if needed. This patch has been tested by pho@ . Differential Revision: https://reviews.freebsd.org/D20080 Reviewed by: markj @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/net/if_vxlan.c head/sys/netinet/in.h head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/in_var.h head/sys/netinet/ip_carp.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_var.h head/sys/netinet6/in6.h head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_var.h head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Tue Jun 25 11:46:01 2019 (r349368) +++ head/sys/net/if_vxlan.c Tue Jun 25 11:54:41 2019 (r349369) @@ -1134,7 +1134,7 @@ vxlan_socket_mc_join_group(struct vxlan_socket *vso, * If we really need to, we can of course look in the INP's * membership list: * sotoinpcb(vso->vxlso_sock)->inp_moptions-> - * imo_membership[]->inm_ifp + * imo_head[]->imf_inm->inm_ifp * similarly to imo_match_group(). */ source->in4.sin_addr = local->in4.sin_addr; Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Tue Jun 25 11:46:01 2019 (r349368) +++ head/sys/netinet/in.h Tue Jun 25 11:54:41 2019 (r349369) @@ -505,13 +505,9 @@ __END_DECLS #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* - * The imo_membership vector for each socket is now dynamically allocated at - * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized - * according to a power-of-two increment. + * Limit for IPv4 multicast memberships */ -#define IP_MIN_MEMBERSHIPS 31 #define IP_MAX_MEMBERSHIPS 4095 -#define IP_MAX_SOURCE_FILTER 1024 /* XXX to be unused */ /* * Default resource limits for IPv4 multicast source filtering. Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue Jun 25 11:46:01 2019 (r349368) +++ head/sys/netinet/in_mcast.c Tue Jun 25 11:54:41 2019 (r349369) @@ -94,7 +94,9 @@ static MALLOC_DEFINE(M_IPMSOURCE, "ip_msource", /* * Locking: - * - Lock order is: Giant, INP_WLOCK, IN_MULTI_LIST_LOCK, IGMP_LOCK, IF_ADDR_LOCK. + * + * - Lock order is: Giant, IN_MULTI_LOCK, INP_WLOCK, + * IN_MULTI_LIST_LOCK, IGMP_LOCK, IF_ADDR_LOCK. * - The IF_ADDR_LOCK is implicitly taken by inm_lookup() earlier, however * it can be taken by code in net/if.c also. * - ip_moptions and in_mfilter are covered by the INP_WLOCK. @@ -144,12 +146,11 @@ static int imf_prune(struct in_mfilter *, const struct static void imf_purge(struct in_mfilter *); static void imf_rollback(struct in_mfilter *); static void imf_reap(struct in_mfilter *); -static int imo_grow(struct ip_moptions *); -static size_t imo_match_group(const struct ip_moptions *, +static struct in_mfilter * + imo_match_group(const struct ip_moptions *, const struct ifnet *, const struct sockaddr *); static struct in_msource * - imo_match_source(const struct ip_moptions *, const size_t, - const struct sockaddr *); + imo_match_source(struct in_mfilter *, const struct sockaddr *); static void ims_merge(struct ip_msource *ims, const struct in_msource *lims, const int rollback); static int in_getmulti(struct ifnet *, const struct in_addr *, @@ -333,6 +334,26 @@ imf_init(struct in_mfilter *imf, const int st0, const imf->imf_st[1] = st1; } +struct in_mfilter * +ip_mfilter_alloc(const int mflags, const int st0, const int st1) +{ + struct in_mfilter *imf; + + imf = malloc(sizeof(*imf), M_INMFILTER, mflags); + if (imf != NULL) + imf_init(imf, st0, st1); + + return (imf); +} + +void +ip_mfilter_free(struct in_mfilter *imf) +{ + + imf_purge(imf); + free(imf, M_INMFILTER); +} + /* * Function for looking up an in_multi record for an IPv4 multicast address * on a given interface. ifp must be valid. If no record found, return NULL. @@ -379,89 +400,30 @@ inm_lookup(struct ifnet *ifp, const struct in_addr ina } /* - * Resize the ip_moptions vector to the next power-of-two minus 1. - * May be called with locks held; do not sleep. - */ -static int -imo_grow(struct ip_moptions *imo) -{ - struct in_multi **nmships; - struct in_multi **omships; - struct in_mfilter *nmfilters; - struct in_mfilter *omfilters; - size_t idx; - size_t newmax; - size_t oldmax; - - nmships = NULL; - nmfilters = NULL; - omships = imo->imo_membership; - omfilters = imo->imo_mfilters; - oldmax = imo->imo_max_memberships; - newmax = ((oldmax + 1) * 2) - 1; - - if (newmax <= IP_MAX_MEMBERSHIPS) { - nmships = (struct in_multi **)realloc(omships, - sizeof(struct in_multi *) * newmax, M_IPMOPTS, M_NOWAIT); - nmfilters = (struct in_mfilter *)realloc(omfilters, - sizeof(struct in_mfilter) * newmax, M_INMFILTER, M_NOWAIT); - if (nmships != NULL && nmfilters != NULL) { - /* Initialize newly allocated source filter heads. */ - for (idx = oldmax; idx < newmax; idx++) { - imf_init(&nmfilters[idx], MCAST_UNDEFINED, - MCAST_EXCLUDE); - } - imo->imo_max_memberships = newmax; - imo->imo_membership = nmships; - imo->imo_mfilters = nmfilters; - } - } - - if (nmships == NULL || nmfilters == NULL) { - if (nmships != NULL) - free(nmships, M_IPMOPTS); - if (nmfilters != NULL) - free(nmfilters, M_INMFILTER); - return (ETOOMANYREFS); - } - - return (0); -} - -/* * Find an IPv4 multicast group entry for this ip_moptions instance * which matches the specified group, and optionally an interface. * Return its index into the array, or -1 if not found. */ -static size_t +static struct in_mfilter * imo_match_group(const struct ip_moptions *imo, const struct ifnet *ifp, const struct sockaddr *group) { const struct sockaddr_in *gsin; - struct in_multi **pinm; - int idx; - int nmships; + struct in_mfilter *imf; + struct in_multi *inm; gsin = (const struct sockaddr_in *)group; - /* The imo_membership array may be lazy allocated. */ - if (imo->imo_membership == NULL || imo->imo_num_memberships == 0) - return (-1); - - nmships = imo->imo_num_memberships; - pinm = &imo->imo_membership[0]; - for (idx = 0; idx < nmships; idx++, pinm++) { - if (*pinm == NULL) + IP_MFILTER_FOREACH(imf, &imo->imo_head) { + inm = imf->imf_inm; + if (inm == NULL) continue; - if ((ifp == NULL || ((*pinm)->inm_ifp == ifp)) && - in_hosteq((*pinm)->inm_addr, gsin->sin_addr)) { + if ((ifp == NULL || (inm->inm_ifp == ifp)) && + in_hosteq(inm->inm_addr, gsin->sin_addr)) { break; } } - if (idx >= nmships) - idx = -1; - - return (idx); + return (imf); } /* @@ -472,23 +434,14 @@ imo_match_group(const struct ip_moptions *imo, const s * it exists, which may not be the desired behaviour. */ static struct in_msource * -imo_match_source(const struct ip_moptions *imo, const size_t gidx, - const struct sockaddr *src) +imo_match_source(struct in_mfilter *imf, const struct sockaddr *src) { struct ip_msource find; - struct in_mfilter *imf; struct ip_msource *ims; const sockunion_t *psa; KASSERT(src->sa_family == AF_INET, ("%s: !AF_INET", __func__)); - KASSERT(gidx != -1 && gidx < imo->imo_num_memberships, - ("%s: invalid index %d\n", __func__, (int)gidx)); - /* The imo_mfilters array may be lazy allocated. */ - if (imo->imo_mfilters == NULL) - return (NULL); - imf = &imo->imo_mfilters[gidx]; - /* Source trees are keyed in host byte order. */ psa = (const sockunion_t *)src; find.ims_haddr = ntohl(psa->sin.sin_addr.s_addr); @@ -507,14 +460,14 @@ int imo_multi_filter(const struct ip_moptions *imo, const struct ifnet *ifp, const struct sockaddr *group, const struct sockaddr *src) { - size_t gidx; + struct in_mfilter *imf; struct in_msource *ims; int mode; KASSERT(ifp != NULL, ("%s: null ifp", __func__)); - gidx = imo_match_group(imo, ifp, group); - if (gidx == -1) + imf = imo_match_group(imo, ifp, group); + if (imf == NULL) return (MCAST_NOTGMEMBER); /* @@ -526,8 +479,8 @@ imo_multi_filter(const struct ip_moptions *imo, const * NOTE: We are comparing group state here at IGMP t1 (now) * with socket-layer t0 (since last downcall). */ - mode = imo->imo_mfilters[gidx].imf_st[1]; - ims = imo_match_source(imo, gidx, src); + mode = imf->imf_st[1]; + ims = imo_match_source(imf, src); if ((ims == NULL && mode == MCAST_INCLUDE) || (ims != NULL && ims->imsl_st[0] != mode)) @@ -1452,7 +1405,6 @@ inp_block_unblock_source(struct inpcb *inp, struct soc struct ip_moptions *imo; struct in_msource *ims; struct in_multi *inm; - size_t idx; uint16_t fmode; int error, doblock; @@ -1531,21 +1483,19 @@ inp_block_unblock_source(struct inpcb *inp, struct soc if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + IN_MULTI_LOCK(); + /* * Check if we are actually a member of this group. */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1 || imo->imo_mfilters == NULL) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { error = EADDRNOTAVAIL; goto out_inp_locked; } + inm = imf->imf_inm; - KASSERT(imo->imo_mfilters != NULL, - ("%s: imo_mfilters not allocated", __func__)); - imf = &imo->imo_mfilters[idx]; - inm = imo->imo_membership[idx]; - /* * Attempting to use the delta-based API on an * non exclusive-mode membership is an error. @@ -1562,7 +1512,7 @@ inp_block_unblock_source(struct inpcb *inp, struct soc * Asked to unblock, but nothing to unblock. * If adding a new block entry, allocate it. */ - ims = imo_match_source(imo, idx, &ssa->sa); + ims = imo_match_source(imf, &ssa->sa); if ((ims != NULL && doblock) || (ims == NULL && !doblock)) { CTR3(KTR_IGMPV3, "%s: source 0x%08x %spresent", __func__, ntohl(ssa->sin.sin_addr.s_addr), doblock ? "" : "not "); @@ -1593,14 +1543,13 @@ inp_block_unblock_source(struct inpcb *inp, struct soc /* * Begin state merge transaction at IGMP layer. */ - IN_MULTI_LOCK(); CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -1609,9 +1558,6 @@ inp_block_unblock_source(struct inpcb *inp, struct soc if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); -out_in_multi_locked: - - IN_MULTI_UNLOCK(); out_imf_rollback: if (error) imf_rollback(imf); @@ -1622,6 +1568,7 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } @@ -1636,9 +1583,6 @@ static struct ip_moptions * inp_findmoptions(struct inpcb *inp) { struct ip_moptions *imo; - struct in_multi **immp; - struct in_mfilter *imfp; - size_t idx; INP_WLOCK(inp); if (inp->inp_moptions != NULL) @@ -1647,29 +1591,16 @@ inp_findmoptions(struct inpcb *inp) INP_WUNLOCK(inp); imo = malloc(sizeof(*imo), M_IPMOPTS, M_WAITOK); - immp = malloc(sizeof(*immp) * IP_MIN_MEMBERSHIPS, M_IPMOPTS, - M_WAITOK | M_ZERO); - imfp = malloc(sizeof(struct in_mfilter) * IP_MIN_MEMBERSHIPS, - M_INMFILTER, M_WAITOK); imo->imo_multicast_ifp = NULL; imo->imo_multicast_addr.s_addr = INADDR_ANY; imo->imo_multicast_vif = -1; imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL; imo->imo_multicast_loop = in_mcast_loop; - imo->imo_num_memberships = 0; - imo->imo_max_memberships = IP_MIN_MEMBERSHIPS; - imo->imo_membership = immp; + STAILQ_INIT(&imo->imo_head); - /* Initialize per-group source filters. */ - for (idx = 0; idx < IP_MIN_MEMBERSHIPS; idx++) - imf_init(&imfp[idx], MCAST_UNDEFINED, MCAST_EXCLUDE); - imo->imo_mfilters = imfp; - INP_WLOCK(inp); if (inp->inp_moptions != NULL) { - free(imfp, M_INMFILTER); - free(immp, M_IPMOPTS); free(imo, M_IPMOPTS); return (inp->inp_moptions); } @@ -1680,32 +1611,25 @@ inp_findmoptions(struct inpcb *inp) static void inp_gcmoptions(struct ip_moptions *imo) { - struct in_mfilter *imf; + struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; - size_t idx, nmships; - nmships = imo->imo_num_memberships; - for (idx = 0; idx < nmships; ++idx) { - imf = imo->imo_mfilters ? &imo->imo_mfilters[idx] : NULL; - if (imf) - imf_leave(imf); - inm = imo->imo_membership[idx]; - ifp = inm->inm_ifp; - if (ifp != NULL) { - CURVNET_SET(ifp->if_vnet); - (void)in_leavegroup(inm, imf); - CURVNET_RESTORE(); - } else { - (void)in_leavegroup(inm, imf); + while ((imf = ip_mfilter_first(&imo->imo_head)) != NULL) { + ip_mfilter_remove(&imo->imo_head, imf); + + imf_leave(imf); + if ((inm = imf->imf_inm) != NULL) { + if ((ifp = inm->inm_ifp) != NULL) { + CURVNET_SET(ifp->if_vnet); + (void)in_leavegroup(inm, imf); + CURVNET_RESTORE(); + } else { + (void)in_leavegroup(inm, imf); + } } - if (imf) - imf_purge(imf); + ip_mfilter_free(imf); } - - if (imo->imo_mfilters) - free(imo->imo_mfilters, M_INMFILTER); - free(imo->imo_membership, M_IPMOPTS); free(imo, M_IPMOPTS); } @@ -1741,7 +1665,7 @@ inp_get_source_filters(struct inpcb *inp, struct socko struct sockaddr_storage *ptss; struct sockaddr_storage *tss; int error; - size_t idx, nsrcs, ncsrcs; + size_t nsrcs, ncsrcs; INP_WLOCK_ASSERT(inp); @@ -1768,12 +1692,11 @@ inp_get_source_filters(struct inpcb *inp, struct socko * Lookup group on the socket. */ gsa = (sockunion_t *)&msfr.msfr_group; - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1 || imo->imo_mfilters == NULL) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { INP_WUNLOCK(inp); return (EADDRNOTAVAIL); } - imf = &imo->imo_mfilters[idx]; /* * Ignore memberships which are in limbo. @@ -2033,14 +1956,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt struct ip_moptions *imo; struct in_multi *inm; struct in_msource *lims; - size_t idx; int error, is_new; ifp = NULL; - imf = NULL; lims = NULL; error = 0; - is_new = 0; memset(&gsr, 0, sizeof(struct group_source_req)); gsa = (sockunion_t *)&gsr.gsr_group; @@ -2148,13 +2068,25 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) return (EADDRNOTAVAIL); + IN_MULTI_LOCK(); + + /* + * Find the membership in the membership list. + */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { is_new = 1; + inm = NULL; + + if (ip_mfilter_count(&imo->imo_head) >= IP_MAX_MEMBERSHIPS) { + error = ENOMEM; + goto out_inp_locked; + } } else { - inm = imo->imo_membership[idx]; - imf = &imo->imo_mfilters[idx]; + is_new = 0; + inm = imf->imf_inm; + if (ssa->ss.ss_family != AF_UNSPEC) { /* * MCAST_JOIN_SOURCE_GROUP on an exclusive membership @@ -2181,7 +2113,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt * full-state SSM API with the delta-based API, * which is discouraged in the relevant RFCs. */ - lims = imo_match_source(imo, idx, &ssa->sa); + lims = imo_match_source(imf, &ssa->sa); if (lims != NULL /*&& lims->imsl_st[1] == MCAST_INCLUDE*/) { error = EADDRNOTAVAIL; @@ -2214,27 +2146,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt */ INP_WLOCK_ASSERT(inp); - if (is_new) { - if (imo->imo_num_memberships == imo->imo_max_memberships) { - error = imo_grow(imo); - if (error) - goto out_inp_locked; - } - /* - * Allocate the new slot upfront so we can deal with - * grafting the new source filter in same code path - * as for join-source on existing membership. - */ - idx = imo->imo_num_memberships; - imo->imo_membership[idx] = NULL; - imo->imo_num_memberships++; - KASSERT(imo->imo_mfilters != NULL, - ("%s: imf_mfilters vector was not allocated", __func__)); - imf = &imo->imo_mfilters[idx]; - KASSERT(RB_EMPTY(&imf->imf_sources), - ("%s: imf_sources not empty", __func__)); - } - /* * Graft new source into filter list for this inpcb's * membership of the group. The in_multi may not have @@ -2250,7 +2161,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt /* Membership starts in IN mode */ if (is_new) { CTR1(KTR_IGMPV3, "%s: new join w/source", __func__); - imf_init(imf, MCAST_UNDEFINED, MCAST_INCLUDE); + imf = ip_mfilter_alloc(M_NOWAIT, MCAST_UNDEFINED, MCAST_INCLUDE); + if (imf == NULL) { + error = ENOMEM; + goto out_inp_locked; + } } else { CTR2(KTR_IGMPV3, "%s: %s source", __func__, "allow"); } @@ -2259,34 +2174,41 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR1(KTR_IGMPV3, "%s: merge imf state failed", __func__); error = ENOMEM; - goto out_imo_free; + goto out_inp_locked; } } else { /* No address specified; Membership starts in EX mode */ if (is_new) { CTR1(KTR_IGMPV3, "%s: new join w/o source", __func__); - imf_init(imf, MCAST_UNDEFINED, MCAST_EXCLUDE); + imf = ip_mfilter_alloc(M_NOWAIT, MCAST_UNDEFINED, MCAST_EXCLUDE); + if (imf == NULL) { + error = ENOMEM; + goto out_inp_locked; + } } } /* * Begin state merge transaction at IGMP layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN_MULTI_LOCK(); - if (is_new) { + in_pcbref(inp); + INP_WUNLOCK(inp); + error = in_joingroup_locked(ifp, &gsa->sin.sin_addr, imf, - &inm); + &imf->imf_inm); + + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) { + error = ENXIO; + goto out_inp_unlocked; + } if (error) { CTR1(KTR_IGMPV3, "%s: in_joingroup_locked failed", __func__); - IN_MULTI_LIST_UNLOCK(); - goto out_imo_free; + goto out_inp_locked; } - inm_acquire(inm); - imo->imo_membership[idx] = inm; + inm_acquire(imf->imf_inm); } else { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); @@ -2295,7 +2217,9 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); error = igmp_change_state(inm); @@ -2303,40 +2227,30 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (error) { CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); - goto out_in_multi_locked; + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } } + if (is_new) + ip_mfilter_insert(&imo->imo_head, imf); -out_in_multi_locked: + imf_commit(imf); + imf = NULL; +out_inp_locked: + INP_WUNLOCK(inp); +out_inp_unlocked: IN_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); - if (error) { - imf_rollback(imf); - if (is_new) - imf_purge(imf); - else - imf_reap(imf); - } else { - imf_commit(imf); - } -out_imo_free: - if (error && is_new) { - inm = imo->imo_membership[idx]; - if (inm != NULL) { + if (is_new && imf) { + if (imf->imf_inm != NULL) { IN_MULTI_LIST_LOCK(); - inm_release_deferred(inm); + inm_release_deferred(imf->imf_inm); IN_MULTI_LIST_UNLOCK(); } - imo->imo_membership[idx] = NULL; - --imo->imo_num_memberships; + ip_mfilter_free(imf); } - -out_inp_locked: - INP_WUNLOCK(inp); return (error); } @@ -2355,12 +2269,12 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop struct ip_moptions *imo; struct in_msource *ims; struct in_multi *inm; - size_t idx; - int error, is_final; + int error; + bool is_final; ifp = NULL; error = 0; - is_final = 1; + is_final = true; memset(&gsr, 0, sizeof(struct group_source_req)); gsa = (sockunion_t *)&gsr.gsr_group; @@ -2460,20 +2374,21 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + IN_MULTI_LOCK(); + /* - * Find the membership in the membership array. + * Find the membership in the membership list. */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { error = EADDRNOTAVAIL; goto out_inp_locked; } - inm = imo->imo_membership[idx]; - imf = &imo->imo_mfilters[idx]; + inm = imf->imf_inm; if (ssa->ss.ss_family != AF_UNSPEC) - is_final = 0; + is_final = false; /* * Begin state merge transaction at socket layer. @@ -2485,13 +2400,14 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop * MCAST_LEAVE_SOURCE_GROUP is only valid for inclusive memberships. */ if (is_final) { + ip_mfilter_remove(&imo->imo_head, imf); imf_leave(imf); } else { if (imf->imf_st[0] == MCAST_EXCLUDE) { error = EADDRNOTAVAIL; goto out_inp_locked; } - ims = imo_match_source(imo, idx, &ssa->sa); + ims = imo_match_source(imf, &ssa->sa); if (ims == NULL) { CTR3(KTR_IGMPV3, "%s: source 0x%08x %spresent", __func__, ntohl(ssa->sin.sin_addr.s_addr), "not "); @@ -2510,17 +2426,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop /* * Begin state merge transaction at IGMP layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN_MULTI_LOCK(); - - if (is_final) { - /* - * Give up the multicast address record to which - * the membership points. - */ - (void)in_leavegroup_locked(inm, imf); - } else { + if (!is_final) { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); @@ -2528,7 +2434,9 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2537,38 +2445,27 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop if (error) { CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } } - -out_in_multi_locked: - - IN_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); - - if (error) - imf_rollback(imf); - else - imf_commit(imf); - + imf_commit(imf); imf_reap(imf); - if (is_final) { - /* Remove the gap in the membership and filter array. */ - KASSERT(RB_EMPTY(&imf->imf_sources), - ("%s: imf_sources not empty", __func__)); - for (++idx; idx < imo->imo_num_memberships; ++idx) { - imo->imo_membership[idx - 1] = imo->imo_membership[idx]; - imo->imo_mfilters[idx - 1] = imo->imo_mfilters[idx]; - } - imf_init(&imo->imo_mfilters[idx - 1], MCAST_UNDEFINED, - MCAST_EXCLUDE); - imo->imo_num_memberships--; - } - out_inp_locked: INP_WUNLOCK(inp); + + if (is_final && imf) { + /* + * Give up the multicast address record to which + * the membership points. + */ + (void) in_leavegroup_locked(imf->imf_inm, imf); + ip_mfilter_free(imf); + } + + IN_MULTI_UNLOCK(); return (error); } @@ -2658,7 +2555,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko struct in_mfilter *imf; struct ip_moptions *imo; struct in_multi *inm; - size_t idx; int error; error = sooptcopyin(sopt, &msfr, sizeof(struct __msfilterreq), @@ -2690,18 +2586,19 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (ifp == NULL) return (EADDRNOTAVAIL); + IN_MULTI_LOCK(); + /* * Take the INP write lock. * Check if this socket is a member of this group. */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1 || imo->imo_mfilters == NULL) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { error = EADDRNOTAVAIL; goto out_inp_locked; } - inm = imo->imo_membership[idx]; - imf = &imo->imo_mfilters[idx]; + inm = imf->imf_inm; /* * Begin state merge transaction at socket layer. @@ -2778,7 +2675,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko goto out_imf_rollback; INP_WLOCK_ASSERT(inp); - IN_MULTI_LOCK(); /* * Begin state merge transaction at IGMP layer. @@ -2789,7 +2685,7 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2798,10 +2694,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); -out_in_multi_locked: - - IN_MULTI_UNLOCK(); - out_imf_rollback: if (error) imf_rollback(imf); @@ -2812,6 +2704,7 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Jun 25 11:46:01 2019 (r349368) +++ head/sys/netinet/in_pcb.c Tue Jun 25 11:54:41 2019 (r349369) @@ -86,6 +86,9 @@ __FBSDID("$FreeBSD$"); #if defined(INET) || defined(INET6) #include #include +#ifdef INET +#include +#endif #include #include #ifdef TCPHPTS @@ -93,16 +96,13 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#endif -#ifdef INET -#include -#endif #ifdef INET6 #include #include #include #include #endif /* INET6 */ +#endif #include @@ -1779,8 +1779,9 @@ void in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet *ifp) { struct inpcb *inp; + struct in_multi *inm; + struct in_mfilter *imf; struct ip_moptions *imo; - int i, gap; INP_INFO_WLOCK(pcbinfo); CK_LIST_FOREACH(inp, pcbinfo->ipi_listhead, inp_list) { @@ -1801,17 +1802,18 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet * * XXX This can all be deferred to an epoch_call */ - for (i = 0, gap = 0; i < imo->imo_num_memberships; - i++) { - if (imo->imo_membership[i]->inm_ifp == ifp) { - IN_MULTI_LOCK_ASSERT(); - in_leavegroup_locked(imo->imo_membership[i], NULL); - gap++; - } else if (gap != 0) - imo->imo_membership[i - gap] = - imo->imo_membership[i]; +restart: + IP_MFILTER_FOREACH(imf, &imo->imo_head) { + if ((inm = imf->imf_inm) == NULL) + continue; + if (inm->inm_ifp != ifp) + continue; + ip_mfilter_remove(&imo->imo_head, imf); + IN_MULTI_LOCK_ASSERT(); + in_leavegroup_locked(inm, NULL); + ip_mfilter_free(imf); + goto restart; } - imo->imo_num_memberships -= gap; } INP_WUNLOCK(inp); } Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Tue Jun 25 11:46:01 2019 (r349368) +++ head/sys/netinet/in_var.h Tue Jun 25 11:54:41 2019 (r349369) @@ -232,7 +232,59 @@ struct in_mfilter { struct ip_msource_tree imf_sources; /* source list for (S,G) */ u_long imf_nsrc; /* # of source entries */ uint8_t imf_st[2]; /* state before/at commit */ + struct in_multi *imf_inm; /* associated multicast address */ + STAILQ_ENTRY(in_mfilter) imf_entry; /* list entry */ }; + +/* + * Helper types and functions for IPv4 multicast filters. + */ +STAILQ_HEAD(ip_mfilter_head, in_mfilter); + +struct in_mfilter *ip_mfilter_alloc(int mflags, int st0, int st1); +void ip_mfilter_free(struct in_mfilter *); + +static inline void +ip_mfilter_init(struct ip_mfilter_head *head) +{ + + STAILQ_INIT(head); +} + +static inline struct in_mfilter * +ip_mfilter_first(const struct ip_mfilter_head *head) +{ + + return (STAILQ_FIRST(head)); +} + +static inline void +ip_mfilter_insert(struct ip_mfilter_head *head, struct in_mfilter *imf) +{ + + STAILQ_INSERT_TAIL(head, imf, imf_entry); +} + +static inline void +ip_mfilter_remove(struct ip_mfilter_head *head, struct in_mfilter *imf) +{ + + STAILQ_REMOVE(head, imf, in_mfilter, imf_entry); +} + +#define IP_MFILTER_FOREACH(imf, head) \ + STAILQ_FOREACH(imf, head, imf_entry) + +static inline size_t +ip_mfilter_count(struct ip_mfilter_head *head) +{ + struct in_mfilter *imf; + size_t num = 0; + + STAILQ_FOREACH(imf, head, imf_entry) + num++; + return (num); +} /* * IPv4 group descriptor. Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Tue Jun 25 11:46:01 2019 (r349368) +++ head/sys/netinet/ip_carp.c Tue Jun 25 11:54:41 2019 (r349369) @@ -1371,25 +1371,24 @@ carp_multicast_setup(struct carp_if *cif, sa_family_t case AF_INET: { struct ip_moptions *imo = &cif->cif_imo; + struct in_mfilter *imf; struct in_addr addr; - if (imo->imo_membership) + if (ip_mfilter_first(&imo->imo_head) != NULL) return (0); - imo->imo_membership = (struct in_multi **)malloc( - (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_CARP, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 25 13:15:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D54DB15CC56A; Tue, 25 Jun 2019 13:15:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D2A8A88D; Tue, 25 Jun 2019 13:15:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E6A118D5E; Tue, 25 Jun 2019 13:15:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PDFUrK082926; Tue, 25 Jun 2019 13:15:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PDFUXd082925; Tue, 25 Jun 2019 13:15:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906251315.x5PDFUXd082925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 25 Jun 2019 13:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349370 - head/usr.sbin/usbdump X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/usbdump X-SVN-Commit-Revision: 349370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77D2A8A88D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 13:15:31 -0000 Author: hselasky Date: Tue Jun 25 13:15:29 2019 New Revision: 349370 URL: https://svnweb.freebsd.org/changeset/base/349370 Log: Fix parsing of corrupt data in usbdump(8). Check that the transfer type array lookup is within bounds to avoid segfault. PR: 238801 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/usr.sbin/usbdump/usbdump.c Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Tue Jun 25 11:54:41 2019 (r349369) +++ head/usr.sbin/usbdump/usbdump.c Tue Jun 25 13:15:29 2019 (r349370) @@ -149,7 +149,9 @@ static const char *errstr_table[USB_ERR_MAX] = { [USB_ERR_NOT_LOCKED] = "NOT_LOCKED", }; -static const char *xfertype_table[4] = { +#define USB_XFERTYPE_MAX 4 + +static const char *xfertype_table[USB_XFERTYPE_MAX] = { [UE_CONTROL] = "CTRL", [UE_ISOCHRONOUS] = "ISOC", [UE_BULK] = "BULK", @@ -320,6 +322,15 @@ usb_speedstr(uint8_t speed) return (speed_table[speed]); } +static const char * +usb_xferstr(uint8_t type) +{ + if (type >= USB_XFERTYPE_MAX || xfertype_table[type] == NULL) + return ("UNKN"); + else + return (xfertype_table[type]); +} + static void print_flags(uint32_t flags) { @@ -496,7 +507,7 @@ print_apacket(const struct header_32 *hdr, const uint8 (int)len, buf, tv.tv_usec, (int)up->up_busunit, (int)up->up_address, (up->up_type == USBPF_XFERTAP_SUBMIT) ? "SUBM" : "DONE", - xfertype_table[up->up_xfertype], + usb_xferstr(up->up_xfertype), (unsigned int)up->up_endpoint, usb_speedstr(up->up_speed), (int)up->up_frames, From owner-svn-src-all@freebsd.org Tue Jun 25 13:24:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C1F415CC8E6; Tue, 25 Jun 2019 13:24:29 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 933E28B02B; Tue, 25 Jun 2019 13:24:28 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5PDONt2049601; Tue, 25 Jun 2019 06:24:23 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5PDONUQ049600; Tue, 25 Jun 2019 06:24:23 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906251324.x5PDONUQ049600@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349352 - in head: etc/mtree include lib lib/libnandfs sbin sbin/camcontrol sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk stand stand/arm/uboot stand/common stand... In-Reply-To: To: Warner Losh Date: Tue, 25 Jun 2019 06:24:23 -0700 (PDT) CC: Warner Losh , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 933E28B02B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.929,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 13:24:29 -0000 > This commit accidentally reverted r349333, r349334, r349335, r349336, > r349339, r349340, r349341 and r349342. I rebased after one of the make > universes I did to proof this set and something must have gone wrong and I > lost these changes. I noticed while committing, but didn't hit ^C fast > enough to prevent the damage it seems. > > I've reapplied those changes rather than revert this commit for two > reasons: first, reverting commits that delete things has caused me trouble > in the past. Second, I judge that to be less repo-churn than doing the > revert, then redoing the nand* removal. > > Time was of the essence, so I hope my snap-judgement was sound. My > apologies both for the 'oops' and for any other fallout. Though this may of reduced repo churn it also broke any MFC that may of been marked in those sets. I am not even sure how one would untwist that maze. MFC original commit is going to leave your second commit as wrongly avaliable commit, so that needs dealt with. MFC your reapply commit, which they have to get by noting these commits as the new merge number. Again, leaving a danglying merge avaliable commit MFC the original commit, your mangle commit, but only the part that applies to there original commit, and the reapply commit. This marks the mangle as merged, but does infact leave the merge avail list for head correct. None of that is very pretty. There are some other options... Anyway my main reason for writting is somehow we need to get out of this "repo churn is expensive I must not revert!" mode of operations. Reverts are almost always the correct way to clean up a mistake, and it almost always leeds to other issues to not revert and instead try to do some magic like what was done here. It is also often a mistake to not exactly revert the original commit, commit that, then commit any additional fix. Reverting and making other changes in the same commit leads to problems more often than it solves them. I do understand the tree might not be in a buildable or correct state for a commit or two. Regards, Rod > Warner > > On Mon, Jun 24, 2019 at 10:50 PM Warner Losh wrote: > > > Author: imp > > Date: Tue Jun 25 04:50:09 2019 > > New Revision: 349352 > > URL: https://svnweb.freebsd.org/changeset/base/349352 > > > > Log: > > Remove NAND and NANDFS support > > > > NANDFS has been broken for years. Remove it. The NAND drivers that > > remain are for ancient parts that are no longer relevant. They are > > polled, have terrible performance and just for ancient arm > > hardware. NAND parts have evolved significantly from this early work > > and little to none of it would be relevant should someone need to > > update to support raw nand. This code has been off by default for > > years and has violated the vnode protocol leading to panics since it > > was committed. > > > > Numerous posts to arch@ and other locations have found no actual users > > for this software. > > > > Relnotes: Yes > > No Objection From: arch@ > > Differential Revision: https://reviews.freebsd.org/D20745 > > ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 25 13:28:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E82115CCA65; Tue, 25 Jun 2019 13:28:20 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 EFA738B304; Tue, 25 Jun 2019 13:28:19 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5PDSIEb049621; Tue, 25 Jun 2019 06:28:18 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5PDSIZV049620; Tue, 25 Jun 2019 06:28:18 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906251328.x5PDSIZV049620@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349366 - head/sys/netpfil/ipfw In-Reply-To: <201906251140.x5PBectm030416@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Tue, 25 Jun 2019 06:28:18 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: EFA738B304 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 13:28:20 -0000 > Author: ae > Date: Tue Jun 25 11:40:37 2019 > New Revision: 349366 > URL: https://svnweb.freebsd.org/changeset/base/349366 > > Log: > Follow the RFC 3128 and drop short TCP fragments with offset = 1. > > Reported by: emaste > MFC after: 1 week Can we get a counter or something so that the dropping of these is not totally silent and invisible? Thanks, Rod > Modified: > head/sys/netpfil/ipfw/ip_fw2.c > > Modified: head/sys/netpfil/ipfw/ip_fw2.c > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw2.c Tue Jun 25 09:11:22 2019 (r349365) > +++ head/sys/netpfil/ipfw/ip_fw2.c Tue Jun 25 11:40:37 2019 (r349366) > @@ -1719,6 +1719,11 @@ do { \ > default: > break; > } > + } else { > + if (offset == 1 && proto == IPPROTO_TCP) { > + /* RFC 3128 */ > + goto pullup_failed; > + } > } > > UPDATE_POINTERS(); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 25 13:30:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A0115CCB1B; Tue, 25 Jun 2019 13:30:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (unknown [IPv6:2a02:6b8:b080:7503::1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "butcher-nb.yandex.net", Issuer "butcher-nb.yandex.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D033B8B480; Tue, 25 Jun 2019 13:30:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (localhost [127.0.0.1]) by butcher-nb.yandex.net (8.15.2/8.15.2) with ESMTP id x5PDRnR7039760; Tue, 25 Jun 2019 16:27:49 +0300 (MSK) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r349366 - head/sys/netpfil/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906251328.x5PDSIZV049620@gndrsh.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=ae@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0IkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz6JATsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxC5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <040e7778-dd19-be48-a5b4-1d6f02ddfbc0@FreeBSD.org> Date: Tue, 25 Jun 2019 16:27:45 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201906251328.x5PDSIZV049620@gndrsh.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tJyJbSWRCMkkLJ9uZe7qFROjD1RWOzXkw" X-Rspamd-Queue-Id: D033B8B480 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.87)[-0.870,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 13:30:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tJyJbSWRCMkkLJ9uZe7qFROjD1RWOzXkw Content-Type: multipart/mixed; boundary="AfA7sp1xvi48BX4MLvPebp5UwC5tNpeGw"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <040e7778-dd19-be48-a5b4-1d6f02ddfbc0@FreeBSD.org> Subject: Re: svn commit: r349366 - head/sys/netpfil/ipfw References: <201906251328.x5PDSIZV049620@gndrsh.dnsmgr.net> In-Reply-To: <201906251328.x5PDSIZV049620@gndrsh.dnsmgr.net> --AfA7sp1xvi48BX4MLvPebp5UwC5tNpeGw Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 25.06.2019 16:28, Rodney W. Grimes wrote: >> Author: ae >> Date: Tue Jun 25 11:40:37 2019 >> New Revision: 349366 >> URL: https://svnweb.freebsd.org/changeset/base/349366 >> >> Log: >> Follow the RFC 3128 and drop short TCP fragments with offset =3D 1. >> =20 >> Reported by: emaste >> MFC after: 1 week >=20 > Can we get a counter or something so that the dropping of these > is not totally silent and invisible? They are logged as all short packets with "Pullup failed" message when net.inet.ip.fw.verbose is enabled. --=20 WBR, Andrey V. Elsukov --AfA7sp1xvi48BX4MLvPebp5UwC5tNpeGw-- --tJyJbSWRCMkkLJ9uZe7qFROjD1RWOzXkw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAl0SIVEACgkQAcXqBBDI oXq4pgf9EtVoUTBdXD2glAb4JyarVsraW07y8ZkkLMzMjvyVEoJeJXQqWVZ68QyZ OZ4zUYvRy0Fpkt29TiScxMjCwPi29Gl4gNZ4+EjoEHzJ1lO8QQ/G3YqU0n5uXPto KdsnTzviYpbD8er8IJXDzjZGWg8Jl7iTDg/npQJd09FUA2nkLmgLgFRmJjgL1WVR fc8HmWHfAdHBnhRYeWHz8GLSU3MUMECHlf8Lp4C4fcyi++etJMXuNXVvEdYGd0Jf uC9sfBzgIm2mJI2IV9ySMq7Z1brrWlASyfRspuDDP+2kCDnis5OaHyI2UjhlwXdG IqoqWD2tWE7KHn5ZLP5JnLYR1c4mUA== =l0pY -----END PGP SIGNATURE----- --tJyJbSWRCMkkLJ9uZe7qFROjD1RWOzXkw-- From owner-svn-src-all@freebsd.org Tue Jun 25 13:35:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D88215CCF45; Tue, 25 Jun 2019 13:35:15 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 DFACA8BB20; Tue, 25 Jun 2019 13:35:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5PDZBi1049676; Tue, 25 Jun 2019 06:35:11 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5PDZBUP049675; Tue, 25 Jun 2019 06:35:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906251335.x5PDZBUP049675@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349366 - head/sys/netpfil/ipfw In-Reply-To: <040e7778-dd19-be48-a5b4-1d6f02ddfbc0@FreeBSD.org> To: "Andrey V. Elsukov" Date: Tue, 25 Jun 2019 06:35:11 -0700 (PDT) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: DFACA8BB20 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.924,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 13:35:15 -0000 -- Start of PGP signed section. [ Charset UTF-8 unsupported, converting... ] > On 25.06.2019 16:28, Rodney W. Grimes wrote: > >> Author: ae > >> Date: Tue Jun 25 11:40:37 2019 > >> New Revision: 349366 > >> URL: https://svnweb.freebsd.org/changeset/base/349366 > >> > >> Log: > >> Follow the RFC 3128 and drop short TCP fragments with offset = 1. > >> > >> Reported by: emaste > >> MFC after: 1 week > > > > Can we get a counter or something so that the dropping of these > > is not totally silent and invisible? > > They are logged as all short packets with "Pullup failed" message when > net.inet.ip.fw.verbose is enabled. Thats over kill for what I was asking about. Also are there not other casses that pullup failed is counted? I was asking for a counter specifically on the rfc3128 packets which one use to be able to do with a ipfw rule, but since the kernel started to deal with these I lost that visibility. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 25 14:50:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4010F15CE605; Tue, 25 Jun 2019 14:50:04 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAF5B8DE8F; Tue, 25 Jun 2019 14:50:03 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFC8F19CBB; Tue, 25 Jun 2019 14:50:03 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PEo3fY030082; Tue, 25 Jun 2019 14:50:03 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PEo3A5030081; Tue, 25 Jun 2019 14:50:03 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201906251450.x5PEo3A5030081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Tue, 25 Jun 2019 14:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349371 - head/usr.bin/calendar/calendars/hr_HR.ISO8859-2 X-SVN-Group: head X-SVN-Commit-Author: zec X-SVN-Commit-Paths: head/usr.bin/calendar/calendars/hr_HR.ISO8859-2 X-SVN-Commit-Revision: 349371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAF5B8DE8F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 14:50:04 -0000 Author: zec Date: Tue Jun 25 14:50:03 2019 New Revision: 349371 URL: https://svnweb.freebsd.org/changeset/base/349371 Log: Croatian calendar: update / fix names, dates, group national public holidays, sort by date. MFC after: 3 days Modified: head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici Modified: head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici ============================================================================== --- head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici Tue Jun 25 13:15:29 2019 (r349370) +++ head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici Tue Jun 25 14:50:03 2019 (r349371) @@ -10,31 +10,31 @@ LANG=hr_HR.ISO8859-2 /* dr¾avni praznici */ -01/01 Nova godina -05/01 Praznik rada -05/30 Tjelovo -06/22 Dan antifa¹istièke borbe -06/25 Dan dr¾avnosti -08/05 Dan domovinske zahvalnosti -10/08 Dan neovisnosti - -/* katolièki blagdani */ -01/06 Sveta tri kralja -Easter-2 Veliki petak +01/01 Nova godina +01/06 Bogojavljenje ili Sveta tri kralja Easter Uskrs Easter+1 Uskrsni ponedjeljak -Easter+49 Duhovi -Easter+50 Duhovni ponedjeljak -Easter+39 Uza¹a¹æe +05/01 Praznik rada +Easter+60 Tijelovo +06/22 Dan antifa¹istièke borbe +06/25 Dan dr¾avnosti +08/05 Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja 08/15 Velika Gospa +10/08 Dan neovisnosti 11/01 Svi sveti 12/25 Bo¾iæ -12/26 Stjepandan +12/26 Sveti Stjepan + +/* katolièki blagdani */ +Easter-2 Veliki petak +Easter+39 Uza¹a¹æe +Easter+49 Duhovi +Easter+50 Duhovni ponedjeljak /* godi¹nja doba */ 03/21* Poèetak proljeæa 06/21* Poèetak ljeta -09/21* Poèetak jesena +09/23* Poèetak jeseni 12/21* Poèetak zime /* ljetno vrijeme */ From owner-svn-src-all@freebsd.org Tue Jun 25 14:56:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5CF015CEA16; Tue, 25 Jun 2019 14:56:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 665B88E518; Tue, 25 Jun 2019 14:56:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D2D619E87; Tue, 25 Jun 2019 14:56:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PEuEfM035294; Tue, 25 Jun 2019 14:56:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PEuEmd035293; Tue, 25 Jun 2019 14:56:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906251456.x5PEuEmd035293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 25 Jun 2019 14:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349372 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 349372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 665B88E518 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 14:56:14 -0000 Author: gjb Date: Tue Jun 25 14:56:13 2019 New Revision: 349372 URL: https://svnweb.freebsd.org/changeset/base/349372 Log: Include files containing metadata specific to the branch in the directory where the individual distribution sets exist. The new metadata files include the build date, svn branch, and revision of the build. Requested by: Mellanox Technologies (via kib) MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/release/Makefile.mirrors Modified: head/release/Makefile.mirrors ============================================================================== --- head/release/Makefile.mirrors Tue Jun 25 14:50:03 2019 (r349371) +++ head/release/Makefile.mirrors Tue Jun 25 14:56:13 2019 (r349372) @@ -19,6 +19,7 @@ FTPDIR?= ${RELEASEDIR}/ftp-stage .if exists(${RELEASEDIR}) STAGE_TARGETS?= iso-images-stage .endif +SRCBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} .if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) . if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != "" @@ -185,6 +186,9 @@ iso-images-stage: .if exists(${RELEASEDIR}/ftp) mkdir -p ${FTP_DIR} cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} + echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE + echo ${SRCBRANCH} > ${FTP_DIR}/SRCBRANCH + echo r${SVNREVISION} > ${FTP_DIR}/REVISION cd ${TLD}/${TARGET} && \ ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ ${REVISION}-${BRANCH} From owner-svn-src-all@freebsd.org Tue Jun 25 15:15:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C11615CF2A6 for ; Tue, 25 Jun 2019 15:15:16 +0000 (UTC) (envelope-from info@onlionyx.com.pl) Received: from shared-ald212.rev.nazwa.pl (shared-ald212.rev.nazwa.pl [85.128.160.212]) by mx1.freebsd.org (Postfix) with ESMTP id 202BB8F247 for ; Tue, 25 Jun 2019 15:15:13 +0000 (UTC) (envelope-from info@onlionyx.com.pl) X-Virus-Scanned: by amavisd-new using ClamAV (9) X-Spam-Flag: NO X-Spam-Score: -0.989 X-Spam-Level: X-Spam-Status: No, score=-0.989 tagged_above=-10 tests=[ALL_TRUSTED=-1, HTML_MESSAGE=0.001, T_KAM_HTML_FONT_INVALID=0.01] autolearn=disabled Received: from WIN-HUAKD8TBG21.local (unknown [93.177.73.218]) by karol101.nazwa.pl (Postfix) with ESMTP id E8A111C7A68 for ; Tue, 25 Jun 2019 17:15:11 +0200 (CEST) From: "CHEMWORLD INTERNATIONAL" To: svn-src-all@freebsd.org Subject: CHAWLA CHEM AND METAL / PI of Phthalic Anhydride (P.A) / CHEMWORLD / 26-06-2019 Date: Tue, 25 Jun 2019 15:15:11 +0200 MIME-Version: 1.0 Message-ID: <1561390144a8597cb01e01166a657ed37c7efa5601_61689@onlionyx.com.pl> X-Rspamd-Queue-Id: 202BB8F247 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dmarc=pass (policy=none) header.from=onlionyx.com.pl; spf=pass (mx1.freebsd.org: domain of info@onlionyx.com.pl designates 85.128.160.212 as permitted sender) smtp.mailfrom=info@onlionyx.com.pl X-Spamd-Result: default: False [-5.48 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,multipart/alternative,text/plain]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MANY_INVISIBLE_PARTS(0.05)[1]; IP_SCORE(-1.92)[ip: (-9.79), ipnet: 85.128.160.0/19(-3.19), asn: 15967(3.32), country: PL(0.06)]; MX_GOOD(-0.01)[cached: onlionyx.com.pl]; DMARC_POLICY_ALLOW(-0.50)[onlionyx.com.pl,none]; NEURAL_HAM_SHORT(-0.90)[-0.900,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:15967, ipnet:85.128.160.0/19, country:PL]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 15:15:16 -0000 Dear Mr. Ahmad / Mr. Azeem Khadim, Please see attached PI of PA for 100mt. Please send us back with sign and stamp. Warm Regards, Khawaja Tariq CHEMWORLD Mamoon Mension 2nd Floor, 19-A Abbot Road, Opp. PTV Station, Lahore-Pakistan. Tel: +92 42 36297034 Mob: +92 308-8888987 Bushra Mob: +92 308-8888368 Babar Mob: +92 307-7776987 Tariq From owner-svn-src-all@freebsd.org Tue Jun 25 15:26:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C85A615CF653 for ; Tue, 25 Jun 2019 15:26:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19E478F7D7 for ; Tue, 25 Jun 2019 15:26:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id d15so12916929qkl.4 for ; Tue, 25 Jun 2019 08:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9HRCJqY2mStZ5GjEdLdZl7Yrp9Lzk58XZJbUlSLiSyA=; b=VgG2kez46pK6qnDKqR5fID8Z7DfPv+BtZrH6F8S70VPSshzGwkpS8fEJ5dw79B24hH 2V2eBwwks/drpmeN6L/U11Rz4C3IEse0+0pSUeGYXqGAX3VlQKW9xIiVZxeM2gFoCdub NsBA0bM1WBJYQGoAo2H/eMH0kLpz+JGQaYhQXktS039sdZohh9ZzncqQxJMEQd/TNtld CVT10eQIC4iRdmU+CHgVYGSa1FXYWiHiuB+hxKuo/qX/HqRBuPDQ2gdesEnjJ1jymQxU TZl33Z0wPCnPJs1RuWk1XsYS4GxBVOMc3XqXw+hR3Dc3TnUWyjYRMAMz3Nv2zj8eJQvK VqlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9HRCJqY2mStZ5GjEdLdZl7Yrp9Lzk58XZJbUlSLiSyA=; b=UClFnidS3DBUGBdIRlovbb42GSqPnJS7XbpAJdEgbPVyhHIpt7Elr/Gsx4NojNp2jE kHOtqeEbQnLNnPYtC0xD32xR+YNF6SsTgBtHh3XRoHiDarlhvVRUVHLl7hXPvAkoXc81 V2dBVPcSUNF/PqKWJ8zJLfcD4K8g/AVYftVUm45hGsoDPvYRHI8ewJXEOOArzIsDOUyt HF8nfWTy+H6LQVZCIiig/+PcGaUVxtIvsWt6yJbJwH4wlnTr9bUkY/b8LamU+3O0Wpnd BYZn+8vA0L8Q1T152fd+OmTjOF9MSeQg3rrompr7/kJpd5YKExjPQYPRoR1Dnt7bFNLb mFpg== X-Gm-Message-State: APjAAAV0H69WVAVqkzlTrDZdRNdSobW4jvxeME8pI1IgwPJwl9K7UxeK ZEBjjKa60BZ5MjoHurHB4ghqIO2fSgPO7uPfA8vi+Q== X-Google-Smtp-Source: APXvYqzSmWQiOCj8WUApuBqftHqgds2noP9+5BtY6f2XeDX2eaS/tizSP98pcUOJBuLTJt8ArU7bvvfA2xnlBQ3nv4M= X-Received: by 2002:a37:6652:: with SMTP id a79mr40003322qkc.60.1561476375133; Tue, 25 Jun 2019 08:26:15 -0700 (PDT) MIME-Version: 1.0 References: <201906251324.x5PDONUQ049600@gndrsh.dnsmgr.net> In-Reply-To: <201906251324.x5PDONUQ049600@gndrsh.dnsmgr.net> From: Warner Losh Date: Tue, 25 Jun 2019 09:26:03 -0600 Message-ID: Subject: Re: svn commit: r349352 - in head: etc/mtree include lib lib/libnandfs sbin sbin/camcontrol sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk stand stand/arm/uboot stand/common stand... To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 19E478F7D7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 15:26:17 -0000 On Tue, Jun 25, 2019 at 7:24 AM Rodney W. Grimes wrote: > > This commit accidentally reverted r349333, r349334, r349335, r349336, > > r349339, r349340, r349341 and r349342. I rebased after one of the make > > universes I did to proof this set and something must have gone wrong and > I > > lost these changes. I noticed while committing, but didn't hit ^C fast > > enough to prevent the damage it seems. > > > > I've reapplied those changes rather than revert this commit for two > > reasons: first, reverting commits that delete things has caused me > trouble > > in the past. Second, I judge that to be less repo-churn than doing the > > revert, then redoing the nand* removal. > > > > Time was of the essence, so I hope my snap-judgement was sound. My > > apologies both for the 'oops' and for any other fallout. > > Though this may of reduced repo churn it also broke any MFC > that may of been marked in those sets. I am not even sure > how one would untwist that maze. > > MFC original commit is going to leave your second commit as > wrongly avaliable commit, so that needs dealt with. > > MFC your reapply commit, which they have to get by noting these > commits as the new merge number. Again, leaving a danglying > merge avaliable commit > > MFC the original commit, your mangle commit, but only the > part that applies to there original commit, and the reapply > commit. This marks the mangle as merged, but does infact > leave the merge avail list for head correct. > > None of that is very pretty. There are some other options... > > > Anyway my main reason for writting is somehow we need to get out > of this "repo churn is expensive I must not revert!" mode of > operations. Reverts are almost always the correct way to clean > up a mistake, and it almost always leeds to other issues to > not revert and instead try to do some magic like what was > done here. > > It is also often a mistake to not exactly revert the original > commit, commit that, then commit any additional fix. Reverting > and making other changes in the same commit leads to problems > more often than it solves them. I do understand the tree might > not be in a buildable or correct state for a commit or two. > I think that you over-state the issue here. Wouldn't the issue be fixed for MFCs of the replayed commits by MFCing them twice? The first time the first commit with svn merge, and then the second commit with a svn merge --record-only? We could do the same --record-only trick with the NAND removal commit, since it will never be MFC'd. Since the number of commits is small, and the people that would be MFCing them are super experienced with svn, I think that wouldn't be an issue. Then for others, it won't show up as a possible merge candidate (though honestly, with the files affected, that bit of svn is rarely used, also mitigating the data anomaly). I made a conscious decision to minimize time to get the repo repaired from the damage of the one commit. Warner Regards, > Rod > > > Warner > > > > On Mon, Jun 24, 2019 at 10:50 PM Warner Losh wrote: > > > > > Author: imp > > > Date: Tue Jun 25 04:50:09 2019 > > > New Revision: 349352 > > > URL: https://svnweb.freebsd.org/changeset/base/349352 > > > > > > Log: > > > Remove NAND and NANDFS support > > > > > > NANDFS has been broken for years. Remove it. The NAND drivers that > > > remain are for ancient parts that are no longer relevant. They are > > > polled, have terrible performance and just for ancient arm > > > hardware. NAND parts have evolved significantly from this early work > > > and little to none of it would be relevant should someone need to > > > update to support raw nand. This code has been off by default for > > > years and has violated the vnode protocol leading to panics since it > > > was committed. > > > > > > Numerous posts to arch@ and other locations have found no actual > users > > > for this software. > > > > > > Relnotes: Yes > > > No Objection From: arch@ > > > Differential Revision: https://reviews.freebsd.org/D20745 > > > ... > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Tue Jun 25 15:43:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1513615CFCD4; Tue, 25 Jun 2019 15:43:53 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A84F7683E7; Tue, 25 Jun 2019 15:43:52 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 847C11A74B; Tue, 25 Jun 2019 15:43:52 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PFhqQh061417; Tue, 25 Jun 2019 15:43:52 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PFhq6c061416; Tue, 25 Jun 2019 15:43:52 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201906251543.x5PFhq6c061416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 25 Jun 2019 15:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349373 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 349373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A84F7683E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 15:43:53 -0000 Author: rlibby Date: Tue Jun 25 15:43:52 2019 New Revision: 349373 URL: https://svnweb.freebsd.org/changeset/base/349373 Log: netipsec key_register: check for M_NOWAIT alloc failure Reviewed by: ae, cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20742 Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Tue Jun 25 14:56:13 2019 (r349372) +++ head/sys/netipsec/key.c Tue Jun 25 15:43:52 2019 (r349373) @@ -7164,7 +7164,7 @@ key_register(struct socket *so, struct mbuf *m, const return key_senderror(so, m, ENOBUFS); MGETHDR(n, M_NOWAIT, MT_DATA); - if (len > MHLEN) { + if (n != NULL && len > MHLEN) { if (!(MCLGET(n, M_NOWAIT))) { m_freem(n); n = NULL; From owner-svn-src-all@freebsd.org Tue Jun 25 16:39:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B49215D0F47; Tue, 25 Jun 2019 16:39:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCA66B599; Tue, 25 Jun 2019 16:39:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10AEC1AFFB; Tue, 25 Jun 2019 16:39:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PGdQ6R088245; Tue, 25 Jun 2019 16:39:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PGdP77088237; Tue, 25 Jun 2019 16:39:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906251639.x5PGdP77088237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Jun 2019 16:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349374 - in head/sys: arm/conf conf kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/conf conf kern X-SVN-Commit-Revision: 349374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FCA66B599 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 16:39:27 -0000 Author: imp Date: Tue Jun 25 16:39:25 2019 New Revision: 349374 URL: https://svnweb.freebsd.org/changeset/base/349374 Log: Remove a couple of harmless stray references to nandfs. Submitted by: tsoome@ Modified: head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/VYBRID head/sys/conf/options head/sys/kern/Make.tags.inc Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Tue Jun 25 15:43:52 2019 (r349373) +++ head/sys/arm/conf/DB-78XXX Tue Jun 25 16:39:25 2019 (r349374) @@ -20,7 +20,6 @@ options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem -options NANDFS # NAND Filesystem options NFSCL # Network Filesystem Client options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Tue Jun 25 15:43:52 2019 (r349373) +++ head/sys/arm/conf/DB-88F6XXX Tue Jun 25 16:39:25 2019 (r349374) @@ -17,7 +17,6 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem -options NANDFS # NAND Filesystem options NFSCL # Network Filesystem Client options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Tue Jun 25 15:43:52 2019 (r349373) +++ head/sys/arm/conf/SHEEVAPLUG Tue Jun 25 16:39:25 2019 (r349374) @@ -19,7 +19,6 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem -options NANDFS # NAND Filesystem options NFSCL # Network Filesystem Client options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Tue Jun 25 15:43:52 2019 (r349373) +++ head/sys/arm/conf/VYBRID Tue Jun 25 16:39:25 2019 (r349374) @@ -26,7 +26,6 @@ makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options PLATFORM # Platform based SoC -#options NANDFS # NAND Filesystem #options SMP # Enable multiple cores # NFS root from boopt/dhcp Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Jun 25 15:43:52 2019 (r349373) +++ head/sys/conf/options Tue Jun 25 16:39:25 2019 (r349374) @@ -256,7 +256,6 @@ FDESCFS opt_dontuse.h FFS opt_dontuse.h FUSEFS opt_dontuse.h MSDOSFS opt_dontuse.h -NANDFS opt_dontuse.h NULLFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Tue Jun 25 15:43:52 2019 (r349373) +++ head/sys/kern/Make.tags.inc Tue Jun 25 16:39:25 2019 (r349374) @@ -28,7 +28,6 @@ COMM= ${SYS}/sys/vnode.h \ ${SYS}/fs/fifofs/*.[ch] \ ${SYS}/fs/fuse/*.[ch] \ ${SYS}/fs/msdosfs/*.[ch] \ - ${SYS}/fs/nandfs/*.[ch] \ ${SYS}/fs/nfs/*.[ch] \ ${SYS}/fs/nfsclient/*.[ch] \ ${SYS}/fs/nfsserver/*.[ch] \ @@ -82,7 +81,6 @@ COMMDIR2= ${SYS}/dev/alc \ ${SYS}/fs/fifofs \ ${SYS}/fs/fuse \ ${SYS}/fs/msdosfs \ - ${SYS}/fs/nandfs \ ${SYS}/fs/nfs \ ${SYS}/fs/nfsclient \ ${SYS}/fs/nfsserver \ From owner-svn-src-all@freebsd.org Tue Jun 25 17:00:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EF2F15D1668; Tue, 25 Jun 2019 17:00:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35FE46C371; Tue, 25 Jun 2019 17:00:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 117031B376; Tue, 25 Jun 2019 17:00:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PH0r5h099119; Tue, 25 Jun 2019 17:00:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PH0rPj099118; Tue, 25 Jun 2019 17:00:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906251700.x5PH0rPj099118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 25 Jun 2019 17:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349376 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 349376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35FE46C371 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 17:00:54 -0000 Author: mav Date: Tue Jun 25 17:00:53 2019 New Revision: 349376 URL: https://svnweb.freebsd.org/changeset/base/349376 Log: Fix strsep_quote() on strings without quotes. For strings without quotes and escapes dstptr and srcptr are equal, so zeroing *dstptr before checking *srcptr is not a good idea. In practice it means that in -maproot=65534:65533 everything after the colon is lost. The problem was there since r293305, but before r346976 it was covered by improper strsep_quote() usage. PR: 238725 MFC after: 3 days Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue Jun 25 16:49:20 2019 (r349375) +++ head/usr.sbin/mountd/mountd.c Tue Jun 25 17:00:53 2019 (r349376) @@ -385,8 +385,8 @@ strsep_quote(char **stringp, const char *delim) *dstptr++ = *srcptr++; } - *dstptr = 0; /* Terminate the string */ *stringp = (*srcptr == '\0') ? NULL : srcptr + 1; + *dstptr = 0; /* Terminate the string */ return (retval); } From owner-svn-src-all@freebsd.org Tue Jun 25 17:04:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0074515D1C0A; Tue, 25 Jun 2019 17:04:21 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 780AC6C87A; Tue, 25 Jun 2019 17:04:21 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f46.google.com with SMTP id s7so4800902iob.11; Tue, 25 Jun 2019 10:04:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=riWwjuwS0VzKS9G8yHbhUmcEY4Ok5JBNLCQumpbgIaI=; b=Ub3NvBaziAvo8u0TlLsgBxSoTJ8GcCwflypWH/AQzPLzpeReuKxHcXN++TdMlLb7fW blpv43H/+Z1eo+ANe1aqwT4LVNg0frlDPc3hclP37mgNxy6u1ykenF6wPnV17Bb6OYE2 P2pF58PF5D0XgMMwVEL3JnWOP/XqlKqNzS9E6CxAw6Xx/elEj/N4Dr36KFFzLwAyd6pm BS8URHYAJhvqRGNU+eswkC+y7k2ddzR4uyXHfUKsVtKD3A2jBDnGphmnqGrMCCodhqbt RTI7Z4zN9bI4ixbJUb7c5tHO3M7KXjbXC2AmZ0NgXulMj7FeEkorQ9GxByBGcPVzJu+G wygg== X-Gm-Message-State: APjAAAXHdgh86DhqTmxLWy8ecNId+R7S6KM6adBuLF0kJEnS5BbAr/tz p7chtfav0I2tS+SsJQU+FOa+5hDRIJhSgOiD/0zdk3KJ X-Google-Smtp-Source: APXvYqxvudx2FkRv03wfswGBldnBBhEhKvZyNIoDSZMalCkHOCCEQcmu0HfGXHlELm4ISVpAzlYuCPsisqjPdipSV/Y= X-Received: by 2002:a6b:5b01:: with SMTP id v1mr9224166ioh.120.1561482254671; Tue, 25 Jun 2019 10:04:14 -0700 (PDT) MIME-Version: 1.0 References: <201906242318.x5ONIhlS043523@repo.freebsd.org> In-Reply-To: <201906242318.x5ONIhlS043523@repo.freebsd.org> From: Ed Maste Date: Tue, 25 Jun 2019 09:03:47 -0400 Message-ID: Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa To: Rebecca Cran Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 780AC6C87A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 17:04:22 -0000 On Mon, 24 Jun 2019 at 19:18, Rebecca Cran wrote: > > Author: bcran > Date: Mon Jun 24 23:18:42 2019 > New Revision: 349349 > URL: https://svnweb.freebsd.org/changeset/base/349349 > > Log: > loader: add HTTP support using UEFI My QEMU smoke test script (tools/boot/ci-qemu-test.sh) fails after this change, with an exception in the loader: Consoles: EFI console | Reading loader env vars from /efi/freebsd/loader.env Setting currdev to disk0p1: / - !!!! X64 Exception Type - 000000000000000E CPU Apic ID - 00000000 !!!! RIP - 0000020000000002, CS - 0000000000000028, RFLAGS - 0000000000000246 ExceptionData - 0000000000000000 RAX - 000000000FF93610, RCX - 000000000A500AD0, RDX - 000000000FF935F8 RBX - 000000000FF93610, RSP - 000000000FF93588, RBP - 000000000FF936C0 RSI - 0000000000000000, RDI - 000000000FF9361C R8 - 0000000000000000, R9 - 000000000A500908, R10 - 000000000E8EFEC8 R11 - 0000000000000083, R12 - 000000000FF935F8, R13 - 000000000000000C R14 - 000000000A500870, R15 - 000000000E8DC0D5 DS - 0000000000000008, ES - 0000000000000008, FS - 0000000000000008 GS - 0000000000000008, SS - 0000000000000008 CR0 - 0000000080000033, CR2 - 0000020000000002, CR3 - 000000000FF33000 CR4 - 0000000000000668, CR8 - 0000000000000000 DR0 - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000 DR3 - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400 GDTR - 000000000FF1ED98 000000000000003F, LDTR - 0000000000000000 IDTR - 000000000F47F018 0000000000000FFF, TR - 0000000000000000 FXSAVE_STATE - 000000000FF931E0 qemu-system-x86_64: terminating on signal 15 from pid 54769 (timeout) Did not boot successfully, see /tmp/ci-qemu-test-boot.log From owner-svn-src-all@freebsd.org Tue Jun 25 17:15:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDEBF15D1F25; Tue, 25 Jun 2019 17:15:45 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8DD6CEA0; Tue, 25 Jun 2019 17:15:45 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C9621B6DB; Tue, 25 Jun 2019 17:15:45 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PHFj5r008999; Tue, 25 Jun 2019 17:15:45 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PHFjwo008995; Tue, 25 Jun 2019 17:15:45 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906251715.x5PHFjwo008995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Tue, 25 Jun 2019 17:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349377 - in head/sys: net sys X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: net sys X-SVN-Commit-Revision: 349377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C8DD6CEA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 17:15:46 -0000 Author: luporl Date: Tue Jun 25 17:15:44 2019 New Revision: 349377 URL: https://svnweb.freebsd.org/changeset/base/349377 Log: [PowerPC64] Don't mark module data as static Fixes panic when loading ipfw.ko and if_epair.ko built with modern compiler. Similar to arm64 and riscv, when using a modern compiler (!gcc4.2), code generated tries to access data in the wrong location, causing kernel panic (data storage interrupt trap) when loading if_epair and ipfw. Issue was reproduced with kernel/module compiled using gcc8 and clang8. It affects both ELFv1 and ELFv2 ABI environments. PR: 232387 Submitted by: alfredo.junior_eldorado.org.br Reported by: Mark Millard Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20461 Modified: head/sys/net/vnet.h head/sys/sys/pcpu.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Tue Jun 25 17:00:53 2019 (r349376) +++ head/sys/net/vnet.h Tue Jun 25 17:15:44 2019 (r349377) @@ -273,7 +273,8 @@ extern struct sx vnet_sxlock; /* struct _hack is to stop this from being used with static data */ #define VNET_DEFINE(t, n) \ struct _hack; t VNET_NAME(n) __section(VNET_SETNAME) __used -#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv)) +#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv) \ + || defined(__powerpc64__)) /* * As with DPCPU_DEFINE_STATIC we are unable to mark this data as static * in modules on some architectures. Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Tue Jun 25 17:00:53 2019 (r349376) +++ head/sys/sys/pcpu.h Tue Jun 25 17:15:44 2019 (r349377) @@ -85,7 +85,8 @@ extern uintptr_t dpcpu_off[]; /* struct _hack is to stop this from being used with the static keyword. */ #define DPCPU_DEFINE(t, n) \ struct _hack; t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used -#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv)) +#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv) \ + || defined(__powerpc64__)) /* * On some architectures the compiler will use PC-relative load to * find the address of DPCPU data with the static keyword. We then From owner-svn-src-all@freebsd.org Tue Jun 25 17:23:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E2CC15D2235 for ; Tue, 25 Jun 2019 17:23:37 +0000 (UTC) (envelope-from dch@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11CC86D4B4; Tue, 25 Jun 2019 17:23:37 +0000 (UTC) (envelope-from dch@freebsd.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: dch/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id DA4E713530; Tue, 25 Jun 2019 17:23:36 +0000 (UTC) (envelope-from dch@freebsd.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id AA9CC22441; Tue, 25 Jun 2019 13:23:36 -0400 (EDT) Received: from imap6 ([10.202.2.56]) by compute1.internal (MEProxy); Tue, 25 Jun 2019 13:23:36 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeggdduudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdffrghv vgcuvehothhtlhgvhhhusggvrhdfuceouggthhesfhhrvggvsghsugdrohhrgheqnecuff homhgrihhnpehfrhgvvggsshgurdhorhhgnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu tghhodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeijeekudekudehvddqud dvudefuddujeejqdgutghhpeepfhhrvggvsghsugdrohhrghesfhgrshhtmhgrihhlrdhf mhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 63B1E1400A1; Tue, 25 Jun 2019 13:23:36 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-730-g63f2c3b-fmstable-20190622v1 Mime-Version: 1.0 Message-Id: <7d119185-32b3-4057-bc4c-ea21d55e6c44@www.fastmail.com> In-Reply-To: <201906242318.x5ONIhlS043523@repo.freebsd.org> References: <201906242318.x5ONIhlS043523@repo.freebsd.org> Date: Tue, 25 Jun 2019 17:23:36 +0000 From: "Dave Cottlehuber" To: "Rebecca Cran" , src-committers , svn-src-all@freebsd.org, scottph@freebsd.org Subject: =?UTF-8?Q?Re:_svn_commit:_r349349_-_in_head/stand:_efi/include_efi/inclu?= =?UTF-8?Q?de/Protocol_efi/libefi_efi/loader_libsa?= Content-Type: text/plain X-Rspamd-Queue-Id: 11CC86D4B4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 17:23:37 -0000 On Mon, 24 Jun 2019, at 23:19, Rebecca Cran wrote: > Author: bcran > Date: Mon Jun 24 23:18:42 2019 > New Revision: 349349 > URL: https://svnweb.freebsd.org/changeset/base/349349 > > Log: > loader: add HTTP support using UEFI > > Add support for an HTTP "network filesystem" using the UEFI's HTTP > stack. > > This also supports HTTPS, but TianoCore EDK2 implementations currently > crash while fetching loader files. > Only IPv4 is supported at the moment. IPv6 support is planned for a > follow-up changeset. > > Note that we include some headers from the TianoCore EDK II project in > stand/efi/include/Protocol verbatim, including links to the license instead > of including the full text because that's their preferred way of > communicating it, despite not being normal FreeBSD project practice. > > Submitted by: scottph > Reviewed by: imp, bcran > Differential Revision: https://reviews.freebsd.org/D20643 > > Added: > head/stand/efi/include/Protocol/Http.h (contents, props changed) > head/stand/efi/include/Protocol/Ip4Config2.h (contents, props changed) > head/stand/efi/include/Protocol/ServiceBinding.h (contents, props changed) > head/stand/efi/libefi/efihttp.c (contents, props changed) > Modified: > head/stand/efi/include/efidevp.h > head/stand/efi/include/efilib.h > head/stand/efi/libefi/Makefile > head/stand/efi/loader/conf.c > head/stand/libsa/stand.h Many thanks for landing this Rebecca & Scott. This fails to identify the partition with a bootable zpool on both a laptop (details in the PR) and also a server (2 zpools), and instead tries to boot from the EFI partition where the boot1.efi loader is located (i.e. disk0p1 and not disk0p2). https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238800 A+ Dave From owner-svn-src-all@freebsd.org Tue Jun 25 17:27:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C04E15D22D3; Tue, 25 Jun 2019 17:27:38 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31B3A6D712; Tue, 25 Jun 2019 17:27:38 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 037C51B88E; Tue, 25 Jun 2019 17:27:38 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PHRbfo015050; Tue, 25 Jun 2019 17:27:37 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PHRbi8015049; Tue, 25 Jun 2019 17:27:37 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906251727.x5PHRbi8015049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 25 Jun 2019 17:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349379 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31B3A6D712 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 17:27:38 -0000 Author: dougm Date: Tue Jun 25 17:27:37 2019 New Revision: 349379 URL: https://svnweb.freebsd.org/changeset/base/349379 Log: Document the KERN_PROTECTION_FAILURE return value from vm_map_protect(). Reviewed by: alc (earlier version) Approved by: kib, markj (mentors) Differential Revision: https://reviews.freebsd.org/D20751 Modified: head/share/man/man9/vm_map_protect.9 Modified: head/share/man/man9/vm_map_protect.9 ============================================================================== --- head/share/man/man9/vm_map_protect.9 Tue Jun 25 17:24:43 2019 (r349378) +++ head/share/man/man9/vm_map_protect.9 Tue Jun 25 17:27:37 2019 (r349379) @@ -96,6 +96,11 @@ would exceed for an entry within the range, .Dv KERN_PROTECTION_FAILURE is returned. +If a copy-on-write mapping is transitioned from read-only to +read-write, and too little swap space is available for backing the +copied pages, +.Dv KERN_RESOURCE_SHORTAGE +is returned. .Sh SEE ALSO .Xr vm_map 9 .Sh AUTHORS From owner-svn-src-all@freebsd.org Tue Jun 25 17:35:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5056015D24DB; Tue, 25 Jun 2019 17:35:41 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bluestop.org (muon.bluestop.org [65.103.231.193]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD7B36DC72; Tue, 25 Jun 2019 17:35:40 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bluestop.org (localhost [127.0.0.1]) by muon.bluestop.org (Postfix) with ESMTP id ECBFE5BAE8; Tue, 25 Jun 2019 11:40:02 -0600 (MDT) Received: from muon.bluestop.org ([127.0.0.1]) by muon.bluestop.org (muon.bluestop.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id DYaEzXDt4jw5; Tue, 25 Jun 2019 11:40:02 -0600 (MDT) Received: from photon.int.bluestop.org (unknown [10.0.10.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTPSA; Tue, 25 Jun 2019 11:40:02 -0600 (MDT) Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head References: <201906242318.x5ONIhlS043523@repo.freebsd.org> From: Rebecca Cran Openpgp: preference=signencrypt Autocrypt: addr=bcran@freebsd.org; keydata= mQINBFrUMZ4BEADI1yUEGeZeXeTCPay1ZpTBdDEpGPAw1dq2VCSTc1VhsnrEBa1iZxAfaeSv Uu5Ti7jlhQ/3sQMl0bJMKGB/RtmIW7k8h2w476oZmG8gChk8su5ZEx/pV1gdqInyFmmJKTYc gabJz8pL+m82w07qPv+oalepZ4dbj+HF++RAK/iEju+q9UHlsjj8e3mMNsvtrOz1K6bnpveO jZ+ms/2H3Hs5a4k8y6buwe2RvwhJQaXa13cR3LhzL+nwj4B9PHZZEa2WpEyYpw/bI0V9YSQN QgC1CYRzDyakZge6BCM6wHOgZSUzRPufGilrNKUwIVbRoIBR9/85+0wR+PlFUOUOfOc6ox7T dWcIx6PuPhek48rh4uwmmwsPtPiH4Z3T5p+GmWQ9NLFZKA1YnEdaSkWtYZsDxwVZZeYG2plt MfhXP0Hj4rf9Y3eoUenCaGioxAbUOBCtXdTGNAhNjz1g5NGDBVyhjKkzwJQvt9UrYTseERit 5dX2CMTy8hYLvSXd/Ivy+HylUS5IslfZxW5z9LgWX7Z97kILgkH3N0ewtLkygkG+Y+x7uaAV dFqp9ASOyzaiwKbJdeOI+WxRSh+AqeCR0S+bpkcLudLmbjrPmaFwjKycy1H85Z5R2J3YHyXY oT6OYjD8vLbUU2GWp6Onkcy1Pu8EMbRuzKil6HnpYg3BexbPFwARAQABtCBSZWJlY2NhIENy YW4gPGJjcmFuQGZyZWVic2Qub3JnPokCVAQTAQgAPhYhBB+5fZtkTdO940Yr4g0CK1MRvhAg BQJa2B8pAhsjBQkJZgGABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEA0CK1MRvhAgAe0P /R65umdPBVFCYKPZ91HMqlZtn0EWOGwycWEK/feWI+jaYOa+8+VVxFau4gwnBmgCdf5XOAJW QugUlPte9T+dP9QXmgm8z3KMLCj2PATYlmqmQfvIleJPf8w7BFBw/kkd6ZxoEQXaEyZwWuJc vY58uFYizZ8s1gMjD7uV3eg2UuGYd4loBZ3MSanWrhE6mmxAjzcYYb0KTsaTH9ON4uctcTYG 4FN0KzRx5d4nAhnS/yaL+3OI23vUDt+XnOCx8tIOczScOEN5NFChgyvTxzwi7hTVNB7uUCha mN6vcjtrrzi03zHXooldE4gRJ5G+SzuH9yHKrrwYXUeKi8sG8uXVoWwzsLbCxHRe7T9Ow7Im 92Aep3DEIE9whG6Fg3hRQ4/d/9OVCGrV3XwRMEstCvamJQc69ZsULo1ssGmPvcLn8fNaLNeP ICCLQj4JLcYvKKfLIQ/Cm0Orsy8rJGhwF4W1mBUbTdR6pk2azEkrhE7KZDylgikpNNqshKV3 1nD/5SNrTDl0P8rTnu0OKT0IbozIsaz9FD2xMPHPUMPnVSTB96+PhgoBIQlHcys19gftotuN 1tlLs4Ny93xWLSjKWoW5l9E9LbIh+M8gD3A7JyyV9DRZkHdbOt3pGjpaozchDPCpRkcsFXp4 9zSbXtxnbAWfZwoSYQTvznmXpzHMzoLMWf/guQINBFrUMZ4BEADkc4mvMcMcDF1tdNxNQuIB E1F243oZamG3LACCKfc1Yur3CPzHwIk5LXCUmbq23iE5bowxMWw3mlVT0p5xM0WnUidIBwCK u4kRyy/fY4NyWWBuwy9srpTdmUcKRBRNB8zEZE8xIlidD1ijjgqLBfeM7n9ylawAxHLxwU96 sdpdHFzb7Z0yKY2e/bzDaHiG0fUvcCmkgLf+uwKKZid1j8zR5PzKpgPqfy/PF01eKyGV3MNu 8Y90xMoiEMWfCI2IB1m+hTuzZoboFvGV54SiMuvfWK/VMQjhsL6K2ddOqwVuy2nIMI4G3xDQ W/v8KVyn43OSIAyW1eaklhzu0Ir2sO60PXRkvbTUrouvmSvpJfIQS49rU0M/X6FSDgXQLKrZ 3my94+g8ptz9KoVml6s4OAwYVz+sb49nuSxipFKkU5FwhKOLmzbsBxCtytcUJoLmjuJPJPDQ ue6YJiIXyc86GVY2pH3DjemKdbB4dSgqAJIp+lCzKSJzz7bgueh2Ox8vzx1tSxKj7V8Nal+U TKKbkxPmMh+e20YZ4esAVifO3bS6IJP/aDnfagghB71vA7+aWGXPbjPlc2UHpCBiRSsl+Igo QXvdvZBsKRyfBx8neODa2C6JIE5vcaCjilSeKF8SzsFXvimnndhQNhAPU/DwQwSXdCl4gTsF Vi5d8Oxq1sce+wARAQABiQI8BBgBCAAmFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAlrUMZ4C GwwFCQlmAYAACgkQDQIrUxG+ECAWnRAAsmZX+KgNxW3v7R/76Tz4Wjmh4AGeE+Ji3p5QsdTY ny1B6vYBL9vCzPJ/AK8pgKMDRaweUP5eZQpfrdWC8Q7SNGgi4Q+97KEs+i2xZLQ+WJb8a+WE EIc716u0y4ITiHfOgM5jWcFO4MXQATbJgv0drLLesa+LQCvZgPBqupt307EsCubQs+Sxt+RV jf6rOUolp1GJXEQYwGsKklVd6yqLC8M1BSG53/WE5tSv5GzBZ8fp6EtmjT7leuidFtEvKYHQ z4DqG9ELpHUF0X0UUCBK/MgXe3kCVLKE060UrJ4M6uPSx57rmVFA2MvwQR8M7GsWC5UsSM4P YwPWBhwxE7vcx0691YKAHT/5q8LxRVBdUyzPSprMhSQFttsBt+ygm6wRi3Pi3TuCEARNubPk QefyeC34yr40SAUCkOl3eWxSXPF4NfXFQb4AAzZSE5hv3qbDuwo3lrL0LqpIpEQPAz+JZ1QZ 6mMFQ5/JD9Gukj54kZc0X8w3sQt0a8vyE/qrJg8vKgv2rCHrPc5MeDkEUEFiiJiCEDdkJtMy oRlU3S4NrnbyLOLEcHE8fGe3hStPX8hY62id2ecdQ5WZ7vLZW5SFeLarbUciuHIkVL6MHnUj bV7XlY50N7ebeFCIdlCWhdum2FJs/Ni+SSxbZC564vrokwlBBGSo6WTPQTa8IWx1DtU= Message-ID: Date: Tue, 25 Jun 2019 11:35:34 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="raGHgiPTDFrbgBuaAr5yK6u5NDUJE1Smk" X-Rspamd-Queue-Id: BD7B36DC72 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 17:35:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --raGHgiPTDFrbgBuaAr5yK6u5NDUJE1Smk Content-Type: multipart/mixed; boundary="yF3esNnbRohMe1DJ1kH6aLYbJWA8VvReS"; protected-headers="v1" From: Rebecca Cran To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Message-ID: Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa References: <201906242318.x5ONIhlS043523@repo.freebsd.org> In-Reply-To: --yF3esNnbRohMe1DJ1kH6aLYbJWA8VvReS Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-06-25 07:03, Ed Maste wrote: > My QEMU smoke test script (tools/boot/ci-qemu-test.sh) fails after > this change, with an exception in the loader: I can replicate this failure, and am working to debug it. --=20 Rebecca Cran --yF3esNnbRohMe1DJ1kH6aLYbJWA8VvReS-- --raGHgiPTDFrbgBuaAr5yK6u5NDUJE1Smk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAl0SW2YACgkQDQIrUxG+ ECClZxAAnkKg6TSZVp26X2AcTdH0LxSNcT0TP8jwJ9Li6niaK1lLaSFbMxM+03aF LC2C83QaWOVZ9P9xqxv4myGxyZ0tG7Eta7fCqOID9xq13QQKtTJm6UAMPhzXzTHp Q5N07+HIqzwnG7S9JPmgkiADvCCsdlzyyvdP21siyi0JigADiZbulslYuFPtfNDM PfA15CoXIBv0tV9DQ4tGJgPVXCSaN/hGlITfMKQTCESIJCLDFx2bzC0EB5CViIbH cHzh7RIM05zk47F2cqVtd6z89X5G0ORFUhPGJscN+gQ+RGm/MTCAMs81NXek0zpa wjXoseopeUNw1o3KOdrU5Vb2fDzUKL2es7RmPVS6sKqDNP2zL+due+/GkcPvqdlf ztho4GZERuLmOsYqyYHNtGk7SZIdE4yZoLyD6EXob9qHu+vPZyqQQk8V5m8VjFNu wf24jYjx+Xe5dnJB8QKstcBkr8JkC+koXtUQuYwBSw52Tz9B1MuLc5KB7YF3FuHr 2eNG05LgNPRilDQpQhJ5L6/f2A+E7ZlFZLK66lLY31+DyaIGMeHAVBt47AIB8b4f ufLTgZ8C1HsK0dexaWWjNVid54YGnVkp6Bi1Sy5VyWAIqXiG42caVWtknLzlFjyK sfkGvglAHlFirwNfdL4LGAEM8tmIJGbbx5sHy7yheTlUWJTjg48= =VGgY -----END PGP SIGNATURE----- --raGHgiPTDFrbgBuaAr5yK6u5NDUJE1Smk-- From owner-svn-src-all@freebsd.org Tue Jun 25 18:13:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA5C715D31FD; Tue, 25 Jun 2019 18:13:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBA96EE9F; Tue, 25 Jun 2019 18:13:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E3421C123; Tue, 25 Jun 2019 18:13:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PIDd6V045762; Tue, 25 Jun 2019 18:13:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PIDdB0045761; Tue, 25 Jun 2019 18:13:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906251813.x5PIDdB0045761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 25 Jun 2019 18:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349380 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 349380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CBA96EE9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 18:13:40 -0000 Author: kevans Date: Tue Jun 25 18:13:39 2019 New Revision: 349380 URL: https://svnweb.freebsd.org/changeset/base/349380 Log: libbe(3): mount: the BE dataset is mounted at / Other parts of libbe(3) were fairly strict on the mountpoint property of the BE dataset, and be_mount was not much better. It was improved in r347027 to allow mountpoint=none for depth==0, but this bit was still sensitive to mountpoint != / and mountpoint != none. Given that other parts of libbe(3) no longer restrict the mountpoint property here, and the rest of the base system is generally OK and will assume that a BE is mounted at /, let's do the same. Reported by: ler MFC after: 3 days Modified: head/lib/libbe/be_access.c Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Tue Jun 25 17:27:37 2019 (r349379) +++ head/lib/libbe/be_access.c Tue Jun 25 18:13:39 2019 (r349380) @@ -96,7 +96,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) NULL, NULL, 0, 1)) return (1); - if (strcmp("none", zfs_mnt) == 0) { + if (strcmp("none", zfs_mnt) == 0 || info->depth == 0) { /* * mountpoint=none; we'll mount it at info->mountpoint assuming * we're at the root. If we're not at the root, we're likely From owner-svn-src-all@freebsd.org Tue Jun 25 18:35:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DDCC15D3995; Tue, 25 Jun 2019 18:35:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D91846FBC4; Tue, 25 Jun 2019 18:35:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1BE71C4C0; Tue, 25 Jun 2019 18:35:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PIZOfR056469; Tue, 25 Jun 2019 18:35:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PIZOJ6056467; Tue, 25 Jun 2019 18:35:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906251835.x5PIZOJ6056467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 25 Jun 2019 18:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349381 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 349381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D91846FBC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 18:35:25 -0000 Author: mav Date: Tue Jun 25 18:35:23 2019 New Revision: 349381 URL: https://svnweb.freebsd.org/changeset/base/349381 Log: Avoid extra taskq_dispatch() calls by DMU. DMU sync code calls taskq_dispatch() for each sublist of os_dirty_dnodes and os_synced_dnodes. Since the number of sublists by default is equal to number of CPUs, it will dispatch equal, potentially large, number of tasks, waking up many CPUs to handle them, even if only one or few of sublists actually have any work to do. This change adds check for empty sublists to avoid this. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jun 25 18:13:39 2019 (r349380) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jun 25 18:35:23 2019 (r349381) @@ -1334,6 +1334,8 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx zio_t *zio; list_t *list; dbuf_dirty_record_t *dr; + int num_sublists; + multilist_t *ml; blkptr_t *blkptr_copy = kmem_alloc(sizeof (*os->os_rootbp), KM_SLEEP); *blkptr_copy = *os->os_rootbp; @@ -1402,10 +1404,13 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx } } - for (int i = 0; - i < multilist_get_num_sublists(os->os_dirty_dnodes[txgoff]); i++) { + ml = os->os_dirty_dnodes[txgoff]; + num_sublists = multilist_get_num_sublists(ml); + for (int i = 0; i < num_sublists; i++) { + if (multilist_sublist_is_empty_idx(ml, i)) + continue; sync_dnodes_arg_t *sda = kmem_alloc(sizeof (*sda), KM_SLEEP); - sda->sda_list = os->os_dirty_dnodes[txgoff]; + sda->sda_list = ml; sda->sda_sublist_idx = i; sda->sda_tx = tx; (void) taskq_dispatch(dmu_objset_pool(os)->dp_sync_taskq, @@ -1619,6 +1624,8 @@ userquota_updates_task(void *arg) void dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t *tx) { + int num_sublists; + if (!dmu_objset_userused_enabled(os)) return; @@ -1632,8 +1639,10 @@ dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); } - for (int i = 0; - i < multilist_get_num_sublists(os->os_synced_dnodes); i++) { + num_sublists = multilist_get_num_sublists(os->os_synced_dnodes); + for (int i = 0; i < num_sublists; i++) { + if (multilist_sublist_is_empty_idx(os->os_synced_dnodes, i)) + continue; userquota_updates_arg_t *uua = kmem_alloc(sizeof (*uua), KM_SLEEP); uua->uua_os = os; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c Tue Jun 25 18:13:39 2019 (r349380) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c Tue Jun 25 18:35:23 2019 (r349381) @@ -360,6 +360,28 @@ multilist_sublist_remove(multilist_sublist_t *mls, voi list_remove(&mls->mls_list, obj); } +int +multilist_sublist_is_empty(multilist_sublist_t *mls) +{ + ASSERT(MUTEX_HELD(&mls->mls_lock)); + return (list_is_empty(&mls->mls_list)); +} + +int +multilist_sublist_is_empty_idx(multilist_t *ml, unsigned int sublist_idx) +{ + multilist_sublist_t *mls; + int empty; + + ASSERT3U(sublist_idx, <, ml->ml_num_sublists); + mls = &ml->ml_sublists[sublist_idx]; + ASSERT(!MUTEX_HELD(&mls->mls_lock)); + mutex_enter(&mls->mls_lock); + empty = list_is_empty(&mls->mls_list); + mutex_exit(&mls->mls_lock); + return (empty); +} + void * multilist_sublist_head(multilist_sublist_t *mls) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Tue Jun 25 18:13:39 2019 (r349380) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Tue Jun 25 18:35:23 2019 (r349381) @@ -89,6 +89,8 @@ void multilist_sublist_insert_head(multilist_sublist_t void multilist_sublist_insert_tail(multilist_sublist_t *, void *); void multilist_sublist_move_forward(multilist_sublist_t *mls, void *obj); void multilist_sublist_remove(multilist_sublist_t *, void *); +int multilist_sublist_is_empty(multilist_sublist_t *); +int multilist_sublist_is_empty_idx(multilist_t *, unsigned int); void *multilist_sublist_head(multilist_sublist_t *); void *multilist_sublist_tail(multilist_sublist_t *); From owner-svn-src-all@freebsd.org Tue Jun 25 18:47:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76CFE15D3F67; Tue, 25 Jun 2019 18:47:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D228703D5; Tue, 25 Jun 2019 18:47:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E85B71C65F; Tue, 25 Jun 2019 18:47:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PIle3O061820; Tue, 25 Jun 2019 18:47:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PIlecl061819; Tue, 25 Jun 2019 18:47:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906251847.x5PIlecl061819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 25 Jun 2019 18:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349383 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 349383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D228703D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 18:47:41 -0000 Author: kevans Date: Tue Jun 25 18:47:40 2019 New Revision: 349383 URL: https://svnweb.freebsd.org/changeset/base/349383 Log: libbe(3): restructure be_mount, skip canmount check for BE dataset Further cleanup after r349380; loader and kernel will both ignore canmount on the root dataset as well, so we should not be so strict about it when mounting it. be_mount is restructured to make it more clear that depth==0 is special, and to not try fetching these properties that we won't care about. MFC after: 3 days Modified: head/lib/libbe/be_access.c Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Tue Jun 25 18:36:11 2019 (r349382) +++ head/lib/libbe/be_access.c Tue Jun 25 18:47:40 2019 (r349383) @@ -89,25 +89,31 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) return (0); } - if (zfs_prop_get_int(zfs_hdl, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) - return (0); + /* + * canmount and mountpoint are both ignored for the BE dataset, because + * the rest of the system (kernel and loader) will effectively do the + * same. + */ + if (info->depth == 0) { + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { + if (zfs_prop_get_int(zfs_hdl, ZFS_PROP_CANMOUNT) == + ZFS_CANMOUNT_OFF) + return (0); - if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, zfs_mnt, BE_MAXPATHLEN, - NULL, NULL, 0, 1)) - return (1); + if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, zfs_mnt, + BE_MAXPATHLEN, NULL, NULL, 0, 1)) + return (1); - if (strcmp("none", zfs_mnt) == 0 || info->depth == 0) { /* - * mountpoint=none; we'll mount it at info->mountpoint assuming - * we're at the root. If we're not at the root, we're likely - * at some intermediate dataset (e.g. zroot/var) that will have - * children that may need to be mounted. + * We've encountered mountpoint=none at some intermediate + * dataset (e.g. zroot/var) that will have children that may + * need to be mounted. Skip mounting it, but iterate through + * the children. */ - if (info->depth > 0) + if (strcmp("none", zfs_mnt) == 0) goto skipmount; - snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); - } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); From owner-svn-src-all@freebsd.org Tue Jun 25 19:06:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC7CB15D461E; Tue, 25 Jun 2019 19:06:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4527102F; Tue, 25 Jun 2019 19:06:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 320B81C9B9; Tue, 25 Jun 2019 19:06:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJ6iFQ072233; Tue, 25 Jun 2019 19:06:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJ6iZI072231; Tue, 25 Jun 2019 19:06:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906251906.x5PJ6iZI072231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 25 Jun 2019 19:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349385 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B4527102F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:06:45 -0000 Author: emaste Date: Tue Jun 25 19:06:43 2019 New Revision: 349385 URL: https://svnweb.freebsd.org/changeset/base/349385 Log: bhyve: avoid theoretical stack buffer overflow from integer overflow Use the proper size_t type to match strlen's return type. This is not exploitable in practice as this parses command line arguments, which are limited to well below 2^31 bytes. This is a minimal change to address the reported issue; hda_parse_config and the rest of this file will benefit from further review. Reported by: Fakhri Zulkifli Reviewed by: jhb, markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/bhyve/pci_hda.c Modified: head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- head/usr.sbin/bhyve/pci_hda.c Tue Jun 25 18:58:51 2019 (r349384) +++ head/usr.sbin/bhyve/pci_hda.c Tue Jun 25 19:06:43 2019 (r349385) @@ -324,15 +324,14 @@ hda_parse_config(const char *opts, const char *key, ch char buf[64]; char *s = buf; char *tmp = NULL; - int len; + size_t len; int i; if (!opts) return (0); len = strlen(opts); - - if (len >= 64) { + if (len >= sizeof(buf)) { DPRINTF("Opts too big\n"); return (0); } From owner-svn-src-all@freebsd.org Tue Jun 25 19:35:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9555315D544F; Tue, 25 Jun 2019 19:35:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 352C072226; Tue, 25 Jun 2019 19:35:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CAC01CED7; Tue, 25 Jun 2019 19:35:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJZu4i087736; Tue, 25 Jun 2019 19:35:56 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJZuB6087735; Tue, 25 Jun 2019 19:35:56 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906251935.x5PJZuB6087735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 25 Jun 2019 19:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349386 - releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 349386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 352C072226 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:35:57 -0000 Author: gjb Date: Tue Jun 25 19:35:56 2019 New Revision: 349386 URL: https://svnweb.freebsd.org/changeset/base/349386 Log: Release notes documentation: - r338938, oce(4) version 11.0.50.0. - r341987, mlx4en(4) and mlx5en(4) version 3.5.0. - r349181, ixl(4) and ixlv(4) version 1.11.9 and 1.5.8. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 25 19:06:43 2019 (r349385) +++ releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 25 19:35:56 2019 (r349386) @@ -489,10 +489,17 @@ Network Drivers + The &man.oce.4; driver has been updated + to version 11.0.50.0. + The TP-Link® TL-WN321G™ network adapter now uses the &man.run.4; driver instead of the &man.rum.4; driver. + The &man.mlx4en.4; and &man.mlx5en.4; + drivers have been updated to version 3.5.0. + The &man.lagg.4; driver has been updated to allow changing the MTU without requiring destroying and @@ -513,6 +520,14 @@ The &man.cxgbe.4; T4, T5, and T6 firmware has been updated to version 1.23.0.0. + + The &man.ixl.4; driver has been updated + version 1.11.9. + + The &man.ixlv.4; driver has been updated + version 1.5.8. From owner-svn-src-all@freebsd.org Tue Jun 25 19:35:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAAE515D5453; Tue, 25 Jun 2019 19:35:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51D4872227; Tue, 25 Jun 2019 19:35:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D8F71CED8; Tue, 25 Jun 2019 19:35:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJZwjd087779; Tue, 25 Jun 2019 19:35:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJZwY5087778; Tue, 25 Jun 2019 19:35:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906251935.x5PJZwY5087778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 25 Jun 2019 19:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349387 - releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 349387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51D4872227 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:35:58 -0000 Author: gjb Date: Tue Jun 25 19:35:57 2019 New Revision: 349387 URL: https://svnweb.freebsd.org/changeset/base/349387 Log: Release notes documentation: - Remove empty sections. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 25 19:35:56 2019 (r349386) +++ releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 25 19:35:57 2019 (r349387) @@ -318,12 +318,6 @@ been updated to the latest upstream version.
- - Installation and Configuration Tools - -   - - <filename class="directory">/etc/rc.d</filename> Scripts @@ -379,18 +373,6 @@ The &man.pthread.3; library has been updated to improve POSIX compliance. - - - ABI Compatibility - -   - - - - Userland Debugging - -   - @@ -423,30 +405,6 @@ future releases will now be printed on all &os; versions. - - - Kernel Bug Fixes - -   - - - - Kernel Configuration - -   - - - - Kernel Modules - -   - - - - System Tuning and Controls - -   - @@ -480,12 +438,6 @@ deprecated, and are not present in &os; 13.0. - - Storage Drivers - -   - - Network Drivers @@ -555,12 +507,6 @@ NumLock, ScrollLock, and numerical keypad keys has been added to &man.bhyve.8;. - - - ARM Support - -   - @@ -576,12 +522,6 @@ weaker algorithms when creating &man.geli.8; providers. - - Networked Storage - -   - - ZFS @@ -594,12 +534,6 @@ ZFS filesystem has been updated to implement parallel mounting. - - - <literal>geom(4)</literal> - -   - @@ -627,12 +561,6 @@ console type and device if not defined in &man.loader.conf.5;. - - - Boot Menu Changes - -   - @@ -658,12 +586,6 @@ IPSec algorithms deprecated in RFC 8221. - - - Network Protocols - -   - @@ -673,33 +595,8 @@ Collection, package infrastructure, and package maintenance and installation tools. - - Infrastructure Changes - -   - - Packaging Changes - -   - - - - - Documentation - - This section covers changes to the &os; Documentation - Project sources and toolchain. - - - Documentation Source Changes - -   - - - - Documentation Toolchain Changes   From owner-svn-src-all@freebsd.org Tue Jun 25 19:35:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D468015D5465; Tue, 25 Jun 2019 19:35:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7607B72232; Tue, 25 Jun 2019 19:35:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CB321CED9; Tue, 25 Jun 2019 19:35:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJZxIM087822; Tue, 25 Jun 2019 19:35:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJZx75087821; Tue, 25 Jun 2019 19:35:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906251935.x5PJZx75087821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 25 Jun 2019 19:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349388 - releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 349388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7607B72232 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:36:00 -0000 Author: gjb Date: Tue Jun 25 19:35:58 2019 New Revision: 349388 URL: https://svnweb.freebsd.org/changeset/base/349388 Log: Release notes documentation: - Add versions of ports-mgmt/pkg, x11/gnome3, and x11/kde5. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 25 19:35:57 2019 (r349387) +++ releng/11.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 25 19:35:58 2019 (r349388) @@ -598,7 +598,14 @@ Packaging Changes -   + The &man.pkg.8; utility has been updated to version + 1.10.5. + + The KDE desktop environment has + been updated to version 5.15.3. + + The GNOME desktop environment + has been updated to version 3.28. From owner-svn-src-all@freebsd.org Tue Jun 25 19:36:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F3F215D54B8; Tue, 25 Jun 2019 19:36:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6B0722B7; Tue, 25 Jun 2019 19:36:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82C9E1CEDB; Tue, 25 Jun 2019 19:36:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJa1a6087915; Tue, 25 Jun 2019 19:36:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJa1CV087914; Tue, 25 Jun 2019 19:36:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906251936.x5PJa1CV087914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 25 Jun 2019 19:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349390 - releng/11.3/release/doc/en_US.ISO8859-1 X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/doc/en_US.ISO8859-1 X-SVN-Commit-Revision: 349390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A6B0722B7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:36:06 -0000 Author: gjb Date: Tue Jun 25 19:36:01 2019 New Revision: 349390 URL: https://svnweb.freebsd.org/changeset/base/349390 Log: Connect the installation page to the build. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/release/doc/en_US.ISO8859-1/Makefile Modified: releng/11.3/release/doc/en_US.ISO8859-1/Makefile ============================================================================== --- releng/11.3/release/doc/en_US.ISO8859-1/Makefile Tue Jun 25 19:36:00 2019 (r349389) +++ releng/11.3/release/doc/en_US.ISO8859-1/Makefile Tue Jun 25 19:36:01 2019 (r349390) @@ -4,6 +4,7 @@ RELN_ROOT?= ${.CURDIR}/.. SUBDIR = relnotes SUBDIR+= hardware +SUBDIR+= installation SUBDIR+= readme SUBDIR+= errata From owner-svn-src-all@freebsd.org Tue Jun 25 19:36:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C8AD15D54B7; Tue, 25 Jun 2019 19:36:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FE1772273; Tue, 25 Jun 2019 19:36:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6974A1CEDA; Tue, 25 Jun 2019 19:36:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJa0JN087869; Tue, 25 Jun 2019 19:36:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJa0pW087868; Tue, 25 Jun 2019 19:36:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906251936.x5PJa0pW087868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 25 Jun 2019 19:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349389 - releng/11.3/release/doc/en_US.ISO8859-1/installation X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/doc/en_US.ISO8859-1/installation X-SVN-Commit-Revision: 349389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FE1772273 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:36:06 -0000 Author: gjb Date: Tue Jun 25 19:36:00 2019 New Revision: 349389 URL: https://svnweb.freebsd.org/changeset/base/349389 Log: Release notes documentation: - Update version numbers in the installation page. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/release/doc/en_US.ISO8859-1/installation/article.xml Modified: releng/11.3/release/doc/en_US.ISO8859-1/installation/article.xml ============================================================================== --- releng/11.3/release/doc/en_US.ISO8859-1/installation/article.xml Tue Jun 25 19:35:58 2019 (r349388) +++ releng/11.3/release/doc/en_US.ISO8859-1/installation/article.xml Tue Jun 25 19:36:00 2019 (r349389) @@ -4,7 +4,7 @@ %release; - + ]>
The &man.freebsd-update.8; utility supports binary upgrades of &arch.i386; and &arch.amd64; systems running earlier FreeBSD releases. Systems running - 10.3-RELEASE, - 11.0-RELEASE can upgrade as follows: + 11.2-RELEASE can upgrade as follows: &prompt.root; freebsd-update fetch &prompt.root; freebsd-update install From owner-svn-src-all@freebsd.org Tue Jun 25 19:44:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B741015D5AAA; Tue, 25 Jun 2019 19:44:23 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2D772E36; Tue, 25 Jun 2019 19:44:23 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 348421D087; Tue, 25 Jun 2019 19:44:23 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJiNha093353; Tue, 25 Jun 2019 19:44:23 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJiNaA093352; Tue, 25 Jun 2019 19:44:23 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906251944.x5PJiNaA093352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 25 Jun 2019 19:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349391 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E2D772E36 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:44:23 -0000 Author: asomers Date: Tue Jun 25 19:44:22 2019 New Revision: 349391 URL: https://svnweb.freebsd.org/changeset/base/349391 Log: fcntl: style changes to r349248 Reported by: bde MFC after: 2 weeks MFC-With: 349248 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Jun 25 19:36:01 2019 (r349390) +++ head/sys/kern/vfs_vnops.c Tue Jun 25 19:44:22 2019 (r349391) @@ -499,10 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp) * closely related to the best I/O size for real disks than * to any block size used by software. */ - fp->f_seqcount += MIN(IO_SEQMAX, + fp->f_seqcount += lmin(IO_SEQMAX, howmany(uio->uio_resid, 16384)); - if (fp->f_seqcount > IO_SEQMAX) - fp->f_seqcount = IO_SEQMAX; return (fp->f_seqcount << IO_SEQSHIFT); } From owner-svn-src-all@freebsd.org Tue Jun 25 19:55:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A73F715D5E4D; Tue, 25 Jun 2019 19:55:43 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBF57347E; Tue, 25 Jun 2019 19:55:43 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DE771D22E; Tue, 25 Jun 2019 19:55:43 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PJtgZx098888; Tue, 25 Jun 2019 19:55:42 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PJtgil098887; Tue, 25 Jun 2019 19:55:42 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201906251955.x5PJtgil098887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 25 Jun 2019 19:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349392 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: julian X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 349392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CBF57347E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 19:55:43 -0000 Author: julian Date: Tue Jun 25 19:55:42 2019 New Revision: 349392 URL: https://svnweb.freebsd.org/changeset/base/349392 Log: Fix annoying whitespace issue. NO real change Modified: head/sys/sys/pmckern.h Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Tue Jun 25 19:44:22 2019 (r349391) +++ head/sys/sys/pmckern.h Tue Jun 25 19:55:42 2019 (r349392) @@ -226,7 +226,7 @@ do { \ */ #define PMC_CALL_HOOK_UNLOCKED(t, cmd, arg) \ do { \ - if (pmc_hook != NULL) \ + if (pmc_hook != NULL) \ (pmc_hook)((t), (cmd), (arg)); \ } while (0) From owner-svn-src-all@freebsd.org Tue Jun 25 20:25:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B48E15D6B8D; Tue, 25 Jun 2019 20:25:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E9C274DAF; Tue, 25 Jun 2019 20:25:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E18AE1D73A; Tue, 25 Jun 2019 20:25:16 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PKPGYJ014590; Tue, 25 Jun 2019 20:25:16 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PKPGml014589; Tue, 25 Jun 2019 20:25:16 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906252025.x5PKPGml014589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 25 Jun 2019 20:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349393 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E9C274DAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 20:25:17 -0000 Author: dougm Date: Tue Jun 25 20:25:16 2019 New Revision: 349393 URL: https://svnweb.freebsd.org/changeset/base/349393 Log: Eliminate some uses of the prev and next fields of vm_map_entry_t. Since the only caller to vm_map_splay is vm_map_lookup_entry, move the implementation of vm_map_splay into vm_map_lookup_helper, called by vm_map_lookup_entry. vm_map_lookup_entry returns the greatest entry less than or equal to a given address, but in many cases the caller wants the least entry greater than or equal to the address and uses the next pointer to get to it. Provide an alternative interface to lookup, vm_map_lookup_entry_ge, to provide the latter behavior, and let callers use one or the other rather than having them use the next pointer after a lookup miss to get what they really want. In vm_map_growstack, the caller wants an entry that includes a given address, and either the preceding or next entry depending on the value of eflags in the first entry. Incorporate that behavior into vm_map_lookup_helper, the function that implements all of these lookups. Eliminate some temporary variables used with vm_map_lookup_entry, but inessential. Reviewed by: markj (earlier version) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20664 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Jun 25 19:55:42 2019 (r349392) +++ head/sys/vm/vm_map.c Tue Jun 25 20:25:16 2019 (r349393) @@ -983,6 +983,17 @@ vm_map_entry_max_free_right(vm_map_entry_t root, vm_ma root->right->max_free : right_ancestor->start - root->end); } +/* + * vm_map_splay_split, vm_map_splay_merge: + * + * The Sleator and Tarjan top-down splay algorithm with the following + * variation. Max_free must be computed bottom-up, so on the downward + * pass (vm_map_splay_split), maintain the left and right spines in + * reverse order, and ensure that the max_free values for those nodes + * store the values of their descendents not on the search path. Later, + * make a second pass up each side (vm_map_splay_merge) to fix the + * pointers and compute max_free. The time bound is O(log n) amortized. + */ #define SPLAY_LEFT_STEP(root, y, rlist, test) do { \ vm_size_t max_free; \ \ @@ -1166,56 +1177,6 @@ vm_map_splay_merge(vm_map_t map, vm_map_entry_t root, } /* - * vm_map_splay: - * - * The Sleator and Tarjan top-down splay algorithm with the - * following variation. Max_free must be computed bottom-up, so - * on the downward pass, maintain the left and right spines in - * reverse order. Then, make a second pass up each side to fix - * the pointers and compute max_free. The time bound is O(log n) - * amortized. - * - * The new root is the vm_map_entry containing "addr", or else an - * adjacent entry (lower if possible) if addr is not in the tree. - * - * The map must be locked, and leaves it so. - * - * Returns: the new root. - */ -static vm_map_entry_t -vm_map_splay(vm_map_t map, vm_offset_t addr) -{ - vm_map_entry_t llist, rlist, root; - - root = vm_map_splay_split(map, addr, 0, &llist, &rlist); - if (root != NULL) { - /* do nothing */ - } else if (llist != &map->header) { - /* - * Recover the greatest node in the left - * subtree and make it the root. - */ - root = llist; - llist = root->right; - root->right = NULL; - } else if (rlist != &map->header) { - /* - * Recover the least node in the right - * subtree and make it the root. - */ - root = rlist; - rlist = root->left; - root->left = NULL; - } else { - /* There is no root. */ - return (NULL); - } - vm_map_splay_merge(map, root, llist, rlist); - VM_MAP_ASSERT_CONSISTENT(map); - return (root); -} - -/* * vm_map_entry_{un,}link: * * Insert/remove entries from maps. @@ -1331,81 +1292,133 @@ vm_map_entry_resize(vm_map_t map, vm_map_entry_t entry } /* - * vm_map_lookup_entry: [ internal use only ] + * vm_map_lookup_helper: [ internal use only ] * - * Finds the map entry containing (or - * immediately preceding) the specified address - * in the given map; the entry is returned - * in the "entry" parameter. The boolean - * result indicates whether the address is - * actually contained in the map. + * Finds the map entry containing (or adjacent to) the specified address + * in the given map; the entry is returned in the "entry" parameter. The + * boolean result indicates whether the address is actually contained in + * the map. If the address is not contained in the map, parameter lesseq + * determines whether the entry provided is before or after the address. + * If the address is contained in the map, parameter nbr, if not NULL, is + * where the next or previous entry is saved, depending on the value of + * eflags in the found entry. */ -boolean_t -vm_map_lookup_entry( - vm_map_t map, - vm_offset_t address, - vm_map_entry_t *entry) /* OUT */ +static bool +vm_map_lookup_helper(vm_map_t map, vm_offset_t addr, bool lesseq, + vm_map_entry_t *entry, vm_map_entry_t *nbr) /* OUT */ { - vm_map_entry_t cur, lbound; - boolean_t locked; + vm_map_entry_t llist, rlist, root; + bool locked, found; /* * If the map is empty, then the map entry immediately preceding - * "address" is the map's header. + * "addr" is the map's header. */ - cur = map->root; - if (cur == NULL) { + root = map->root; + if (root == NULL) { *entry = &map->header; - return (FALSE); + return (false); } - if (address >= cur->start && cur->end > address) { - *entry = cur; - return (TRUE); - } if ((locked = vm_map_locked(map)) || sx_try_upgrade(&map->lock)) { + /* * Splay requires a write lock on the map. However, it only * restructures the binary search tree; it does not otherwise * change the map. Thus, the map's timestamp need not change * on a temporary upgrade. */ - cur = vm_map_splay(map, address); + root = vm_map_splay_split(map, addr, 0, &llist, &rlist); + found = root != NULL; + *entry = root; + if (root != NULL) { + if (nbr == NULL) + ; /* Ignore. */ + else if ((root->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { + vm_map_splay_findnext(root, &rlist); + *nbr = rlist; + } else { + vm_map_splay_findprev(root, &llist); + *nbr = llist; + } + } else if (llist != &map->header) { + /* + * Recover the greatest node in the left + * subtree and make it the root. + */ + *entry = lesseq ? llist : rlist; + root = llist; + llist = root->right; + root->right = NULL; + } else { + /* + * Recover the least node in the right + * subtree and make it the root. + */ + *entry = lesseq ? llist : rlist; + root = rlist; + rlist = root->left; + root->left = NULL; + } + vm_map_splay_merge(map, root, llist, rlist); + VM_MAP_ASSERT_CONSISTENT(map); if (!locked) sx_downgrade(&map->lock); - - /* - * If "address" is contained within a map entry, the new root - * is that map entry. Otherwise, the new root is a map entry - * immediately before or after "address". - */ - if (address < cur->start) { - *entry = &map->header; - return (FALSE); - } - *entry = cur; - return (address < cur->end); + return (found); } /* * Since the map is only locked for read access, perform a - * standard binary search tree lookup for "address". + * standard binary search tree lookup for "addr". */ - lbound = &map->header; + llist = rlist = &map->header; do { - if (address < cur->start) { - cur = cur->left; - } else if (cur->end <= address) { - lbound = cur; - cur = cur->right; + if (addr < root->start) { + rlist = root; + root = root->left; + } else if (root->end <= addr) { + llist = root; + root = root->right; } else { - *entry = cur; - return (TRUE); + *entry = root; + if (nbr == NULL); + else if ((root->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { + /* Make nbr the successor to root. */ + if (root->right != NULL) { + rlist = root->right; + while (rlist->left != NULL) + rlist = rlist->left; + } + *nbr = rlist; + } else { + /* Make nbr the predecessor to root. */ + if (root->left != NULL) { + llist = root->left; + while (llist->right != NULL) + llist = llist->right; + } + *nbr = llist; + } + return (true); } - } while (cur != NULL); - *entry = lbound; - return (FALSE); + } while (root != NULL); + *entry = lesseq ? llist : rlist; + return (false); } +bool +vm_map_lookup_entry(vm_map_t map, vm_offset_t addr, + vm_map_entry_t *entry) /* OUT */ +{ + return (vm_map_lookup_helper(map, addr, true, entry, NULL)); +} + +static bool +vm_map_lookup_entry_ge(vm_map_t map, vm_offset_t addr, + vm_map_entry_t *entry) /* OUT */ +{ + return (vm_map_lookup_helper(map, addr, false, entry, NULL)); +} + /* * vm_map_insert: * @@ -1422,7 +1435,7 @@ int vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry, prev_entry, temp_entry; + vm_map_entry_t new_entry, prev_entry; struct ucred *cred; vm_eflags_t protoeflags; vm_inherit_t inheritance; @@ -1447,11 +1460,9 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof * Find the entry prior to the proposed starting address; if it's part * of an existing entry, this range is bogus. */ - if (vm_map_lookup_entry(map, start, &temp_entry)) + if (vm_map_lookup_entry(map, start, &prev_entry)) return (KERN_NO_SPACE); - prev_entry = temp_entry; - /* * Assert that the next entry doesn't overlap the end point. */ @@ -2314,10 +2325,8 @@ vm_map_submap( VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry(map, start, &entry)) { + if (vm_map_lookup_entry_ge(map, start, &entry)) vm_map_clip_start(map, entry, start); - } else - entry = entry->next; vm_map_clip_end(map, entry, end); @@ -2472,8 +2481,7 @@ again: VM_MAP_RANGE_CHECK(map, start, end); - if (!vm_map_lookup_entry(map, start, &entry)) - entry = entry->next; + vm_map_lookup_entry_ge(map, start, &entry); /* * Make a first pass to check for protection violations. @@ -2663,11 +2671,9 @@ vm_map_madvise( */ VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry(map, start, &entry)) { + if (vm_map_lookup_entry_ge(map, start, &entry)) { if (modify_map) vm_map_clip_start(map, entry, start); - } else { - entry = entry->next; } if (modify_map) { @@ -2799,7 +2805,6 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off vm_inherit_t new_inheritance) { vm_map_entry_t entry; - vm_map_entry_t temp_entry; switch (new_inheritance) { case VM_INHERIT_NONE: @@ -2814,11 +2819,8 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry(map, start, &temp_entry)) { - entry = temp_entry; + if (vm_map_lookup_entry_ge(map, start, &entry)) vm_map_clip_start(map, entry, start); - } else - entry = temp_entry->next; while (entry->start < end) { vm_map_clip_end(map, entry, end); if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || @@ -2851,10 +2853,8 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs user_unwire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - if (!vm_map_lookup_entry(map, start, &first_entry)) { - if (flags & VM_MAP_WIRE_HOLESOK) - first_entry = first_entry->next; - else { + if (!vm_map_lookup_entry_ge(map, start, &first_entry)) { + if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { vm_map_unlock(map); return (KERN_INVALID_ADDRESS); } @@ -2882,11 +2882,9 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs * Specifically, the entry may have been * clipped, merged, or deleted. */ - if (!vm_map_lookup_entry(map, saved_start, + if (!vm_map_lookup_entry_ge(map, saved_start, &tmp_entry)) { - if (flags & VM_MAP_WIRE_HOLESOK) - tmp_entry = tmp_entry->next; - else { + if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { if (saved_start == start) { /* * First_entry has been deleted. @@ -2944,11 +2942,9 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs done: need_wakeup = FALSE; if (first_entry == NULL) { - result = vm_map_lookup_entry(map, start, &first_entry); - if (!result && (flags & VM_MAP_WIRE_HOLESOK)) - first_entry = first_entry->next; - else - KASSERT(result, ("vm_map_unwire: lookup failed")); + result = vm_map_lookup_entry_ge(map, start, &first_entry); + KASSERT(result || (flags & VM_MAP_WIRE_HOLESOK) != 0, + ("vm_map_unwire: lookup failed")); } for (entry = first_entry; entry->start < end; entry = entry->next) { /* @@ -3090,10 +3086,8 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm prot |= VM_PROT_WRITE; user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; VM_MAP_RANGE_CHECK(map, start, end); - if (!vm_map_lookup_entry(map, start, &first_entry)) { - if (flags & VM_MAP_WIRE_HOLESOK) - first_entry = first_entry->next; - else + if (!vm_map_lookup_entry_ge(map, start, &first_entry)) { + if ((flags & VM_MAP_WIRE_HOLESOK) == 0) return (KERN_INVALID_ADDRESS); } last_timestamp = map->timestamp; @@ -3119,11 +3113,9 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm * Specifically, the entry may have been * clipped, merged, or deleted. */ - if (!vm_map_lookup_entry(map, saved_start, + if (!vm_map_lookup_entry_ge(map, saved_start, &tmp_entry)) { - if (flags & VM_MAP_WIRE_HOLESOK) - tmp_entry = tmp_entry->next; - else { + if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { if (saved_start == start) { /* * first_entry has been deleted. @@ -3256,11 +3248,9 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm done: need_wakeup = FALSE; if (first_entry == NULL) { - result = vm_map_lookup_entry(map, start, &first_entry); - if (!result && (flags & VM_MAP_WIRE_HOLESOK)) - first_entry = first_entry->next; - else - KASSERT(result, ("vm_map_wire: lookup failed")); + result = vm_map_lookup_entry_ge(map, start, &first_entry); + KASSERT(result || (flags & VM_MAP_WIRE_HOLESOK) != 0, + ("vm_map_wire: lookup failed")); } for (entry = first_entry; entry->start < end; entry = entry->next) { /* @@ -3361,7 +3351,8 @@ vm_map_sync( if (!vm_map_lookup_entry(map, start, &entry)) { vm_map_unlock_read(map); return (KERN_INVALID_ADDRESS); - } else if (start == end) { + } + if (start == end) { start = entry->start; end = entry->end; } @@ -3416,9 +3407,10 @@ vm_map_sync( start += size; vm_object_deallocate(object); vm_map_lock_read(map); - if (last_timestamp == map->timestamp || - !vm_map_lookup_entry(map, start, ¤t)) + if (last_timestamp == map->timestamp) current = current->next; + else + vm_map_lookup_entry_ge(map, start, ¤t); } vm_map_unlock_read(map); @@ -3551,7 +3543,6 @@ int vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end) { vm_map_entry_t entry; - vm_map_entry_t first_entry; VM_MAP_ASSERT_LOCKED(map); if (start == end) @@ -3560,12 +3551,8 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs /* * Find the start of the region, and clip it */ - if (!vm_map_lookup_entry(map, start, &first_entry)) - entry = first_entry->next; - else { - entry = first_entry; + if (vm_map_lookup_entry_ge(map, start, &entry)) vm_map_clip_start(map, entry, start); - } /* * Step through all entries in this region @@ -3583,29 +3570,22 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs vm_map_entry_system_wired_count(entry) != 0)) { unsigned int last_timestamp; vm_offset_t saved_start; - vm_map_entry_t tmp_entry; saved_start = entry->start; entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; last_timestamp = map->timestamp; (void) vm_map_unlock_and_wait(map, 0); vm_map_lock(map); - if (last_timestamp + 1 != map->timestamp) { - /* - * Look again for the entry because the map was - * modified while it was unlocked. - * Specifically, the entry may have been - * clipped, merged, or deleted. - */ - if (!vm_map_lookup_entry(map, saved_start, - &tmp_entry)) - entry = tmp_entry->next; - else { - entry = tmp_entry; - vm_map_clip_start(map, entry, - saved_start); - } - } + if (last_timestamp + 1 == map->timestamp) + continue; + + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, the + * entry may have been clipped, merged, or deleted. + */ + if (vm_map_lookup_entry_ge(map, saved_start, &entry)) + vm_map_clip_start(map, entry, saved_start); continue; } vm_map_clip_end(map, entry, end); @@ -3680,11 +3660,9 @@ vm_map_check_protection(vm_map_t map, vm_offset_t star vm_prot_t protection) { vm_map_entry_t entry; - vm_map_entry_t tmp_entry; - if (!vm_map_lookup_entry(map, start, &tmp_entry)) + if (!vm_map_lookup_entry(map, start, &entry)) return (FALSE); - entry = tmp_entry; while (start < end) { /* @@ -4120,7 +4098,7 @@ static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry, prev_entry; + vm_map_entry_t new_entry; vm_offset_t bot, gap_bot, gap_top, top; vm_size_t init_ssize, sgp; int orient, rv; @@ -4148,13 +4126,13 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, init_ssize = max_ssize - sgp; /* If addr is already mapped, no go */ - if (vm_map_lookup_entry(map, addrbos, &prev_entry)) + if (vm_map_lookup_entry_ge(map, addrbos, &new_entry)) return (KERN_NO_SPACE); /* * If we can't accommodate max_ssize in the current mapping, no go. */ - if (prev_entry->next->start < addrbos + max_ssize) + if (new_entry->start < addrbos + max_ssize) return (KERN_NO_SPACE); /* @@ -4181,7 +4159,6 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, rv = vm_map_insert(map, NULL, 0, bot, top, prot, max, cow); if (rv != KERN_SUCCESS) return (rv); - new_entry = prev_entry->next; KASSERT(new_entry->end == top || new_entry->start == bot, ("Bad entry start/end for new stack entry")); KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || @@ -4240,19 +4217,18 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma vmemlim = lim_cur(curthread, RLIMIT_VMEM); retry: /* If addr is not in a hole for a stack grow area, no need to grow. */ - if (gap_entry == NULL && !vm_map_lookup_entry(map, addr, &gap_entry)) + if (gap_entry == NULL && + !vm_map_lookup_helper(map, addr, true, &gap_entry, &stack_entry)) return (KERN_FAILURE); if ((gap_entry->eflags & MAP_ENTRY_GUARD) == 0) return (KERN_SUCCESS); if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { - stack_entry = gap_entry->next; if ((stack_entry->eflags & MAP_ENTRY_GROWS_DOWN) == 0 || stack_entry->start != gap_entry->end) return (KERN_FAILURE); grow_amount = round_page(stack_entry->start - addr); grow_down = true; } else if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_UP) != 0) { - stack_entry = gap_entry->prev; if ((stack_entry->eflags & MAP_ENTRY_GROWS_UP) == 0 || stack_entry->end != gap_entry->start) return (KERN_FAILURE); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Tue Jun 25 19:55:42 2019 (r349392) +++ head/sys/vm/vm_map.h Tue Jun 25 20:25:16 2019 (r349393) @@ -415,7 +415,7 @@ int vm_map_lookup (vm_map_t *, vm_offset_t, vm_prot_t, int vm_map_lookup_locked(vm_map_t *, vm_offset_t, vm_prot_t, vm_map_entry_t *, vm_object_t *, vm_pindex_t *, vm_prot_t *, boolean_t *); void vm_map_lookup_done (vm_map_t, vm_map_entry_t); -boolean_t vm_map_lookup_entry (vm_map_t, vm_offset_t, vm_map_entry_t *); +bool vm_map_lookup_entry(vm_map_t, vm_offset_t, vm_map_entry_t *); int vm_map_protect (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t, boolean_t); int vm_map_remove (vm_map_t, vm_offset_t, vm_offset_t); void vm_map_simplify_entry(vm_map_t map, vm_map_entry_t entry); From owner-svn-src-all@freebsd.org Tue Jun 25 21:26:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 920C115D7E9E; Tue, 25 Jun 2019 21:26:59 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE1B677A85; Tue, 25 Jun 2019 21:26:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 501DA1E173; Tue, 25 Jun 2019 21:26:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5PLQwCr048336; Tue, 25 Jun 2019 21:26:58 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5PLQwuU048335; Tue, 25 Jun 2019 21:26:58 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906252126.x5PLQwuU048335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Tue, 25 Jun 2019 21:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349395 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 349395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE1B677A85 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 21:26:59 -0000 Author: bcran Date: Tue Jun 25 21:26:57 2019 New Revision: 349395 URL: https://svnweb.freebsd.org/changeset/base/349395 Log: Disconnect EFI HTTP support The EFI HTTP code has been causing boot failures for people, so disable it while a fix is being worked on. Modified: head/stand/efi/loader/conf.c Modified: head/stand/efi/loader/conf.c ============================================================================== --- head/stand/efi/loader/conf.c Tue Jun 25 21:21:34 2019 (r349394) +++ head/stand/efi/loader/conf.c Tue Jun 25 21:26:57 2019 (r349395) @@ -39,7 +39,6 @@ struct devsw *devsw[] = { &efipart_fddev, &efipart_cddev, &efipart_hddev, - &efihttp_dev, /* ordering with efinet_dev matters */ &efinet_dev, &vdisk_dev, #ifdef EFI_ZFS_BOOT @@ -55,7 +54,6 @@ struct fs_ops *file_system[] = { &dosfs_fsops, &ufs_fsops, &cd9660_fsops, - &efihttp_fsops, &tftp_fsops, &nfs_fsops, &gzipfs_fsops, From owner-svn-src-all@freebsd.org Tue Jun 25 21:29:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F0CC15D7F30 for ; Tue, 25 Jun 2019 21:29:01 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bluestop.org (muon.bluestop.org [65.103.231.193]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DB5077C10; Tue, 25 Jun 2019 21:29:01 +0000 (UTC) (envelope-from bcran@freebsd.org) Received: from muon.bluestop.org (localhost [127.0.0.1]) by muon.bluestop.org (Postfix) with ESMTP id EA37F5BD3F; Tue, 25 Jun 2019 15:33:23 -0600 (MDT) Received: from muon.bluestop.org ([127.0.0.1]) by muon.bluestop.org (muon.bluestop.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kePLs2ySgWdG; Tue, 25 Jun 2019 15:33:23 -0600 (MDT) Received: from photon.int.bluestop.org (unknown [10.0.10.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTPSA; Tue, 25 Jun 2019 15:33:23 -0600 (MDT) Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa To: Dave Cottlehuber , src-committers , svn-src-all@freebsd.org, scottph@freebsd.org References: <201906242318.x5ONIhlS043523@repo.freebsd.org> <7d119185-32b3-4057-bc4c-ea21d55e6c44@www.fastmail.com> From: Rebecca Cran Openpgp: preference=signencrypt Autocrypt: addr=bcran@freebsd.org; keydata= mQINBFrUMZ4BEADI1yUEGeZeXeTCPay1ZpTBdDEpGPAw1dq2VCSTc1VhsnrEBa1iZxAfaeSv Uu5Ti7jlhQ/3sQMl0bJMKGB/RtmIW7k8h2w476oZmG8gChk8su5ZEx/pV1gdqInyFmmJKTYc gabJz8pL+m82w07qPv+oalepZ4dbj+HF++RAK/iEju+q9UHlsjj8e3mMNsvtrOz1K6bnpveO jZ+ms/2H3Hs5a4k8y6buwe2RvwhJQaXa13cR3LhzL+nwj4B9PHZZEa2WpEyYpw/bI0V9YSQN QgC1CYRzDyakZge6BCM6wHOgZSUzRPufGilrNKUwIVbRoIBR9/85+0wR+PlFUOUOfOc6ox7T dWcIx6PuPhek48rh4uwmmwsPtPiH4Z3T5p+GmWQ9NLFZKA1YnEdaSkWtYZsDxwVZZeYG2plt MfhXP0Hj4rf9Y3eoUenCaGioxAbUOBCtXdTGNAhNjz1g5NGDBVyhjKkzwJQvt9UrYTseERit 5dX2CMTy8hYLvSXd/Ivy+HylUS5IslfZxW5z9LgWX7Z97kILgkH3N0ewtLkygkG+Y+x7uaAV dFqp9ASOyzaiwKbJdeOI+WxRSh+AqeCR0S+bpkcLudLmbjrPmaFwjKycy1H85Z5R2J3YHyXY oT6OYjD8vLbUU2GWp6Onkcy1Pu8EMbRuzKil6HnpYg3BexbPFwARAQABtCBSZWJlY2NhIENy YW4gPGJjcmFuQGZyZWVic2Qub3JnPokCVAQTAQgAPhYhBB+5fZtkTdO940Yr4g0CK1MRvhAg BQJa2B8pAhsjBQkJZgGABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEA0CK1MRvhAgAe0P /R65umdPBVFCYKPZ91HMqlZtn0EWOGwycWEK/feWI+jaYOa+8+VVxFau4gwnBmgCdf5XOAJW QugUlPte9T+dP9QXmgm8z3KMLCj2PATYlmqmQfvIleJPf8w7BFBw/kkd6ZxoEQXaEyZwWuJc vY58uFYizZ8s1gMjD7uV3eg2UuGYd4loBZ3MSanWrhE6mmxAjzcYYb0KTsaTH9ON4uctcTYG 4FN0KzRx5d4nAhnS/yaL+3OI23vUDt+XnOCx8tIOczScOEN5NFChgyvTxzwi7hTVNB7uUCha mN6vcjtrrzi03zHXooldE4gRJ5G+SzuH9yHKrrwYXUeKi8sG8uXVoWwzsLbCxHRe7T9Ow7Im 92Aep3DEIE9whG6Fg3hRQ4/d/9OVCGrV3XwRMEstCvamJQc69ZsULo1ssGmPvcLn8fNaLNeP ICCLQj4JLcYvKKfLIQ/Cm0Orsy8rJGhwF4W1mBUbTdR6pk2azEkrhE7KZDylgikpNNqshKV3 1nD/5SNrTDl0P8rTnu0OKT0IbozIsaz9FD2xMPHPUMPnVSTB96+PhgoBIQlHcys19gftotuN 1tlLs4Ny93xWLSjKWoW5l9E9LbIh+M8gD3A7JyyV9DRZkHdbOt3pGjpaozchDPCpRkcsFXp4 9zSbXtxnbAWfZwoSYQTvznmXpzHMzoLMWf/guQINBFrUMZ4BEADkc4mvMcMcDF1tdNxNQuIB E1F243oZamG3LACCKfc1Yur3CPzHwIk5LXCUmbq23iE5bowxMWw3mlVT0p5xM0WnUidIBwCK u4kRyy/fY4NyWWBuwy9srpTdmUcKRBRNB8zEZE8xIlidD1ijjgqLBfeM7n9ylawAxHLxwU96 sdpdHFzb7Z0yKY2e/bzDaHiG0fUvcCmkgLf+uwKKZid1j8zR5PzKpgPqfy/PF01eKyGV3MNu 8Y90xMoiEMWfCI2IB1m+hTuzZoboFvGV54SiMuvfWK/VMQjhsL6K2ddOqwVuy2nIMI4G3xDQ W/v8KVyn43OSIAyW1eaklhzu0Ir2sO60PXRkvbTUrouvmSvpJfIQS49rU0M/X6FSDgXQLKrZ 3my94+g8ptz9KoVml6s4OAwYVz+sb49nuSxipFKkU5FwhKOLmzbsBxCtytcUJoLmjuJPJPDQ ue6YJiIXyc86GVY2pH3DjemKdbB4dSgqAJIp+lCzKSJzz7bgueh2Ox8vzx1tSxKj7V8Nal+U TKKbkxPmMh+e20YZ4esAVifO3bS6IJP/aDnfagghB71vA7+aWGXPbjPlc2UHpCBiRSsl+Igo QXvdvZBsKRyfBx8neODa2C6JIE5vcaCjilSeKF8SzsFXvimnndhQNhAPU/DwQwSXdCl4gTsF Vi5d8Oxq1sce+wARAQABiQI8BBgBCAAmFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAlrUMZ4C GwwFCQlmAYAACgkQDQIrUxG+ECAWnRAAsmZX+KgNxW3v7R/76Tz4Wjmh4AGeE+Ji3p5QsdTY ny1B6vYBL9vCzPJ/AK8pgKMDRaweUP5eZQpfrdWC8Q7SNGgi4Q+97KEs+i2xZLQ+WJb8a+WE EIc716u0y4ITiHfOgM5jWcFO4MXQATbJgv0drLLesa+LQCvZgPBqupt307EsCubQs+Sxt+RV jf6rOUolp1GJXEQYwGsKklVd6yqLC8M1BSG53/WE5tSv5GzBZ8fp6EtmjT7leuidFtEvKYHQ z4DqG9ELpHUF0X0UUCBK/MgXe3kCVLKE060UrJ4M6uPSx57rmVFA2MvwQR8M7GsWC5UsSM4P YwPWBhwxE7vcx0691YKAHT/5q8LxRVBdUyzPSprMhSQFttsBt+ygm6wRi3Pi3TuCEARNubPk QefyeC34yr40SAUCkOl3eWxSXPF4NfXFQb4AAzZSE5hv3qbDuwo3lrL0LqpIpEQPAz+JZ1QZ 6mMFQ5/JD9Gukj54kZc0X8w3sQt0a8vyE/qrJg8vKgv2rCHrPc5MeDkEUEFiiJiCEDdkJtMy oRlU3S4NrnbyLOLEcHE8fGe3hStPX8hY62id2ecdQ5WZ7vLZW5SFeLarbUciuHIkVL6MHnUj bV7XlY50N7ebeFCIdlCWhdum2FJs/Ni+SSxbZC564vrokwlBBGSo6WTPQTa8IWx1DtU= Message-ID: <59d594bc-f129-7c14-64c2-2624de9b76fb@freebsd.org> Date: Tue, 25 Jun 2019 15:28:59 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <7d119185-32b3-4057-bc4c-ea21d55e6c44@www.fastmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LV1sO5n6pt1OLAZQiedBmno71Wvjtym2m" X-Rspamd-Queue-Id: 1DB5077C10 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 21:29:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LV1sO5n6pt1OLAZQiedBmno71Wvjtym2m Content-Type: multipart/mixed; boundary="qYRjk6N4sjFAtYoREZKKFrOaT3LPXLXgd"; protected-headers="v1" From: Rebecca Cran To: Dave Cottlehuber , src-committers , svn-src-all@freebsd.org, scottph@freebsd.org Message-ID: <59d594bc-f129-7c14-64c2-2624de9b76fb@freebsd.org> Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa References: <201906242318.x5ONIhlS043523@repo.freebsd.org> <7d119185-32b3-4057-bc4c-ea21d55e6c44@www.fastmail.com> In-Reply-To: <7d119185-32b3-4057-bc4c-ea21d55e6c44@www.fastmail.com> --qYRjk6N4sjFAtYoREZKKFrOaT3LPXLXgd Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-06-25 11:23, Dave Cottlehuber wrote: > This fails to identify the partition with a bootable zpool on both a la= ptop (details > in the PR) and also a server (2 zpools), and instead tries to boot fro= m the EFI > partition where the boot1.efi loader is located (i.e. disk0p1 and not d= isk0p2). >=20 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238800 This doesn't sound related to the EFI HTTP changes, but may be related to some recent changes Warner's made? Other people have reported problems booting after my changeset though, so I've disconnected the HTTP boot code in r349395. --=20 Rebecca Cran --qYRjk6N4sjFAtYoREZKKFrOaT3LPXLXgd-- --LV1sO5n6pt1OLAZQiedBmno71Wvjtym2m Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH7l9m2RN073jRiviDQIrUxG+ECAFAl0SkhsACgkQDQIrUxG+ ECDK2Q//W1FeoFFo3JEBmI7BBgZJuGYXuiLQjkfkSCaOlyMYJNZCYSx86kxXpB2U KsfnjiPgyKzUnBh6ZawExKhoa6zgAU420pDX8NKRUMgAMbmO++61GYqF7pwEtgar GeCfCkbld7FAXYGjjHmuRXSmLxY0UhuBiqD/QCr7NSFsKjAMfTGV5ly0MnPFq9+x JV6Vbsf9lolIZNMWzOT17Ow77SS7642kGEzYY789smNyG5bItJbDe9FT7x43izN6 z2G1JMdR3OLPuclqhz9UJuSkFW2CR5iM9CF04647V0GQxGOW7UiV14aupGGnCW/v kiwREOh8WCytbRzUvTJbHsYOaOjvk8Ll0b4odbw75nAv8aQsts5dNLrvuXZX8pxq Jb2pndhnAWJgiocZlnNtw34/ofXeyps7HMfK9fIoQB4NGS5fT/t0aHeumMC7VEBb widWnZSjAcrnqp+XKM2uMQShLldB5YKD9ADx9jFQN+TE8PUU2w67Qkzb4SsLAsyk XXMdGTEoYuBNNb48NOO5q9hFTYwo5+ZJrr2LrI64ei4c0VTeosdeoEFHHGRXIoqy aDnjBEnlp/xhXcDQROyA+2KqoglGKqERS8Pp7VhiGdNP4jftVtw+uj9jla3W5qVT Hb8ZrqUWi89ljzY+RZAyBQn2I0hAlQRa6CZKuCBmiGYnX9kxDQ0= =EXwY -----END PGP SIGNATURE----- --LV1sO5n6pt1OLAZQiedBmno71Wvjtym2m-- From owner-svn-src-all@freebsd.org Tue Jun 25 21:37:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84CE315D81B5 for ; Tue, 25 Jun 2019 21:37:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2056B80355 for ; Tue, 25 Jun 2019 21:37:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82f.google.com with SMTP id x47so93267qtk.11 for ; Tue, 25 Jun 2019 14:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l34V6AfJ2+reJONkQe8r9iPNyM1QbkRt5HzlVc5FMcY=; b=LPGD82pxzcgvi77yeP6cPXZq6GWtsNxobVHVzXnxZsX3elHuCUtiIiREzbEbHQgd9j nw2IMQhIWlgTf89N3rp8L9Bp7Mj3jM6brCo2o2XDF3V8eJ5LQ481ofgzTPGxZlU/WTAK nANgSk/TSEZ3LDAhpruhjzVLzfjRu3hbFPCEe3ysiII7Jr0W8yFEaQS43uEmFgw6xpZx E1qE/dRT7Ty4rMP1+xMSgwRjVZjJBSRqB0fzE250QfZqrJaof6YzwRNsPexGyeOMsa3f 5NnbjzRgx6SOt7xqXLwy3bsP5jsJMCUGTHyv8DsVVra0BQYlFHPD9K1dGYh+7hnSCh4/ dWBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l34V6AfJ2+reJONkQe8r9iPNyM1QbkRt5HzlVc5FMcY=; b=qzxcoXhDOXCCZAdgptdJog1DLYqIPOdN2sUAPGHrIE9grC7Pn1zdToeeP7rHfmXj8x ZjpurZR/9+Y3t9b3wOcwS3zlLES8J6TZyef8mCJ6Bdy68KIX7qYkKfVmQvsiRAgDYbAM B1UCYftNymOkRspp6upQ4F09XYWGSHPjdfF4T7uOIglGc2vNiWzQ460BYel/nJc5D7tv eiTbEV0s9WLL9Y4Ec3NlMxSv1qgnWSSjrRvGA1DsIjITiZMWtVu6dJXlm+wgm0uqjoVV fK7KB2HlYQZTFv+qedHo3bdhzEcjxrMbkXerrBHkZmGiP9aXI0Rp9kfKqzPXDw64Qe+n lYUg== X-Gm-Message-State: APjAAAXryKOabP2joBZXhs+OpChJhNY7SSTGkNAO7sEHoTLlvnGBFkBc Izriai6pmU6ncEyExPm6SicxtS8vrVZ6n32mlAY2fg== X-Google-Smtp-Source: APXvYqwKj11QcDTqNmP9MmfHDpq4yBettqvnhLKOhp/k8M1mUh2NN36gm3yXrwWXepK26tnCtN8oGwi+K96Yf7X2EjU= X-Received: by 2002:aed:3e1d:: with SMTP id l29mr522702qtf.175.1561498634191; Tue, 25 Jun 2019 14:37:14 -0700 (PDT) MIME-Version: 1.0 References: <201906242318.x5ONIhlS043523@repo.freebsd.org> <7d119185-32b3-4057-bc4c-ea21d55e6c44@www.fastmail.com> <59d594bc-f129-7c14-64c2-2624de9b76fb@freebsd.org> In-Reply-To: <59d594bc-f129-7c14-64c2-2624de9b76fb@freebsd.org> From: Warner Losh Date: Tue, 25 Jun 2019 15:37:02 -0600 Message-ID: Subject: Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa To: Rebecca Cran Cc: dch@freebsd.org, src-committers , svn-src-all@freebsd.org, scottph@freebsd.org X-Rspamd-Queue-Id: 2056B80355 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 21:37:15 -0000 On Tue, Jun 25, 2019, 3:29 PM Rebecca Cran wrote: > On 2019-06-25 11:23, Dave Cottlehuber wrote: > > > This fails to identify the partition with a bootable zpool on both a > laptop (details > > in the PR) and also a server (2 zpools), and instead tries to boot from > the EFI > > partition where the boot1.efi loader is located (i.e. disk0p1 and not > disk0p2). > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238800 > > This doesn't sound related to the EFI HTTP changes, but may be related > to some recent changes Warner's made? > > Other people have reported problems booting after my changeset though, > so I've disconnected the HTTP boot code in r349395. > Please let me know if this persists. Warner > From owner-svn-src-all@freebsd.org Wed Jun 26 00:53:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC4BA15DB617; Wed, 26 Jun 2019 00:53:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 930AA8598B; Wed, 26 Jun 2019 00:53:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CA152043B; Wed, 26 Jun 2019 00:53:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q0rhp7058601; Wed, 26 Jun 2019 00:53:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q0rhZs058600; Wed, 26 Jun 2019 00:53:43 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906260053.x5Q0rhZs058600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 26 Jun 2019 00:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349399 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 930AA8598B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 00:53:44 -0000 Author: cy Date: Wed Jun 26 00:53:43 2019 New Revision: 349399 URL: https://svnweb.freebsd.org/changeset/base/349399 Log: Prompted by r349366, ipfilter is also does not conform to RFC 3128 by dropping TCP fragments with offset = 1. In addition to dropping these fragments, add a DTrace probe to allow for more detailed monitoring and diagnosis if required. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 26 00:06:41 2019 (r349398) +++ head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 26 00:53:43 2019 (r349399) @@ -1723,6 +1723,10 @@ ipf_pr_ipv4hdr(fin) * calculate the byte offset that it represents. */ off &= IP_MF|IP_OFFMASK; + if (off == 1 && p == IPPROTO_TCP) { + fin->fin_flx |= FI_SHORT; /* RFC 3128 */ + DT1(ipf_fi_tcp_frag_off_1, fr_info_t *, fin); + } if (off != 0) { int morefrag = off & IP_MF; From owner-svn-src-all@freebsd.org Wed Jun 26 00:53:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1687515DB635; Wed, 26 Jun 2019 00:53:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD7C485997; Wed, 26 Jun 2019 00:53:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 871462043C; Wed, 26 Jun 2019 00:53:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q0rkrQ058649; Wed, 26 Jun 2019 00:53:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q0rkSE058648; Wed, 26 Jun 2019 00:53:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906260053.x5Q0rkSE058648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 26 Jun 2019 00:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349400 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD7C485997 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 00:53:47 -0000 Author: cy Date: Wed Jun 26 00:53:46 2019 New Revision: 349400 URL: https://svnweb.freebsd.org/changeset/base/349400 Log: Remove a tautological compare for offset != 0. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 26 00:53:43 2019 (r349399) +++ head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 26 00:53:46 2019 (r349400) @@ -1732,24 +1732,22 @@ ipf_pr_ipv4hdr(fin) fi->fi_flx |= FI_FRAG; off &= IP_OFFMASK; - if (off != 0) { - fin->fin_flx |= FI_FRAGBODY; - off <<= 3; - if ((off + fin->fin_dlen > 65535) || - (fin->fin_dlen == 0) || - ((morefrag != 0) && ((fin->fin_dlen & 7) != 0))) { - /* - * The length of the packet, starting at its - * offset cannot exceed 65535 (0xffff) as the - * length of an IP packet is only 16 bits. - * - * Any fragment that isn't the last fragment - * must have a length greater than 0 and it - * must be an even multiple of 8. - */ - fi->fi_flx |= FI_BAD; - DT1(ipf_fi_bad_fragbody_gt_65535, fr_info_t *, fin); - } + fin->fin_flx |= FI_FRAGBODY; + off <<= 3; + if ((off + fin->fin_dlen > 65535) || + (fin->fin_dlen == 0) || + ((morefrag != 0) && ((fin->fin_dlen & 7) != 0))) { + /* + * The length of the packet, starting at its + * offset cannot exceed 65535 (0xffff) as the + * length of an IP packet is only 16 bits. + * + * Any fragment that isn't the last fragment + * must have a length greater than 0 and it + * must be an even multiple of 8. + */ + fi->fi_flx |= FI_BAD; + DT1(ipf_fi_bad_fragbody_gt_65535, fr_info_t *, fin); } } fin->fin_off = off; From owner-svn-src-all@freebsd.org Wed Jun 26 00:53:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 761F615DB656; Wed, 26 Jun 2019 00:53:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D386385A41; Wed, 26 Jun 2019 00:53:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 021D12043D; Wed, 26 Jun 2019 00:53:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q0rnFK058695; Wed, 26 Jun 2019 00:53:49 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q0rnSW058693; Wed, 26 Jun 2019 00:53:49 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906260053.x5Q0rnSW058693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 26 Jun 2019 00:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349401 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D386385A41 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 00:53:55 -0000 Author: cy Date: Wed Jun 26 00:53:49 2019 New Revision: 349401 URL: https://svnweb.freebsd.org/changeset/base/349401 Log: While working on PR/238796 I discovered an unused variable in frdest, the next hop structure. It is likely this contributes to PR/238796 though other factors remain to be investigated. PR: 238796 MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_fil.h Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 26 00:53:46 2019 (r349400) +++ head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 26 00:53:49 2019 (r349401) @@ -7474,10 +7474,6 @@ ipf_resolvedest(softc, base, fdp, v) } fdp->fd_ptr = ifp; - if ((ifp != NULL) && (ifp != (void *)-1)) { - fdp->fd_local = ipf_deliverlocal(softc, v, ifp, &fdp->fd_ip6); - } - return errval; } Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jun 26 00:53:46 2019 (r349400) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jun 26 00:53:49 2019 (r349401) @@ -560,7 +560,6 @@ typedef struct frdest { addrfamily_t fd_addr; fr_dtypes_t fd_type; int fd_name; - int fd_local; } frdest_t; #define fd_ip6 fd_addr.adf_addr From owner-svn-src-all@freebsd.org Wed Jun 26 01:14:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2626115DBEC9; Wed, 26 Jun 2019 01:14:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF7F586721; Wed, 26 Jun 2019 01:14:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CC4E20799; Wed, 26 Jun 2019 01:14:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q1Eeq9069257; Wed, 26 Jun 2019 01:14:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q1Ee7e069255; Wed, 26 Jun 2019 01:14:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906260114.x5Q1Ee7e069255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 26 Jun 2019 01:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349402 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 349402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF7F586721 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.919,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 01:14:41 -0000 Author: jhibbits Date: Wed Jun 26 01:14:39 2019 New Revision: 349402 URL: https://svnweb.freebsd.org/changeset/base/349402 Log: powerpc/booke: Handle misaligned floating point loads/stores as on AIM Misaligned floating point loads and stores are already handled for AIM, but use the DSISR to obtain the necessary data. Book-E does not have the DSISR, so these fixups are not performed, leading to a SIGBUS on misaligned FP loads or stores. Obtain the necessary data on the Book-E side, similar to how is done for SPE. MFC after: 1 week Modified: head/sys/powerpc/include/trap.h head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Wed Jun 26 00:53:49 2019 (r349401) +++ head/sys/powerpc/include/trap.h Wed Jun 26 01:14:39 2019 (r349402) @@ -130,7 +130,7 @@ /* Macros to extract register information */ #define EXC_ALI_RST(dsisr) ((dsisr >> 5) & 0x1f) /* source or target */ #define EXC_ALI_RA(dsisr) (dsisr & 0x1f) -#define EXC_ALI_SPE_REG(instr) ((instr >> 21) & 0x1f) +#define EXC_ALI_INST_RST(instr) ((instr >> 21) & 0x1f) /* * SRR1 bits for program exception traps. These identify what caused Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Wed Jun 26 00:53:49 2019 (r349401) +++ head/sys/powerpc/powerpc/trap.c Wed Jun 26 01:14:39 2019 (r349402) @@ -788,7 +788,7 @@ static int fix_unaligned(struct thread *td, struct trapframe *frame) { struct thread *fputhread; -#ifdef __SPE__ +#ifdef BOOKE uint32_t inst; #endif int indicator, reg; @@ -799,7 +799,7 @@ fix_unaligned(struct thread *td, struct trapframe *fra if (indicator & ESR_SPE) { if (copyin((void *)frame->srr0, &inst, sizeof(inst)) != 0) return (-1); - reg = EXC_ALI_SPE_REG(inst); + reg = EXC_ALI_INST_RST(inst); fpr = (double *)td->td_pcb->pcb_vec.vr[reg]; fputhread = PCPU_GET(vecthread); @@ -829,12 +829,22 @@ fix_unaligned(struct thread *td, struct trapframe *fra return (0); } #else +#ifdef BOOKE + indicator = (frame->cpu.booke.esr & ESR_ST) ? EXC_ALI_STFD : EXC_ALI_LFD; +#else indicator = EXC_ALI_OPCODE_INDICATOR(frame->cpu.aim.dsisr); +#endif switch (indicator) { case EXC_ALI_LFD: case EXC_ALI_STFD: +#ifdef BOOKE + if (copyin((void *)frame->srr0, &inst, sizeof(inst)) != 0) + return (-1); + reg = EXC_ALI_INST_RST(inst); +#else reg = EXC_ALI_RST(frame->cpu.aim.dsisr); +#endif fpr = &td->td_pcb->pcb_fpu.fpr[reg].fpr; fputhread = PCPU_GET(fputhread); From owner-svn-src-all@freebsd.org Wed Jun 26 03:06:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AF1F15DDD65; Wed, 26 Jun 2019 03:06:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED6A89D82; Wed, 26 Jun 2019 03:06:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0064C21A44; Wed, 26 Jun 2019 03:06:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q36vuH027998; Wed, 26 Jun 2019 03:06:57 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q36v3t027997; Wed, 26 Jun 2019 03:06:57 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906260306.x5Q36v3t027997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Wed, 26 Jun 2019 03:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349404 - in head/stand/efi: libefi loader X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: in head/stand/efi: libefi loader X-SVN-Commit-Revision: 349404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2ED6A89D82 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 03:06:58 -0000 Author: bcran Date: Wed Jun 26 03:06:57 2019 New Revision: 349404 URL: https://svnweb.freebsd.org/changeset/base/349404 Log: Re-enable loader efi http boot and fix dv_open bug if dv_init failed The code in efihttp.c was assuming that dv_open wouldn't be called if dv_init failed. But the dv_init return value is currently ignored. Add a new variable, `efihttp_init_done` and only proceed in dv_open if it's true. This fixes the loader on systems without efi http support. Modified: head/stand/efi/libefi/efihttp.c head/stand/efi/loader/conf.c Modified: head/stand/efi/libefi/efihttp.c ============================================================================== --- head/stand/efi/libefi/efihttp.c Wed Jun 26 02:09:22 2019 (r349403) +++ head/stand/efi/libefi/efihttp.c Wed Jun 26 03:06:57 2019 (r349404) @@ -52,6 +52,8 @@ static EFI_GUID http_guid = EFI_HTTP_PROTOCOL_GUID; static EFI_GUID httpsb_guid = EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID; static EFI_GUID ip4config2_guid = EFI_IP4_CONFIG2_PROTOCOL_GUID; +static bool efihttp_init_done = false; + static int efihttp_dev_init(void); static int efihttp_dev_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, size_t *rsize); @@ -208,6 +210,9 @@ efihttp_dev_init(void) return (efi_status_to_errno(status)); err = efi_register_handles(&efihttp_dev, &handle, NULL, 1); + if (!err) + efihttp_init_done = true; + return (err); } @@ -236,6 +241,9 @@ efihttp_dev_open(struct open_file *f, ...) EFI_STATUS status; int err, len; + if (!efihttp_init_done) + return (ENXIO); + imgpath = efi_lookup_image_devpath(IH); if (imgpath == NULL) return (ENXIO); @@ -555,6 +563,8 @@ efihttp_fs_open(const char *path, struct open_file *f) char *path_slash; int err; + if (!efihttp_init_done) + return (ENXIO); /* * If any path fails to open, try with a trailing slash in * case it's a directory. Modified: head/stand/efi/loader/conf.c ============================================================================== --- head/stand/efi/loader/conf.c Wed Jun 26 02:09:22 2019 (r349403) +++ head/stand/efi/loader/conf.c Wed Jun 26 03:06:57 2019 (r349404) @@ -39,6 +39,7 @@ struct devsw *devsw[] = { &efipart_fddev, &efipart_cddev, &efipart_hddev, + &efihttp_dev, /* ordering with efinet_dev matters */ &efinet_dev, &vdisk_dev, #ifdef EFI_ZFS_BOOT @@ -54,6 +55,7 @@ struct fs_ops *file_system[] = { &dosfs_fsops, &ufs_fsops, &cd9660_fsops, + &efihttp_fsops, &tftp_fsops, &nfs_fsops, &gzipfs_fsops, From owner-svn-src-all@freebsd.org Wed Jun 26 03:12:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1089715DDFB5; Wed, 26 Jun 2019 03:12:58 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B82E78A22E; Wed, 26 Jun 2019 03:12:57 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94A5421C02; Wed, 26 Jun 2019 03:12:57 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q3CviR033175; Wed, 26 Jun 2019 03:12:57 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q3Cvgo033173; Wed, 26 Jun 2019 03:12:57 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906260312.x5Q3Cvgo033173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Wed, 26 Jun 2019 03:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349405 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B82E78A22E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 03:12:58 -0000 Author: dougm Date: Wed Jun 26 03:12:57 2019 New Revision: 349405 URL: https://svnweb.freebsd.org/changeset/base/349405 Log: Revert r349393, which leads to an assertion failure on bootup, in vm_map_stack_locked. Reported by: ler@lerctr.org Approved by: kib, markj (mentors, implicit) Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Jun 26 03:06:57 2019 (r349404) +++ head/sys/vm/vm_map.c Wed Jun 26 03:12:57 2019 (r349405) @@ -983,17 +983,6 @@ vm_map_entry_max_free_right(vm_map_entry_t root, vm_ma root->right->max_free : right_ancestor->start - root->end); } -/* - * vm_map_splay_split, vm_map_splay_merge: - * - * The Sleator and Tarjan top-down splay algorithm with the following - * variation. Max_free must be computed bottom-up, so on the downward - * pass (vm_map_splay_split), maintain the left and right spines in - * reverse order, and ensure that the max_free values for those nodes - * store the values of their descendents not on the search path. Later, - * make a second pass up each side (vm_map_splay_merge) to fix the - * pointers and compute max_free. The time bound is O(log n) amortized. - */ #define SPLAY_LEFT_STEP(root, y, rlist, test) do { \ vm_size_t max_free; \ \ @@ -1177,6 +1166,56 @@ vm_map_splay_merge(vm_map_t map, vm_map_entry_t root, } /* + * vm_map_splay: + * + * The Sleator and Tarjan top-down splay algorithm with the + * following variation. Max_free must be computed bottom-up, so + * on the downward pass, maintain the left and right spines in + * reverse order. Then, make a second pass up each side to fix + * the pointers and compute max_free. The time bound is O(log n) + * amortized. + * + * The new root is the vm_map_entry containing "addr", or else an + * adjacent entry (lower if possible) if addr is not in the tree. + * + * The map must be locked, and leaves it so. + * + * Returns: the new root. + */ +static vm_map_entry_t +vm_map_splay(vm_map_t map, vm_offset_t addr) +{ + vm_map_entry_t llist, rlist, root; + + root = vm_map_splay_split(map, addr, 0, &llist, &rlist); + if (root != NULL) { + /* do nothing */ + } else if (llist != &map->header) { + /* + * Recover the greatest node in the left + * subtree and make it the root. + */ + root = llist; + llist = root->right; + root->right = NULL; + } else if (rlist != &map->header) { + /* + * Recover the least node in the right + * subtree and make it the root. + */ + root = rlist; + rlist = root->left; + root->left = NULL; + } else { + /* There is no root. */ + return (NULL); + } + vm_map_splay_merge(map, root, llist, rlist); + VM_MAP_ASSERT_CONSISTENT(map); + return (root); +} + +/* * vm_map_entry_{un,}link: * * Insert/remove entries from maps. @@ -1292,133 +1331,81 @@ vm_map_entry_resize(vm_map_t map, vm_map_entry_t entry } /* - * vm_map_lookup_helper: [ internal use only ] + * vm_map_lookup_entry: [ internal use only ] * - * Finds the map entry containing (or adjacent to) the specified address - * in the given map; the entry is returned in the "entry" parameter. The - * boolean result indicates whether the address is actually contained in - * the map. If the address is not contained in the map, parameter lesseq - * determines whether the entry provided is before or after the address. - * If the address is contained in the map, parameter nbr, if not NULL, is - * where the next or previous entry is saved, depending on the value of - * eflags in the found entry. + * Finds the map entry containing (or + * immediately preceding) the specified address + * in the given map; the entry is returned + * in the "entry" parameter. The boolean + * result indicates whether the address is + * actually contained in the map. */ -static bool -vm_map_lookup_helper(vm_map_t map, vm_offset_t addr, bool lesseq, - vm_map_entry_t *entry, vm_map_entry_t *nbr) /* OUT */ +boolean_t +vm_map_lookup_entry( + vm_map_t map, + vm_offset_t address, + vm_map_entry_t *entry) /* OUT */ { - vm_map_entry_t llist, rlist, root; - bool locked, found; + vm_map_entry_t cur, lbound; + boolean_t locked; /* * If the map is empty, then the map entry immediately preceding - * "addr" is the map's header. + * "address" is the map's header. */ - root = map->root; - if (root == NULL) { + cur = map->root; + if (cur == NULL) { *entry = &map->header; - return (false); + return (FALSE); } + if (address >= cur->start && cur->end > address) { + *entry = cur; + return (TRUE); + } if ((locked = vm_map_locked(map)) || sx_try_upgrade(&map->lock)) { - /* * Splay requires a write lock on the map. However, it only * restructures the binary search tree; it does not otherwise * change the map. Thus, the map's timestamp need not change * on a temporary upgrade. */ - root = vm_map_splay_split(map, addr, 0, &llist, &rlist); - found = root != NULL; - *entry = root; - if (root != NULL) { - if (nbr == NULL) - ; /* Ignore. */ - else if ((root->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { - vm_map_splay_findnext(root, &rlist); - *nbr = rlist; - } else { - vm_map_splay_findprev(root, &llist); - *nbr = llist; - } - } else if (llist != &map->header) { - /* - * Recover the greatest node in the left - * subtree and make it the root. - */ - *entry = lesseq ? llist : rlist; - root = llist; - llist = root->right; - root->right = NULL; - } else { - /* - * Recover the least node in the right - * subtree and make it the root. - */ - *entry = lesseq ? llist : rlist; - root = rlist; - rlist = root->left; - root->left = NULL; - } - vm_map_splay_merge(map, root, llist, rlist); - VM_MAP_ASSERT_CONSISTENT(map); + cur = vm_map_splay(map, address); if (!locked) sx_downgrade(&map->lock); - return (found); + + /* + * If "address" is contained within a map entry, the new root + * is that map entry. Otherwise, the new root is a map entry + * immediately before or after "address". + */ + if (address < cur->start) { + *entry = &map->header; + return (FALSE); + } + *entry = cur; + return (address < cur->end); } /* * Since the map is only locked for read access, perform a - * standard binary search tree lookup for "addr". + * standard binary search tree lookup for "address". */ - llist = rlist = &map->header; + lbound = &map->header; do { - if (addr < root->start) { - rlist = root; - root = root->left; - } else if (root->end <= addr) { - llist = root; - root = root->right; + if (address < cur->start) { + cur = cur->left; + } else if (cur->end <= address) { + lbound = cur; + cur = cur->right; } else { - *entry = root; - if (nbr == NULL); - else if ((root->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { - /* Make nbr the successor to root. */ - if (root->right != NULL) { - rlist = root->right; - while (rlist->left != NULL) - rlist = rlist->left; - } - *nbr = rlist; - } else { - /* Make nbr the predecessor to root. */ - if (root->left != NULL) { - llist = root->left; - while (llist->right != NULL) - llist = llist->right; - } - *nbr = llist; - } - return (true); + *entry = cur; + return (TRUE); } - } while (root != NULL); - *entry = lesseq ? llist : rlist; - return (false); + } while (cur != NULL); + *entry = lbound; + return (FALSE); } -bool -vm_map_lookup_entry(vm_map_t map, vm_offset_t addr, - vm_map_entry_t *entry) /* OUT */ -{ - return (vm_map_lookup_helper(map, addr, true, entry, NULL)); -} - -static bool -vm_map_lookup_entry_ge(vm_map_t map, vm_offset_t addr, - vm_map_entry_t *entry) /* OUT */ -{ - return (vm_map_lookup_helper(map, addr, false, entry, NULL)); -} - /* * vm_map_insert: * @@ -1435,7 +1422,7 @@ int vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry, prev_entry; + vm_map_entry_t new_entry, prev_entry, temp_entry; struct ucred *cred; vm_eflags_t protoeflags; vm_inherit_t inheritance; @@ -1460,9 +1447,11 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof * Find the entry prior to the proposed starting address; if it's part * of an existing entry, this range is bogus. */ - if (vm_map_lookup_entry(map, start, &prev_entry)) + if (vm_map_lookup_entry(map, start, &temp_entry)) return (KERN_NO_SPACE); + prev_entry = temp_entry; + /* * Assert that the next entry doesn't overlap the end point. */ @@ -2325,8 +2314,10 @@ vm_map_submap( VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry_ge(map, start, &entry)) + if (vm_map_lookup_entry(map, start, &entry)) { vm_map_clip_start(map, entry, start); + } else + entry = entry->next; vm_map_clip_end(map, entry, end); @@ -2481,7 +2472,8 @@ again: VM_MAP_RANGE_CHECK(map, start, end); - vm_map_lookup_entry_ge(map, start, &entry); + if (!vm_map_lookup_entry(map, start, &entry)) + entry = entry->next; /* * Make a first pass to check for protection violations. @@ -2671,9 +2663,11 @@ vm_map_madvise( */ VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry_ge(map, start, &entry)) { + if (vm_map_lookup_entry(map, start, &entry)) { if (modify_map) vm_map_clip_start(map, entry, start); + } else { + entry = entry->next; } if (modify_map) { @@ -2805,6 +2799,7 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off vm_inherit_t new_inheritance) { vm_map_entry_t entry; + vm_map_entry_t temp_entry; switch (new_inheritance) { case VM_INHERIT_NONE: @@ -2819,8 +2814,11 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry_ge(map, start, &entry)) + if (vm_map_lookup_entry(map, start, &temp_entry)) { + entry = temp_entry; vm_map_clip_start(map, entry, start); + } else + entry = temp_entry->next; while (entry->start < end) { vm_map_clip_end(map, entry, end); if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || @@ -2853,8 +2851,10 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs user_unwire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - if (!vm_map_lookup_entry_ge(map, start, &first_entry)) { - if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { + if (!vm_map_lookup_entry(map, start, &first_entry)) { + if (flags & VM_MAP_WIRE_HOLESOK) + first_entry = first_entry->next; + else { vm_map_unlock(map); return (KERN_INVALID_ADDRESS); } @@ -2882,9 +2882,11 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs * Specifically, the entry may have been * clipped, merged, or deleted. */ - if (!vm_map_lookup_entry_ge(map, saved_start, + if (!vm_map_lookup_entry(map, saved_start, &tmp_entry)) { - if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { + if (flags & VM_MAP_WIRE_HOLESOK) + tmp_entry = tmp_entry->next; + else { if (saved_start == start) { /* * First_entry has been deleted. @@ -2942,9 +2944,11 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs done: need_wakeup = FALSE; if (first_entry == NULL) { - result = vm_map_lookup_entry_ge(map, start, &first_entry); - KASSERT(result || (flags & VM_MAP_WIRE_HOLESOK) != 0, - ("vm_map_unwire: lookup failed")); + result = vm_map_lookup_entry(map, start, &first_entry); + if (!result && (flags & VM_MAP_WIRE_HOLESOK)) + first_entry = first_entry->next; + else + KASSERT(result, ("vm_map_unwire: lookup failed")); } for (entry = first_entry; entry->start < end; entry = entry->next) { /* @@ -3086,8 +3090,10 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm prot |= VM_PROT_WRITE; user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; VM_MAP_RANGE_CHECK(map, start, end); - if (!vm_map_lookup_entry_ge(map, start, &first_entry)) { - if ((flags & VM_MAP_WIRE_HOLESOK) == 0) + if (!vm_map_lookup_entry(map, start, &first_entry)) { + if (flags & VM_MAP_WIRE_HOLESOK) + first_entry = first_entry->next; + else return (KERN_INVALID_ADDRESS); } last_timestamp = map->timestamp; @@ -3113,9 +3119,11 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm * Specifically, the entry may have been * clipped, merged, or deleted. */ - if (!vm_map_lookup_entry_ge(map, saved_start, + if (!vm_map_lookup_entry(map, saved_start, &tmp_entry)) { - if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { + if (flags & VM_MAP_WIRE_HOLESOK) + tmp_entry = tmp_entry->next; + else { if (saved_start == start) { /* * first_entry has been deleted. @@ -3248,9 +3256,11 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm done: need_wakeup = FALSE; if (first_entry == NULL) { - result = vm_map_lookup_entry_ge(map, start, &first_entry); - KASSERT(result || (flags & VM_MAP_WIRE_HOLESOK) != 0, - ("vm_map_wire: lookup failed")); + result = vm_map_lookup_entry(map, start, &first_entry); + if (!result && (flags & VM_MAP_WIRE_HOLESOK)) + first_entry = first_entry->next; + else + KASSERT(result, ("vm_map_wire: lookup failed")); } for (entry = first_entry; entry->start < end; entry = entry->next) { /* @@ -3351,8 +3361,7 @@ vm_map_sync( if (!vm_map_lookup_entry(map, start, &entry)) { vm_map_unlock_read(map); return (KERN_INVALID_ADDRESS); - } - if (start == end) { + } else if (start == end) { start = entry->start; end = entry->end; } @@ -3407,10 +3416,9 @@ vm_map_sync( start += size; vm_object_deallocate(object); vm_map_lock_read(map); - if (last_timestamp == map->timestamp) + if (last_timestamp == map->timestamp || + !vm_map_lookup_entry(map, start, ¤t)) current = current->next; - else - vm_map_lookup_entry_ge(map, start, ¤t); } vm_map_unlock_read(map); @@ -3543,6 +3551,7 @@ int vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end) { vm_map_entry_t entry; + vm_map_entry_t first_entry; VM_MAP_ASSERT_LOCKED(map); if (start == end) @@ -3551,8 +3560,12 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs /* * Find the start of the region, and clip it */ - if (vm_map_lookup_entry_ge(map, start, &entry)) + if (!vm_map_lookup_entry(map, start, &first_entry)) + entry = first_entry->next; + else { + entry = first_entry; vm_map_clip_start(map, entry, start); + } /* * Step through all entries in this region @@ -3570,22 +3583,29 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs vm_map_entry_system_wired_count(entry) != 0)) { unsigned int last_timestamp; vm_offset_t saved_start; + vm_map_entry_t tmp_entry; saved_start = entry->start; entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; last_timestamp = map->timestamp; (void) vm_map_unlock_and_wait(map, 0); vm_map_lock(map); - if (last_timestamp + 1 == map->timestamp) - continue; - - /* - * Look again for the entry because the map was - * modified while it was unlocked. Specifically, the - * entry may have been clipped, merged, or deleted. - */ - if (vm_map_lookup_entry_ge(map, saved_start, &entry)) - vm_map_clip_start(map, entry, saved_start); + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. + * Specifically, the entry may have been + * clipped, merged, or deleted. + */ + if (!vm_map_lookup_entry(map, saved_start, + &tmp_entry)) + entry = tmp_entry->next; + else { + entry = tmp_entry; + vm_map_clip_start(map, entry, + saved_start); + } + } continue; } vm_map_clip_end(map, entry, end); @@ -3660,9 +3680,11 @@ vm_map_check_protection(vm_map_t map, vm_offset_t star vm_prot_t protection) { vm_map_entry_t entry; + vm_map_entry_t tmp_entry; - if (!vm_map_lookup_entry(map, start, &entry)) + if (!vm_map_lookup_entry(map, start, &tmp_entry)) return (FALSE); + entry = tmp_entry; while (start < end) { /* @@ -4098,7 +4120,7 @@ static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry; + vm_map_entry_t new_entry, prev_entry; vm_offset_t bot, gap_bot, gap_top, top; vm_size_t init_ssize, sgp; int orient, rv; @@ -4126,13 +4148,13 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, init_ssize = max_ssize - sgp; /* If addr is already mapped, no go */ - if (vm_map_lookup_entry_ge(map, addrbos, &new_entry)) + if (vm_map_lookup_entry(map, addrbos, &prev_entry)) return (KERN_NO_SPACE); /* * If we can't accommodate max_ssize in the current mapping, no go. */ - if (new_entry->start < addrbos + max_ssize) + if (prev_entry->next->start < addrbos + max_ssize) return (KERN_NO_SPACE); /* @@ -4159,6 +4181,7 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, rv = vm_map_insert(map, NULL, 0, bot, top, prot, max, cow); if (rv != KERN_SUCCESS) return (rv); + new_entry = prev_entry->next; KASSERT(new_entry->end == top || new_entry->start == bot, ("Bad entry start/end for new stack entry")); KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || @@ -4217,18 +4240,19 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma vmemlim = lim_cur(curthread, RLIMIT_VMEM); retry: /* If addr is not in a hole for a stack grow area, no need to grow. */ - if (gap_entry == NULL && - !vm_map_lookup_helper(map, addr, true, &gap_entry, &stack_entry)) + if (gap_entry == NULL && !vm_map_lookup_entry(map, addr, &gap_entry)) return (KERN_FAILURE); if ((gap_entry->eflags & MAP_ENTRY_GUARD) == 0) return (KERN_SUCCESS); if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { + stack_entry = gap_entry->next; if ((stack_entry->eflags & MAP_ENTRY_GROWS_DOWN) == 0 || stack_entry->start != gap_entry->end) return (KERN_FAILURE); grow_amount = round_page(stack_entry->start - addr); grow_down = true; } else if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_UP) != 0) { + stack_entry = gap_entry->prev; if ((stack_entry->eflags & MAP_ENTRY_GROWS_UP) == 0 || stack_entry->end != gap_entry->start) return (KERN_FAILURE); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Wed Jun 26 03:06:57 2019 (r349404) +++ head/sys/vm/vm_map.h Wed Jun 26 03:12:57 2019 (r349405) @@ -415,7 +415,7 @@ int vm_map_lookup (vm_map_t *, vm_offset_t, vm_prot_t, int vm_map_lookup_locked(vm_map_t *, vm_offset_t, vm_prot_t, vm_map_entry_t *, vm_object_t *, vm_pindex_t *, vm_prot_t *, boolean_t *); void vm_map_lookup_done (vm_map_t, vm_map_entry_t); -bool vm_map_lookup_entry(vm_map_t, vm_offset_t, vm_map_entry_t *); +boolean_t vm_map_lookup_entry (vm_map_t, vm_offset_t, vm_map_entry_t *); int vm_map_protect (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t, boolean_t); int vm_map_remove (vm_map_t, vm_offset_t, vm_offset_t); void vm_map_simplify_entry(vm_map_t map, vm_map_entry_t entry); From owner-svn-src-all@freebsd.org Wed Jun 26 03:32:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D4BC15DE5E6; Wed, 26 Jun 2019 03:32:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E03448AD10; Wed, 26 Jun 2019 03:32:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id fyfNhmWDUo7SQfyfOhcpmq; Tue, 25 Jun 2019 21:32:14 -0600 X-Authority-Analysis: v=2.3 cv=Go88BX9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=hhWWyWAOk7TUdWXy1xYA:9 a=oZqBB_jpOfjAqMcn:21 a=DkvMeU1PYl3GNetm:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id CEA10D4; Tue, 25 Jun 2019 20:32:12 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5Q3WCBm004935; Tue, 25 Jun 2019 20:32:12 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5Q3WCIG004876; Tue, 25 Jun 2019 20:32:12 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906260332.x5Q3WCIG004876@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Doug Moore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Larry Rosenman Subject: Re: svn commit: r349393 - head/sys/vm In-Reply-To: Message from Doug Moore of "Tue, 25 Jun 2019 20:25:16 -0000." <201906252025.x5PKPGml014589@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 25 Jun 2019 20:32:12 -0700 X-CMAE-Envelope: MS4wfDxx29+0Jg5Rd2oNxscgV+WCRQ29QqgBetJkvHQ7Aj36pT7gmFb5jdEe9T3GNSL261i+TtAWFqAIJGG9mbB4lmNYJPUfKBAV0YhmJ+VpZ4QXmrL53q0I keqBDS5H81ntgr2Lr5BH1kOvDTrimdT+A1QQpfdn/rDmiUtLGLlp9ND82b5yNsvBa4wZY6sMbys7T97XM9gOfM38zHQiF7CMG+x5fS/M/o520A32d5LJLRDy qwknoOoVgGyRohMDne7axD8HvgyFSN7o4VpMSO9zCXkoih8i7bCkaMUIWszmMuRjnEmRMgDWs5qRlEGce0UY9A== X-Rspamd-Queue-Id: E03448AD10 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.98 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.87)[-0.875,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.40)[ip: (-6.08), ipnet: 64.59.128.0/20(-3.28), asn: 6327(-2.54), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 03:32:17 -0000 In message <201906252025.x5PKPGml014589@repo.freebsd.org>, Doug Moore writes: > Author: dougm > Date: Tue Jun 25 20:25:16 2019 > New Revision: 349393 > URL: https://svnweb.freebsd.org/changeset/base/349393 > > Log: > Eliminate some uses of the prev and next fields of vm_map_entry_t. > > Since the only caller to vm_map_splay is vm_map_lookup_entry, move the > implementation of vm_map_splay into vm_map_lookup_helper, called by > vm_map_lookup_entry. > > vm_map_lookup_entry returns the greatest entry less than or equal to a > given address, but in many cases the caller wants the least entry > greater than or equal to the address and uses the next pointer to get > to it. Provide an alternative interface to lookup, > vm_map_lookup_entry_ge, to provide the latter behavior, and let > callers use one or the other rather than having them use the next > pointer after a lookup miss to get what they really want. > > In vm_map_growstack, the caller wants an entry that includes a given > address, and either the preceding or next entry depending on the value > of eflags in the first entry. Incorporate that behavior into > vm_map_lookup_helper, the function that implements all of these > lookups. > > Eliminate some temporary variables used with vm_map_lookup_entry, but > inessential. > > Reviewed by: markj (earlier version) > Approved by: kib (mentor) > Differential Revision: https://reviews.freebsd.org/D20664 > > Modified: > head/sys/vm/vm_map.c > head/sys/vm/vm_map.h > [...] Hi Doug, This commit causes the following panic. The panic occurs during UFS fsck. Booting into single user and issuing fsck by hand also results in the panic. Reverting this rev provides relief. <118>Starting file system checks: Fatal trap 12: page fault while in kernel mode cpuid = 1; apic id = 01 fault virtual address = 0x52 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff809649b4 stack pointer = 0x0:0xfffffe0035853810 frame pointer = 0x0:0xfffffe00358538f0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 62 (fsck_ufs) trap number = 12 panic: page fault cpuid = 1 time = 1561490154 KDB: stack backtrace: #0 0xffffffff806bff77 at kdb_backtrace+0x67 #1 0xffffffff806744fd at vpanic+0x19d #2 0xffffffff80674353 at panic+0x43 #3 0xffffffff809adcdc at trap_fatal+0x39c #4 0xffffffff809add29 at trap_pfault+0x49 #5 0xffffffff809ad31f at trap+0x29f #6 0xffffffff80989125 at calltrap+0x8 #7 0xffffffff80956702 at vm_fault_hold+0x72 #8 0xffffffff80956640 at vm_fault+0x60 #9 0xffffffff809ade44 at trap_pfault+0x164 #10 0xffffffff809ad4ab at trap+0x42b #11 0xffffffff80989125 at calltrap+0x8 Uptime: 22s Dumping 302 out of 4068 MB:..6%..11%..22%..32%..43%..53%..64%..74%..85%. .96% __curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (OFFSETOF_CURTHREAD)); (kgdb) bt #0 __curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 #1 doadump (textdump=) at /opt/src/svn-current/sys/kern/ kern_shutdown.c:392 #2 0xffffffff806740b8 in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 #3 0xffffffff80674559 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 #4 0xffffffff80674353 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 #5 0xffffffff809adcdc in trap_fatal (frame=0xfffffe0035853750, eva=82) at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 #6 0xffffffff809add29 in trap_pfault (frame=0xfffffe0035853750, usermode=0) at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 #7 0xffffffff809ad31f in trap (frame=0xfffffe0035853750) at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 #8 #9 0xffffffff809649b4 in vm_map_growstack (map=0xfffff80005757000, addr=140737487298560, gap_entry=0xfffff8000546a9a0) at /opt/src/svn-current/sys/vm/vm_map.c:4226 #10 vm_map_lookup (var_map=0xfffffe00358539e0, vaddr=140737487298560, fault_typea=18 '\022', out_entry=0xfffffe00358539e8, object=0xfffffe00358539d0, pindex=0xfffffe00358539d8, out_prot=0xfffffe0035853a17 "\003", wired=0xfffffe0035853a04) at /opt/src/svn-current/sys/vm/vm_map.c:4549 #11 0xffffffff80956702 in vm_fault_hold (map=0xfffff80005757000, vaddr=140737487298560, fault_type=2 '\002', fault_flags=0, m_hold=0x0) at /opt/src/svn-current/sys/vm/vm_fault.c:589 #12 0xffffffff80956640 in vm_fault (map=0xfffff80005757000, vaddr=, fault_type=2 '\002', fault_flags=0) at /opt/src/svn-current/sys/vm/vm_fault.c:550 #13 0xffffffff809ade44 in trap_pfault (frame=0xfffffe0035853c00, usermode=1) at /opt/src/svn-current/sys/amd64/amd64/trap.c:846 #14 0xffffffff809ad4ab in trap (frame=0xfffffe0035853c00) at /opt/src/svn-current/sys/amd64/amd64/trap.c:355 #15 #16 0x0000000000215f3e in ?? () Backtrace stopped: Cannot access memory at address 0x7fffffefe4b0 -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Wed Jun 26 06:40:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E804E15B8A7A; Wed, 26 Jun 2019 06:40:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5236B8FE7F; Wed, 26 Jun 2019 06:40:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2763923DE8; Wed, 26 Jun 2019 06:40:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q6eUHM037864; Wed, 26 Jun 2019 06:40:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q6eUNM037863; Wed, 26 Jun 2019 06:40:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906260640.x5Q6eUNM037863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 26 Jun 2019 06:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349406 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5236B8FE7F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 06:40:32 -0000 Author: avg Date: Wed Jun 26 06:40:30 2019 New Revision: 349406 URL: https://svnweb.freebsd.org/changeset/base/349406 Log: owc.4: document how to set up the 1-wire bus on a device.hints system MFC after: 1 week Modified: head/share/man/man4/owc.4 Modified: head/share/man/man4/owc.4 ============================================================================== --- head/share/man/man4/owc.4 Wed Jun 26 03:12:57 2019 (r349405) +++ head/share/man/man4/owc.4 Wed Jun 26 06:40:30 2019 (r349406) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2015 +.Dd June 26, 2019 .Dt OWC 4 .Os .Sh NAME @@ -69,6 +69,23 @@ For more details about the .Va gpios property, please consult .Pa /usr/src/sys/dts/bindings-gpio.txt . +.Pp +On a +.Xr device.hints 5 +based system these values are required for the +.Nm : +.Bl -tag -width ".Va hint.owc.%d.atXXX" +.It Va hint.owc.%d.at +The +.Nm gpiobus +you are attaching to. +.It Va hint.owc.%d.pins +This is a bitmask that defines a pin on the +.Nm gpiobus +that is to be used for the 1-Wire bus. +For instance, to configure pin 10, use the bitmask of 0x400. +Please note that this mask should have only one bit set +(any other bits - i.e., pins - will be ignored). .Sh SEE ALSO .Xr gpiobus 4 , .Xr ow 4 , From owner-svn-src-all@freebsd.org Wed Jun 26 07:08:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C3915B9058; Wed, 26 Jun 2019 07:08:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88D32908CB; Wed, 26 Jun 2019 07:08:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CEA5242DF; Wed, 26 Jun 2019 07:08:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q78q4e053370; Wed, 26 Jun 2019 07:08:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q78qLk053369; Wed, 26 Jun 2019 07:08:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906260708.x5Q78qLk053369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 26 Jun 2019 07:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349407 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88D32908CB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 07:08:53 -0000 Author: avg Date: Wed Jun 26 07:08:51 2019 New Revision: 349407 URL: https://svnweb.freebsd.org/changeset/base/349407 Log: fix up r349406, add missing .El MFC after: 1 week Modified: head/share/man/man4/owc.4 Modified: head/share/man/man4/owc.4 ============================================================================== --- head/share/man/man4/owc.4 Wed Jun 26 06:40:30 2019 (r349406) +++ head/share/man/man4/owc.4 Wed Jun 26 07:08:51 2019 (r349407) @@ -86,6 +86,7 @@ that is to be used for the 1-Wire bus. For instance, to configure pin 10, use the bitmask of 0x400. Please note that this mask should have only one bit set (any other bits - i.e., pins - will be ignored). +.El .Sh SEE ALSO .Xr gpiobus 4 , .Xr ow 4 , From owner-svn-src-all@freebsd.org Wed Jun 26 07:38:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F336715B9909; Wed, 26 Jun 2019 07:38:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A7CC914EC; Wed, 26 Jun 2019 07:38:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76523247E5; Wed, 26 Jun 2019 07:38:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5Q7cViK068545; Wed, 26 Jun 2019 07:38:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5Q7cVVr068544; Wed, 26 Jun 2019 07:38:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906260738.x5Q7cVVr068544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 26 Jun 2019 07:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349408 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A7CC914EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 07:38:32 -0000 Author: avg Date: Wed Jun 26 07:38:31 2019 New Revision: 349408 URL: https://svnweb.freebsd.org/changeset/base/349408 Log: gpio.4: document device hints common to all devices on gpiobus "at" keyword is documented in device.hints(5) for all buses, but it does hurt to add another reference to it. "pins" keyword is specific to gpiobus. At least these two hints should be configured for any gpiobus device on a hints based system. MFC after: 10 days Modified: head/share/man/man4/gpio.4 Modified: head/share/man/man4/gpio.4 ============================================================================== --- head/share/man/man4/gpio.4 Wed Jun 26 07:08:51 2019 (r349407) +++ head/share/man/man4/gpio.4 Wed Jun 26 07:38:31 2019 (r349408) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2013 +.Dd June 26, 2019 .Dt GPIO 4 .Os .Sh NAME @@ -103,12 +103,36 @@ passed to the kernel, being either statically compiled of ways where the boot loader (or Open Firmware enabled system) passes the DTS blob to the kernel at boot. .Pp +On a +.Xr device.hints 5 +based system these hints can be used to configure drivers for devices +attached to +.Nm +pins: +.Bl -tag -width ".Va hint.driver.unit.pins" +.It Va hint.driver.unit.at +The +.Nm gpiobus +where the device is attached. +For example, +.Qq gpiobus0 . +.Ar driver +and +.Ar unit +are the driver name and the unit number for the device driver. +.It Va hint.driver.unit.pins +This is a bitmask of the pins on the +.Nm gpiobus +that are connected to the device. +The pins will be allocated to the specified driver instance. +.El +.Pp The following .Xr device.hints 5 are only provided by the .Cd ar71xx_gpio driver: -.Bl -tag -width ".Va hint.gpioiic.%d.atXXX" +.Bl -tag -width ".Va hint.gpio.function_clear" .It Va hint.gpio.%d.pinmask This is a bitmask of pins on the GPIO board that we would like to expose for use to the host operating system. @@ -133,6 +157,7 @@ of some device in a system. .Xr gpioiic 4 , .Xr gpioled 4 , .Xr iicbus 4 , +.Xr device.hints 5 , .Xr gpioctl 8 .Sh HISTORY The From owner-svn-src-all@freebsd.org Wed Jun 26 11:28:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D9E915C553A; Wed, 26 Jun 2019 11:28:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 148C86A32B; Wed, 26 Jun 2019 11:28:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7CAD26E9F; Wed, 26 Jun 2019 11:28:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QBS8Z4088460; Wed, 26 Jun 2019 11:28:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QBS8Jx088459; Wed, 26 Jun 2019 11:28:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906261128.x5QBS8Jx088459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 26 Jun 2019 11:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349409 - head/lib/libusb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/lib/libusb X-SVN-Commit-Revision: 349409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 148C86A32B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 11:28:09 -0000 Author: hselasky Date: Wed Jun 26 11:28:08 2019 New Revision: 349409 URL: https://svnweb.freebsd.org/changeset/base/349409 Log: Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE flag. Make sure when the flag is not specified no arrival events are generated for currently enumerated devices. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/lib/libusb/libusb10.h head/lib/libusb/libusb10_hotplug.c Modified: head/lib/libusb/libusb10.h ============================================================================== --- head/lib/libusb/libusb10.h Wed Jun 26 07:38:31 2019 (r349408) +++ head/lib/libusb/libusb10.h Wed Jun 26 11:28:08 2019 (r349409) @@ -89,6 +89,8 @@ struct libusb_hotplug_callback_handle_struct { void *user_data; }; +TAILQ_HEAD(libusb_device_head, libusb_device); + struct libusb_context { int debug; int debug_fixed; @@ -106,7 +108,7 @@ struct libusb_context { TAILQ_HEAD(, libusb_super_pollfd) pollfds; TAILQ_HEAD(, libusb_super_transfer) tr_done; TAILQ_HEAD(, libusb_hotplug_callback_handle_struct) hotplug_cbh; - TAILQ_HEAD(, libusb_device) hotplug_devs; + struct libusb_device_head hotplug_devs; struct libusb_super_pollfd ctx_poll; Modified: head/lib/libusb/libusb10_hotplug.c ============================================================================== --- head/lib/libusb/libusb10_hotplug.c Wed Jun 26 07:38:31 2019 (r349408) +++ head/lib/libusb/libusb10_hotplug.c Wed Jun 26 11:28:08 2019 (r349409) @@ -85,20 +85,35 @@ libusb_hotplug_filter(libusb_context *ctx, libusb_hotp return (pcbh->fn(ctx, dev, event, pcbh->user_data)); } +static int +libusb_hotplug_enumerate(libusb_context *ctx, struct libusb_device_head *phead) +{ + libusb_device **ppdev; + ssize_t count; + ssize_t x; + + count = libusb_get_device_list(ctx, &ppdev); + if (count < 0) + return (-1); + + for (x = 0; x != count; x++) + TAILQ_INSERT_TAIL(phead, ppdev[x], hotplug_entry); + + libusb_free_device_list(ppdev, 0); + return (0); +} + static void * libusb_hotplug_scan(void *arg) { - TAILQ_HEAD(, libusb_device) hotplug_devs; + struct libusb_device_head hotplug_devs; libusb_hotplug_callback_handle acbh; libusb_hotplug_callback_handle bcbh; libusb_context *ctx = arg; - libusb_device **ppdev; libusb_device *temp; libusb_device *adev; libusb_device *bdev; unsigned do_loop = 1; - ssize_t count; - ssize_t x; while (do_loop) { usleep(4000000); @@ -108,14 +123,8 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - count = libusb_get_device_list(ctx, &ppdev); - if (count < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) continue; - for (x = 0; x != count; x++) { - TAILQ_INSERT_TAIL(&hotplug_devs, ppdev[x], - hotplug_entry); - } - libusb_free_device_list(ppdev, 0); } else { do_loop = 0; } @@ -201,6 +210,8 @@ int libusb_hotplug_register_callback(libusb_context *c handle->devclass = dev_class; handle->fn = cb_fn; handle->user_data = user_data; + + libusb_hotplug_enumerate(ctx, &ctx->hotplug_devs); if (flags & LIBUSB_HOTPLUG_ENUMERATE) { TAILQ_FOREACH(adev, &ctx->hotplug_devs, hotplug_entry) { From owner-svn-src-all@freebsd.org Wed Jun 26 12:04:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76DEC15C6C79; Wed, 26 Jun 2019 12:04:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E6F06B89A; Wed, 26 Jun 2019 12:04:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B66227545; Wed, 26 Jun 2019 12:04:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QC4s5j009716; Wed, 26 Jun 2019 12:04:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QC4sjv009715; Wed, 26 Jun 2019 12:04:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906261204.x5QC4sjv009715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 26 Jun 2019 12:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349410 - head/lib/libusb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/lib/libusb X-SVN-Commit-Revision: 349410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E6F06B89A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 12:04:55 -0000 Author: hselasky Date: Wed Jun 26 12:04:54 2019 New Revision: 349410 URL: https://svnweb.freebsd.org/changeset/base/349410 Log: Only call libusb_hotplug_enumerate() once from libusb_hotplug_register_callback(). Else when registering multiple filters the same USB device may appear twice in the list. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/lib/libusb/libusb10_hotplug.c Modified: head/lib/libusb/libusb10_hotplug.c ============================================================================== --- head/lib/libusb/libusb10_hotplug.c Wed Jun 26 11:28:08 2019 (r349409) +++ head/lib/libusb/libusb10_hotplug.c Wed Jun 26 12:04:54 2019 (r349410) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2016 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2016-2019 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -200,6 +200,8 @@ int libusb_hotplug_register_callback(libusb_context *c HOTPLUG_LOCK(ctx); if (ctx->hotplug_handler == NO_THREAD) { + libusb_hotplug_enumerate(ctx, &ctx->hotplug_devs); + if (pthread_create(&ctx->hotplug_handler, NULL, &libusb_hotplug_scan, ctx) != 0) ctx->hotplug_handler = NO_THREAD; @@ -210,8 +212,6 @@ int libusb_hotplug_register_callback(libusb_context *c handle->devclass = dev_class; handle->fn = cb_fn; handle->user_data = user_data; - - libusb_hotplug_enumerate(ctx, &ctx->hotplug_devs); if (flags & LIBUSB_HOTPLUG_ENUMERATE) { TAILQ_FOREACH(adev, &ctx->hotplug_devs, hotplug_entry) { From owner-svn-src-all@freebsd.org Wed Jun 26 12:26:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B19B615C7687; Wed, 26 Jun 2019 12:26:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52D7C6C431; Wed, 26 Jun 2019 12:26:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EA81278B2; Wed, 26 Jun 2019 12:26:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QCQdCv020134; Wed, 26 Jun 2019 12:26:39 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QCQdq5020133; Wed, 26 Jun 2019 12:26:39 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906261226.x5QCQdq5020133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 26 Jun 2019 12:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349411 - stable/11/sys/netpfil/ipfw/nat64 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 349411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52D7C6C431 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 12:26:39 -0000 Author: ae Date: Wed Jun 26 12:26:38 2019 New Revision: 349411 URL: https://svnweb.freebsd.org/changeset/base/349411 Log: Fix the uninitialized use of source IPv6 address in NAT64LSN. This code is already refactored in head/, but due to the missing epoch(9) support it is impossible to merge. So, it is direct commit to stable/11. Reported by: Patrick M. Hausen Tested by: Patrick M. Hausen MFC after: 3 days Modified: stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c Modified: stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c Wed Jun 26 12:04:54 2019 (r349410) +++ stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c Wed Jun 26 12:26:38 2019 (r349411) @@ -408,6 +408,7 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, const st } else logdata = NULL; + src6 = cfg->base.plat_prefix; nat64_embed_ip4(&src6, cfg->base.plat_plen, htonl(f_id->src_ip)); ret = nat64_do_handle_ip4(*pm, &src6, &nh->addr, lport, &cfg->base, logdata); From owner-svn-src-all@freebsd.org Wed Jun 26 15:16:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D7715CACAF; Wed, 26 Jun 2019 15:16:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B796771BE8; Wed, 26 Jun 2019 15:16:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 907911676; Wed, 26 Jun 2019 15:16:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QFGNrh009313; Wed, 26 Jun 2019 15:16:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QFGNJn009312; Wed, 26 Jun 2019 15:16:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906261516.x5QFGNJn009312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 26 Jun 2019 15:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349413 - releng/11.3/release/doc/share/xml X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/doc/share/xml X-SVN-Commit-Revision: 349413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B796771BE8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 15:16:24 -0000 Author: gjb Date: Wed Jun 26 15:16:23 2019 New Revision: 349413 URL: https://svnweb.freebsd.org/changeset/base/349413 Log: Bump the release.manpath.freebsd macro version, although I do not see any place this is actually used. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/release/doc/share/xml/release.ent Modified: releng/11.3/release/doc/share/xml/release.ent ============================================================================== --- releng/11.3/release/doc/share/xml/release.ent Wed Jun 26 15:15:24 2019 (r349412) +++ releng/11.3/release/doc/share/xml/release.ent Wed Jun 26 15:16:23 2019 (r349413) @@ -58,7 +58,7 @@ - + From owner-svn-src-all@freebsd.org Wed Jun 26 15:28:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9531015CB130; Wed, 26 Jun 2019 15:28:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33FB67224F; Wed, 26 Jun 2019 15:28:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0985A181B; Wed, 26 Jun 2019 15:28:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QFSLJg014598; Wed, 26 Jun 2019 15:28:21 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QFSL5q014597; Wed, 26 Jun 2019 15:28:21 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906261528.x5QFSL5q014597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 26 Jun 2019 15:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349414 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 349414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33FB67224F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 15:28:22 -0000 Author: marius Date: Wed Jun 26 15:28:21 2019 New Revision: 349414 URL: https://svnweb.freebsd.org/changeset/base/349414 Log: o In iflib_txq_drain(): - Remove desc_used, which is only ever written to. - Remove a dead store to reclaimed. - Don't recycle avail. - Sort variables according to style(9). These changes will make a subsequent commit easier to read. o In iflib_tx_credits_update(), don't bother checking whether the ift_txd_credits_update method pointer is NULL; _iflib_pre_assert() asserts upfront that this method has been assigned and functions like iflib_{fast_intr_rxtx,netmap_timer_adjust,txq_can_drain}() and _task_fn_tx() were already unconditionally relying on the method being callable. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Jun 26 15:16:23 2019 (r349413) +++ head/sys/net/iflib.c Wed Jun 26 15:28:21 2019 (r349414) @@ -3580,10 +3580,10 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, ui iflib_txq_t txq = r->cookie; if_ctx_t ctx = txq->ift_ctx; if_t ifp = ctx->ifc_ifp; - struct mbuf **mp, *m; - int i, count, consumed, pkt_sent, bytes_sent, mcast_sent, avail; - int reclaimed, err, in_use_prev, desc_used; - bool do_prefetch, ring, rang; + struct mbuf *m, **mp; + int avail, bytes_sent, consumed, count, err, i, in_use_prev; + int mcast_sent, pkt_sent, reclaimed, txq_avail; + bool do_prefetch, rang, ring; if (__predict_false(!(if_getdrvflags(ifp) & IFF_DRV_RUNNING) || !LINK_ACTIVE(ctx))) { @@ -3621,16 +3621,15 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, ui avail, ctx->ifc_flags, TXQ_AVAIL(txq)); #endif do_prefetch = (ctx->ifc_flags & IFC_PREFETCH); - avail = TXQ_AVAIL(txq); + txq_avail = TXQ_AVAIL(txq); err = 0; - for (desc_used = i = 0; i < count && avail > MAX_TX_DESC(ctx) + 2; i++) { + for (i = 0; i < count && txq_avail > MAX_TX_DESC(ctx) + 2; i++) { int rem = do_prefetch ? count - i : 0; mp = _ring_peek_one(r, cidx, i, rem); MPASS(mp != NULL && *mp != NULL); if (__predict_false(*mp == (struct mbuf *)txq)) { consumed++; - reclaimed++; continue; } in_use_prev = txq->ift_in_use; @@ -3649,10 +3648,9 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, ui DBG_COUNTER_INC(tx_sent); bytes_sent += m->m_pkthdr.len; mcast_sent += !!(m->m_flags & M_MCAST); - avail = TXQ_AVAIL(txq); + txq_avail = TXQ_AVAIL(txq); txq->ift_db_pending += (txq->ift_in_use - in_use_prev); - desc_used += (txq->ift_in_use - in_use_prev); ETHER_BPF_MTAP(ifp, m); if (__predict_false(!(ifp->if_drv_flags & IFF_DRV_RUNNING))) break; @@ -6154,9 +6152,6 @@ iflib_tx_credits_update(if_ctx_t ctx, iflib_txq_t txq) #ifdef INVARIANTS int credits_pre = txq->ift_cidx_processed; #endif - - if (ctx->isc_txd_credits_update == NULL) - return (0); bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_POSTREAD); From owner-svn-src-all@freebsd.org Wed Jun 26 15:34:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3FDC15CB388; Wed, 26 Jun 2019 15:34:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A12172677; Wed, 26 Jun 2019 15:34:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E428C19BA; Wed, 26 Jun 2019 15:34:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QFYdNp019441; Wed, 26 Jun 2019 15:34:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QFYZco019422; Wed, 26 Jun 2019 15:34:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906261534.x5QFYZco019422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 26 Jun 2019 15:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349415 - in stable/12: share/man/man9 sys/arm/allwinner sys/arm64/conf sys/conf sys/dev/pwm sys/dts/arm64/overlays sys/modules/dtb/allwinner sys/sys usr.sbin usr.sbin/pwm X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/arm/allwinner sys/arm64/conf sys/conf sys/dev/pwm sys/dts/arm64/overlays sys/modules/dtb/allwinner sys/sys usr.sbin usr.sbin/pwm X-SVN-Commit-Revision: 349415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A12172677 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 15:34:41 -0000 Author: ian Date: Wed Jun 26 15:34:35 2019 New Revision: 349415 URL: https://svnweb.freebsd.org/changeset/base/349415 Log: MFC r341268, r342003-r342007, r342087-r342088, r342091 r341268 by manu: arm64: allwinner: Add a dtbo to have cpu operating points This enables cpufreq on A64 boards. r342003 by manu: Add a pwm subsystem so we can configure pwm controller from kernel and userland. The pwm subsystem consist of API for PWM controllers, pwmbus to register them and a pwm(8) utility to talk to them from userland. Reviewed by: oshgobo (capsicum), bcr (manpage), 0mp (manpage) Differential Revision: https://reviews.freebsd.org/D17938 r342004 by manu: arm64: allwinner: Add pwm driver Add a pwm driver for Allwinner PWM Add pwm and aw_pwm to the GENERIC kernel r342005 by manu: arm64: allwinner: Add DTSO for pwm and r_pwm Those are both dtso (overlays) for the two pwm controllers found on the A64. r342006 by manu: arm64: allwinner: Fix pwm dtso Double patched files ended up in the tree Reported by: kevans r342007 by manu: pwm: Fix some arches by using %ju and casting to uintmax_t Reported by: ci.freebsd.org r342087 by manu: pwm: Convert period and duty to unsigned int We don't need a 64 bits value to store nanoseconds Discused with: ian, jhibbits r342088 by manu: pwm(8): Add percentage value support for duty cycle r342091 by manu: allwinner: aw_pwm: Read value at attach The booloaded might have configured the pwm controller so read the values. Added: stable/12/share/man/man9/pwm.9 - copied unchanged from r342007, head/share/man/man9/pwm.9 stable/12/share/man/man9/pwmbus.9 - copied unchanged from r342007, head/share/man/man9/pwmbus.9 stable/12/sys/arm/allwinner/aw_pwm.c - copied, changed from r342007, head/sys/arm/allwinner/aw_pwm.c stable/12/sys/dev/pwm/ - copied from r342007, head/sys/dev/pwm/ stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso - copied unchanged from r341268, head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso stable/12/sys/dts/arm64/overlays/sun50i-a64-pwm.dtso - copied unchanged from r342007, head/sys/dts/arm64/overlays/sun50i-a64-pwm.dtso stable/12/sys/dts/arm64/overlays/sun50i-a64-rpwm.dtso - copied unchanged from r342007, head/sys/dts/arm64/overlays/sun50i-a64-rpwm.dtso stable/12/sys/sys/pwm.h - copied, changed from r342007, head/sys/sys/pwm.h stable/12/usr.sbin/pwm/ - copied from r342007, head/usr.sbin/pwm/ Modified: stable/12/share/man/man9/Makefile stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files stable/12/sys/conf/files.arm64 stable/12/sys/dev/pwm/pwm_if.m stable/12/sys/dev/pwm/pwmbus.c stable/12/sys/dev/pwm/pwmbus_if.m stable/12/sys/modules/dtb/allwinner/Makefile stable/12/usr.sbin/Makefile stable/12/usr.sbin/pwm/pwm.8 stable/12/usr.sbin/pwm/pwm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Wed Jun 26 15:28:21 2019 (r349414) +++ stable/12/share/man/man9/Makefile Wed Jun 26 15:34:35 2019 (r349415) @@ -269,6 +269,8 @@ MAN= accept_filter.9 \ proc_rwmem.9 \ pseudofs.9 \ psignal.9 \ + pwm.9 \ + pwmbus.9 \ random.9 \ random_harvest.9 \ ratecheck.9 \ Copied: stable/12/share/man/man9/pwm.9 (from r342007, head/share/man/man9/pwm.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man9/pwm.9 Wed Jun 26 15:34:35 2019 (r349415, copy of r342007, head/share/man/man9/pwm.9) @@ -0,0 +1,93 @@ +.\" Copyright (c) 2018 Emmanuel Vadot +.\" +.\" 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 the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 12, 2018 +.Dt PWM 9 +.Os +.Sh NAME +.Nm pwm , +.Nm PWM_GET_BUS , +.Nm PWM_CHANNEL_CONFIG , +.Nm PWM_CHANNEL_GET_CONFIG , +.Nm PWM_CHANNEL_SET_FLAGS , +.Nm PWM_CHANNEL_GET_FLAGS , +.Nm PWM_CHANNEL_ENABLE , +.Nm PWM_CHANNEL_IS_ENABLED , +.Nm PWM_CHANNEL_MAX +.Nd PWM methods +.Sh SYNOPSIS +.Cd "device pwm" +.In "pwm_if.h" +.Ft device_t +.Fn PWM_GET_BUS "device_t dev" +.Ft int +.Fn PWM_CHANNEL_CONFIG "device_t dev" "int channel" "uint64_t period" "uint64_t duty" +.Ft int +.Fn PWM_CHANNEL_GET_CONFIG "device_t dev" "int channel" "uint64_t *period" "uint64_t *duty" +.Ft int +.Fn PWM_CHANNEL_SET_FLAGS "device_t dev" "int channel" "uint32_t flags" +.Ft int +.Fn PWM_CHANNEL_GET_FLAGS "device_t dev" "int channel" "uint32_t *flags" +.Ft int +.Fn PWM_CHANNEL_ENABLE "device_t dev" "int channel" "bool enable" +.Ft int +.Fn PWM_CHANNEL_IS_ENABLED "device_t dev" "int channel" "bool *enabled" +.Ft int +.Fn PWM_CHANNEL_MAX "device_t dev" "int channel" "int *nchannel" +.Sh DESCRIPTION +The PWM (Pulse-Width Modulation) interface allows the device driver to register to a global +bus so other devices in the kernel can use them in a generic way. +.Sh INTERFACE +.Bl -tag -width indent +.It Fn PWM_GET_BUS "device_t dev" +Return the bus device. +.It Fn PWM_CHANNEL_CONFIG "device_t dev" "int channel" "uint64_t period" "uint64_t duty" +Configure the period and duty (in nanoseconds) in the PWM controller for the specified channel. +Returns 0 on success or +.Er EINVAL +if the values are not supported by the controller or +.Er EBUSY +is the PWM controller is in use and does not support changing the value on the fly. +.It Fn PWM_CHANNEL_GET_CONFIG "device_t dev" "int channel" "uint64_t *period" "uint64_t *duty" +Get the current configuration of the period and duty for the specified channel. +.It Fn PWM_CHANNEL_SET_FLAGS "device_t dev" "int channel" "uint32_t flags" +Set the flags of the channel (like inverted polarity). +.It Fn PWM_CHANNEL_GET_FLAGS "device_t dev" "int channel" "uint32_t *flags" +Get the current flags for the channel. +.It Fn PWM_CHANNEL_ENABLE "device_t dev" "int channel" "bool enable" +Enable the PWM channel. +.It Fn PWM_CHANNEL_ISENABLED "device_t dev" "int channel" "bool *enable" +Test if the PWM channel is enabled. +.It PWM_CHANNEL_MAX "device_t dev" "int channel" "int *nchannel" +Get the maximum number of channels supported by the controller. +.El +.Sh HISTORY +The +.Nm pwm +interface first appeared in +.Fx 13.0 . +The +.Nm pwm +interface and manual page was written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . Copied: stable/12/share/man/man9/pwmbus.9 (from r342007, head/share/man/man9/pwmbus.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man9/pwmbus.9 Wed Jun 26 15:34:35 2019 (r349415, copy of r342007, head/share/man/man9/pwmbus.9) @@ -0,0 +1,98 @@ +.\" Copyright (c) 2018 Emmanuel Vadot +.\" +.\" 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 the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 12, 2018 +.Dt PWMBUS 9 +.Os +.Sh NAME +.Nm pwmbus , +.Nm pwmbus_attach_bus , +.Nm PWMBUS_GET_BUS , +.Nm PWMBUS_CHANNEL_CONFIG , +.Nm PWMBUS_CHANNEL_GET_CONFIG , +.Nm PWMBUS_CHANNEL_SET_FLAGS , +.Nm PWMBUS_CHANNEL_GET_FLAGS , +.Nm PWMBUS_CHANNEL_ENABLE , +.Nm PWMBUS_CHANNEL_IS_ENABLED , +.Nm PWMBUS_CHANNEL_MAX +.Nd PWMBUS methods +.Sh SYNOPSIS +.Cd "device pwm" +.In "pwmbus_if.h" +.Ft device_t +.Fn pwmbus_attach_bus "device_t dev" +.Ft int +.Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" +.Ft int +.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.Ft int +.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +.Ft int +.Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" +.Ft int +.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +.Ft int +.Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enabled" +.Ft int +.Fn PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" +.Sh DESCRIPTION +The PWMBUS (Pulse-Width Modulation) interface allows the device driver to register to a global +bus so other devices in the kernel can use them in a generic way +.Sh INTERFACE +.Bl -tag -width indent +.It Fn pwmbus_attach_bus "device_t dev" +Attach the +.Nm pwmbus +to the device driver +.It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" +Configure the period and duty (in nanoseconds) in the PWM controller on the bus for the specified channel. +Returns 0 on success or +.Er EINVAL +is the values are not supported by the controller or +.Er EBUSY +is the PWMBUS controller is in use and doesn't support changing the value on the fly. +.It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +Get the current configuration of the period and duty for the specified channel. +.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +Set the flags of the channel (like inverted polarity), if the driver or controller +doesn't support this a default method is used. +.It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" +Get the current flags for the channel, if the driver or controller +doesn't support this, a default method is used. +.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +Enable the PWM channel. +.It Fn PWMBUS_CHANNEL_ISENABLED "device_t bus" "int channel" "bool *enable" +Test if the PWM channel is enabled. +.It PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" +Get the maximum number of channel supported by the controller. +.El +.Sh HISTORY +The +.Nm pwmbus +interface first appear in +.Fx 13.0 . +The +.Nm pwmbus +interface and manual page was written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . Copied and modified: stable/12/sys/arm/allwinner/aw_pwm.c (from r342007, head/sys/arm/allwinner/aw_pwm.c) ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Wed Dec 12 21:25:52 2018 (r342007, copy source) +++ stable/12/sys/arm/allwinner/aw_pwm.c Wed Jun 26 15:34:35 2019 (r349415) @@ -87,8 +87,8 @@ struct aw_pwm_softc { struct resource *res; uint64_t clk_freq; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned int duty; uint32_t flags; bool enabled; }; @@ -136,7 +136,8 @@ static int aw_pwm_attach(device_t dev) { struct aw_pwm_softc *sc; - /* uint32_t reg; */ + uint64_t clk_freq; + uint32_t reg; int error; sc = device_get_softc(dev); @@ -160,6 +161,26 @@ aw_pwm_attach(device_t dev) if ((sc->busdev = pwmbus_attach_bus(dev)) == NULL) device_printf(dev, "Cannot attach pwm bus\n"); + /* Read the configuration left by U-Boot */ + reg = AW_PWM_READ(sc, AW_PWM_CTRL); + if (reg & (AW_PWM_CTRL_GATE | AW_PWM_CTRL_EN)) + sc->enabled = true; + + reg = AW_PWM_READ(sc, AW_PWM_CTRL); + reg &= AW_PWM_CTRL_PRESCALE_MASK; + if (reg > nitems(aw_pwm_clk_prescaler)) { + device_printf(dev, "Bad prescaler %x, cannot guess current settings\n", reg); + goto out; + } + clk_freq = sc->clk_freq / aw_pwm_clk_prescaler[reg]; + + reg = AW_PWM_READ(sc, AW_PWM_PERIOD); + sc->period = NS_PER_SEC / + (clk_freq / ((reg >> AW_PWM_PERIOD_TOTAL_SHIFT) & AW_PWM_PERIOD_TOTAL_MASK)); + sc->duty = NS_PER_SEC / + (clk_freq / ((reg >> AW_PWM_PERIOD_ACTIVE_SHIFT) & AW_PWM_PERIOD_ACTIVE_MASK)); + +out: return (0); fail: @@ -191,7 +212,7 @@ aw_pwm_channel_max(device_t dev, int *nchannel) } static int -aw_pwm_channel_config(device_t dev, int channel, uint64_t period, uint64_t duty) +aw_pwm_channel_config(device_t dev, int channel, unsigned int period, unsigned int duty) { struct aw_pwm_softc *sc; uint64_t period_freq, duty_freq; @@ -254,7 +275,7 @@ aw_pwm_channel_config(device_t dev, int channel, uint6 } static int -aw_pwm_channel_get_config(device_t dev, int channel, uint64_t *period, uint64_t *duty) +aw_pwm_channel_get_config(device_t dev, int channel, unsigned int *period, unsigned int *duty) { struct aw_pwm_softc *sc; Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Wed Jun 26 15:28:21 2019 (r349414) +++ stable/12/sys/arm64/conf/GENERIC Wed Jun 26 15:34:35 2019 (r349415) @@ -231,6 +231,10 @@ device aw_thermal # Allwinner Thermal Sensor Controll device spibus device bcm2835_spi # Broadcom BCM283x SPI bus +# PWM +device pwm +device aw_pwm + # Console device vt device kbdmux Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Wed Jun 26 15:28:21 2019 (r349414) +++ stable/12/sys/conf/files Wed Jun 26 15:34:35 2019 (r349415) @@ -2775,6 +2775,11 @@ dev/puc/puc.c optional puc dev/puc/puc_cfg.c optional puc dev/puc/puc_pccard.c optional puc pccard dev/puc/puc_pci.c optional puc pci +dev/pwm/pwmc.c optional pwm +dev/pwm/pwmbus.c optional pwm +dev/pwm/pwm_if.m optional pwm +dev/pwm/pwmbus_if.m optional pwm +dev/pwm/ofw_pwm.c optional pwm fdt dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Wed Jun 26 15:28:21 2019 (r349414) +++ stable/12/sys/conf/files.arm64 Wed Jun 26 15:34:35 2019 (r349415) @@ -31,6 +31,7 @@ arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt arm/allwinner/aw_nmi.c optional aw_nmi fdt \ compile-with "${NORMAL_C} -I$S/gnu/dts/include" +arm/allwinner/aw_pwm.c optional aw_pwm fdt arm/allwinner/aw_rsb.c optional aw_rsb fdt arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_sid.c optional aw_sid nvmem fdt Modified: stable/12/sys/dev/pwm/pwm_if.m ============================================================================== --- head/sys/dev/pwm/pwm_if.m Wed Dec 12 21:25:52 2018 (r342007) +++ stable/12/sys/dev/pwm/pwm_if.m Wed Jun 26 15:34:35 2019 (r349415) @@ -46,8 +46,8 @@ METHOD device_t get_bus { METHOD int channel_config { device_t dev; int channel; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned duty; }; # @@ -57,8 +57,8 @@ METHOD int channel_config { METHOD int channel_get_config { device_t dev; int channel; - uint64_t *period; - uint64_t *duty; + unsigned int *period; + unsigned int *duty; }; # Modified: stable/12/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Wed Dec 12 21:25:52 2018 (r342007) +++ stable/12/sys/dev/pwm/pwmbus.c Wed Jun 26 15:34:35 2019 (r349415) @@ -138,7 +138,7 @@ pwmbus_detach(device_t dev) } static int -pwmbus_channel_config(device_t bus, int channel, uint64_t period, uint64_t duty) +pwmbus_channel_config(device_t bus, int channel, unsigned int period, unsigned int duty) { struct pwmbus_softc *sc; @@ -151,7 +151,7 @@ pwmbus_channel_config(device_t bus, int channel, uint6 } static int -pwmbus_channel_get_config(device_t bus, int channel, uint64_t *period, uint64_t *duty) +pwmbus_channel_get_config(device_t bus, int channel, unsigned int *period, unsigned int *duty) { struct pwmbus_softc *sc; Modified: stable/12/sys/dev/pwm/pwmbus_if.m ============================================================================== --- head/sys/dev/pwm/pwmbus_if.m Wed Dec 12 21:25:52 2018 (r342007) +++ stable/12/sys/dev/pwm/pwmbus_if.m Wed Jun 26 15:34:35 2019 (r349415) @@ -59,8 +59,8 @@ HEADER { METHOD int channel_config { device_t bus; int channel; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned int duty; }; # @@ -70,8 +70,8 @@ METHOD int channel_config { METHOD int channel_get_config { device_t bus; int channel; - uint64_t *period; - uint64_t *duty; + unsigned int *period; + unsigned int *duty; }; # Copied: stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso (from r341268, head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Wed Jun 26 15:34:35 2019 (r349415, copy of r341268, head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso) @@ -0,0 +1,72 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&{/} { + cpu0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-648000000 { + opp-hz = /bits/ 64 <648000000>; + opp-microvolt = <1040000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1100000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-912000000 { + opp-hz = /bits/ 64 <912000000>; + opp-microvolt = <1120000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-960000000 { + opp-hz = /bits/ 64 <960000000>; + opp-microvolt = <1160000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1200000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1056000000 { + opp-hz = /bits/ 64 <1056000000>; + opp-microvolt = <1240000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1104000000 { + opp-hz = /bits/ 64 <1104000000>; + opp-microvolt = <1260000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1152000000 { + opp-hz = /bits/ 64 <1152000000>; + opp-microvolt = <1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + }; +}; + +&{/cpus/cpu@0} { + operating-points-v2 = <&cpu0_opp_table>; + clocks = <&ccu 1>; + cpu-supply = <®_dcdc2>; +}; + +&{/cpus/cpu@1} { + operating-points-v2 = <&cpu0_opp_table>; +}; + +&{/cpus/cpu@2} { + operating-points-v2 = <&cpu0_opp_table>; +}; + +&{/cpus/cpu@3} { + operating-points-v2 = <&cpu0_opp_table>; +}; Copied: stable/12/sys/dts/arm64/overlays/sun50i-a64-pwm.dtso (from r342007, head/sys/dts/arm64/overlays/sun50i-a64-pwm.dtso) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/overlays/sun50i-a64-pwm.dtso Wed Jun 26 15:34:35 2019 (r349415, copy of r342007, head/sys/dts/arm64/overlays/sun50i-a64-pwm.dtso) @@ -0,0 +1,26 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&{/soc} { + pwm: pwm@1c21400 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01c21400 0x400>; + clocks = <&osc24M>; + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; +}; + +&{/soc/pinctrl@1c20800} { + pwm_pin: pwm_pin { + pins = "PD22"; + function = "pwm"; + }; +}; Copied: stable/12/sys/dts/arm64/overlays/sun50i-a64-rpwm.dtso (from r342007, head/sys/dts/arm64/overlays/sun50i-a64-rpwm.dtso) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/overlays/sun50i-a64-rpwm.dtso Wed Jun 26 15:34:35 2019 (r349415, copy of r342007, head/sys/dts/arm64/overlays/sun50i-a64-rpwm.dtso) @@ -0,0 +1,26 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&{/soc} { + r_pwm: pwm@1f03800 { + compatible = "allwinner,sun50i-a64-pwm", + "allwinner,sun5i-a13-pwm"; + reg = <0x01f03800 0x400>; + clocks = <&osc24M>; + pinctrl-names = "default"; + pinctrl-0 = <&r_pwm_pin>; + #pwm-cells = <3>; + status = "okay"; + }; +}; + +&{/soc/pinctrl@1f02c00} { + r_pwm_pin: pwm { + pins = "PL10"; + function = "s_pwm"; + }; +}; Modified: stable/12/sys/modules/dtb/allwinner/Makefile ============================================================================== --- stable/12/sys/modules/dtb/allwinner/Makefile Wed Jun 26 15:28:21 2019 (r349414) +++ stable/12/sys/modules/dtb/allwinner/Makefile Wed Jun 26 15:34:35 2019 (r349415) @@ -44,7 +44,10 @@ DTS= \ allwinner/sun50i-a64-sopine-baseboard.dts \ allwinner/sun50i-h5-orangepi-pc2.dts -DTSO= sun50i-a64-sid.dtso \ +DTSO= sun50i-a64-opp.dtso \ + sun50i-a64-pwm.dtso \ + sun50i-a64-rpwm.dtso \ + sun50i-a64-sid.dtso \ sun50i-a64-ths.dtso \ sun50i-a64-timer.dtso Copied and modified: stable/12/sys/sys/pwm.h (from r342007, head/sys/sys/pwm.h) ============================================================================== --- head/sys/sys/pwm.h Wed Dec 12 21:25:52 2018 (r342007, copy source) +++ stable/12/sys/sys/pwm.h Wed Jun 26 15:34:35 2019 (r349415) @@ -35,8 +35,8 @@ struct pwm_state { int channel; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned int duty; uint32_t flags; bool enable; }; Modified: stable/12/usr.sbin/Makefile ============================================================================== --- stable/12/usr.sbin/Makefile Wed Jun 26 15:28:21 2019 (r349414) +++ stable/12/usr.sbin/Makefile Wed Jun 26 15:34:35 2019 (r349415) @@ -67,6 +67,7 @@ SUBDIR= adduser \ pstat \ pw \ pwd_mkdb \ + pwm \ quot \ rarpd \ rmt \ Modified: stable/12/usr.sbin/pwm/pwm.8 ============================================================================== --- head/usr.sbin/pwm/pwm.8 Wed Dec 12 21:25:52 2018 (r342007) +++ stable/12/usr.sbin/pwm/pwm.8 Wed Jun 26 15:34:35 2019 (r349415) @@ -67,7 +67,7 @@ Show the configuration of the pwm channel .It Fl p Ar period Configure the period (in nanoseconds) of the pwm channel .It Fl d Ar duty -Configure the duty (in nanoseconds) of the pwm channel +Configure the duty (in nanoseconds or percentage) of the pwm channel .El .Sh EXAMPLES .Bl -bullet @@ -76,9 +76,13 @@ Show the configuration of the pwm channel: .Pp pwm -f /dev/pwmc0 -C .It -Configure a 50000 ns period and a 25000 duty cycles: +Configure a 50000 ns period and a 25000 duty cycle: .Pp pwm -f /dev/pwmc0 -p 50000 -d 25000 +.It +Configure a 50% duty cycle: +.Pp +pwm -f /dev/pwmc0 -d 50% .El .Sh SEE ALSO .Xr pwm 9 , Modified: stable/12/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Wed Dec 12 21:25:52 2018 (r342007) +++ stable/12/usr.sbin/pwm/pwm.c Wed Jun 26 15:34:35 2019 (r349415) @@ -71,6 +71,7 @@ main(int argc, char *argv[]) int action, ch; cap_rights_t right_ioctl; const unsigned long pwm_ioctls[] = {PWMGETSTATE, PWMSETSTATE, PWMMAXCHANNEL}; + char *percent; action = 0; fd = -1; @@ -104,7 +105,9 @@ main(int argc, char *argv[]) if (action & ~(PWM_PERIOD | PWM_DUTY)) usage(); action = PWM_DUTY; - duty = strtol(optarg, NULL, 10); + duty = strtol(optarg, &percent, 10); + if (*percent != '\0' && *percent != '%') + usage(); break; case 'c': if (channel != -1) @@ -190,17 +193,21 @@ main(int argc, char *argv[]) } break; case PWM_SHOW_CONFIG: - printf("period: %ju\nduty: %ju\nenabled:%d\n", - (uintmax_t) state.period, - (uintmax_t) state.duty, + printf("period: %u\nduty: %u\nenabled:%d\n", + state.period, + state.duty, state.enable); break; case PWM_PERIOD: case PWM_DUTY: if (period != -1) state.period = period; - if (duty != -1) - state.duty = duty; + if (duty != -1) { + if (*percent != '\0') + state.duty = state.period * duty / 100; + else + state.duty = duty; + } if (ioctl(fd, PWMSETSTATE, &state) == -1) { fprintf(stderr, "Cannot configure the pwm controller\n"); From owner-svn-src-all@freebsd.org Wed Jun 26 15:43:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C02C15CB64E; Wed, 26 Jun 2019 15:43:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8B072B4E; Wed, 26 Jun 2019 15:43:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07C041B77; Wed, 26 Jun 2019 15:43:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QFhKjZ024800; Wed, 26 Jun 2019 15:43:20 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QFhKTA024799; Wed, 26 Jun 2019 15:43:20 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201906261543.x5QFhKTA024799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 26 Jun 2019 15:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349416 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 349416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A8B072B4E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 15:43:21 -0000 Author: arichardson Date: Wed Jun 26 15:43:20 2019 New Revision: 349416 URL: https://svnweb.freebsd.org/changeset/base/349416 Log: Fix -Wsign-compare warnings in realpath.c This is needed in order to build realpath.c as part of rtld. Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Wed Jun 26 15:34:35 2019 (r349415) +++ head/lib/libc/stdlib/realpath.c Wed Jun 26 15:43:20 2019 (r349416) @@ -91,7 +91,7 @@ realpath1(const char *path, char *resolved) */ p = strchr(left, '/'); - next_token_len = p != NULL ? p - left : left_len; + next_token_len = p != NULL ? (size_t)(p - left) : left_len; memcpy(next_token, left, next_token_len); next_token[next_token_len] = '\0'; @@ -146,7 +146,7 @@ realpath1(const char *path, char *resolved) return (NULL); } slen = readlink(resolved, symlink, sizeof(symlink)); - if (slen <= 0 || slen >= sizeof(symlink)) { + if (slen <= 0 || slen >= (ssize_t)sizeof(symlink)) { if (slen < 0) ; /* keep errno from readlink(2) call */ else if (slen == 0) @@ -173,7 +173,7 @@ realpath1(const char *path, char *resolved) */ if (p != NULL) { if (symlink[slen - 1] != '/') { - if (slen + 1 >= sizeof(symlink)) { + if (slen + 1 >= (ssize_t)sizeof(symlink)) { errno = ENAMETOOLONG; return (NULL); } From owner-svn-src-all@freebsd.org Wed Jun 26 15:43:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6038915CB674; Wed, 26 Jun 2019 15:43:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAF6B72BCE; Wed, 26 Jun 2019 15:43:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEC511B78; Wed, 26 Jun 2019 15:43:26 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QFhQmv024855; Wed, 26 Jun 2019 15:43:26 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QFhQ7B024853; Wed, 26 Jun 2019 15:43:26 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201906261543.x5QFhQ7B024853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 26 Jun 2019 15:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349417 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 349417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EAF6B72BCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 15:43:29 -0000 Author: arichardson Date: Wed Jun 26 15:43:26 2019 New Revision: 349417 URL: https://svnweb.freebsd.org/changeset/base/349417 Log: Use rtld_putstr() instead of write() for the rtld msg() macro This removes an unnecessary libc dependency from rtld. See https://reviews.freebsd.org/D20663 for more details. Modified: head/libexec/rtld-elf/debug.h head/libexec/rtld-elf/rtld_printf.h Modified: head/libexec/rtld-elf/debug.h ============================================================================== --- head/libexec/rtld-elf/debug.h Wed Jun 26 15:43:20 2019 (r349416) +++ head/libexec/rtld-elf/debug.h Wed Jun 26 15:43:26 2019 (r349417) @@ -37,7 +37,7 @@ #include #include -#include +#include "rtld_printf.h" void debug_printf(const char *, ...) __printflike(1, 2); extern int debug; @@ -57,7 +57,7 @@ extern int debug; #define assert(cond) ((cond) ? (void) 0 : \ (msg(_MYNAME ": assert failed: " __FILE__ ":" \ __XSTRING(__LINE__) "\n"), abort())) -#define msg(s) write(STDOUT_FILENO, s, strlen(s)) +#define msg(s) rtld_putstr(s) #define trace() msg(_MYNAME ": " __XSTRING(__LINE__) "\n") Modified: head/libexec/rtld-elf/rtld_printf.h ============================================================================== --- head/libexec/rtld-elf/rtld_printf.h Wed Jun 26 15:43:20 2019 (r349416) +++ head/libexec/rtld-elf/rtld_printf.h Wed Jun 26 15:43:26 2019 (r349417) @@ -31,6 +31,7 @@ #define RTLD_PRINTF_H 1 #include +#include #include int rtld_snprintf(char *buf, size_t bufsize, const char *fmt, ...) From owner-svn-src-all@freebsd.org Wed Jun 26 16:23:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9A5815CC236; Wed, 26 Jun 2019 16:23:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD5574381; Wed, 26 Jun 2019 16:23:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A8312267; Wed, 26 Jun 2019 16:23:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGNPKG045810; Wed, 26 Jun 2019 16:23:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGNPk3045809; Wed, 26 Jun 2019 16:23:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906261623.x5QGNPk3045809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 26 Jun 2019 16:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349418 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CD5574381 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:23:26 -0000 Author: mav Date: Wed Jun 26 16:23:24 2019 New Revision: 349418 URL: https://svnweb.freebsd.org/changeset/base/349418 Log: Fix qlxgbe(4) static build. MFC after: 2 weeks Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Jun 26 15:43:26 2019 (r349417) +++ head/sys/conf/files.amd64 Wed Jun 26 16:23:24 2019 (r349418) @@ -389,6 +389,9 @@ dev/qlxgbe/ql_isr.c optional qlxgbe pci dev/qlxgbe/ql_misc.c optional qlxgbe pci dev/qlxgbe/ql_os.c optional qlxgbe pci dev/qlxgbe/ql_reset.c optional qlxgbe pci +dev/qlxgbe/ql_fw.c optional qlxgbe pci +dev/qlxgbe/ql_boot.c optional qlxgbe pci +dev/qlxgbe/ql_minidump.c optional qlxgbe pci dev/qlnx/qlnxe/ecore_cxt.c optional qlnxe pci \ compile-with "${LINUXKPI_C}" dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c optional qlnxe pci \ From owner-svn-src-all@freebsd.org Wed Jun 26 16:28:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 679DA15CC33A; Wed, 26 Jun 2019 16:28:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0996B745C4; Wed, 26 Jun 2019 16:28:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6CC52288; Wed, 26 Jun 2019 16:28:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGSgTO046071; Wed, 26 Jun 2019 16:28:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGSgF0046070; Wed, 26 Jun 2019 16:28:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261628.x5QGSgF0046070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 16:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349419 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 349419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0996B745C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:28:43 -0000 Author: markj Date: Wed Jun 26 16:28:42 2019 New Revision: 349419 URL: https://svnweb.freebsd.org/changeset/base/349419 Log: Remove references to splbio in ffs_softdep.c. Assert that the per-mountpoint softdep mutex is held in modified functions that do not already have this assertion. No functional change intended. Reviewed by: kib, mckusick (previous version) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20741 Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Jun 26 16:23:24 2019 (r349418) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Jun 26 16:28:42 2019 (r349419) @@ -2110,7 +2110,6 @@ pagedep_find(pagedephd, ino, lbn, pagedeppp) * Look up a pagedep. Return 1 if found, 0 otherwise. * If not found, allocate if DEPALLOC flag is passed. * Found or allocated entry is returned in pagedeppp. - * This routine must be called with splbio interrupts blocked. */ static int pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp) @@ -2202,7 +2201,6 @@ inodedep_find(inodedephd, inum, inodedeppp) * Look up an inodedep. Return 1 if found, 0 if not found. * If not found, allocate if DEPALLOC flag is passed. * Found or allocated entry is returned in inodedeppp. - * This routine must be called with splbio interrupts blocked. */ static int inodedep_lookup(mp, inum, flags, inodedeppp) @@ -5478,7 +5476,6 @@ jnewblk_merge(new, old, wkhd) /* * Replace an old allocdirect dependency with a newer one. - * This routine must be called with splbio interrupts blocked. */ static void allocdirect_merge(adphead, newadp, oldadp) @@ -7534,7 +7531,6 @@ free_newblk(newblk) /* * Free a newdirblk. Clear the NEWBLOCK flag on its associated pagedep. - * This routine must be called with splbio interrupts blocked. */ static void free_newdirblk(newdirblk) @@ -7665,7 +7661,6 @@ softdep_freefile(pvp, ino, mode) /* * Check to see if an inode has never been written to disk. If * so free the inodedep and return success, otherwise return failure. - * This routine must be called with splbio interrupts blocked. * * If we still have a bitmap dependency, then the inode has never * been written to disk. Drop the dependency as it is no longer @@ -8897,8 +8892,7 @@ cancel_diradd(dap, dirrem, jremref, dotremref, dotdotr } /* - * Free a diradd dependency structure. This routine must be called - * with splbio interrupts blocked. + * Free a diradd dependency structure. */ static void free_diradd(dap, wkhd) @@ -11195,9 +11189,7 @@ softdep_disk_write_complete(bp) } /* - * Called from within softdep_disk_write_complete above. Note that - * this routine is always called from interrupt level with further - * splbio interrupts blocked. + * Called from within softdep_disk_write_complete above. */ static void handle_allocdirect_partdone(adp, wkhd) @@ -11209,6 +11201,7 @@ handle_allocdirect_partdone(adp, wkhd) struct inodedep *inodedep; long bsize; + LOCK_OWNED(VFSTOUFS(adp->ad_block.nb_list.wk_mp)); if ((adp->ad_state & ALLCOMPLETE) != ALLCOMPLETE) return; /* @@ -11818,7 +11811,6 @@ handle_written_indirdep(indirdep, bp, bpp, flags) /* * Process a diradd entry after its dependent inode has been written. - * This routine must be called with splbio interrupts blocked. */ static void diradd_inode_written(dap, inodedep) @@ -11826,6 +11818,7 @@ diradd_inode_written(dap, inodedep) struct inodedep *inodedep; { + LOCK_OWNED(VFSTOUFS(dap->da_list.wk_mp)); dap->da_state |= COMPLETE; complete_diradd(dap); WORKLIST_INSERT(&inodedep->id_pendinghd, &dap->da_list); @@ -12386,8 +12379,7 @@ retry: /* * Merge the a new inode dependency list (such as id_newinoupdt) into an - * old inode dependency list (such as id_inoupdt). This routine must be - * called with splbio interrupts blocked. + * old inode dependency list (such as id_inoupdt). */ static void merge_inode_lists(newlisthead, oldlisthead) @@ -12397,6 +12389,8 @@ merge_inode_lists(newlisthead, oldlisthead) struct allocdirect *listadp, *newadp; newadp = TAILQ_FIRST(newlisthead); + if (newadp != NULL) + LOCK_OWNED(VFSTOUFS(newadp->ad_block.nb_list.wk_mp)); for (listadp = TAILQ_FIRST(oldlisthead); listadp && newadp;) { if (listadp->ad_offset < newadp->ad_offset) { listadp = TAILQ_NEXT(listadp, ad_next); @@ -12891,7 +12885,6 @@ out: /* * Flush the dependencies associated with an inodedep. - * Called with splbio blocked. */ static int flush_inodedep_deps(vp, mp, ino) @@ -12956,7 +12949,6 @@ restart: /* * Flush an inode dependency list. - * Called with splbio blocked. */ static int flush_deplist(listhead, waitfor, errorp) @@ -13098,7 +13090,6 @@ flush_newblk_dep(vp, mp, lbn) /* * Eliminate a pagedep dependency by flushing out all its diradd dependencies. - * Called with splbio blocked. */ static int flush_pagedep_deps(pvp, mp, diraddhdp) From owner-svn-src-all@freebsd.org Wed Jun 26 16:30:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E356C15CC407; Wed, 26 Jun 2019 16:30:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2197477D; Wed, 26 Jun 2019 16:30:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F166228F; Wed, 26 Jun 2019 16:30:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGUFes046200; Wed, 26 Jun 2019 16:30:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGUFGE046199; Wed, 26 Jun 2019 16:30:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261630.x5QGUFGE046199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 16:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349420 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A2197477D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:30:16 -0000 Author: markj Date: Wed Jun 26 16:30:14 2019 New Revision: 349420 URL: https://svnweb.freebsd.org/changeset/base/349420 Log: libelftc: Micro-optimize string table insertion. The string's length is already known, so use memcpy() instead of strcpy() to add it to the string table image. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20760 Modified: head/contrib/elftoolchain/libelftc/elftc_string_table.c Modified: head/contrib/elftoolchain/libelftc/elftc_string_table.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jun 26 16:28:42 2019 (r349419) +++ head/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jun 26 16:30:14 2019 (r349420) @@ -119,7 +119,7 @@ elftc_string_table_add_to_pool(Elftc_String_Table *st, st->st_string_pool_size = newsize; } - strcpy(st->st_string_pool + stlen, string); + memcpy(st->st_string_pool + stlen, string, len); ELFTC_STRING_TABLE_UPDATE_LENGTH(st, stlen + len); return (stlen); From owner-svn-src-all@freebsd.org Wed Jun 26 16:31:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D9D915CC651; Wed, 26 Jun 2019 16:31:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B419A74B31; Wed, 26 Jun 2019 16:31:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DC0B2406; Wed, 26 Jun 2019 16:31:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGVpTc047836; Wed, 26 Jun 2019 16:31:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGVp2i047833; Wed, 26 Jun 2019 16:31:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261631.x5QGVp2i047833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 16:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349421 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B419A74B31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:31:52 -0000 Author: markj Date: Wed Jun 26 16:31:50 2019 New Revision: 349421 URL: https://svnweb.freebsd.org/changeset/base/349421 Log: libelftc: Consistently use size_t for string table offsets and sizes. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20702 Modified: head/contrib/elftoolchain/libelftc/elftc_string_table.c head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 head/contrib/elftoolchain/libelftc/libelftc.h Modified: head/contrib/elftoolchain/libelftc/elftc_string_table.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jun 26 16:30:14 2019 (r349420) +++ head/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jun 26 16:31:50 2019 (r349421) @@ -44,7 +44,7 @@ ELFTC_VCSID("$Id: elftc_string_table.c 2869 2013-01-06 #define ELFTC_STRING_TABLE_POOL_SIZE_INCREMENT (4*1024) struct _Elftc_String_Table_Entry { - int ste_idx; + ssize_t ste_idx; SLIST_ENTRY(_Elftc_String_Table_Entry) ste_next; }; @@ -64,9 +64,9 @@ struct _Elftc_String_Table_Entry { } while (0) struct _Elftc_String_Table { - unsigned int st_len; /* length and flags */ + size_t st_len; /* length and flags */ int st_nbuckets; - int st_string_pool_size; + size_t st_string_pool_size; char *st_string_pool; SLIST_HEAD(_Elftc_String_Table_Bucket, _Elftc_String_Table_Entry) st_buckets[]; @@ -86,7 +86,7 @@ elftc_string_table_find_hash_entry(Elftc_String_Table *rhashindex = hashindex; SLIST_FOREACH(ste, &st->st_buckets[hashindex], ste_next) { - s = st->st_string_pool + abs(ste->ste_idx); + s = st->st_string_pool + labs(ste->ste_idx); assert(s > st->st_string_pool && s < st->st_string_pool + st->st_string_pool_size); @@ -102,7 +102,7 @@ static int elftc_string_table_add_to_pool(Elftc_String_Table *st, const char *string) { char *newpool; - int len, newsize, stlen; + size_t len, newsize, stlen; len = strlen(string) + 1; /* length, including the trailing NUL */ stlen = ELFTC_STRING_TABLE_LENGTH(st); @@ -126,10 +126,10 @@ elftc_string_table_add_to_pool(Elftc_String_Table *st, } Elftc_String_Table * -elftc_string_table_create(int sizehint) +elftc_string_table_create(size_t sizehint) { - int n, nbuckets, tablesize; struct _Elftc_String_Table *st; + int n, nbuckets, tablesize; if (sizehint < ELFTC_STRING_TABLE_DEFAULT_SIZE) sizehint = ELFTC_STRING_TABLE_DEFAULT_SIZE; @@ -173,13 +173,13 @@ elftc_string_table_destroy(Elftc_String_Table *st) } Elftc_String_Table * -elftc_string_table_from_section(Elf_Scn *scn, int sizehint) +elftc_string_table_from_section(Elf_Scn *scn, size_t sizehint) { - int len; Elf_Data *d; GElf_Shdr sh; const char *s, *end; Elftc_String_Table *st; + size_t len; /* Verify the type of the section passed in. */ if (gelf_getshdr(scn, &sh) == NULL || @@ -235,7 +235,8 @@ elftc_string_table_image(Elftc_String_Table *st, size_ char *r, *s, *end; struct _Elftc_String_Table_Entry *ste; struct _Elftc_String_Table_Bucket *head; - int copied, hashindex, offset, length, newsize; + size_t copied, offset, length, newsize; + int hashindex; /* * For the common case of a string table has not seen @@ -303,8 +304,9 @@ elftc_string_table_image(Elftc_String_Table *st, size_ size_t elftc_string_table_insert(Elftc_String_Table *st, const char *string) { - int hashindex, idx; struct _Elftc_String_Table_Entry *ste; + ssize_t idx; + int hashindex; hashindex = 0; @@ -326,7 +328,7 @@ elftc_string_table_insert(Elftc_String_Table *st, cons idx = ste->ste_idx; if (idx < 0) /* Undelete. */ - ste->ste_idx = idx = (- idx); + ste->ste_idx = idx = -idx; return (idx); } @@ -334,8 +336,9 @@ elftc_string_table_insert(Elftc_String_Table *st, cons size_t elftc_string_table_lookup(Elftc_String_Table *st, const char *string) { - int hashindex, idx; struct _Elftc_String_Table_Entry *ste; + ssize_t idx; + int hashindex; ste = elftc_string_table_find_hash_entry(st, string, &hashindex); @@ -350,17 +353,17 @@ elftc_string_table_lookup(Elftc_String_Table *st, cons int elftc_string_table_remove(Elftc_String_Table *st, const char *string) { - int idx; struct _Elftc_String_Table_Entry *ste; + ssize_t idx; ste = elftc_string_table_find_hash_entry(st, string, NULL); if (ste == NULL || (idx = ste->ste_idx) < 0) return (ELFTC_FAILURE); - assert(idx > 0 && idx < (int) ELFTC_STRING_TABLE_LENGTH(st)); + assert(idx > 0 && (size_t)idx < ELFTC_STRING_TABLE_LENGTH(st)); - ste->ste_idx = (- idx); + ste->ste_idx = -idx; ELFTC_STRING_TABLE_SET_COMPACTION_FLAG(st); Modified: head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jun 26 16:30:14 2019 (r349420) +++ head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jun 26 16:31:50 2019 (r349421) @@ -24,7 +24,7 @@ .\" .\" $Id: elftc_string_table_create.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" -.Dd January 5, 2013 +.Dd June 19, 2019 .Dt ELFTC_STRING_TABLE_CREATE 3 .Os .Sh NAME @@ -40,11 +40,11 @@ .Sh SYNOPSIS .In libelftc.h .Ft "Elftc_String_Table *" -.Fn elftc_string_table_create "int sizehint" +.Fn elftc_string_table_create "size_t sizehint" .Ft int .Fn elftc_string_table_destroy "Elftc_String_Table *table" .Ft "Elftc_String_Table *" -.Fn elftc_string_table_from_section "Elf_Scn *scn" "int sizehint" +.Fn elftc_string_table_from_section "Elf_Scn *scn" "size_t sizehint" .Ft "const char *" .Fo elftc_string_table_image .Fa "Elftc_String_Table *table" Modified: head/contrib/elftoolchain/libelftc/libelftc.h ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc.h Wed Jun 26 16:30:14 2019 (r349420) +++ head/contrib/elftoolchain/libelftc/libelftc.h Wed Jun 26 16:31:50 2019 (r349421) @@ -77,10 +77,10 @@ int elftc_demangle(const char *_mangledname, char *_b size_t _bufsize, unsigned int _flags); const char *elftc_reloc_type_str(unsigned int mach, unsigned int type); int elftc_set_timestamps(const char *_filename, struct stat *_sb); -Elftc_String_Table *elftc_string_table_create(int _hint); +Elftc_String_Table *elftc_string_table_create(size_t _sizehint); void elftc_string_table_destroy(Elftc_String_Table *_table); Elftc_String_Table *elftc_string_table_from_section(Elf_Scn *_scn, - int _hint); + size_t _sizehint); const char *elftc_string_table_image(Elftc_String_Table *_table, size_t *_sz); size_t elftc_string_table_insert(Elftc_String_Table *_table, From owner-svn-src-all@freebsd.org Wed Jun 26 16:32:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7000415CC6C4; Wed, 26 Jun 2019 16:32:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1397074D3C; Wed, 26 Jun 2019 16:32:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2F30244C; Wed, 26 Jun 2019 16:32:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGWfMT050882; Wed, 26 Jun 2019 16:32:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGWfnW050881; Wed, 26 Jun 2019 16:32:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261632.x5QGWfnW050881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 16:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349422 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1397074D3C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:32:42 -0000 Author: markj Date: Wed Jun 26 16:32:41 2019 New Revision: 349422 URL: https://svnweb.freebsd.org/changeset/base/349422 Log: libelftc: Fix the documented prototype for elftc_string_table_destroy(). MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Modified: head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jun 26 16:31:50 2019 (r349421) +++ head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jun 26 16:32:41 2019 (r349422) @@ -41,7 +41,7 @@ .In libelftc.h .Ft "Elftc_String_Table *" .Fn elftc_string_table_create "size_t sizehint" -.Ft int +.Ft void .Fn elftc_string_table_destroy "Elftc_String_Table *table" .Ft "Elftc_String_Table *" .Fn elftc_string_table_from_section "Elf_Scn *scn" "size_t sizehint" From owner-svn-src-all@freebsd.org Wed Jun 26 16:35:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B0F215CC7E3; Wed, 26 Jun 2019 16:35:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09B7B74F22; Wed, 26 Jun 2019 16:35:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2AF3244E; Wed, 26 Jun 2019 16:35:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGZbn6051085; Wed, 26 Jun 2019 16:35:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGZbJ7051084; Wed, 26 Jun 2019 16:35:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261635.x5QGZbJ7051084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 16:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349423 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 349423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09B7B74F22 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:35:38 -0000 Author: markj Date: Wed Jun 26 16:35:37 2019 New Revision: 349423 URL: https://svnweb.freebsd.org/changeset/base/349423 Log: elfcopy: Provide a size hint when creating the section string table. Use the input file's .shstrtab size as the hint if it exists. This gives a small performance improvement when processing files with many sections. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20544 Modified: head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Wed Jun 26 16:32:41 2019 (r349422) +++ head/contrib/elftoolchain/elfcopy/sections.c Wed Jun 26 16:35:37 2019 (r349423) @@ -1398,8 +1398,24 @@ update_shdr(struct elfcopy *ecp, int update_link) void init_shstrtab(struct elfcopy *ecp) { + Elf_Scn *shstrtab; + GElf_Shdr shdr; struct section *s; + size_t indx, sizehint; + if (elf_getshstrndx(ecp->ein, &indx) != 0) { + shstrtab = elf_getscn(ecp->ein, indx); + if (shstrtab == NULL) + errx(EXIT_FAILURE, "elf_getscn failed: %s", + elf_errmsg(-1)); + if (gelf_getshdr(shstrtab, &shdr) != &shdr) + errx(EXIT_FAILURE, "gelf_getshdr failed: %s", + elf_errmsg(-1)); + sizehint = shdr.sh_size; + } else { + sizehint = 0; + } + if ((ecp->shstrtab = calloc(1, sizeof(*ecp->shstrtab))) == NULL) err(EXIT_FAILURE, "calloc failed"); s = ecp->shstrtab; @@ -1410,7 +1426,7 @@ init_shstrtab(struct elfcopy *ecp) s->loadable = 0; s->type = SHT_STRTAB; s->vma = 0; - s->strtab = elftc_string_table_create(0); + s->strtab = elftc_string_table_create(sizehint); add_to_shstrtab(ecp, ""); add_to_shstrtab(ecp, ".symtab"); From owner-svn-src-all@freebsd.org Wed Jun 26 16:38:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76EB615CC8D6; Wed, 26 Jun 2019 16:38:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18DDC750D6; Wed, 26 Jun 2019 16:38:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6C2A2458; Wed, 26 Jun 2019 16:38:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGcUU8051234; Wed, 26 Jun 2019 16:38:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGcUac051233; Wed, 26 Jun 2019 16:38:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261638.x5QGcUac051233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 16:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349424 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 349424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18DDC750D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:38:31 -0000 Author: markj Date: Wed Jun 26 16:38:30 2019 New Revision: 349424 URL: https://svnweb.freebsd.org/changeset/base/349424 Log: libdwarf: Use the cached strtab pointer when reading string attributes. Previously we would perform a linear search of the DWARF section list for ".debug_str". However, libdwarf always caches a pointer to the strtab image in its debug descriptor. Using it gives a modest performance improvement when iterating over the attributes of each DIE. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20759 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_attr.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_attr.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_attr.c Wed Jun 26 16:35:37 2019 (r349423) +++ head/contrib/elftoolchain/libdwarf/libdwarf_attr.c Wed Jun 26 16:38:30 2019 (r349424) @@ -100,7 +100,6 @@ _dwarf_attr_init(Dwarf_Debug dbg, Dwarf_Section *ds, u uint64_t form, int indirect, Dwarf_Error *error) { struct _Dwarf_Attribute atref; - Dwarf_Section *str; int ret; ret = DW_DLE_NONE; @@ -183,9 +182,7 @@ _dwarf_attr_init(Dwarf_Debug dbg, Dwarf_Section *ds, u break; case DW_FORM_strp: atref.u[0].u64 = dbg->read(ds->ds_data, offsetp, dwarf_size); - str = _dwarf_find_section(dbg, ".debug_str"); - assert(str != NULL); - atref.u[1].s = (char *) str->ds_data + atref.u[0].u64; + atref.u[1].s = _dwarf_strtab_get_table(dbg) + atref.u[0].u64; break; case DW_FORM_ref_sig8: atref.u[0].u64 = 8; From owner-svn-src-all@freebsd.org Wed Jun 26 16:38:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE9EA15CC902; Wed, 26 Jun 2019 16:38:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5723B751EE; Wed, 26 Jun 2019 16:38:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F4CC245D; Wed, 26 Jun 2019 16:38:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGclrG051290; Wed, 26 Jun 2019 16:38:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGckQS051285; Wed, 26 Jun 2019 16:38:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906261638.x5QGckQS051285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 26 Jun 2019 16:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349425 - stable/12/lib/libcapsicum X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/lib/libcapsicum X-SVN-Commit-Revision: 349425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5723B751EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:38:47 -0000 Author: ian Date: Wed Jun 26 16:38:46 2019 New Revision: 349425 URL: https://svnweb.freebsd.org/changeset/base/349425 Log: MFC r340130, r340134: r340130: (by oshogbo) libcapsicum: Introduce caph_{rights,ioctls,fcntls}_limit The idea behind those functions is not to force consumers to remember that there is a need to check errno on failure. We already have a caph_enter(3) function which does the same for cap_enter(2). r340134: (by oshogbo) Fix a recusive call introduce in the r340130. Modified: stable/12/lib/libcapsicum/Makefile stable/12/lib/libcapsicum/capsicum_helpers.3 stable/12/lib/libcapsicum/capsicum_helpers.h Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcapsicum/Makefile ============================================================================== --- stable/12/lib/libcapsicum/Makefile Wed Jun 26 16:38:30 2019 (r349424) +++ stable/12/lib/libcapsicum/Makefile Wed Jun 26 16:38:46 2019 (r349425) @@ -8,6 +8,7 @@ MAN+= capsicum_helpers.3 MLINKS+=capsicum_helpers.3 caph_enter.3 MLINKS+=capsicum_helpers.3 caph_enter_casper.3 +MLINKS+=capsicum_helpers.3 caph_rights_limit.3 MLINKS+=capsicum_helpers.3 caph_limit_stream.3 MLINKS+=capsicum_helpers.3 caph_limit_stdin.3 MLINKS+=capsicum_helpers.3 caph_limit_stderr.3 Modified: stable/12/lib/libcapsicum/capsicum_helpers.3 ============================================================================== --- stable/12/lib/libcapsicum/capsicum_helpers.3 Wed Jun 26 16:38:30 2019 (r349424) +++ stable/12/lib/libcapsicum/capsicum_helpers.3 Wed Jun 26 16:38:46 2019 (r349425) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 18, 2018 +.Dd November 4, 2018 .Dt CAPSICUM_HELPERS 3 .Os .Sh NAME @@ -34,7 +34,12 @@ .Nm caph_limit_stdout , .Nm caph_limit_stdio , .Nm caph_cache_tzdata , -.Nm caph_cache_catpages +.Nm caph_cache_catpages , +.Nm caph_enter , +.Nm caph_enter_casper , +.Nm caph_rights_limit , +.Nm caph_ioctls_limit , +.Nm caph_fcntls_limit .Nd "set of the capsicum helpers, part of the libcapsicum" .Sh LIBRARY .Lb libcapsicum @@ -45,8 +50,12 @@ .Ft int .Fn caph_enter_casper "void" .Ft int -.Fn caph_limit_stream "int fd" "int flags" +.Fn caph_rights_limit "inf fd" "const cap_righst_t *rights" .Ft int +.Fn caph_ioctls_limit "inf fd" "const unsigned long *cmds" "size_t ncmds" +.Ft int +.Fn caph_fcntls_limit "inf fd" "uint32_t fcntlrights" +.Ft int .Fn caph_limit_stdin "void" .Ft int .Fn caph_limit_stderr "void" @@ -60,9 +69,17 @@ .Fn caph_cache_catpages "void" .Sh DESCRIPTION The -.Nm caph_enter -is equivalent to the -.Xr cap_enter 2 +.Nm caph_enter , +.Nm caph_rights_limit , +.Nm caph_ioctls_limit +and +.Nm caph_fcntls_limit +are respectively equivalent to +.Xr cap_enter 2 , +.Xr cap_rights_limit 2 , +.Xr cap_ioctls_limit 2 +and +.Xr cap_fcntls_limit 2 , it returns success when the kernel is built without support of the capability mode. .Pp @@ -125,4 +142,5 @@ among others. .Ed .Sh SEE ALSO .Xr cap_enter 2 , +.Xr cap_rights_limit 2 , .Xr rights 4 Modified: stable/12/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- stable/12/lib/libcapsicum/capsicum_helpers.h Wed Jun 26 16:38:30 2019 (r349424) +++ stable/12/lib/libcapsicum/capsicum_helpers.h Wed Jun 26 16:38:46 2019 (r349425) @@ -136,6 +136,35 @@ caph_enter(void) return (0); } +static __inline int +caph_rights_limit(int fd, const cap_rights_t *rights) +{ + + if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS) + return (-1); + + return (0); +} + +static __inline int +caph_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds) +{ + + if (cap_ioctls_limit(fd, cmds, ncmds) < 0 && errno != ENOSYS) + return (-1); + + return (0); +} + +static __inline int +caph_fcntls_limit(int fd, uint32_t fcntlrights) +{ + + if (cap_fcntls_limit(fd, fcntlrights) < 0 && errno != ENOSYS) + return (-1); + + return (0); +} static __inline int caph_enter_casper(void) From owner-svn-src-all@freebsd.org Wed Jun 26 16:47:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3D7A15CCBE5 for ; Wed, 26 Jun 2019 16:47:02 +0000 (UTC) (envelope-from dch@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BEAC756CE; Wed, 26 Jun 2019 16:47:02 +0000 (UTC) (envelope-from dch@freebsd.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: dch/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 18EAE1DF8F; Wed, 26 Jun 2019 16:47:02 +0000 (UTC) (envelope-from dch@freebsd.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id A92192179E; Wed, 26 Jun 2019 12:47:01 -0400 (EDT) Received: from imap6 ([10.202.2.56]) by compute1.internal (MEProxy); Wed, 26 Jun 2019 12:47:01 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeigddutdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfffgr vhgvucevohhtthhlvghhuhgsvghrfdcuoegutghhsehfrhgvvggsshgurdhorhhgqeenuc ffohhmrghinhepfhhrvggvsghsugdrohhrghenucfrrghrrghmpehmrghilhhfrhhomhep uggthhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieejkedukeduhedvqd duvddufeduudejjedquggthheppehfrhgvvggsshgurdhorhhgsehfrghsthhmrghilhdr fhhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 491FA1400A1; Wed, 26 Jun 2019 12:47:01 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-730-g63f2c3b-fmstable-20190622v1 Mime-Version: 1.0 Message-Id: <4f3d1bbb-0f21-487e-9230-6b0636d2e019@www.fastmail.com> In-Reply-To: References: <201906242318.x5ONIhlS043523@repo.freebsd.org> <7d119185-32b3-4057-bc4c-ea21d55e6c44@www.fastmail.com> <59d594bc-f129-7c14-64c2-2624de9b76fb@freebsd.org> Date: Wed, 26 Jun 2019 16:47:00 +0000 From: "Dave Cottlehuber" To: "Warner Losh" , "Rebecca Cran" Cc: src-committers , svn-src-all@freebsd.org, scottph@freebsd.org Subject: =?UTF-8?Q?Re:_svn_commit:_r349349_-_in_head/stand:_efi/include_efi/inclu?= =?UTF-8?Q?de/Protocol_efi/libefi_efi/loader_libsa?= Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4BEAC756CE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:47:02 -0000 On Tue, 25 Jun 2019, at 21:37, Warner Losh wrote: >=20 >=20 > On Tue, Jun 25, 2019, 3:29 PM Rebecca Cran wrote: > > On 2019-06-25 11:23, Dave Cottlehuber wrote: > >=20 > > > This fails to identify the partition with a bootable zpool on bot= h a laptop (details > > > in the PR) and also a server (2 zpools), and instead tries to boo= t from the EFI > > > partition where the boot1.efi loader is located (i.e. disk0p1 and= not disk0p2). > > >=20 > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238800 > >=20 > > This doesn't sound related to the EFI HTTP changes, but may be rela= ted > > to some recent changes Warner's made? > >=20 > > Other people have reported problems booting after my changeset thou= gh, > > so I've disconnected the HTTP boot code in r349395. r349404 works for me again - thanks. Please let me know when the next pa= tches for this come on phabricator and I'll test. A+ Dave =E2=80=94 O for a muse of fire, that would ascend the brightest heaven of inventio= n! From owner-svn-src-all@freebsd.org Wed Jun 26 16:56:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6088F15CCE66; Wed, 26 Jun 2019 16:56:57 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05F0375B3A; Wed, 26 Jun 2019 16:56:57 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBDFA27AA; Wed, 26 Jun 2019 16:56:56 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QGuuPI061821; Wed, 26 Jun 2019 16:56:56 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QGuuwS061820; Wed, 26 Jun 2019 16:56:56 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201906261656.x5QGuuwS061820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Wed, 26 Jun 2019 16:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349426 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05F0375B3A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 16:56:57 -0000 Author: cognet Date: Wed Jun 26 16:56:56 2019 New Revision: 349426 URL: https://svnweb.freebsd.org/changeset/base/349426 Log: Fix debugging of 32bits arm binaries on arm64. In set_regs32()/fill_regs32(), we have to get/set SP and LR from/to tf_x[13] and tf_x[14]. set_regs() and fill_regs() may be called for a 32bits process, if the process is ptrace'd from a 64bits debugger. So, in set_regs() and fill_regs(), get or set PC and SPSR from where the debugger expects it, from tf_x[15] and tf_x[16]. Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Jun 26 16:38:46 2019 (r349425) +++ head/sys/arm64/arm64/machdep.c Wed Jun 26 16:56:56 2019 (r349426) @@ -194,6 +194,16 @@ fill_regs(struct thread *td, struct reg *regs) memcpy(regs->x, frame->tf_x, sizeof(regs->x)); +#ifdef COMPAT_FREEBSD32 + /* + * We may be called here for a 32bits process, if we're using a + * 64bits debugger. If so, put PC and SPSR where it expects it. + */ + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + regs->x[15] = frame->tf_elr; + regs->x[16] = frame->tf_spsr; + } +#endif return (0); } @@ -211,6 +221,17 @@ set_regs(struct thread *td, struct reg *regs) memcpy(frame->tf_x, regs->x, sizeof(frame->tf_x)); +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + /* + * We may be called for a 32bits process if we're using + * a 64bits debugger. If so, get PC and SPSR from where + * it put it. + */ + frame->tf_elr = regs->x[15]; + frame->tf_spsr = regs->x[16] & PSR_FLAGS; + } +#endif return (0); } @@ -283,8 +304,9 @@ fill_regs32(struct thread *td, struct reg32 *regs) tf = td->td_frame; for (i = 0; i < 13; i++) regs->r[i] = tf->tf_x[i]; - regs->r_sp = tf->tf_sp; - regs->r_lr = tf->tf_lr; + /* For arm32, SP is r13 and LR is r14 */ + regs->r_sp = tf->tf_x[13]; + regs->r_lr = tf->tf_x[14]; regs->r_pc = tf->tf_elr; regs->r_cpsr = tf->tf_spsr; @@ -300,8 +322,9 @@ set_regs32(struct thread *td, struct reg32 *regs) tf = td->td_frame; for (i = 0; i < 13; i++) tf->tf_x[i] = regs->r[i]; - tf->tf_sp = regs->r_sp; - tf->tf_lr = regs->r_lr; + /* For arm 32, SP is r13 an LR is r14 */ + tf->tf_x[13] = regs->r_sp; + tf->tf_x[14] = regs->r_lr; tf->tf_elr = regs->r_pc; tf->tf_spsr = regs->r_cpsr; From owner-svn-src-all@freebsd.org Wed Jun 26 17:16:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C73C15CD616; Wed, 26 Jun 2019 17:16:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13A197688E; Wed, 26 Jun 2019 17:16:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E28702B4D; Wed, 26 Jun 2019 17:16:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHGQ35071842; Wed, 26 Jun 2019 17:16:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHGQYB071841; Wed, 26 Jun 2019 17:16:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906261716.x5QHGQYB071841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 26 Jun 2019 17:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349427 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 349427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13A197688E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:16:27 -0000 Author: kib Date: Wed Jun 26 17:16:26 2019 New Revision: 349427 URL: https://svnweb.freebsd.org/changeset/base/349427 Log: amd64 pmap: Fix pkru handling in pmap_remove(). When pmap_pkru_on_remove() is called, the sva argument value was advanced. Clear PKRU earlier when sva still specifies the start of the region. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jun 26 16:56:56 2019 (r349426) +++ head/sys/amd64/amd64/pmap.c Wed Jun 26 17:16:26 2019 (r349427) @@ -4998,6 +4998,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t pmap_delayed_invl_start(); PMAP_LOCK(pmap); + pmap_pkru_on_remove(pmap, sva, eva); /* * special handling of removing one page. a very @@ -5091,7 +5092,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t out: if (anyvalid) pmap_invalidate_all(pmap); - pmap_pkru_on_remove(pmap, sva, eva); PMAP_UNLOCK(pmap); pmap_delayed_invl_finish(); vm_page_free_pages_toq(&free, true); From owner-svn-src-all@freebsd.org Wed Jun 26 17:17:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99C8515CD6CC; Wed, 26 Jun 2019 17:17:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B5A876A4D; Wed, 26 Jun 2019 17:17:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1592C2B4F; Wed, 26 Jun 2019 17:17:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHHXTI071927; Wed, 26 Jun 2019 17:17:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHHX3M071926; Wed, 26 Jun 2019 17:17:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906261717.x5QHHX3M071926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 26 Jun 2019 17:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349428 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 349428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B5A876A4D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:17:34 -0000 Author: avg Date: Wed Jun 26 17:17:33 2019 New Revision: 349428 URL: https://svnweb.freebsd.org/changeset/base/349428 Log: owc_gpiobus: clean / fix up the driver module things "fdt" is removed from the driver module name as the driver does not require FDT and can work very well on hints based systems. A module dependency is added for gpiobus. Without that owc cannot resolve symbols in gpiobus if both are loaded as kernel modules. Finally, a driver module module version is added. Reviewed by: imp MFC after: 11 days Modified: head/sys/dev/ow/owc_gpiobus.c Modified: head/sys/dev/ow/owc_gpiobus.c ============================================================================== --- head/sys/dev/ow/owc_gpiobus.c Wed Jun 26 17:16:26 2019 (r349427) +++ head/sys/dev/ow/owc_gpiobus.c Wed Jun 26 17:17:33 2019 (r349428) @@ -416,5 +416,7 @@ static driver_t owc_gpiobus_driver = { sizeof(struct owc_gpiobus_softc), }; -DRIVER_MODULE(owc_gpiobus_fdt, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); -MODULE_DEPEND(owc_gpiobus_fdt, ow, 1, 1, 1); +DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); +MODULE_DEPEND(owc_gpiobust, ow, 1, 1, 1); +MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); +MODULE_VERSION(owc_gpiobus, 1); From owner-svn-src-all@freebsd.org Wed Jun 26 17:21:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D62A715CD947; Wed, 26 Jun 2019 17:21:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D02176CE4; Wed, 26 Jun 2019 17:21:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55E192BA2; Wed, 26 Jun 2019 17:21:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHLVQc073695; Wed, 26 Jun 2019 17:21:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHLVBw073694; Wed, 26 Jun 2019 17:21:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906261721.x5QHLVBw073694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 26 Jun 2019 17:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349429 - releng/11.3/sys/netpfil/ipfw/nat64 X-SVN-Group: releng X-SVN-Commit-Author: ae X-SVN-Commit-Paths: releng/11.3/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 349429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D02176CE4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:21:32 -0000 Author: ae Date: Wed Jun 26 17:21:30 2019 New Revision: 349429 URL: https://svnweb.freebsd.org/changeset/base/349429 Log: Merge from stable/11: Fix the uninitialized use of source IPv6 address in NAT64LSN. This code is already refactored in head/, but due to the missing epoch(9) support it is impossible to merge. So, it is direct commit to stable/11. Reported by: Patrick M. Hausen Tested by: Patrick M. Hausen Approved by: re (kib, gjb) Modified: releng/11.3/sys/netpfil/ipfw/nat64/nat64lsn.c Directory Properties: releng/11.3/ (props changed) Modified: releng/11.3/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- releng/11.3/sys/netpfil/ipfw/nat64/nat64lsn.c Wed Jun 26 17:17:33 2019 (r349428) +++ releng/11.3/sys/netpfil/ipfw/nat64/nat64lsn.c Wed Jun 26 17:21:30 2019 (r349429) @@ -408,6 +408,7 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, const st } else logdata = NULL; + src6 = cfg->base.plat_prefix; nat64_embed_ip4(&src6, cfg->base.plat_plen, htonl(f_id->src_ip)); ret = nat64_do_handle_ip4(*pm, &src6, &nh->addr, lport, &cfg->base, logdata); From owner-svn-src-all@freebsd.org Wed Jun 26 17:28:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C39715CDD1D; Wed, 26 Jun 2019 17:28:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4885577BA2; Wed, 26 Jun 2019 17:28:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07BFF2D13; Wed, 26 Jun 2019 17:28:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHSw1f078854; Wed, 26 Jun 2019 17:28:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHSuNc078844; Wed, 26 Jun 2019 17:28:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906261728.x5QHSuNc078844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 26 Jun 2019 17:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349430 - in stable/12: etc/mtree include share/man/man4 share/man/man9 sys/arm/allwinner sys/arm/conf sys/arm/ti/am335x sys/conf sys/dev/pwm sys/modules sys/modules/allwinner sys/modul... X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12: etc/mtree include share/man/man4 share/man/man9 sys/arm/allwinner sys/arm/conf sys/arm/ti/am335x sys/conf sys/dev/pwm sys/modules sys/modules/allwinner sys/modules/allwinner/aw_pwm sys/m... X-SVN-Commit-Revision: 349430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4885577BA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:28:59 -0000 Author: ian Date: Wed Jun 26 17:28:55 2019 New Revision: 349430 URL: https://svnweb.freebsd.org/changeset/base/349430 Log: MFC r343826, r346698, r349057-r349060, r349073-r349077, r349080-r349086, r349088, r349091-r349097, r349115, r349119, r349130-r349132, r349143-r349145, r349164-r349168, r349174, r349269-r349273 r343826 by yuripv: pwm.8: fix markup in synopsis, add -f description r346698 by manu: arm: allwinner: aw_pwm: compile it as module too r349057: Allow pwm(9) components to be selected individually, while 'device pwm' still includes it all. r349058: In detach(), check for failure of bus_generic_detach(), only release resources if they got allocated (because detach() gets called from attach() to handle various failures), and delete the pwmbus child if it got created. r349059: Don't call pwmbus_attach_bus(), because it may not be present if this driver is compiled into the kernel but pwmbus will be loaded as a module when needed (and because of that, pwmbus_attach_bus() is going away in the near future). Instead, just directly do what that function did: register the fdt xfef handle, and attach the pwmbus. r349060: Handle failure to enable the clock or obtain its frequency. r349073: Do not include pwm.h here, it is purely a userland interface file containing ioctl defintions for the pwmc driver. It is not part of the pwmbus interface. r349074: Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h. The file contains ioctl definitions and related datatypes that allow userland control of pwm hardware via the pwmc device. The new name and location better reflects its assocation with a single device driver. r349075: Remove pwmbus_attach_bus(), it no longer has any callers. Also remove a couple prototypes for functions that never existed (and never will). r349076: Use device_delete_children() instead of a locally-rolled copy of it that leaks the device-list memory. r349077: Add a missing #include. I suspect this used to get included via some header pollution that was cleaned up recently, and this file got missed in the cleanup because it's not attached to the build unless you specifically request this device in a custom kernel config. r349080: Make pwmbus driver and devclass vars static; they're not mentioned in any header file, so they can't be used outside this file anyway. r349081: Unwrap prototype lines so that return type and function name are on the same line. No functional changes. r349082: Spell unsigned int as u_int and channel as chan; eliminates the need to wrap some long lines. r349083: Give the aw_pwm driver a module version. r349084: Rename the channel_max method to channel_count, because that's what it's returning. (If the channel count is 2, then the max channel number is 1.) r349085: Destroy the cdev on device detach. Also, make the driver and devclass static, because nothing outside this file needs them. r349086: Restructure the pwm device hirearchy and interfaces. The pwm and pwmbus interfaces were nearly identical, this merges them into a single pwmbus interface. The pwmbus driver now implements the pwmbus interface by simply passing all calls through to its parent (the hardware driver). The channel_count method moves from pwm to pwmbus, and the get_bus method is deleted (just no longer needed). The net effect is that the interface for doing pwm stuff is now the same regardless of whether you're a child of pwmbus, or some random driver elsewhere in the hierarchy that is bypassing the pwmbus layer and is talking directly to the hardware driver via cross-hierarchy connections established using fdt data. The pwmc driver is now a child of pwmbus, instead of being its sibling (that's why the get_bus method is no longer needed; pwmc now gets the device_t of the bus using device_get_parent()). r349088: Make pwm channel numbers unsigned. r349091: The pwm interface was replaced with pwmbus, include the right header file. r349092: Make channel number unsigned, and spell unsigned int u_int. This should have been part of r349088. r349093: This code no longer uses fdt/ofw stuff, no need to include ofw headers. r349094: Add module makefiles for pwm. r349095: Split the dtb MODULES_EXTRA line to a series of += lines, making it easier to maintain and keep in alphabetical order, and paving the way for adding some other modules that aren't dtb-related. r349096: Add module makefiles for Texas Instruments ARM SoCs. The natural place to look for them based on how other SoCs are organized would be sys/modules/ti, but that's already taken. Drop a clue into modules/ti/Makefile directing people to modules/arm_ti if they're looking for ARM modules. r349097: Build SoC-specific modules with GENERIC for the SoCs that have them. r349115: Rename pwmbus.h to ofw_pwm.h, because after all the recent changes, there is nothing left in the file that related to pwmbus at all. It just contains prototypes for the functions implemented in dev/pwm.ofw_pwm.c, so name it accordingly and fix the include protect wrappers to match. A new pwmbus.h will be coming along in a future commit. r349119: Rework pwmbus and pwmc so that each child will handle a single PWM channel. Previously, there was a pwmc instance for each instance of pwm hardware regardless of how many pwm channels that hardware supported. Now there will be a pwmc instance for each channel when the hardware supports multiple channels. With a separate instance for each channel, we can have "named channels" in userland by making devfs alias entries in /dev/pwm. These changes add support for ivars to pwmbus, and use an ivar to track the channel number for each child. It also adds support for hinted children. In pwmc, the driver checks for a label hint, and if present, it's used to create an alias for the cdev in /dev/pwm. It's not anticipated that hints will be heavily used, but it's easy to do and allows quick ad-hoc creation of named channels from userland by using kenv to create hint.pwmc.N.label= hints. Upcoming changes will add FDT support, and most labels will probably be specified that way. r349130: Add ofw_pwmbus to enumerate pwmbus devices on systems configured with fdt data. Also, add fdt support to pwmc. r349131: Implement the ofw_bus_get_node method in aw_pwm(4) so that ofw_pwmbus can find its metadata for instantiating children. r349132: Add back a const qualifier I somehow fumbled away between test-building and committing recent changes. r349143: Put the pwmc cdev filenames under the pwm directory along with any label names. I.e., everything related to pwm now goes in /dev/pwm. This will make it easier for userland tools to turn an unqualified name into a fully qualified pathname, whether it's the base pwmcX.Y name or a label name. r349144: Follow changes in the pwmc(4) driver in relation to device filenames. The driver now names its cdev nodes pwmcX.Y where X is unit number and Y is the channel within that unit. Change the default device name from pwmc0 to pwmc0.0. The driver now puts cdev files and label aliases in the /dev/pwm directory, so allow the user to provide unqualified names with -f and automatically prepend the /dev/pwm part for them. Update the examples in the manpage to show the new device name format and location within /dev/pwm. r349145: Put periods at the ends of argument descriptions. Explain the relationship between the period and duty arguments. r349164: Remove everything related to channels from the pwmc public interface, now that there is a pwmc(4) instance per channel and the channel number is maintained as a driver ivar rather than being passed in from userland. r349165: Explain the relationship between PWM hardware channels being controlled and pwmc(4) device filenames. Also, use uppercase PWM when the term is being used as an acronym, and expand the acronym where it's first used. r349166: Rearrange the argument checking and processing so that enable and disable can be combined with configuring the period and duty cycle (the same ioctl sets all 3 values at once, so there's no reason to require the user to run the program twice to get all 3 things set). r349167: Oops, it seems I left out the word 'cycle', fix it. r349168: Add a pwmc(4) manpage. r349174: Handle labels specified with hints even on FDT systems. Hints are the easiest thing for a user to control (via loader.conf or kenv+kldload), so handle them in addition to any label specified via the FDT data. r349269: Some mundane tweaks and cleanups to help de-clutter the diffs of some upcoming functional changes. Add an ofw_compat_data table for probing compat strings, and use it to add PNP data. Remove some stray semicolons at the end of macro definitions, and add a PWM_LOCK_ASSERT macro to round out the usual suite. Move the device_t and driver_methods structs to the end of the file. Tweak comments. r349270: Add support for the PWM(9) API. This allows configuring the pwm output using pwm(9), but also maintains the historical sysctl config interface for compatiblity with existing apps. The two config systems are not compatible with each other; if you use both interfaces to change configurations you're likely to end up with incorrect output or none at all. r349271: Catch up with recent changes in pwmbus(9). The pwm(9) and pwmbus(9) interfaces were unified into pwmbus(9), and the PWMBUS_CHANNEL_MAX method was renamed PWMBUS_CHANNEL_COUNT. The pwmbus_attach_bus() function just went away completely. Also, fix a few typos such as s/is/if/. r349272: Do some general cleanup and light wordsmithing. Sort methods alphabetically. Wrap long lines. Start sentences on a new line. Remove contractions (not because it's a good idea, just to silence igor). Add some explanation of the units for the period and duty arguments and the convention for channel numbers. r349273: Add pwm to the armv7 GENERIC kernel, it's now used by TI and Allwinner. Added: stable/12/share/man/man4/pwmc.4 - copied unchanged from r349168, head/share/man/man4/pwmc.4 stable/12/sys/dev/pwm/ofw_pwm.h - copied unchanged from r349115, head/sys/dev/pwm/ofw_pwm.h stable/12/sys/dev/pwm/ofw_pwmbus.c - copied unchanged from r349132, head/sys/dev/pwm/ofw_pwmbus.c stable/12/sys/dev/pwm/pwmc.h - copied, changed from r349074, head/sys/dev/pwm/pwmc.h stable/12/sys/modules/allwinner/aw_pwm/ - copied from r346698, head/sys/modules/allwinner/aw_pwm/ stable/12/sys/modules/arm_ti/ - copied from r349097, head/sys/modules/arm_ti/ stable/12/sys/modules/pwm/ - copied from r349097, head/sys/modules/pwm/ Replaced: stable/12/sys/dev/pwm/pwmbus.h - copied, changed from r349119, head/sys/dev/pwm/pwmbus.h Deleted: stable/12/share/man/man9/pwm.9 stable/12/sys/dev/pwm/pwm_if.m stable/12/sys/sys/pwm.h Modified: stable/12/etc/mtree/BSD.include.dist stable/12/include/Makefile stable/12/share/man/man4/Makefile stable/12/share/man/man9/Makefile stable/12/share/man/man9/pwmbus.9 stable/12/sys/arm/allwinner/aw_pwm.c stable/12/sys/arm/conf/GENERIC stable/12/sys/arm/ti/am335x/am335x_dmtpps.c stable/12/sys/arm/ti/am335x/am335x_ehrpwm.c stable/12/sys/conf/files stable/12/sys/dev/pwm/ofw_pwm.c stable/12/sys/dev/pwm/pwmbus.c stable/12/sys/dev/pwm/pwmbus_if.m stable/12/sys/dev/pwm/pwmc.c stable/12/sys/modules/Makefile stable/12/sys/modules/allwinner/Makefile stable/12/sys/modules/allwinner/aw_pwm/Makefile stable/12/sys/modules/pwm/pwmbus/Makefile stable/12/sys/modules/ti/Makefile stable/12/usr.sbin/pwm/pwm.8 stable/12/usr.sbin/pwm/pwm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/etc/mtree/BSD.include.dist ============================================================================== --- stable/12/etc/mtree/BSD.include.dist Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/etc/mtree/BSD.include.dist Wed Jun 26 17:28:55 2019 (r349430) @@ -152,6 +152,8 @@ .. ppbus .. + pwm + .. smbus .. speaker Modified: stable/12/include/Makefile ============================================================================== --- stable/12/include/Makefile Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/include/Makefile Wed Jun 26 17:28:55 2019 (r349430) @@ -46,8 +46,8 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \ - dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ - dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ + dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ + dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/share/man/man4/Makefile Wed Jun 26 17:28:55 2019 (r349430) @@ -428,6 +428,7 @@ MAN= aac.4 \ pts.4 \ pty.4 \ puc.4 \ + pwmc.4 \ ${_qlxge.4} \ ${_qlxgb.4} \ ${_qlxgbe.4} \ Copied: stable/12/share/man/man4/pwmc.4 (from r349168, head/share/man/man4/pwmc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/pwmc.4 Wed Jun 26 17:28:55 2019 (r349430, copy of r349168, head/share/man/man4/pwmc.4) @@ -0,0 +1,212 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" 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 the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 17, 2019 +.Dt PWMC 4 +.Os +.Sh NAME +.Nm pwmc +.Nd PWM (Pulse Width Modulation) control device driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pwmbus" +.Cd "device pwmc" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +pwmc_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides device-control access to a channel of PWM hardware. +Each instance of a +.Nm +device is associated with a single PWM output channel. +.Pp +Some PWM hardware is organized with multiple channels sharing a +common clock or other resources. +In such cases, a separate +.Nm +instance will exist for each channel, but changing the period or +duty cycle of any one channel may affect other channels within the +hardware which share the same resources. +Consult the documentation for the underlying PWM hardware device driver +for details on channels that share resources. +.Pp +An instance of +.Nm +creates a character device named +.Pa /dev/pwm/pwmcX.Y +where +.Va X +is a sequential number assigned to each PWM hardware controller +as it is discovered by the system, and +.Va Y +is the channel number within that hardware controller. +The driver can be configured to create aliases that point to the +.Pa pwmcX.Y +entries, in effect creating named channels. +.Pp +The +.Nm +driver provides control of a PWM channel with the following +.Xr ioctl 2 +calls and data structures, defined in +.In dev/pwm/pwmc.h : +.Bl -tag -width indent +.It Dv PWMGETSTATE Pq Vt "struct pwm_state" +Retrieve the current state of the channel. +.It Dv PWMSETSTATE Pq Vt "struct pwm_state" +Set the current state of the channel. +All parameters are updated on every call. +To change just one of the values, use +.Dv PWMGETSTATE +to get the current state and then submit the same data back with +just the appropriate value changed. +.El +.Pp +The +.Va pwm_state +structure is defined as follows: +.Bd -literal +struct pwm_state { + u_int period; + u_int duty; + uint32_t flags; + bool enable; +}; +.Ed +.Pp +.Bl -tag -width period +.It Va period +The duration, in nanoseconds, of one complete on-off cycle. +.It Va duty +The duration, in nanoseconds, of the on portion of one cycle. +.It Va flags +Flags that affect the output signal can be bitwise-ORed together. +The following flags are currently defined: +.Pp +.Bl -tag -width PWM_POLARITY_INVERTED -compact +.It Dv PWM_POLARITY_INVERTED +Invert the signal polarity. +.El +.It Va enable +.Va +False to disable the output signal or true to enable it. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.pwmc.%d.at +The pwmbus instance the +.Nm +instance is attached to. +.It Va hint.pwmc.%d.channel +The hardware channel number the instance is attached to. +Channel numbers count up from zero. +.It Va hint.pwmc.%d.label +If this optional hint is set, the driver creates an alias in +.Pa /dev/pwm +with the given name, which points to the instance. +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, a +.Nm +device is described with a child node of the pwm hardware controller node. +When the hardware supports multiple channels within the controller, it is +not necessary to include a +.Nm +child node for every channel the hardware supports. +Define only the channels you need to control. +.Pp +The following properties are required for a +.Nm +device node: +.Bl -tag -width indent +.It Va compatible +Must be the string "freebsd,pwmc". +.It Va reg +The hardware channel number. +.El +.Pp +The following properties are optional for the +.Nm +device node: +.Bl -tag -width indent +.It Va label +A string containing only characters legal in a file name. +The driver creates an alias with the given name in +.Pa /dev/pwm +which points to the instance's +.Pa /dev/pwm/pwmcX.Y +device entry. +.El +.Pp +Example of a PWM hardware node containing one +.Nm +child node: +.Bd -literal +&ehrpwm0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&ehrpwm0_AB_pins>; + + pwmcontrol@0 { + compatible = "freebsd,pwmc"; + reg = <0>; + label = "backlight"; + }; +}; +.Ed +.Sh FILES +.Bl -tag -width -compact +.It Pa /dev/pwm/pwmc* +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr device.hints 5 , +.Xr pwm 8 , +.Xr pwm 9 +.Sh HISTORY +The +.Nm +driver +appeared in +.Fx 13.0 . Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/share/man/man9/Makefile Wed Jun 26 17:28:55 2019 (r349430) @@ -269,7 +269,6 @@ MAN= accept_filter.9 \ proc_rwmem.9 \ pseudofs.9 \ psignal.9 \ - pwm.9 \ pwmbus.9 \ random.9 \ random_harvest.9 \ @@ -1671,6 +1670,7 @@ MLINKS+=proc_rwmem.9 proc_readmem.9 \ MLINKS+=psignal.9 gsignal.9 \ psignal.9 pgsignal.9 \ psignal.9 tdsignal.9 +MLINKS+=pwmbus.9 pwm.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 read_random.9 \ Modified: stable/12/share/man/man9/pwmbus.9 ============================================================================== --- stable/12/share/man/man9/pwmbus.9 Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/share/man/man9/pwmbus.9 Wed Jun 26 17:28:55 2019 (r349430) @@ -22,70 +22,85 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd June 21, 2019 .Dt PWMBUS 9 .Os .Sh NAME .Nm pwmbus , -.Nm pwmbus_attach_bus , -.Nm PWMBUS_GET_BUS , .Nm PWMBUS_CHANNEL_CONFIG , +.Nm PWMBUS_CHANNEL_COUNT , +.Nm PWMBUS_CHANNEL_ENABLE , .Nm PWMBUS_CHANNEL_GET_CONFIG , -.Nm PWMBUS_CHANNEL_SET_FLAGS , .Nm PWMBUS_CHANNEL_GET_FLAGS , -.Nm PWMBUS_CHANNEL_ENABLE , .Nm PWMBUS_CHANNEL_IS_ENABLED , -.Nm PWMBUS_CHANNEL_MAX +.Nm PWMBUS_CHANNEL_SET_FLAGS , +.Nm PWMBUS_GET_BUS .Nd PWMBUS methods .Sh SYNOPSIS .Cd "device pwm" .In "pwmbus_if.h" -.Ft device_t -.Fn pwmbus_attach_bus "device_t dev" .Ft int .Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" .Ft int -.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" .Ft int -.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" .Ft int +.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.Ft int .Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" .Ft int -.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" -.Ft int .Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enabled" .Ft int -.Fn PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" +.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" .Sh DESCRIPTION -The PWMBUS (Pulse-Width Modulation) interface allows the device driver to register to a global -bus so other devices in the kernel can use them in a generic way +The PWMBUS (Pulse-Width Modulation) interface allows a device driver to +register to a global bus so other devices in the kernel can use them in a +generic way. +.Pp +For all +.Nm +methods, the +.Va period +argument is the duration in nanoseconds of one complete on-off cycle, and the +.Va duty +argument is the duration in nanoseconds of the on portion of that cycle. +.Pp +Some PWM hardware is organized as a single controller with multiple channels. +Channel numbers count up from zero. +When multiple channels are present, they sometimes share a common clock or +other resources. +In such cases, changing the period or duty cycle of any one channel may affect +other channels within the hardware which share the same resources. +Consult the documentation for the underlying PWM hardware device driver for +details on channels that share resources. .Sh INTERFACE .Bl -tag -width indent -.It Fn pwmbus_attach_bus "device_t dev" -Attach the -.Nm pwmbus -to the device driver .It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" -Configure the period and duty (in nanoseconds) in the PWM controller on the bus for the specified channel. +Configure the period and duty (in nanoseconds) in the PWM controller on the bus +for the specified channel. Returns 0 on success or .Er EINVAL -is the values are not supported by the controller or +if the values are not supported by the controller or .Er EBUSY -is the PWMBUS controller is in use and doesn't support changing the value on the fly. +if the PWMBUS controller is in use and does not support changing the value on +the fly. +.It Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int *nchannel" +Get the number of channels supported by the controller. +.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +Enable the PWM channel. .It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" Get the current configuration of the period and duty for the specified channel. -.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" -Set the flags of the channel (like inverted polarity), if the driver or controller -doesn't support this a default method is used. .It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" -Get the current flags for the channel, if the driver or controller -doesn't support this, a default method is used. -.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" -Enable the PWM channel. -.It Fn PWMBUS_CHANNEL_ISENABLED "device_t bus" "int channel" "bool *enable" -Test if the PWM channel is enabled. -.It PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" -Get the maximum number of channel supported by the controller. +Get the current flags for the channel. +If the driver or controller +does not support this, a default method returns a flags value of zero. +.It Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enable" +Test whether the PWM channel is enabled. +.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +Set the flags of the channel (such as inverted polarity). +If the driver or controller does not support this a do-nothing default method +is used. .El .Sh HISTORY The Modified: stable/12/sys/arm/allwinner/aw_pwm.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_pwm.c Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/sys/arm/allwinner/aw_pwm.c Wed Jun 26 17:28:55 2019 (r349430) @@ -44,10 +44,8 @@ __FBSDID("$FreeBSD$"); #include -#include +#include "pwmbus_if.h" -#include "pwm_if.h" - #define AW_PWM_CTRL 0x00 #define AW_PWM_CTRL_PRESCALE_MASK 0xF #define AW_PWM_CTRL_EN (1 << 4) @@ -138,6 +136,7 @@ aw_pwm_attach(device_t dev) struct aw_pwm_softc *sc; uint64_t clk_freq; uint32_t reg; + phandle_t node; int error; sc = device_get_softc(dev); @@ -149,8 +148,16 @@ aw_pwm_attach(device_t dev) goto fail; } error = clk_enable(sc->clk); + if (error != 0) { + device_printf(dev, "cannot enable clock\n"); + goto fail; + } error = clk_get_freq(sc->clk, &sc->clk_freq); + if (error != 0) { + device_printf(dev, "cannot get clock frequency\n"); + goto fail; + } if (bus_alloc_resources(dev, aw_pwm_spec, &sc->res) != 0) { device_printf(dev, "cannot allocate resources for device\n"); @@ -158,9 +165,6 @@ aw_pwm_attach(device_t dev) goto fail; } - if ((sc->busdev = pwmbus_attach_bus(dev)) == NULL) - device_printf(dev, "Cannot attach pwm bus\n"); - /* Read the configuration left by U-Boot */ reg = AW_PWM_READ(sc, AW_PWM_CTRL); if (reg & (AW_PWM_CTRL_GATE | AW_PWM_CTRL_EN)) @@ -170,7 +174,7 @@ aw_pwm_attach(device_t dev) reg &= AW_PWM_CTRL_PRESCALE_MASK; if (reg > nitems(aw_pwm_clk_prescaler)) { device_printf(dev, "Bad prescaler %x, cannot guess current settings\n", reg); - goto out; + goto skipcfg; } clk_freq = sc->clk_freq / aw_pwm_clk_prescaler[reg]; @@ -180,9 +184,18 @@ aw_pwm_attach(device_t dev) sc->duty = NS_PER_SEC / (clk_freq / ((reg >> AW_PWM_PERIOD_ACTIVE_SHIFT) & AW_PWM_PERIOD_ACTIVE_MASK)); -out: - return (0); +skipcfg: + /* + * Note that we don't check for failure to attach pwmbus -- even without + * it we can still service clients who connect via fdt xref data. + */ + node = ofw_bus_get_node(dev); + OF_device_register_xref(OF_xref_from_node(node), dev); + sc->busdev = device_add_child(dev, "pwmbus", -1); + + return (bus_generic_attach(dev)); + fail: aw_pwm_detach(dev); return (error); @@ -192,18 +205,37 @@ static int aw_pwm_detach(device_t dev) { struct aw_pwm_softc *sc; + int error; sc = device_get_softc(dev); - bus_generic_detach(sc->dev); + if ((error = bus_generic_detach(sc->dev)) != 0) { + device_printf(sc->dev, "cannot detach child devices\n"); + return (error); + } - bus_release_resources(dev, aw_pwm_spec, &sc->res); + if (sc->busdev != NULL) + device_delete_child(dev, sc->busdev); + if (sc->res != NULL) + bus_release_resources(dev, aw_pwm_spec, &sc->res); + return (0); } +static phandle_t +aw_pwm_get_node(device_t bus, device_t dev) +{ + + /* + * Share our controller node with our pwmbus child; it instantiates + * devices by walking the children contained within our node. + */ + return ofw_bus_get_node(bus); +} + static int -aw_pwm_channel_max(device_t dev, int *nchannel) +aw_pwm_channel_count(device_t dev, u_int *nchannel) { *nchannel = 1; @@ -212,7 +244,7 @@ aw_pwm_channel_max(device_t dev, int *nchannel) } static int -aw_pwm_channel_config(device_t dev, int channel, unsigned int period, unsigned int duty) +aw_pwm_channel_config(device_t dev, u_int channel, u_int period, u_int duty) { struct aw_pwm_softc *sc; uint64_t period_freq, duty_freq; @@ -275,7 +307,7 @@ aw_pwm_channel_config(device_t dev, int channel, unsig } static int -aw_pwm_channel_get_config(device_t dev, int channel, unsigned int *period, unsigned int *duty) +aw_pwm_channel_get_config(device_t dev, u_int channel, u_int *period, u_int *duty) { struct aw_pwm_softc *sc; @@ -288,7 +320,7 @@ aw_pwm_channel_get_config(device_t dev, int channel, u } static int -aw_pwm_channel_enable(device_t dev, int channel, bool enable) +aw_pwm_channel_enable(device_t dev, u_int channel, bool enable) { struct aw_pwm_softc *sc; uint32_t reg; @@ -312,7 +344,7 @@ aw_pwm_channel_enable(device_t dev, int channel, bool } static int -aw_pwm_channel_is_enabled(device_t dev, int channel, bool *enabled) +aw_pwm_channel_is_enabled(device_t dev, u_int channel, bool *enabled) { struct aw_pwm_softc *sc; @@ -323,29 +355,22 @@ aw_pwm_channel_is_enabled(device_t dev, int channel, b return (0); } -static device_t -aw_pwm_get_bus(device_t dev) -{ - struct aw_pwm_softc *sc; - - sc = device_get_softc(dev); - - return (sc->busdev); -} static device_method_t aw_pwm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, aw_pwm_probe), DEVMETHOD(device_attach, aw_pwm_attach), DEVMETHOD(device_detach, aw_pwm_detach), - /* pwm interface */ - DEVMETHOD(pwm_get_bus, aw_pwm_get_bus), - DEVMETHOD(pwm_channel_max, aw_pwm_channel_max), - DEVMETHOD(pwm_channel_config, aw_pwm_channel_config), - DEVMETHOD(pwm_channel_get_config, aw_pwm_channel_get_config), - DEVMETHOD(pwm_channel_enable, aw_pwm_channel_enable), - DEVMETHOD(pwm_channel_is_enabled, aw_pwm_channel_is_enabled), + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, aw_pwm_get_node), + /* pwmbus interface */ + DEVMETHOD(pwmbus_channel_count, aw_pwm_channel_count), + DEVMETHOD(pwmbus_channel_config, aw_pwm_channel_config), + DEVMETHOD(pwmbus_channel_get_config, aw_pwm_channel_get_config), + DEVMETHOD(pwmbus_channel_enable, aw_pwm_channel_enable), + DEVMETHOD(pwmbus_channel_is_enabled, aw_pwm_channel_is_enabled), + DEVMETHOD_END }; @@ -358,4 +383,5 @@ static driver_t aw_pwm_driver = { static devclass_t aw_pwm_devclass; DRIVER_MODULE(aw_pwm, simplebus, aw_pwm_driver, aw_pwm_devclass, 0, 0); +MODULE_VERSION(aw_pwm, 1); SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/arm/conf/GENERIC ============================================================================== --- stable/12/sys/arm/conf/GENERIC Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/sys/arm/conf/GENERIC Wed Jun 26 17:28:55 2019 (r349430) @@ -174,6 +174,9 @@ device ti_spi # ADC support device ti_adc +# PWM +device pwm + # Watchdog support # If we don't enable the watchdog driver, the BealeBone could potentially # reboot automatically because the boot loader might have enabled the @@ -266,4 +269,16 @@ device imx6_snvs # On-chip RTC # Flattened Device Tree options FDT # Configure using FDT/DTB data -makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/imx6 dtb/nvidia dtb/rpi dtb/zynq dtb/omap4" +makeoptions MODULES_EXTRA+="dtb/allwinner" +makeoptions MODULES_EXTRA+="dtb/am335x" +makeoptions MODULES_EXTRA+="dtb/imx6" +makeoptions MODULES_EXTRA+="dtb/nvidia" +makeoptions MODULES_EXTRA+="dtb/omap4" +makeoptions MODULES_EXTRA+="dtb/rpi" +makeoptions MODULES_EXTRA+="dtb/zynq" + +# SOC-specific modules +makeoptions MODULES_EXTRA+="allwinner" +makeoptions MODULES_EXTRA+="arm_ti" +makeoptions MODULES_EXTRA+="imx" + Modified: stable/12/sys/arm/ti/am335x/am335x_dmtpps.c ============================================================================== --- stable/12/sys/arm/ti/am335x/am335x_dmtpps.c Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/sys/arm/ti/am335x/am335x_dmtpps.c Wed Jun 26 17:28:55 2019 (r349430) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/12/sys/arm/ti/am335x/am335x_ehrpwm.c ============================================================================== --- stable/12/sys/arm/ti/am335x/am335x_ehrpwm.c Wed Jun 26 17:21:30 2019 (r349429) +++ stable/12/sys/arm/ti/am335x/am335x_ehrpwm.c Wed Jun 26 17:28:55 2019 (r349430) @@ -45,21 +45,43 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pwmbus_if.h" + #include "am335x_pwm.h" +/******************************************************************************* + * Enhanced resolution PWM driver. Many of the advanced featues of the hardware + * are not supported by this driver. What is implemented here is simple + * variable-duty-cycle PWM output. + * + * Note that this driver was historically configured using a set of sysctl + * variables/procs, and later gained support for the PWM(9) API. The sysctl + * code is still present to support existing apps, but that interface is + * considered deprecated. + * + * An important caveat is that the original sysctl interface and the new PWM API + * cannot both be used at once. If both interfaces are used to change + * configuration, it's quite likely you won't get the expected results. Also, + * reading the sysctl values after configuring via PWM will not return the right + * results. + ******************************************************************************/ + /* In ticks */ #define DEFAULT_PWM_PERIOD 1000 #define PWM_CLOCK 100000000UL +#define NS_PER_SEC 1000000000 + #define PWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define PWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define PWM_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) #define PWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ device_get_nameunit(_sc->sc_dev), "am335x_ehrpwm softc", MTX_DEF) #define PWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) -#define EPWM_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res, reg); +#define EPWM_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res, reg) #define EPWM_WRITE2(_sc, reg, value) \ - bus_write_2((_sc)->sc_mem_res, reg, value); + bus_write_2((_sc)->sc_mem_res, reg, value) #define EPWM_TBCTL 0x00 #define TBCTL_FREERUN (2 << 14) @@ -119,6 +141,11 @@ __FBSDID("$FreeBSD$"); #define AQCTL_ZRO_TOGGLE (3 << 0) #define EPWM_AQSFRC 0x1a #define EPWM_AQCSFRC 0x1c +#define AQCSFRC_OFF 0 +#define AQCSFRC_LO 1 +#define AQCSFRC_HI 2 +#define AQCSFRC_MASK 3 +#define AQCSFRC(chan, hilo) ((hilo) << (2 * chan)) /* Trip-Zone module */ #define EPWM_TZCTL 0x28 @@ -135,12 +162,21 @@ static device_detach_t am335x_ehrpwm_detach; static int am335x_ehrpwm_clkdiv[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }; +struct ehrpwm_channel { + u_int duty; /* on duration, in ns */ + bool enabled; /* channel enabled? */ + bool inverted; /* signal inverted? */ +}; +#define NUM_CHANNELS 2 + struct am335x_ehrpwm_softc { device_t sc_dev; + device_t sc_busdev; struct mtx sc_mtx; struct resource *sc_mem_res; int sc_mem_rid; - /* sysctl for configuration */ + + /* Things used for configuration via sysctl [deprecated]. */ int sc_pwm_clkdiv; int sc_pwm_freq; struct sysctl_oid *sc_clkdiv_oid; @@ -151,25 +187,132 @@ struct am335x_ehrpwm_softc { uint32_t sc_pwm_period; uint32_t sc_pwm_dutyA; uint32_t sc_pwm_dutyB; -}; -static device_method_t am335x_ehrpwm_methods[] = { - DEVMETHOD(device_probe, am335x_ehrpwm_probe), - DEVMETHOD(device_attach, am335x_ehrpwm_attach), - DEVMETHOD(device_detach, am335x_ehrpwm_detach), - - DEVMETHOD_END + /* Things used for configuration via pwm(9) api. */ + u_int sc_clkfreq; /* frequency in Hz */ + u_int sc_clktick; /* duration in ns */ + u_int sc_period; /* duration in ns */ + struct ehrpwm_channel sc_channels[NUM_CHANNELS]; }; -static driver_t am335x_ehrpwm_driver = { - "am335x_ehrpwm", - am335x_ehrpwm_methods, - sizeof(struct am335x_ehrpwm_softc), +static struct ofw_compat_data compat_data[] = { + {"ti,am33xx-ehrpwm", true}, + {NULL, false}, }; +SIMPLEBUS_PNP_INFO(compat_data); -static devclass_t am335x_ehrpwm_devclass; +static void +am335x_ehrpwm_cfg_duty(struct am335x_ehrpwm_softc *sc, u_int chan, u_int duty) +{ + u_int tbcmp; + if (duty == 0) + tbcmp = 0; + else + tbcmp = max(1, duty / sc->sc_clktick); + + sc->sc_channels[chan].duty = tbcmp * sc->sc_clktick; + + PWM_LOCK_ASSERT(sc); + EPWM_WRITE2(sc, (chan == 0) ? EPWM_CMPA : EPWM_CMPB, tbcmp); +} + static void +am335x_ehrpwm_cfg_enable(struct am335x_ehrpwm_softc *sc, u_int chan, bool enable) +{ + uint16_t regval; + + sc->sc_channels[chan].enabled = enable; + + /* + * Turn off any existing software-force of the channel, then force + * it in the right direction (high or low) if it's not being enabled. + */ + PWM_LOCK_ASSERT(sc); + regval = EPWM_READ2(sc, EPWM_AQCSFRC); + regval &= ~AQCSFRC(chan, AQCSFRC_MASK); + if (!sc->sc_channels[chan].enabled) { + if (sc->sc_channels[chan].inverted) + regval |= AQCSFRC(chan, AQCSFRC_HI); + else + regval |= AQCSFRC(chan, AQCSFRC_LO); + } + EPWM_WRITE2(sc, EPWM_AQCSFRC, regval); +} + +static bool +am335x_ehrpwm_cfg_period(struct am335x_ehrpwm_softc *sc, u_int period) +{ + uint16_t regval; + u_int clkdiv, hspclkdiv, pwmclk, pwmtick, tbprd; + + /* Can't do a period shorter than 2 clock ticks. */ + if (period < 2 * NS_PER_SEC / PWM_CLOCK) { + sc->sc_clkfreq = 0; + sc->sc_clktick = 0; + sc->sc_period = 0; + return (false); + } + + /* + * Figure out how much we have to divide down the base 100MHz clock so + * that we can express the requested period as a 16-bit tick count. + */ + tbprd = 0; + for (clkdiv = 0; clkdiv < 8; ++clkdiv) { + const u_int cd = 1 << clkdiv; + for (hspclkdiv = 0; hspclkdiv < 8; ++hspclkdiv) { + const u_int cdhs = max(1, hspclkdiv * 2); + pwmclk = PWM_CLOCK / (cd * cdhs); + pwmtick = NS_PER_SEC / pwmclk; + if (period / pwmtick < 65536) { + tbprd = period / pwmtick; + break; + } + } + if (tbprd != 0) + break; + } + + /* Handle requested period too long for available clock divisors. */ + if (tbprd == 0) + return (false); + + /* + * If anything has changed from the current settings, reprogram the + * clock divisors and period register. + */ + if (sc->sc_clkfreq != pwmclk || sc->sc_clktick != pwmtick || + sc->sc_period != tbprd * pwmtick) { + + sc->sc_clkfreq = pwmclk; + sc->sc_clktick = pwmtick; + sc->sc_period = tbprd * pwmtick; + + PWM_LOCK_ASSERT(sc); + regval = EPWM_READ2(sc, EPWM_TBCTL); + regval &= ~(TBCTL_CLKDIV_MASK | TBCTL_HSPCLKDIV_MASK); + regval |= TBCTL_CLKDIV(clkdiv) | TBCTL_HSPCLKDIV(hspclkdiv); + EPWM_WRITE2(sc, EPWM_TBCTL, regval); + EPWM_WRITE2(sc, EPWM_TBPRD, tbprd - 1); +#if 0 + device_printf(sc->sc_dev, "clkdiv %u hspclkdiv %u tbprd %u " + "clkfreq %u Hz clktick %u ns period got %u requested %u\n", + clkdiv, hspclkdiv, tbprd - 1, + sc->sc_clkfreq, sc->sc_clktick, sc->sc_period, period); +#endif + /* + * If the period changed, that invalidates the current CMP + * registers (duty values), just zero them out. + */ + am335x_ehrpwm_cfg_duty(sc, 0, 0); + am335x_ehrpwm_cfg_duty(sc, 1, 0); + } + + return (true); +} + +static void am335x_ehrpwm_freq(struct am335x_ehrpwm_softc *sc) { int clkdiv; @@ -331,13 +474,89 @@ am335x_ehrpwm_sysctl_period(SYSCTL_HANDLER_ARGS) } static int +am335x_ehrpwm_channel_count(device_t dev, u_int *nchannel) +{ + + *nchannel = NUM_CHANNELS; + + return (0); +} + +static int +am335x_ehrpwm_channel_config(device_t dev, u_int channel, u_int period, u_int duty) +{ + struct am335x_ehrpwm_softc *sc; + bool status; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + PWM_LOCK(sc); + status = am335x_ehrpwm_cfg_period(sc, period); + if (status) + am335x_ehrpwm_cfg_duty(sc, channel, duty); + PWM_UNLOCK(sc); + + return (status ? 0 : EINVAL); +} + +static int +am335x_ehrpwm_channel_get_config(device_t dev, u_int channel, + u_int *period, u_int *duty) +{ + struct am335x_ehrpwm_softc *sc; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + *period = sc->sc_period; + *duty = sc->sc_channels[channel].duty; + return (0); +} + +static int +am335x_ehrpwm_channel_enable(device_t dev, u_int channel, bool enable) +{ + struct am335x_ehrpwm_softc *sc; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + PWM_LOCK(sc); + am335x_ehrpwm_cfg_enable(sc, channel, enable); + PWM_UNLOCK(sc); + + return (0); +} + +static int +am335x_ehrpwm_channel_is_enabled(device_t dev, u_int channel, bool *enabled) +{ + struct am335x_ehrpwm_softc *sc; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + *enabled = sc->sc_channels[channel].enabled; + + return (0); +} + +static int am335x_ehrpwm_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "ti,am33xx-ehrpwm")) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "AM335x EHRPWM"); @@ -365,7 +584,7 @@ am335x_ehrpwm_attach(device_t dev) goto fail; } - /* Init backlight interface */ + /* Init sysctl interface */ ctx = device_get_sysctl_ctx(sc->sc_dev); tree = device_get_sysctl_tree(sc->sc_dev); @@ -414,7 +633,13 @@ am335x_ehrpwm_attach(device_t dev) EPWM_WRITE2(sc, EPWM_TZCTL, 0xf); reg = EPWM_READ2(sc, EPWM_TZFLG); - return (0); + if ((sc->sc_busdev = device_add_child(dev, "pwmbus", -1)) == NULL) { + device_printf(dev, "Cannot add child pwmbus\n"); + // This driver can still do things even without the bus child. + } + + bus_generic_probe(dev); + return (bus_generic_attach(dev)); fail: PWM_LOCK_DESTROY(sc); if (sc->sc_mem_res) @@ -428,13 +653,22 @@ static int am335x_ehrpwm_detach(device_t dev) { struct am335x_ehrpwm_softc *sc; + int error; sc = device_get_softc(dev); + if ((error = bus_generic_detach(sc->sc_dev)) != 0) + return (error); + PWM_LOCK(sc); + + if (sc->sc_busdev != NULL) + device_delete_child(dev, sc->sc_busdev); + if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, sc->sc_mem_res); + PWM_UNLOCK(sc); PWM_LOCK_DESTROY(sc); @@ -442,6 +676,44 @@ am335x_ehrpwm_detach(device_t dev) return (0); } +static phandle_t *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 26 17:31:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7540115CDF39 for ; Wed, 26 Jun 2019 17:31:32 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8B5377EFE for ; Wed, 26 Jun 2019 17:31:31 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1561570290; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Zh6J3GYJDd7c3tSivezJskX7RYCdwiP2cBELZKu3IZN3XHVDlrqMgtEyR0oqdISeUC3OsfHnE7bzP OgsDel+pZ8oPXWiE8yw8NBk42U0o/18vf8KiQA21d53Ox3OlLr8RWZTCobausIKF6f32+VErRamXfY IlpcisL1SMDlfjLEXzu5g6LoMkHBla681u1Eacqj1Ymkp5C3u6BqDsuwL5TesxQ7WeG1i+F0X/r9sa 38bq6gXmkduIWxV4AeuDdcW+pAxm1SUh1sZ0VY5z1i/waIBuyM39iGo4Fc/AtfRvPx6zkSxxyDYg3K AJXFQjoiWUrY7XskV5dZsFUEzqh4fbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=u8VcAzL5MhLbY0FdEr+GQwR9l0WvLyAWqJe/OWVYTCo=; b=SMyNiIG+v1xK3BoCXTzZ04R6FJToffypYZk6rwnNVsEvXIhNDHGxd01TjpBNqztYkzFAakskGO4xD MJU8X4o0U+wcEM3aoLq1i7aol40U8cZY4MjHlYc/gg5X2nJ31UYWBKDZlrKPvRxEKEb3H6j1tvsn9J hcAzwo7jp6Rt8oJWbyQIoZ+7eR1o5jdJt5pD4OKrsqBG7rd2EQvVcTx3n54WeD0D5iUF/YGr/wu/m3 u7TF0uJvEenMpeGZ+dRUNk+r9TcxNEcHhRB8HHlb7RP7yKyP8wK1tZGkfMb1o0tKbkhwRVJJg8k7Fl mJznnNawjvCh/AJTHR9gaY8+g5BIiFQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=u8VcAzL5MhLbY0FdEr+GQwR9l0WvLyAWqJe/OWVYTCo=; b=D2jJ3peFpV81UTnAVJibHvcJrxiANiCvq5ZxeU/Y04KvynPUViCWWSdaRzUKZ0tmgu7Xy47zVGyqV r3h49Ti8YKDOj3ikz0XtWN1FwJuFUYrr9ixfcBYh/GxNV1QcQMlNKDoKALwm9Xe0gmgMoufxHNuNxW MqFJfgZG69CB0oh0qeblhuIQ9BoDNHnTPXChRdlkqG2ynNk1lLl9spd/o4A4XLMBZPNb4ikVXeBZzz LHlpmBFs/Iy1ZcOXw56VxsP1zGMRNcepDNouVSZ8EpsUrHiiSkEKMbVBnalKLtOp0gKqye7zabwg6G v2E5k/ZzEWBzlpxG0KP8yVph1PqeUDw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 3a11b609-9838-11e9-a4fc-d9033e875444 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 3a11b609-9838-11e9-a4fc-d9033e875444; Wed, 26 Jun 2019 17:31:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x5QHVQGR051566; Wed, 26 Jun 2019 11:31:26 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <5b434ce0f1123b3a569c486c4365a8481cb16ccc.camel@freebsd.org> Subject: Re: svn commit: r349428 - head/sys/dev/ow From: Ian Lepore To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 26 Jun 2019 11:31:26 -0600 In-Reply-To: <201906261717.x5QHHX3M071926@repo.freebsd.org> References: <201906261717.x5QHHX3M071926@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E8B5377EFE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:31:32 -0000 On Wed, 2019-06-26 at 17:17 +0000, Andriy Gapon wrote: > +MODULE_DEPEND(owc_gpiobust, ow, 1, 1, 1); Looks like a typo there. -- Ian From owner-svn-src-all@freebsd.org Wed Jun 26 17:36:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06A7715CE034; Wed, 26 Jun 2019 17:36:39 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49B94802B0; Wed, 26 Jun 2019 17:36:38 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f173.google.com with SMTP id p17so3093965ljg.1; Wed, 26 Jun 2019 10:36:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=fDbyjenVSIolg/Tf6dkl7wW5UsJCphOegPVc99WOqaU=; b=ev9LgjCxlZ1MGu3sHpCqqXDvG1TKrSi50nlGEhv4Zja95WB8iRmw7NkMgbABYn7zEM NaWXEy3rw+9QZvgeFTe5aUseEvnRXZSx5dkA9VPWZOUIvMP+jIT1K+gpGQl6q5oLWRJz kaDGSyah3h4kh3ka6VKlYNxKYh/sK1JDJNn7lv1cRdnfb7PIRLqI7Z3RuJuhcdJZosp2 3Ne8sseOsPfcxlKWhJmKQEeKSCMztbL5qo5jU5qt8yi5mlFs0vjxJU1EtzFXqXWHMZa0 64A2Mefr0Z1/pGJeauh6DEFk3Ec5pkuo+VoNER/rqAbJTdrxXZUH5vYFTDwD6Cm/aYaF D9rQ== X-Gm-Message-State: APjAAAWKMI2e3oH0OR0/R9ybq12LLHIJNj7fx4KtlkAtc27KKfALl4Tq iPUelILKWWtA+nQHBWNSiOEDyiXHEAQ= X-Google-Smtp-Source: APXvYqxmnbY1uz0fF+OgZtbeb6JGxALXLR+xUqyCYRHY+6wnkm6SAk5IVT0/NCT6ayirXSYzDQ5Law== X-Received: by 2002:a2e:81c4:: with SMTP id s4mr3634330ljg.182.1561570591117; Wed, 26 Jun 2019 10:36:31 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 20sm2900279ljf.21.2019.06.26.10.36.29 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2019 10:36:30 -0700 (PDT) Subject: Re: svn commit: r349428 - head/sys/dev/ow To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906261717.x5QHHX3M071926@repo.freebsd.org> <5b434ce0f1123b3a569c486c4365a8481cb16ccc.camel@freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <37f2825a-5754-2f30-89a8-2e8d6d8d6866@FreeBSD.org> Date: Wed, 26 Jun 2019 20:36:29 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <5b434ce0f1123b3a569c486c4365a8481cb16ccc.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49B94802B0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:36:39 -0000 On 26/06/2019 20:31, Ian Lepore wrote: > On Wed, 2019-06-26 at 17:17 +0000, Andriy Gapon wrote: >> +MODULE_DEPEND(owc_gpiobust, ow, 1, 1, 1); > > Looks like a typo there. Busted! Thank you! -- Andriy Gapon From owner-svn-src-all@freebsd.org Wed Jun 26 17:37:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FE2F15CE0CF; Wed, 26 Jun 2019 17:37:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED7CA80442; Wed, 26 Jun 2019 17:37:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD4832EB4; Wed, 26 Jun 2019 17:37:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHbqVo084430; Wed, 26 Jun 2019 17:37:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHbp8J084423; Wed, 26 Jun 2019 17:37:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261737.x5QHbp8J084423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 17:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349432 - in head/sys: amd64/sgx dev/drm2/ttm vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/sgx dev/drm2/ttm vm X-SVN-Commit-Revision: 349432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED7CA80442 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:37:53 -0000 Author: markj Date: Wed Jun 26 17:37:51 2019 New Revision: 349432 URL: https://svnweb.freebsd.org/changeset/base/349432 Log: Add a return value to vm_page_remove(). Use it to indicate whether the page may be safely freed following its removal from the object. Also change vm_page_remove() to assume that the page's object pointer is non-NULL, and have callers perform this check instead. This is a step towards an implementation of an atomic reference counter for each physical page structure. Reviewed by: alc, dougm, kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20758 Modified: head/sys/amd64/sgx/sgx.c head/sys/dev/drm2/ttm/ttm_bo_vm.c head/sys/vm/device_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/amd64/sgx/sgx.c ============================================================================== --- head/sys/amd64/sgx/sgx.c Wed Jun 26 17:32:31 2019 (r349431) +++ head/sys/amd64/sgx/sgx.c Wed Jun 26 17:37:51 2019 (r349432) @@ -358,7 +358,7 @@ sgx_page_remove(struct sgx_softc *sc, vm_page_t p) uint64_t offs; vm_page_lock(p); - vm_page_remove(p); + (void)vm_page_remove(p); vm_page_unlock(p); dprintf("%s: p->pidx %ld\n", __func__, p->pindex); Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Jun 26 17:32:31 2019 (r349431) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Jun 26 17:37:51 2019 (r349432) @@ -115,7 +115,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_ooffset_t offse vm_object_pip_add(vm_obj, 1); if (*mres != NULL) { vm_page_lock(*mres); - vm_page_remove(*mres); + (void)vm_page_remove(*mres); vm_page_unlock(*mres); } retry: Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Wed Jun 26 17:32:31 2019 (r349431) +++ head/sys/vm/device_pager.c Wed Jun 26 17:37:51 2019 (r349432) @@ -236,7 +236,7 @@ cdev_pager_free_page(vm_object_t object, vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("unmanaged %p", m)); pmap_remove_all(m); vm_page_lock(m); - vm_page_remove(m); + (void)vm_page_remove(m); vm_page_unlock(m); } else if (object->type == OBJT_DEVICE) dev_pager_free_page(object, m); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Jun 26 17:32:31 2019 (r349431) +++ head/sys/vm/vm_fault.c Wed Jun 26 17:37:51 2019 (r349432) @@ -1144,7 +1144,7 @@ readrest: fs.object == fs.first_object->backing_object) { vm_page_lock(fs.m); vm_page_dequeue(fs.m); - vm_page_remove(fs.m); + (void)vm_page_remove(fs.m); vm_page_unlock(fs.m); vm_page_lock(fs.first_m); vm_page_replace_checked(fs.m, fs.first_object, Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Jun 26 17:32:31 2019 (r349431) +++ head/sys/vm/vm_object.c Wed Jun 26 17:37:51 2019 (r349432) @@ -1595,10 +1595,8 @@ vm_object_collapse_scan(vm_object_t object, int op) vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); - if (!vm_page_wired(p)) + if (vm_page_remove(p)) vm_page_free(p); - else - vm_page_remove(p); vm_page_unlock(p); continue; } @@ -1639,10 +1637,8 @@ vm_object_collapse_scan(vm_object_t object, int op) vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); - if (!vm_page_wired(p)) + if (vm_page_remove(p)) vm_page_free(p); - else - vm_page_remove(p); vm_page_unlock(p); continue; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jun 26 17:32:31 2019 (r349431) +++ head/sys/vm/vm_page.c Wed Jun 26 17:37:51 2019 (r349432) @@ -1458,20 +1458,21 @@ vm_page_insert_radixdone(vm_page_t m, vm_object_t obje * vm_page_remove: * * Removes the specified page from its containing object, but does not - * invalidate any backing storage. + * invalidate any backing storage. Return true if the page may be safely + * freed and false otherwise. * * The object must be locked. The page must be locked if it is managed. */ -void +bool vm_page_remove(vm_page_t m) { vm_object_t object; vm_page_t mrem; + object = m->object; + if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_assert_locked(m); - if ((object = m->object) == NULL) - return; VM_OBJECT_ASSERT_WLOCKED(object); if (vm_page_xbusied(m)) vm_page_xunbusy_maybelocked(m); @@ -1495,6 +1496,7 @@ vm_page_remove(vm_page_t m) vdrop(object->handle); m->object = NULL; + return (!vm_page_wired(m)); } /* @@ -1665,7 +1667,7 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm */ m->pindex = opidx; vm_page_lock(m); - vm_page_remove(m); + (void)vm_page_remove(m); /* Return back to the new pindex to complete vm_page_insert(). */ m->pindex = new_pindex; @@ -3436,7 +3438,8 @@ vm_page_free_prep(vm_page_t m) if (vm_page_sbusied(m)) panic("vm_page_free_prep: freeing busy page %p", m); - vm_page_remove(m); + if (m->object != NULL) + (void)vm_page_remove(m); /* * If fictitious remove object association and Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Jun 26 17:32:31 2019 (r349431) +++ head/sys/vm/vm_page.h Wed Jun 26 17:37:51 2019 (r349432) @@ -561,7 +561,7 @@ bool vm_page_reclaim_contig(int req, u_long npages, vm bool vm_page_reclaim_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); void vm_page_reference(vm_page_t m); -void vm_page_remove (vm_page_t); +bool vm_page_remove(vm_page_t); int vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); vm_page_t vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex); From owner-svn-src-all@freebsd.org Wed Jun 26 17:38:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A057D15CE13A; Wed, 26 Jun 2019 17:38:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 141E480595; Wed, 26 Jun 2019 17:38:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E42A42EB9; Wed, 26 Jun 2019 17:38:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHcc8o084505; Wed, 26 Jun 2019 17:38:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHccwg084504; Wed, 26 Jun 2019 17:38:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906261738.x5QHccwg084504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 26 Jun 2019 17:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349433 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 349433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 141E480595 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:38:39 -0000 Author: avg Date: Wed Jun 26 17:38:38 2019 New Revision: 349433 URL: https://svnweb.freebsd.org/changeset/base/349433 Log: fix up r349428, fix a typo made during "fdt" removal Reported by: ian MFC after: 11 days Modified: head/sys/dev/ow/owc_gpiobus.c Modified: head/sys/dev/ow/owc_gpiobus.c ============================================================================== --- head/sys/dev/ow/owc_gpiobus.c Wed Jun 26 17:37:51 2019 (r349432) +++ head/sys/dev/ow/owc_gpiobus.c Wed Jun 26 17:38:38 2019 (r349433) @@ -417,6 +417,6 @@ static driver_t owc_gpiobus_driver = { }; DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); -MODULE_DEPEND(owc_gpiobust, ow, 1, 1, 1); +MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); MODULE_VERSION(owc_gpiobus, 1); From owner-svn-src-all@freebsd.org Wed Jun 26 17:41:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 147C215CE3C7; Wed, 26 Jun 2019 17:41:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC7580994; Wed, 26 Jun 2019 17:41:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A0453060; Wed, 26 Jun 2019 17:41:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHfcpr088502; Wed, 26 Jun 2019 17:41:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHfcge088501; Wed, 26 Jun 2019 17:41:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261741.x5QHfcge088501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 17:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349434 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 349434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADC7580994 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:41:39 -0000 Author: markj Date: Wed Jun 26 17:41:38 2019 New Revision: 349434 URL: https://svnweb.freebsd.org/changeset/base/349434 Log: MFC r349196: Make zlib encoding messages idempotent. PR: 238333 Modified: stable/12/usr.sbin/bhyve/rfb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/12/usr.sbin/bhyve/rfb.c Wed Jun 26 17:38:38 2019 (r349433) +++ stable/12/usr.sbin/bhyve/rfb.c Wed Jun 26 17:41:38 2019 (r349434) @@ -270,8 +270,10 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int c rc->enc_raw_ok = true; break; case RFB_ENCODING_ZLIB: - rc->enc_zlib_ok = true; - deflateInit(&rc->zstream, Z_BEST_SPEED); + if (!rc->enc_zlib_ok) { + deflateInit(&rc->zstream, Z_BEST_SPEED); + rc->enc_zlib_ok = true; + } break; case RFB_ENCODING_RESIZE: rc->enc_resize_ok = true; From owner-svn-src-all@freebsd.org Wed Jun 26 17:42:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D9A815CE4A2; Wed, 26 Jun 2019 17:42:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1438F80D37; Wed, 26 Jun 2019 17:42:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D93C630A7; Wed, 26 Jun 2019 17:42:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QHglN6089565; Wed, 26 Jun 2019 17:42:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QHglDw089564; Wed, 26 Jun 2019 17:42:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906261742.x5QHglDw089564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 17:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349435 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 349435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1438F80D37 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 17:42:48 -0000 Author: markj Date: Wed Jun 26 17:42:47 2019 New Revision: 349435 URL: https://svnweb.freebsd.org/changeset/base/349435 Log: MFC r349196: Make zlib encoding messages idempotent. PR: 238333 Modified: stable/11/usr.sbin/bhyve/rfb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/11/usr.sbin/bhyve/rfb.c Wed Jun 26 17:41:38 2019 (r349434) +++ stable/11/usr.sbin/bhyve/rfb.c Wed Jun 26 17:42:47 2019 (r349435) @@ -270,8 +270,10 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int c rc->enc_raw_ok = true; break; case RFB_ENCODING_ZLIB: - rc->enc_zlib_ok = true; - deflateInit(&rc->zstream, Z_BEST_SPEED); + if (!rc->enc_zlib_ok) { + deflateInit(&rc->zstream, Z_BEST_SPEED); + rc->enc_zlib_ok = true; + } break; case RFB_ENCODING_RESIZE: rc->enc_resize_ok = true; From owner-svn-src-all@freebsd.org Wed Jun 26 20:11:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FFC815D0FC6; Wed, 26 Jun 2019 20:11:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E73C085F95; Wed, 26 Jun 2019 20:11:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C497C4DB3; Wed, 26 Jun 2019 20:11:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QKBqlC065477; Wed, 26 Jun 2019 20:11:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QKBq5e065476; Wed, 26 Jun 2019 20:11:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906262011.x5QKBq5e065476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 20:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349438 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 349438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E73C085F95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 20:11:53 -0000 Author: markj Date: Wed Jun 26 20:11:52 2019 New Revision: 349438 URL: https://svnweb.freebsd.org/changeset/base/349438 Log: Avoid a divide-by-zero when bad checksum counters overflow. A mixture of IP or UDP packets with valid and invalid checksum could cause {ip,udp}_packets_bad_checksum to wrap around to 0, resulting in a division by zero. This is packet.c rev. 1.27 from OpenBSD. admbugs: 552 Obtained from: OpenBSD MFC after: 3 days Modified: head/sbin/dhclient/packet.c Modified: head/sbin/dhclient/packet.c ============================================================================== --- head/sbin/dhclient/packet.c Wed Jun 26 20:07:16 2019 (r349437) +++ head/sbin/dhclient/packet.c Wed Jun 26 20:11:52 2019 (r349438) @@ -183,7 +183,7 @@ decode_udp_ip_header(unsigned char *buf, int bufix, st ip_packets_seen++; if (wrapsum(checksum(buf + bufix, ip_len, 0)) != 0) { ip_packets_bad_checksum++; - if (ip_packets_seen > 4 && + if (ip_packets_seen > 4 && ip_packets_bad_checksum != 0 && (ip_packets_seen / ip_packets_bad_checksum) < 2) { note("%d bad IP checksums seen in %d packets", ip_packets_bad_checksum, ip_packets_seen); @@ -235,7 +235,7 @@ decode_udp_ip_header(unsigned char *buf, int bufix, st udp_packets_seen++; if (usum && usum != sum) { udp_packets_bad_checksum++; - if (udp_packets_seen > 4 && + if (udp_packets_seen > 4 && udp_packets_bad_checksum != 0 && (udp_packets_seen / udp_packets_bad_checksum) < 2) { note("%d bad udp checksums in %d packets", udp_packets_bad_checksum, udp_packets_seen); From owner-svn-src-all@freebsd.org Wed Jun 26 20:19:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44F1915D120F; Wed, 26 Jun 2019 20:19:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D99D18657D; Wed, 26 Jun 2019 20:19:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B112F4EF9; Wed, 26 Jun 2019 20:19:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QKJmAI068405; Wed, 26 Jun 2019 20:19:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QKJmfJ068404; Wed, 26 Jun 2019 20:19:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906262019.x5QKJmfJ068404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Jun 2019 20:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349439 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 349439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D99D18657D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 20:19:49 -0000 Author: markj Date: Wed Jun 26 20:19:48 2019 New Revision: 349439 URL: https://svnweb.freebsd.org/changeset/base/349439 Log: Free DHCP options with length zero. Otherwise they are leaked, allowing an attacker to trigger memory exhaustion. This is options.c rev. 1.70 from OpenBSD. admbugs: 552 Obtained from: OpenBSD MFC after: 3 days Modified: head/sbin/dhclient/options.c Modified: head/sbin/dhclient/options.c ============================================================================== --- head/sbin/dhclient/options.c Wed Jun 26 20:11:52 2019 (r349438) +++ head/sbin/dhclient/options.c Wed Jun 26 20:19:48 2019 (r349439) @@ -896,6 +896,5 @@ do_packet(struct interface_info *interface, struct dhc /* Free the data associated with the options. */ for (i = 0; i < 256; i++) - if (tp.options[i].len && tp.options[i].data) - free(tp.options[i].data); + free(tp.options[i].data); } From owner-svn-src-all@freebsd.org Wed Jun 26 20:45:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82CFD15D1DB2; Wed, 26 Jun 2019 20:45:46 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 DCC1A87556; Wed, 26 Jun 2019 20:45:45 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5QKjivm056236; Wed, 26 Jun 2019 13:45:44 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5QKji74056235; Wed, 26 Jun 2019 13:45:44 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906262045.x5QKji74056235@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349435 - stable/11/usr.sbin/bhyve In-Reply-To: <201906261742.x5QHglDw089564@repo.freebsd.org> To: Mark Johnston Date: Wed, 26 Jun 2019 13:45:44 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: DCC1A87556 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.935,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 20:45:46 -0000 > Author: markj > Date: Wed Jun 26 17:42:47 2019 > New Revision: 349435 > URL: https://svnweb.freebsd.org/changeset/base/349435 > > Log: > MFC r349196: > Make zlib encoding messages idempotent. Is this headed for 11.3RC3? IIRC this fixes a significant number of vnc client related issues? > PR: 238333 > > Modified: > stable/11/usr.sbin/bhyve/rfb.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/usr.sbin/bhyve/rfb.c > ============================================================================== > --- stable/11/usr.sbin/bhyve/rfb.c Wed Jun 26 17:41:38 2019 (r349434) > +++ stable/11/usr.sbin/bhyve/rfb.c Wed Jun 26 17:42:47 2019 (r349435) > @@ -270,8 +270,10 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int c > rc->enc_raw_ok = true; > break; > case RFB_ENCODING_ZLIB: > - rc->enc_zlib_ok = true; > - deflateInit(&rc->zstream, Z_BEST_SPEED); > + if (!rc->enc_zlib_ok) { > + deflateInit(&rc->zstream, Z_BEST_SPEED); > + rc->enc_zlib_ok = true; > + } > break; > case RFB_ENCODING_RESIZE: > rc->enc_resize_ok = true; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Jun 26 21:19:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 901F315D258C; Wed, 26 Jun 2019 21:19:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31E5F884F0; Wed, 26 Jun 2019 21:19:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 004E259F1; Wed, 26 Jun 2019 21:19:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QLJhkb099461; Wed, 26 Jun 2019 21:19:43 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QLJhkq099460; Wed, 26 Jun 2019 21:19:43 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201906262119.x5QLJhkq099460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Wed, 26 Jun 2019 21:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349441 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 349441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31E5F884F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 21:19:44 -0000 Author: rgrimes Date: Wed Jun 26 21:19:43 2019 New Revision: 349441 URL: https://svnweb.freebsd.org/changeset/base/349441 Log: Emulate the "TEST r/m{16,32,64}, imm{16,32,32}" instructions (opcode F7H). This adds emulation for: test r/m16, imm16 test r/m32, imm32 test r/m64, imm32 sign-extended to 64 OpenBSD guests compiled with clang 8.0.0 use TEST directly against a Local APIC register instead of separate read via MOV followed by a TEST against the register. PR: 238794 Submitted by: jhb Reported by: Jason Tubnor jason@tubnor.net Tested by: Jason Tubnor jason@tubnor.net Reviewed by: markj, Patrick Mooney patrick.mooney@joyent.com MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20755 Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jun 26 20:25:57 2019 (r349440) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jun 26 21:19:43 2019 (r349441) @@ -78,6 +78,7 @@ enum { VIE_OP_TYPE_BITTEST, VIE_OP_TYPE_TWOB_GRP15, VIE_OP_TYPE_ADD, + VIE_OP_TYPE_TEST, VIE_OP_TYPE_LAST }; @@ -221,6 +222,12 @@ static const struct vie_op one_byte_opcodes[256] = { .op_byte = 0x8F, .op_type = VIE_OP_TYPE_POP, }, + [0xF7] = { + /* XXX Group 3 extended opcode - not just TEST */ + .op_byte = 0xF7, + .op_type = VIE_OP_TYPE_TEST, + .op_flags = VIE_OP_F_IMM, + }, [0xFF] = { /* XXX Group 5 extended opcode - not just PUSH */ .op_byte = 0xFF, @@ -450,6 +457,41 @@ getaddflags(int opsize, uint64_t x, uint64_t y) return (getaddflags64(x, y)); } +/* + * Return the status flags that would result from doing (x & y). + */ +#define GETANDFLAGS(sz) \ +static u_long \ +getandflags##sz(uint##sz##_t x, uint##sz##_t y) \ +{ \ + u_long rflags; \ + \ + __asm __volatile("and %2,%1; pushfq; popq %0" : \ + "=r" (rflags), "+r" (x) : "m" (y)); \ + return (rflags); \ +} struct __hack + +GETANDFLAGS(8); +GETANDFLAGS(16); +GETANDFLAGS(32); +GETANDFLAGS(64); + +static u_long +getandflags(int opsize, uint64_t x, uint64_t y) +{ + KASSERT(opsize == 1 || opsize == 2 || opsize == 4 || opsize == 8, + ("getandflags: invalid operand size %d", opsize)); + + if (opsize == 1) + return (getandflags8(x, y)); + else if (opsize == 2) + return (getandflags16(x, y)); + else if (opsize == 4) + return (getandflags32(x, y)); + else + return (getandflags64(x, y)); +} + static int emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -1219,6 +1261,55 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct } static int +emulate_test(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t op1, rflags, rflags2; + + size = vie->opsize; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0xF7: + /* + * F7 /0 test r/m16, imm16 + * F7 /0 test r/m32, imm32 + * REX.W + F7 /0 test r/m64, imm32 sign-extended to 64 + * + * Test mem (ModRM:r/m) with immediate and set status + * flags according to the results. The comparison is + * performed by anding the immediate from the first + * operand and then setting the status flags. + */ + if ((vie->reg & 7) != 0) + return (EINVAL); + + error = memread(vm, vcpuid, gpa, &op1, size, arg); + if (error) + return (error); + + rflags2 = getandflags(size, op1, vie->immediate); + break; + default: + return (EINVAL); + } + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, &rflags); + if (error) + return (error); + + /* + * OF and CF are cleared; the SF, ZF and PF flags are set according + * to the result; AF is undefined. + */ + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & (PSL_PF | PSL_Z | PSL_N); + + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, rflags, 8); + return (error); +} + +static int emulate_add(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) { @@ -1642,6 +1733,10 @@ vmm_emulate_instruction(void *vm, int vcpuid, uint64_t case VIE_OP_TYPE_ADD: error = emulate_add(vm, vcpuid, gpa, vie, memread, memwrite, memarg); + break; + case VIE_OP_TYPE_TEST: + error = emulate_test(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); break; default: error = EINVAL; From owner-svn-src-all@freebsd.org Wed Jun 26 21:43:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 637C715D2F6B; Wed, 26 Jun 2019 21:43:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06CF489354; Wed, 26 Jun 2019 21:43:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D67115EFF; Wed, 26 Jun 2019 21:43:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QLhfjR015005; Wed, 26 Jun 2019 21:43:41 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QLhf6u015004; Wed, 26 Jun 2019 21:43:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906262143.x5QLhf6u015004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 26 Jun 2019 21:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349442 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 06CF489354 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 21:43:42 -0000 Author: alc Date: Wed Jun 26 21:43:41 2019 New Revision: 349442 URL: https://svnweb.freebsd.org/changeset/base/349442 Log: Revert one of the changes from r349323. Specifically, undo the change that replaced a pmap_invalidate_page() with a dsb(ishst) in pmap_enter_quick_locked(). Even though this change is in principle correct, I am seeing occasional, spurious bus errors that are only reproducible without this pmap_invalidate_page(). (None of adding an isb, "upgrading" the dsb to wait on loads as well as stores, or disabling superpage mappings eliminates the bus errors.) Add an XXX comment explaining why the pmap_invalidate_page() is being performed. Discussed with: andrew, markj Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Jun 26 21:19:43 2019 (r349441) +++ head/sys/arm64/arm64/pmap.c Wed Jun 26 21:43:41 2019 (r349442) @@ -3758,7 +3758,15 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v cpu_icache_sync_range(PHYS_TO_DMAP(pa), PAGE_SIZE); pmap_load_store(l3, l3_val); - dsb(ishst); + + /* + * XXX In principle, because this L3 entry was invalid, we should not + * need to perform a TLB invalidation here. However, in practice, + * when simply performing a "dsb ishst" here, processes are being + * terminated due to bus errors and segmentation violations. + */ + pmap_invalidate_page(pmap, va); + return (mpte); } From owner-svn-src-all@freebsd.org Wed Jun 26 21:59:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 412BF15D3301; Wed, 26 Jun 2019 21:59:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8052899A5; Wed, 26 Jun 2019 21:59:43 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C155960B6; Wed, 26 Jun 2019 21:59:43 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QLxhCl020381; Wed, 26 Jun 2019 21:59:43 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QLxhSB020380; Wed, 26 Jun 2019 21:59:43 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201906262159.x5QLxhSB020380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Wed, 26 Jun 2019 21:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349443 - in stable: 11/sys/amd64/vmm 12/sys/amd64/vmm X-SVN-Group: stable-12 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 11/sys/amd64/vmm 12/sys/amd64/vmm X-SVN-Commit-Revision: 349443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8052899A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 21:59:44 -0000 Author: rgrimes Date: Wed Jun 26 21:59:43 2019 New Revision: 349443 URL: https://svnweb.freebsd.org/changeset/base/349443 Log: MFC: r347065 (by jhb) Emulate the "ADD reg, r/m" instruction (opcode 03H). OVMF's flash variable storage is using add instructions when indexing the variable store bootrom location. Modified: stable/12/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm_instruction_emul.c Wed Jun 26 21:43:41 2019 (r349442) +++ stable/12/sys/amd64/vmm/vmm_instruction_emul.c Wed Jun 26 21:59:43 2019 (r349443) @@ -77,6 +77,7 @@ enum { VIE_OP_TYPE_STOS, VIE_OP_TYPE_BITTEST, VIE_OP_TYPE_TWOB_GRP15, + VIE_OP_TYPE_ADD, VIE_OP_TYPE_LAST }; @@ -112,6 +113,10 @@ static const struct vie_op two_byte_opcodes[256] = { }; static const struct vie_op one_byte_opcodes[256] = { + [0x03] = { + .op_byte = 0x03, + .op_type = VIE_OP_TYPE_ADD, + }, [0x0F] = { .op_byte = 0x0F, .op_type = VIE_OP_TYPE_TWO_BYTE @@ -410,6 +415,41 @@ getcc(int opsize, uint64_t x, uint64_t y) return (getcc64(x, y)); } +/* + * Macro creation of functions getaddflags{8,16,32,64} + */ +#define GETADDFLAGS(sz) \ +static u_long \ +getaddflags##sz(uint##sz##_t x, uint##sz##_t y) \ +{ \ + u_long rflags; \ + \ + __asm __volatile("add %2,%1; pushfq; popq %0" : \ + "=r" (rflags), "+r" (x) : "m" (y)); \ + return (rflags); \ +} struct __hack + +GETADDFLAGS(8); +GETADDFLAGS(16); +GETADDFLAGS(32); +GETADDFLAGS(64); + +static u_long +getaddflags(int opsize, uint64_t x, uint64_t y) +{ + KASSERT(opsize == 1 || opsize == 2 || opsize == 4 || opsize == 8, + ("getaddflags: invalid operand size %d", opsize)); + + if (opsize == 1) + return (getaddflags8(x, y)); + else if (opsize == 2) + return (getaddflags16(x, y)); + else if (opsize == 4) + return (getaddflags32(x, y)); + else + return (getaddflags64(x, y)); +} + static int emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -1179,6 +1219,62 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct } static int +emulate_add(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t nval, rflags, rflags2, val1, val2; + enum vm_reg_name reg; + + size = vie->opsize; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x03: + /* + * ADD r/m to r and store the result in r + * + * 03/r ADD r16, r/m16 + * 03/r ADD r32, r/m32 + * REX.W + 03/r ADD r64, r/m64 + */ + + /* get the first operand */ + reg = gpr_map[vie->reg]; + error = vie_read_register(vm, vcpuid, reg, &val1); + if (error) + break; + + /* get the second operand */ + error = memread(vm, vcpuid, gpa, &val2, size, arg); + if (error) + break; + + /* perform the operation and write the result */ + nval = val1 + val2; + error = vie_update_register(vm, vcpuid, reg, nval, size); + break; + default: + break; + } + + if (!error) { + rflags2 = getaddflags(size, val1, val2); + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + &rflags); + if (error) + return (error); + + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & RFLAGS_STATUS_BITS; + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + rflags, 8); + } + + return (error); +} + +static int emulate_sub(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) { @@ -1542,6 +1638,10 @@ vmm_emulate_instruction(void *vm, int vcpuid, uint64_t case VIE_OP_TYPE_TWOB_GRP15: error = emulate_twob_group15(vm, vcpuid, gpa, vie, memread, memwrite, memarg); + break; + case VIE_OP_TYPE_ADD: + error = emulate_add(vm, vcpuid, gpa, vie, memread, + memwrite, memarg); break; default: error = EINVAL; From owner-svn-src-all@freebsd.org Wed Jun 26 21:59:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F45515D3302; Wed, 26 Jun 2019 21:59:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3482A899A6; Wed, 26 Jun 2019 21:59:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1105360B7; Wed, 26 Jun 2019 21:59:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QLxhCg020388; Wed, 26 Jun 2019 21:59:43 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QLxh2w020387; Wed, 26 Jun 2019 21:59:43 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201906262159.x5QLxh2w020387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Wed, 26 Jun 2019 21:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349443 - in stable: 11/sys/amd64/vmm 12/sys/amd64/vmm X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 11/sys/amd64/vmm 12/sys/amd64/vmm X-SVN-Commit-Revision: 349443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3482A899A6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 21:59:44 -0000 Author: rgrimes Date: Wed Jun 26 21:59:43 2019 New Revision: 349443 URL: https://svnweb.freebsd.org/changeset/base/349443 Log: MFC: r347065 (by jhb) Emulate the "ADD reg, r/m" instruction (opcode 03H). OVMF's flash variable storage is using add instructions when indexing the variable store bootrom location. Modified: stable/11/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm_instruction_emul.c Wed Jun 26 21:43:41 2019 (r349442) +++ stable/11/sys/amd64/vmm/vmm_instruction_emul.c Wed Jun 26 21:59:43 2019 (r349443) @@ -75,6 +75,7 @@ enum { VIE_OP_TYPE_STOS, VIE_OP_TYPE_BITTEST, VIE_OP_TYPE_TWOB_GRP15, + VIE_OP_TYPE_ADD, VIE_OP_TYPE_LAST }; @@ -110,6 +111,10 @@ static const struct vie_op two_byte_opcodes[256] = { }; static const struct vie_op one_byte_opcodes[256] = { + [0x03] = { + .op_byte = 0x03, + .op_type = VIE_OP_TYPE_ADD, + }, [0x0F] = { .op_byte = 0x0F, .op_type = VIE_OP_TYPE_TWO_BYTE @@ -408,6 +413,41 @@ getcc(int opsize, uint64_t x, uint64_t y) return (getcc64(x, y)); } +/* + * Macro creation of functions getaddflags{8,16,32,64} + */ +#define GETADDFLAGS(sz) \ +static u_long \ +getaddflags##sz(uint##sz##_t x, uint##sz##_t y) \ +{ \ + u_long rflags; \ + \ + __asm __volatile("add %2,%1; pushfq; popq %0" : \ + "=r" (rflags), "+r" (x) : "m" (y)); \ + return (rflags); \ +} struct __hack + +GETADDFLAGS(8); +GETADDFLAGS(16); +GETADDFLAGS(32); +GETADDFLAGS(64); + +static u_long +getaddflags(int opsize, uint64_t x, uint64_t y) +{ + KASSERT(opsize == 1 || opsize == 2 || opsize == 4 || opsize == 8, + ("getaddflags: invalid operand size %d", opsize)); + + if (opsize == 1) + return (getaddflags8(x, y)); + else if (opsize == 2) + return (getaddflags16(x, y)); + else if (opsize == 4) + return (getaddflags32(x, y)); + else + return (getaddflags64(x, y)); +} + static int emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -1177,6 +1217,62 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct } static int +emulate_add(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t nval, rflags, rflags2, val1, val2; + enum vm_reg_name reg; + + size = vie->opsize; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x03: + /* + * ADD r/m to r and store the result in r + * + * 03/r ADD r16, r/m16 + * 03/r ADD r32, r/m32 + * REX.W + 03/r ADD r64, r/m64 + */ + + /* get the first operand */ + reg = gpr_map[vie->reg]; + error = vie_read_register(vm, vcpuid, reg, &val1); + if (error) + break; + + /* get the second operand */ + error = memread(vm, vcpuid, gpa, &val2, size, arg); + if (error) + break; + + /* perform the operation and write the result */ + nval = val1 + val2; + error = vie_update_register(vm, vcpuid, reg, nval, size); + break; + default: + break; + } + + if (!error) { + rflags2 = getaddflags(size, val1, val2); + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + &rflags); + if (error) + return (error); + + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & RFLAGS_STATUS_BITS; + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + rflags, 8); + } + + return (error); +} + +static int emulate_sub(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) { @@ -1540,6 +1636,10 @@ vmm_emulate_instruction(void *vm, int vcpuid, uint64_t case VIE_OP_TYPE_TWOB_GRP15: error = emulate_twob_group15(vm, vcpuid, gpa, vie, memread, memwrite, memarg); + break; + case VIE_OP_TYPE_ADD: + error = emulate_add(vm, vcpuid, gpa, vie, memread, + memwrite, memarg); break; default: error = EINVAL; From owner-svn-src-all@freebsd.org Wed Jun 26 22:06:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 198BA15D3588; Wed, 26 Jun 2019 22:06:41 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0C3889EF9; Wed, 26 Jun 2019 22:06:40 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87FD7626C; Wed, 26 Jun 2019 22:06:40 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QM6e1S025574; Wed, 26 Jun 2019 22:06:40 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QM6eYw025573; Wed, 26 Jun 2019 22:06:40 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201906262206.x5QM6eYw025573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Wed, 26 Jun 2019 22:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349444 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0C3889EF9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 22:06:41 -0000 Author: cognet Date: Wed Jun 26 22:06:40 2019 New Revision: 349444 URL: https://svnweb.freebsd.org/changeset/base/349444 Log: In get_fpcontext32() and set_fpcontext32(), we can't just use memcpy() to copy the VFP registers. arvm7 VFP uses 32 64bits fp registers (but those could be used in pairs to make 16 128bits registers), while aarch64 uses 32 128bits fp registers, so we have to copy the value of each register. Modified: head/sys/arm64/arm64/freebsd32_machdep.c Modified: head/sys/arm64/arm64/freebsd32_machdep.c ============================================================================== --- head/sys/arm64/arm64/freebsd32_machdep.c Wed Jun 26 21:59:43 2019 (r349443) +++ head/sys/arm64/arm64/freebsd32_machdep.c Wed Jun 26 22:06:40 2019 (r349444) @@ -122,6 +122,7 @@ static void get_fpcontext32(struct thread *td, mcontext32_vfp_t *mcp) { struct pcb *curpcb; + int i; critical_enter(); curpcb = curthread->td_pcb; @@ -137,8 +138,8 @@ get_fpcontext32(struct thread *td, mcontext32_vfp_t *m ("Called get_fpcontext while the kernel is using the VFP")); KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, ("Non-userspace FPU flags set in get_fpcontext")); - memcpy(mcp->mcv_reg, curpcb->pcb_fpustate.vfp_regs, - sizeof(mcp->mcv_reg)); + for (i = 0; i < 32; i++) + mcp->mcv_reg[i] = (uint64_t)curpcb->pcb_fpustate.vfp_regs[i]; mcp->mcv_fpscr = VFP_FPSCR_FROM_SRCR(curpcb->pcb_fpustate.vfp_fpcr, curpcb->pcb_fpustate.vfp_fpsr); } @@ -149,13 +150,14 @@ static void set_fpcontext32(struct thread *td, mcontext32_vfp_t *mcp) { struct pcb *pcb; + int i; critical_enter(); pcb = td->td_pcb; if (td == curthread) vfp_discard(td); - memcpy(pcb->pcb_fpustate.vfp_regs, mcp->mcv_reg, - sizeof(pcb->pcb_fpustate.vfp_regs)); + for (i = 0; i < 32; i++) + pcb->pcb_fpustate.vfp_regs[i] = mcp->mcv_reg[i]; pcb->pcb_fpustate.vfp_fpsr = VFP_FPSR_FROM_FPSCR(mcp->mcv_fpscr); pcb->pcb_fpustate.vfp_fpcr = VFP_FPSR_FROM_FPSCR(mcp->mcv_fpscr); critical_exit(); From owner-svn-src-all@freebsd.org Wed Jun 26 23:02:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 877D915D45A8; Wed, 26 Jun 2019 23:02:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C82D8B74C; Wed, 26 Jun 2019 23:02:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd33.google.com with SMTP id m24so526594ioo.2; Wed, 26 Jun 2019 16:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BK6sSPH4ktgPNV5Vs3kS4ov2SG0bLG4pjqJH+xmlcQk=; b=TWdhMgu+jBTx9nIMCeplDirdD5wc0Kmpv/H8moxIPIzqOJ1M771JgFw+YjS7m+6Rip JajbaJCV/uL+v/kOrt9KKVsjZYX+mXG6S08My/ufPzqqtjG3DUc05AWopDUwN7xSZmfJ b9w78r88FG71anjcRD37FZCFOkvERph216vX5bp3e97csuJumszcZ9FJQ4Vv2qagXcY/ 3oKOBrItDg76GWgUmne6A/kbPhD60K/T+tg1cLzXJYys6owPeNyu4yDaAIs75Ou2mCXy F0yDqBVietS5OgeqyDtWXOpndneTeeXABSbcKEiqvmOL/Kn4P4Eowp/JuwWup62+5yu4 KwOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=BK6sSPH4ktgPNV5Vs3kS4ov2SG0bLG4pjqJH+xmlcQk=; b=Fg3F+ImQTPyEoIZk3KWM8pUrP+07pNXEJ2L+ZaN+g+ZySXmQ0eM3AvzQygxJtXM953 BYby1OgOOZQLfZWD8q49gtEXtMi+IgDVYoAEhZhNsIupddjUQNry1VtosBDtmXlfBISy NTA3y3De0IXNPfa6DGMEB0Cp15TLbpRHYFfIc9LLsAtaF32Fl1qozGWp/lYTXLUEXc7N 5B7KsQU/R7mn/uRK0h8843QTc2/jGnfwFC1WTkxNpv/6lYjUJ1TRUmwQJh7gKkMArz11 FqCEp8fqJVuZdC13CBcz6NFXn3T6EUCQSCStbLqIGW+48TqPz9GDo1Q4GqPoaiaxvcTU DUSg== X-Gm-Message-State: APjAAAW8Zl6wwEWrBlZstyNOWX0FBA38GVg+nq4fiTa+8GycweEAEDSd yjPeeidfl9L2juO3DlcmGEhuo/Ie X-Google-Smtp-Source: APXvYqy1t+XFLFy6hDgR7VHhZConbrquJml/4W26ausO8cUdnmBdM63JrlFXxdFdgRXTDoW+XI6HAA== X-Received: by 2002:a6b:f406:: with SMTP id i6mr836417iog.110.1561590168138; Wed, 26 Jun 2019 16:02:48 -0700 (PDT) Received: from raichu (toroon0560w-lp140-05-70-29-85-38.dsl.bell.ca. [70.29.85.38]) by smtp.gmail.com with ESMTPSA id a7sm329082iok.19.2019.06.26.16.02.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 16:02:47 -0700 (PDT) Sender: Mark Johnston Date: Wed, 26 Jun 2019 19:02:45 -0400 From: Mark Johnston To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r349435 - stable/11/usr.sbin/bhyve Message-ID: <20190626230245.GF4676@raichu> References: <201906261742.x5QHglDw089564@repo.freebsd.org> <201906262045.x5QKji74056235@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906262045.x5QKji74056235@gndrsh.dnsmgr.net> User-Agent: Mutt/1.12.0 (2019-05-25) X-Rspamd-Queue-Id: 0C82D8B74C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 23:02:49 -0000 On Wed, Jun 26, 2019 at 01:45:44PM -0700, Rodney W. Grimes wrote: > > Author: markj > > Date: Wed Jun 26 17:42:47 2019 > > New Revision: 349435 > > URL: https://svnweb.freebsd.org/changeset/base/349435 > > > > Log: > > MFC r349196: > > Make zlib encoding messages idempotent. > > Is this headed for 11.3RC3? No, I will submit an EN request. > IIRC this fixes a significant number of vnc client related issues? I don't think so, it just fixes a possible crash when a client connects. From owner-svn-src-all@freebsd.org Wed Jun 26 23:33:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C519E15D4C80; Wed, 26 Jun 2019 23:33:34 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69F5D8C363; Wed, 26 Jun 2019 23:33:34 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 435777147; Wed, 26 Jun 2019 23:33:34 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5QNXYJa071714; Wed, 26 Jun 2019 23:33:34 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5QNXWqq071707; Wed, 26 Jun 2019 23:33:32 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201906262333.x5QNXWqq071707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 26 Jun 2019 23:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349446 - in head/lib/libsecureboot: . h openpgp X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/lib/libsecureboot: . h openpgp X-SVN-Commit-Revision: 349446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69F5D8C363 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2019 23:33:35 -0000 Author: sjg Date: Wed Jun 26 23:33:32 2019 New Revision: 349446 URL: https://svnweb.freebsd.org/changeset/base/349446 Log: libsecureboot: allow OpenPGP support to be dormant Since we can now add OpenPGP trust anchors at runtime, ensure the latent support is available. Ensure we do not add duplicate keys to trust store. Also allow reporting names of trust anchors added/revoked We only do this for loader and only after initializing trust store. Thus only changes to initial trust store will be logged. Reviewed by: stevek MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20700 Modified: head/lib/libsecureboot/h/libsecureboot.h head/lib/libsecureboot/libsecureboot-priv.h head/lib/libsecureboot/local.trust.mk head/lib/libsecureboot/openpgp/opgp_key.c head/lib/libsecureboot/readfile.c head/lib/libsecureboot/verify_file.c head/lib/libsecureboot/vets.c Modified: head/lib/libsecureboot/h/libsecureboot.h ============================================================================== --- head/lib/libsecureboot/h/libsecureboot.h Wed Jun 26 23:10:20 2019 (r349445) +++ head/lib/libsecureboot/h/libsecureboot.h Wed Jun 26 23:33:32 2019 (r349446) @@ -42,6 +42,7 @@ #include +unsigned char * read_fd(int, size_t); #ifndef NEED_BRSSL_H unsigned char * read_file(const char *, size_t *); #endif @@ -51,8 +52,12 @@ extern int DebugVe; #define DEBUG_PRINTF(n, x) if (DebugVe >= n) printf x int ve_trust_init(void); +size_t ve_trust_anchors_add_buf(unsigned char *, size_t); +size_t ve_trust_anchors_revoke(unsigned char *, size_t); int ve_trust_add(const char *); void ve_debug_set(int); +void ve_anchor_verbose_set(int); +int ve_anchor_verbose_get(void); void ve_utc_set(time_t utc); char *ve_error_get(void); int ve_error_set(const char *, ...) __printflike(1,2); Modified: head/lib/libsecureboot/libsecureboot-priv.h ============================================================================== --- head/lib/libsecureboot/libsecureboot-priv.h Wed Jun 26 23:10:20 2019 (r349445) +++ head/lib/libsecureboot/libsecureboot-priv.h Wed Jun 26 23:33:32 2019 (r349446) @@ -56,6 +56,8 @@ int is_verified(struct stat *stp); void add_verify_status(struct stat *stp, int status); int openpgp_trust_init(void); +int openpgp_trust_add_buf(unsigned char *, size_t); +int openpgp_trust_revoke(const char *); int openpgp_self_tests(void); int efi_secure_boot_enabled(void); Modified: head/lib/libsecureboot/local.trust.mk ============================================================================== --- head/lib/libsecureboot/local.trust.mk Wed Jun 26 23:10:20 2019 (r349445) +++ head/lib/libsecureboot/local.trust.mk Wed Jun 26 23:33:32 2019 (r349446) @@ -33,6 +33,10 @@ VE_SIGNATURE_EXT_LIST+= \ sig .endif +# add OpenPGP support - possibly dormant +VE_SIGNATURE_LIST+= OPENPGP +VE_SIGNATURE_EXT_LIST+= asc + SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py .if exists(${SIGNER}) @@ -42,7 +46,12 @@ SIGN_ECDSA= ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${ECDS RSA2_PORT:= ${163%y:L:gmtime} SIGN_RSA2= ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${RSA2_PORT} -h sha256 +# deal with quirk of our .esig format +XCFLAGS.vets+= -DVE_ECDSA_HASH_AGAIN + .if !empty(OPENPGP_SIGN_URL) +XCFLAGS.opgp_key+= -DHAVE_TA_ASC_H + VE_SIGNATURE_LIST+= OPENPGP VE_SIGNATURE_EXT_LIST+= asc Modified: head/lib/libsecureboot/openpgp/opgp_key.c ============================================================================== --- head/lib/libsecureboot/openpgp/opgp_key.c Wed Jun 26 23:10:20 2019 (r349445) +++ head/lib/libsecureboot/openpgp/opgp_key.c Wed Jun 26 23:33:32 2019 (r349446) @@ -209,13 +209,54 @@ openpgp_trust_add(OpenPGP_key *key) LIST_INIT(&trust_list); } - if (key) { - DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id)); + if (key && openpgp_trust_get(key->id) == NULL) { + if (ve_anchor_verbose_get()) + printf("openpgp_trust_add(%s)\n", key->id); LIST_INSERT_HEAD(&trust_list, key, entries); } } /** + * @brief add trust anchor from buf + */ +int +openpgp_trust_add_buf(unsigned char *buf, size_t nbytes) +{ + OpenPGP_key *key; + + if ((key = load_key_buf(buf, nbytes))) { + openpgp_trust_add(key); + } + return (key != NULL); +} + + +/** + * @brief if keyID is in our list clobber it + * + * @return true if keyID removed + */ +int +openpgp_trust_revoke(const char *keyID) +{ + OpenPGP_key *key, *tkey; + + openpgp_trust_add(NULL); /* initialize if needed */ + + LIST_FOREACH(key, &trust_list, entries) { + if (strcmp(key->id, keyID) == 0) { + tkey = key; + LIST_REMOVE(tkey, entries); + printf("openpgp_trust_revoke(%s)\n", key->id); + memset(key, 0, sizeof(OpenPGP_key)); + free(key); + return (1); + } + } + return (0); +} + +/** * @brief if keyID is in our list return the key * * @return key or NULL @@ -251,7 +292,9 @@ load_key_file(const char *kfile) return (key); } +#ifdef HAVE_TA_ASC_H #include +#endif #ifndef _STANDALONE /* we can lookup keyID in filesystem */ @@ -330,8 +373,8 @@ openpgp_trust_init(void) } } } - } #endif + } return (once); } Modified: head/lib/libsecureboot/readfile.c ============================================================================== --- head/lib/libsecureboot/readfile.c Wed Jun 26 23:10:20 2019 (r349445) +++ head/lib/libsecureboot/readfile.c Wed Jun 26 23:33:32 2019 (r349446) @@ -28,21 +28,13 @@ __FBSDID("$FreeBSD$"); #include unsigned char * -read_file(const char *path, size_t *len) +read_fd(int fd, size_t len) { - int fd, m, n, x; - struct stat st; + int m, n, x; unsigned char *buf; - if (len) - *len = 0; - if ((fd = open(path, O_RDONLY)) < 0) - return (NULL); - fstat(fd, &st); - if (len) - *len = st.st_size; - buf = malloc(st.st_size + 1); - for (x = 0, m = st.st_size; m > 0; ) { + buf = malloc(len + 1); + for (x = 0, m = len; m > 0; ) { n = read(fd, &buf[x], m); if (n < 0) break; @@ -51,11 +43,30 @@ read_file(const char *path, size_t *len) x += n; } } - close(fd); if (m == 0) { - buf[st.st_size] = '\0'; + buf[len] = '\0'; return (buf); } free(buf); return (NULL); } + +unsigned char * +read_file(const char *path, size_t *len) +{ + struct stat st; + unsigned char *ucp; + int fd; + + if (len) + *len = 0; + if ((fd = open(path, O_RDONLY)) < 0) + return (NULL); + fstat(fd, &st); + ucp = read_fd(fd, st.st_size); + close(fd); + if (len != NULL && ucp != NULL) + *len = st.st_size; + return (ucp); +} + Modified: head/lib/libsecureboot/verify_file.c ============================================================================== --- head/lib/libsecureboot/verify_file.c Wed Jun 26 23:10:20 2019 (r349445) +++ head/lib/libsecureboot/verify_file.c Wed Jun 26 23:33:32 2019 (r349446) @@ -246,7 +246,9 @@ severity_guess(const char *filename) } static void -verify_tweak(char *tweak, int *accept_no_fp, int *verbose, int *verifying) +verify_tweak(int fd, off_t off, struct stat *stp, + char *tweak, int *accept_no_fp, + int *verbose, int *verifying) { if (strcmp(tweak, "off") == 0) { *verifying = 0; @@ -268,6 +270,25 @@ verify_tweak(char *tweak, int *accept_no_fp, int *verb *verbose = 1; } else if (strcmp(tweak, "quiet") == 0) { *verbose = 0; + } else if (strncmp(tweak, "trust", 5) == 0) { + /* content is trust anchor to add or revoke */ + unsigned char *ucp; + size_t num; + + if (off > 0) + lseek(fd, 0, SEEK_SET); + ucp = read_fd(fd, stp->st_size); + if (ucp == NULL) + return; + if (strstr(tweak, "revoke")) { + num = ve_trust_anchors_revoke(ucp, stp->st_size); + DEBUG_PRINTF(3, ("revoked %d trust anchors\n", + (int) num)); + } else { + num = ve_trust_anchors_add_buf(ucp, stp->st_size); + DEBUG_PRINTF(3, ("added %d trust anchors\n", + (int) num)); + } } } @@ -317,8 +338,10 @@ verify_file(int fd, const char *filename, off_t off, i rc = verifying ? VE_NOT_CHECKED : VE_NOT_VERIFYING; ve_status_set(0, rc); ve_status_state = VE_STATUS_NONE; - if (verifying) + if (verifying) { ve_self_tests(); + ve_anchor_verbose_set(1); + } } if (!verifying) return (0); @@ -367,7 +390,7 @@ verify_file(int fd, const char *filename, off_t off, i cp++; if (strncmp(cp, "loader.ve.", 10) == 0) { cp += 10; - verify_tweak(cp, + verify_tweak(fd, off, &st, cp, &accept_no_fp, &verbose, &verifying); } Modified: head/lib/libsecureboot/vets.c ============================================================================== --- head/lib/libsecureboot/vets.c Wed Jun 26 23:10:20 2019 (r349445) +++ head/lib/libsecureboot/vets.c Wed Jun 26 23:33:32 2019 (r349446) @@ -55,7 +55,21 @@ static anchor_list trust_anchors = VEC_INIT; static anchor_list forbidden_anchors = VEC_INIT; static digest_list forbidden_digests = VEC_INIT; +static int anchor_verbose = 0; + void +ve_anchor_verbose_set(int n) +{ + anchor_verbose = n; +} + +int +ve_anchor_verbose_get(void) +{ + return (anchor_verbose); +} + +void ve_debug_set(int n) { DebugVe = n; @@ -116,6 +130,47 @@ free_cert_contents(br_x509_certificate *xc) xfree(xc->data); } +/* + * a bit of a dance to get commonName from a certificate + */ +static char * +x509_cn_get(br_x509_certificate *xc, char *buf, size_t len) +{ + br_x509_minimal_context mc; + br_name_element cn; + unsigned char cn_oid[4]; + int err; + + if (buf == NULL) + return (buf); + /* + * We want the commonName field + * the OID we want is 2,5,4,3 - but DER encoded + */ + cn_oid[0] = 3; + cn_oid[1] = 0x55; + cn_oid[2] = 4; + cn_oid[3] = 3; + cn.oid = cn_oid; + cn.buf = buf; + cn.len = len; + cn.buf[0] = '\0'; + + br_x509_minimal_init(&mc, &br_sha256_vtable, NULL, 0); + br_x509_minimal_set_name_elements(&mc, &cn, 1); + /* the below actually does the work - updates cn.status */ + mc.vtable->start_chain(&mc.vtable, NULL); + mc.vtable->start_cert(&mc.vtable, xc->data_len); + mc.vtable->append(&mc.vtable, xc->data, xc->data_len); + mc.vtable->end_cert(&mc.vtable); + /* we don' actually care about cert status - just its name */ + err = mc.vtable->end_chain(&mc.vtable); + + if (!cn.status) + buf = NULL; + return (buf); +} + /* ASN parsing related defines */ #define ASN1_PRIMITIVE_TAG 0x1F #define ASN1_INF_LENGTH 0x80 @@ -184,7 +239,8 @@ ve_forbidden_digest_add(hash_data *digest, size_t num) } static size_t -ve_anchors_add(br_x509_certificate *xcs, size_t num, anchor_list *anchors) +ve_anchors_add(br_x509_certificate *xcs, size_t num, anchor_list *anchors, + char *anchors_name) { br_x509_trust_anchor ta; size_t u; @@ -194,6 +250,15 @@ ve_anchors_add(br_x509_certificate *xcs, size_t num, a break; } VEC_ADD(*anchors, ta); + if (anchor_verbose && anchors_name) { + char buf[64]; + char *cp; + + cp = x509_cn_get(&xcs[u], buf, sizeof(buf)); + if (cp) { + printf("x509_anchor(%s) %s\n", cp, anchors_name); + } + } } return (u); } @@ -205,27 +270,78 @@ ve_anchors_add(br_x509_certificate *xcs, size_t num, a size_t ve_trust_anchors_add(br_x509_certificate *xcs, size_t num) { - return (ve_anchors_add(xcs, num, &trust_anchors)); + return (ve_anchors_add(xcs, num, &trust_anchors, "trusted")); } size_t ve_forbidden_anchors_add(br_x509_certificate *xcs, size_t num) { - return (ve_anchors_add(xcs, num, &forbidden_anchors)); + return (ve_anchors_add(xcs, num, &forbidden_anchors, "forbidden")); } + /** + * @brief add trust anchors in buf + * + * Assume buf contains x509 certificates, but if not and + * we support OpenPGP try adding as that. + * + * @return number of anchors added + */ +size_t +ve_trust_anchors_add_buf(unsigned char *buf, size_t len) +{ + br_x509_certificate *xcs; + size_t num; + + num = 0; + xcs = parse_certificates(buf, len, &num); + if (xcs != NULL) { + num = ve_trust_anchors_add(xcs, num); +#ifdef VE_OPENPGP_SUPPORT + } else { + num = openpgp_trust_add_buf(buf, len); +#endif + } + return (num); +} + +/** + * @brief revoke trust anchors in buf + * + * Assume buf contains x509 certificates, but if not and + * we support OpenPGP try revoking keyId + * + * @return number of anchors revoked + */ +size_t +ve_trust_anchors_revoke(unsigned char *buf, size_t len) +{ + br_x509_certificate *xcs; + size_t num; + + num = 0; + xcs = parse_certificates(buf, len, &num); + if (xcs != NULL) { + num = ve_forbidden_anchors_add(xcs, num); +#ifdef VE_OPENPGP_SUPPORT + } else { + if (buf[len - 1] == '\n') + buf[len - 1] = '\0'; + num = openpgp_trust_revoke((char *)buf); +#endif + } + return (num); +} + +/** * @brief * initialize our trust_anchors from ta_PEM */ int ve_trust_init(void) { -#ifdef TRUST_ANCHOR_STR - br_x509_certificate *xcs; -#endif static int once = -1; - size_t num; if (once >= 0) return (once); @@ -240,10 +356,8 @@ ve_trust_init(void) #endif #ifdef TRUST_ANCHOR_STR - xcs = parse_certificates(__DECONST(unsigned char *, TRUST_ANCHOR_STR), - sizeof(TRUST_ANCHOR_STR), &num); - if (xcs != NULL) - num = ve_trust_anchors_add(xcs, num); + ve_trust_anchors_add_buf(__DECONST(unsigned char *, TRUST_ANCHOR_STR), + sizeof(TRUST_ANCHOR_STR)); #endif once = (int) VEC_LEN(trust_anchors); #ifdef VE_OPENPGP_SUPPORT @@ -552,6 +666,7 @@ verify_ec(br_x509_pkey *pk, const char *file, const ch br_sha256_init(&ctx); br_sha256_update(&ctx, fcp, flen); br_sha256_out(&ctx, rhbuf); +#ifdef VE_ECDSA_HASH_AGAIN hex = hexdigest(hexbuf, sizeof(hexbuf), rhbuf, br_sha256_SIZE); /* now hash that */ if (hex) { @@ -559,6 +674,7 @@ verify_ec(br_x509_pkey *pk, const char *file, const ch br_sha256_update(&ctx, hex, strlen(hex)); br_sha256_out(&ctx, rhbuf); } +#endif ec = br_ec_get_default(); vrfy = br_ecdsa_vrfy_asn1_get_default(); if (!vrfy(ec, rhbuf, br_sha256_SIZE, &pk->key.ec, po->data, From owner-svn-src-all@freebsd.org Thu Jun 27 02:42:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E279115D8682; Thu, 27 Jun 2019 02:42:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 837956A9E7; Thu, 27 Jun 2019 02:42:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5872E90F0; Thu, 27 Jun 2019 02:42:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5R2gv9O070653; Thu, 27 Jun 2019 02:42:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5R2gvof070652; Thu, 27 Jun 2019 02:42:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906270242.x5R2gvof070652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Jun 2019 02:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349448 - head/contrib/ipfilter/man X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/man X-SVN-Commit-Revision: 349448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 837956A9E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 02:42:58 -0000 Author: cy Date: Thu Jun 27 02:42:56 2019 New Revision: 349448 URL: https://svnweb.freebsd.org/changeset/base/349448 Log: Fix a typo. PR/238816 initially addressed updates to usage() however it has now become a shopping list of fixes to ipmon man pages and usage(). PR: 238816 MFC after: 3 days Modified: head/contrib/ipfilter/man/ipmon.8 Modified: head/contrib/ipfilter/man/ipmon.8 ============================================================================== --- head/contrib/ipfilter/man/ipmon.8 Thu Jun 27 00:00:48 2019 (r349447) +++ head/contrib/ipfilter/man/ipmon.8 Thu Jun 27 02:42:56 2019 (r349448) @@ -27,7 +27,7 @@ ipmon \- monitors /dev/ipl for logged packets .LP \fBipmon\fP opens \fB/dev/ipl\fP for reading and awaits data to be saved from the packet filter. The binary data read from the device is reprinted in -human readable for, however, IP#'s are not mapped back to hostnames, nor are +human readable form, however, IP#'s are not mapped back to hostnames, nor are ports mapped back to service names. The output goes to standard output by default or a filename, if given on the command line. Should the \fB\-s\fP option be used, output is instead sent to \fBsyslogd(8)\fP. Messages sent From owner-svn-src-all@freebsd.org Thu Jun 27 02:43:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19DC115D86BC; Thu, 27 Jun 2019 02:43:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5F0B6AB3B; Thu, 27 Jun 2019 02:43:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9270B90F4; Thu, 27 Jun 2019 02:43:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5R2hRG7070732; Thu, 27 Jun 2019 02:43:27 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5R2hRMA070730; Thu, 27 Jun 2019 02:43:27 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906270243.x5R2hRMA070730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Jun 2019 02:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349449 - in head: sbin/ipf/ipmon tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head: sbin/ipf/ipmon tools/build/mk X-SVN-Commit-Revision: 349449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5F0B6AB3B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 02:43:28 -0000 Author: cy Date: Thu Jun 27 02:43:26 2019 New Revision: 349449 URL: https://svnweb.freebsd.org/changeset/base/349449 Log: Add the ipmon.5 man page. PR/238816 initially addressed updates to usage() however the PR has morphed into a shopping list of updates to usage() and man pages. PR: 238816 (I added to the list during discussion) MFC after: 1 week Modified: head/sbin/ipf/ipmon/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/sbin/ipf/ipmon/Makefile ============================================================================== --- head/sbin/ipf/ipmon/Makefile Thu Jun 27 02:42:56 2019 (r349448) +++ head/sbin/ipf/ipmon/Makefile Thu Jun 27 02:43:26 2019 (r349449) @@ -3,7 +3,7 @@ PACKAGE= ipf PROG= ipmon SRCS= ${GENHDRS} ipmon.c ipmon_y.c ipmon_l.c -MAN= ipmon.8 +MAN= ipmon.5 ipmon.8 CFLAGS+= -DLOGFAC=LOG_LOCAL0 -I. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 27 02:42:56 2019 (r349448) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 27 02:43:26 2019 (r349449) @@ -3350,6 +3350,7 @@ OLD_FILES+=usr/share/man/man5/ipf.5.gz OLD_FILES+=usr/share/man/man5/ipf.conf.5.gz OLD_FILES+=usr/share/man/man5/ipf6.conf.5.gz OLD_FILES+=usr/share/man/man5/ipfilter.5.gz +OLD_FILES+=usr/share/man/man8/ipmon.5.gz OLD_FILES+=usr/share/man/man5/ipnat.5.gz OLD_FILES+=usr/share/man/man5/ipnat.conf.5.gz OLD_FILES+=usr/share/man/man5/ippool.5.gz From owner-svn-src-all@freebsd.org Thu Jun 27 02:43:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D17715D86E2; Thu, 27 Jun 2019 02:43:31 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D08ED6AB48; Thu, 27 Jun 2019 02:43:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A93F390F6; Thu, 27 Jun 2019 02:43:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5R2hUU2070793; Thu, 27 Jun 2019 02:43:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5R2hUZx070792; Thu, 27 Jun 2019 02:43:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906270243.x5R2hUZx070792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Jun 2019 02:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349450 - head/contrib/ipfilter/tools X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/tools X-SVN-Commit-Revision: 349450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D08ED6AB48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 02:43:31 -0000 Author: cy Date: Thu Jun 27 02:43:30 2019 New Revision: 349450 URL: https://svnweb.freebsd.org/changeset/base/349450 Log: Update usage() to refect the current state of ipmon. PR: 238816 MFC after: 1 week Modified: head/contrib/ipfilter/tools/ipmon.c Modified: head/contrib/ipfilter/tools/ipmon.c ============================================================================== --- head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 02:43:26 2019 (r349449) +++ head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 02:43:30 2019 (r349450) @@ -1438,8 +1438,11 @@ printipflog: static void usage(prog) char *prog; { - fprintf(stderr, "%s: [-NFhstvxX] [-f ]\n", prog); - exit(1); + fprintf(stderr, "Usage: %s [ -abDFhnpstvxX ] [ -B ] [ -C ]\n" + "\t[ -f ] [ -L ] [ -N ]\n" + "\t[ -o [NSI] ] [ -O [NSI] ] [ -P ] [ -S ]\n" + "\t[ ]\n", prog); + exit(-1); } From owner-svn-src-all@freebsd.org Thu Jun 27 03:01:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C785215D8DA4; Thu, 27 Jun 2019 03:01:59 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (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 35FBC6B57A; Thu, 27 Jun 2019 03:01:59 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5R31srq057764; Wed, 26 Jun 2019 20:01:54 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5R31sLH057763; Wed, 26 Jun 2019 20:01:54 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906270301.x5R31sLH057763@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349450 - head/contrib/ipfilter/tools In-Reply-To: <201906270243.x5R2hUZx070792@repo.freebsd.org> To: Cy Schubert Date: Wed, 26 Jun 2019 20:01:54 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 35FBC6B57A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 03:02:00 -0000 > Author: cy > Date: Thu Jun 27 02:43:30 2019 > New Revision: 349450 > URL: https://svnweb.freebsd.org/changeset/base/349450 > > Log: > Update usage() to refect the current state of ipmon. > > PR: 238816 > MFC after: 1 week > > Modified: > head/contrib/ipfilter/tools/ipmon.c > > Modified: head/contrib/ipfilter/tools/ipmon.c > ============================================================================== > --- head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 02:43:26 2019 (r349449) > +++ head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 02:43:30 2019 (r349450) > @@ -1438,8 +1438,11 @@ printipflog: > static void usage(prog) > char *prog; > { > - fprintf(stderr, "%s: [-NFhstvxX] [-f ]\n", prog); > - exit(1); expected > + fprintf(stderr, "Usage: %s [ -abDFhnpstvxX ] [ -B ] [ -C ]\n" > + "\t[ -f ] [ -L ] [ -N ]\n" > + "\t[ -o [NSI] ] [ -O [NSI] ] [ -P ] [ -S ]\n" > + "\t[ ]\n", prog); > + exit(-1); Was it intentional to flip the exit code to -1? Someones scripts might not be prepared for that. > } -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jun 27 03:43:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C65E15D9C10; Thu, 27 Jun 2019 03:43:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CE5226CC5D; Thu, 27 Jun 2019 03:43:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id gLJchgfslldkPgLJehoSbw; Wed, 26 Jun 2019 21:43:18 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=Vaev78BLB3p2O4-yin8A:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1D5B298F; Wed, 26 Jun 2019 20:43:16 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5R3hFhO058293; Wed, 26 Jun 2019 20:43:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5R3hFfS058290; Wed, 26 Jun 2019 20:43:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906270343.x5R3hFfS058290@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349450 - head/contrib/ipfilter/tools In-Reply-To: Message from "Rodney W. Grimes" of "Wed, 26 Jun 2019 20:01:54 -0700." <201906270301.x5R31sLH057763@gndrsh.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 26 Jun 2019 20:43:15 -0700 X-CMAE-Envelope: MS4wfIg/Zlq/oIv5wL4bbI4sF0JJn81o6PA0iEe35zxL2y8Z9KAjNCDC8wTFSLlMjl3Zt9XU+hPuamEvDNKyD70S2T5wnyNFvfAkudbYkgv24nOIyE77Q68r 3+KRWdkp9pP/r93HPsPfQRJ9FOE6i+KNZe/uvBWt1ZusJISR06+wUcwVVWTKGQO0JzgqQY5X2OHQMRHCQSWBnIlSqILRD6WUe1HlWnNVmNytZQmZTRhCZ9zW BndlidxL1OBEQtkIIafNdZ9Rhmtm9MyM2T3pSQBNcIgM86CciwGftAI7Uj6Vd6TlmM9yInQYddfMKP6dR2YODQ== X-Rspamd-Queue-Id: CE5226CC5D X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.55)[ip: (-6.85), ipnet: 64.59.128.0/20(-3.27), asn: 6327(-2.54), country: CA(-0.09)]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.73)[-0.729,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 03:43:22 -0000 In message <201906270301.x5R31sLH057763@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > Author: cy > > Date: Thu Jun 27 02:43:30 2019 > > New Revision: 349450 > > URL: https://svnweb.freebsd.org/changeset/base/349450 > > > > Log: > > Update usage() to refect the current state of ipmon. > > > > PR: 238816 > > MFC after: 1 week > > > > Modified: > > head/contrib/ipfilter/tools/ipmon.c > > > > Modified: head/contrib/ipfilter/tools/ipmon.c > > =========================================================================== > === > > --- head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 02:43:26 2019 > (r349449) > > +++ head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 02:43:30 2019 > (r349450) > > @@ -1438,8 +1438,11 @@ printipflog: > > static void usage(prog) > > char *prog; > > { > > - fprintf(stderr, "%s: [-NFhstvxX] [-f ]\n", prog); > > - exit(1); > expected > > > + fprintf(stderr, "Usage: %s [ -abDFhnpstvxX ] [ -B ] [ > -C ]\n" > > + "\t[ -f ] [ -L ] [ -N ]\n" > > + "\t[ -o [NSI] ] [ -O [NSI] ] [ -P ] [ -S ]\n > " > > + "\t[ ]\n", prog); > > + exit(-1); > > Was it intentional to flip the exit code to -1? > Someones scripts might not be prepared for that. My mistake I missed that. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Jun 27 03:50:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BEEC15D9DD8; Thu, 27 Jun 2019 03:50:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DDE16CFDF; Thu, 27 Jun 2019 03:50:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6CA09B82; Thu, 27 Jun 2019 03:50:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5R3oDvw005554; Thu, 27 Jun 2019 03:50:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5R3oDlg005553; Thu, 27 Jun 2019 03:50:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906270350.x5R3oDlg005553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Jun 2019 03:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349451 - head/contrib/ipfilter/tools X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/tools X-SVN-Commit-Revision: 349451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DDE16CFDF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 03:50:14 -0000 Author: cy Date: Thu Jun 27 03:50:13 2019 New Revision: 349451 URL: https://svnweb.freebsd.org/changeset/base/349451 Log: Return a return code scripts might expect. I missed this while reviewing and rewriting a patch in PR/238816. PR: 238816 Reported by: rgrimes@ Pointy hat to: cy@ MFC after: 1 week X-MFC with: r349450 Modified: head/contrib/ipfilter/tools/ipmon.c Modified: head/contrib/ipfilter/tools/ipmon.c ============================================================================== --- head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 02:43:30 2019 (r349450) +++ head/contrib/ipfilter/tools/ipmon.c Thu Jun 27 03:50:13 2019 (r349451) @@ -1442,7 +1442,7 @@ static void usage(prog) "\t[ -f ] [ -L ] [ -N ]\n" "\t[ -o [NSI] ] [ -O [NSI] ] [ -P ] [ -S ]\n" "\t[ ]\n", prog); - exit(-1); + exit(1); } From owner-svn-src-all@freebsd.org Thu Jun 27 12:37:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BB8015C1CCA; Thu, 27 Jun 2019 12:37:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B69F284551; Thu, 27 Jun 2019 12:37:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 969D0F5D0; Thu, 27 Jun 2019 12:37:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RCbjQu088270; Thu, 27 Jun 2019 12:37:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RCbjxX088267; Thu, 27 Jun 2019 12:37:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906271237.x5RCbjxX088267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Jun 2019 12:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349452 - in head: sbin/ipf/ipmon tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head: sbin/ipf/ipmon tools/build/mk X-SVN-Commit-Revision: 349452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B69F284551 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 12:37:46 -0000 Author: cy Date: Thu Jun 27 12:37:44 2019 New Revision: 349452 URL: https://svnweb.freebsd.org/changeset/base/349452 Log: Create a link to the ipmon.conf.5 man page as documented in ipmon.5. Add its corresponding optional removal entry. PR: 238816 MFC after: 1 week Modified: head/sbin/ipf/ipmon/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/sbin/ipf/ipmon/Makefile ============================================================================== --- head/sbin/ipf/ipmon/Makefile Thu Jun 27 03:50:13 2019 (r349451) +++ head/sbin/ipf/ipmon/Makefile Thu Jun 27 12:37:44 2019 (r349452) @@ -4,6 +4,7 @@ PACKAGE= ipf PROG= ipmon SRCS= ${GENHDRS} ipmon.c ipmon_y.c ipmon_l.c MAN= ipmon.5 ipmon.8 +MLINKS= ipmon.5 ipmon.conf.5 CFLAGS+= -DLOGFAC=LOG_LOCAL0 -I. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 27 03:50:13 2019 (r349451) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 27 12:37:44 2019 (r349452) @@ -3351,6 +3351,7 @@ OLD_FILES+=usr/share/man/man5/ipf.conf.5.gz OLD_FILES+=usr/share/man/man5/ipf6.conf.5.gz OLD_FILES+=usr/share/man/man5/ipfilter.5.gz OLD_FILES+=usr/share/man/man8/ipmon.5.gz +OLD_FILES+=usr/share/man/man5/ipmon.conf.5.gz OLD_FILES+=usr/share/man/man5/ipnat.5.gz OLD_FILES+=usr/share/man/man5/ipnat.conf.5.gz OLD_FILES+=usr/share/man/man5/ippool.5.gz From owner-svn-src-all@freebsd.org Thu Jun 27 13:31:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24CD15C3201; Thu, 27 Jun 2019 13:31:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83FE585EF9; Thu, 27 Jun 2019 13:31:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F50DFFBD; Thu, 27 Jun 2019 13:31:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RDVuBK020035; Thu, 27 Jun 2019 13:31:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RDVukU020034; Thu, 27 Jun 2019 13:31:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906271331.x5RDVukU020034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 27 Jun 2019 13:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349453 - head/release/picobsd/build X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/release/picobsd/build X-SVN-Commit-Revision: 349453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83FE585EF9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 13:31:57 -0000 Author: emaste Date: Thu Jun 27 13:31:55 2019 New Revision: 349453 URL: https://svnweb.freebsd.org/changeset/base/349453 Log: picobsd: also exclude .git where we exclude .svn today Sponsored by: The FreeBSD Foundation Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Thu Jun 27 12:37:44 2019 (r349452) +++ head/release/picobsd/build/picobsd Thu Jun 27 13:31:55 2019 (r349453) @@ -437,7 +437,7 @@ populate_floppy_fs() { # OK ${MY_TREE}/floppy.tree.${SITE} ; do if [ -d ${FLOPPY_TREE} ] ; then (cd ${FLOPPY_TREE} ; tar -cf - \ - --exclude .svn ${excl} . ) | \ + --exclude .git --exclude .svn ${excl} . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) log "Copied from ${FLOPPY_TREE}" fi @@ -698,7 +698,7 @@ populate_mfs_tree() { for MFS_TREE in ${PICO_TREE}/mfs_tree ${MY_TREE}/mfs_tree ; do if [ -d ${MFS_TREE} ] ; then log "Copy ${MFS_TREE} ..." - (cd ${MFS_TREE} ; tar -cf - --exclude .svn . ) | \ + (cd ${MFS_TREE} ; tar -cf - --exclude .git --exclude .svn . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) fi done From owner-svn-src-all@freebsd.org Thu Jun 27 13:37:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97B7A15C3450; Thu, 27 Jun 2019 13:37:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3845E86348; Thu, 27 Jun 2019 13:37:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06AFD18002; Thu, 27 Jun 2019 13:37:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RDbaSN022903; Thu, 27 Jun 2019 13:37:36 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RDbYvH022889; Thu, 27 Jun 2019 13:37:34 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906271337.x5RDbYvH022889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 27 Jun 2019 13:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349454 - in vendor/libarchive/dist: . build/ci/cirrus_ci libarchive libarchive/test X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in vendor/libarchive/dist: . build/ci/cirrus_ci libarchive libarchive/test X-SVN-Commit-Revision: 349454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3845E86348 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 13:37:37 -0000 Author: mm Date: Thu Jun 27 13:37:34 2019 New Revision: 349454 URL: https://svnweb.freebsd.org/changeset/base/349454 Log: Update vendor/libarchive/dist to git d6d3799d6b309593f271c4c319dfba92efc95772 Relevant vendor changes: PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary (OSS-Fuzz 15431) PR #1218: Fixes to sparse file handling Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc30 vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc30.distcheck vendor/libarchive/dist/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu Deleted: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29 vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29.distcheck Modified: vendor/libarchive/dist/.cirrus.yml vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Modified: vendor/libarchive/dist/.cirrus.yml ============================================================================== --- vendor/libarchive/dist/.cirrus.yml Thu Jun 27 13:31:55 2019 (r349453) +++ vendor/libarchive/dist/.cirrus.yml Thu Jun 27 13:37:34 2019 (r349454) @@ -35,8 +35,6 @@ MacOS_task: matrix: osx_instance: image: mojave-xcode-10.2 - osx_instance: - image: high-sierra-xcode-10.0 prepare_script: - ./build/ci/cirrus_ci/ci.sh prepare configure_script: @@ -50,9 +48,9 @@ MacOS_task: install_script: - ./build/ci/build.sh -a install -Fedora_29_task: +Fedora_30_task: container: - dockerfile: build/ci/cirrus_ci/Dockerfile.fc29 + dockerfile: build/ci/cirrus_ci/Dockerfile.fc30 matrix: env: BS: autotools @@ -68,9 +66,9 @@ Fedora_29_task: install_script: - ./build/ci/build.sh -a install -Fedora_29_distcheck_task: +Fedora_30_distcheck_task: container: - dockerfile: build/ci/cirrus_ci/Dockerfile.fc29.distcheck + dockerfile: build/ci/cirrus_ci/Dockerfile.fc30.distcheck env: BS: autotools configure_script: Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Thu Jun 27 13:31:55 2019 (r349453) +++ vendor/libarchive/dist/Makefile.am Thu Jun 27 13:37:34 2019 (r349454) @@ -865,6 +865,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_rar5_symlink.rar.uu \ libarchive/test/test_read_format_rar5_truncated_huff.rar.uu \ libarchive/test/test_read_format_rar5_win32.rar.uu \ + libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu \ libarchive/test/test_read_format_raw.bufr.uu \ libarchive/test/test_read_format_raw.data.gz.uu \ libarchive/test/test_read_format_raw.data.Z.uu \ Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc30 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc30 Thu Jun 27 13:37:34 2019 (r349454) @@ -0,0 +1,3 @@ +FROM fedora:30 + +RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc30.distcheck ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc30.distcheck Thu Jun 27 13:37:34 2019 (r349454) @@ -0,0 +1,3 @@ +FROM fedora:30 + +RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel groff ghostscript Modified: vendor/libarchive/dist/libarchive/archive_read.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read.c Thu Jun 27 13:31:55 2019 (r349453) +++ vendor/libarchive/dist/libarchive/archive_read.c Thu Jun 27 13:37:34 2019 (r349454) @@ -844,7 +844,8 @@ archive_read_data(struct archive *_a, void *buff, size dest = (char *)buff; while (s > 0) { - if (a->read_data_remaining == 0) { + if (a->read_data_offset == a->read_data_output_offset && + a->read_data_remaining == 0) { read_buf = a->read_data_block; a->read_data_is_posix_read = 1; a->read_data_requested = s; Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Thu Jun 27 13:31:55 2019 (r349453) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Thu Jun 27 13:37:34 2019 (r349454) @@ -1143,6 +1143,8 @@ _archive_read_next_header2(struct archive *_a, struct t->entry_fd = -1; } + archive_entry_clear(entry); + for (;;) { r = next_entry(a, t, entry); if (t->entry_fd >= 0) { Modified: vendor/libarchive/dist/libarchive/archive_read_disk_windows.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Thu Jun 27 13:31:55 2019 (r349453) +++ vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Thu Jun 27 13:37:34 2019 (r349454) @@ -1126,6 +1126,8 @@ _archive_read_next_header2(struct archive *_a, struct t->entry_fh = INVALID_HANDLE_VALUE; } + archive_entry_clear(entry); + while ((r = next_entry(a, t, entry)) == ARCHIVE_RETRY) archive_entry_clear(entry); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c Thu Jun 27 13:31:55 2019 (r349453) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c Thu Jun 27 13:37:34 2019 (r349454) @@ -623,9 +623,9 @@ static int run_arm_filter(struct rar5* rar, struct fil for(i = 0; i < flt->block_length - 3; i += 4) { uint8_t* b = &rar->cstate.window_buf[ (rar->cstate.solid_offset + - flt->block_start + i) & rar->cstate.window_mask]; + flt->block_start + i + 3) & rar->cstate.window_mask]; - if(b[3] == 0xEB) { + if(*b == 0xEB) { /* 0xEB = ARM's BL (branch + link) instruction. */ offset = read_filter_data(rar, (rar->cstate.solid_offset + flt->block_start + i) & Modified: vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Thu Jun 27 13:31:55 2019 (r349453) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Thu Jun 27 13:37:34 2019 (r349454) @@ -1215,3 +1215,18 @@ DEFINE_TEST(test_read_format_rar5_different_window_siz EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_arm_filter_on_window_boundary) +{ + char buf[4096]; + PROLOGUE("test_read_format_rar5_arm_filter_on_window_boundary.rar"); + + /* Return codes of those calls are ignored, because this sample file + * is invalid. However, the unpacker shouldn't produce any SIGSEGV + * errors during processing. */ + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + EPILOGUE(); +} Added: vendor/libarchive/dist/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu Thu Jun 27 13:37:34 2019 (r349454) @@ -0,0 +1,9 @@ +begin 600 test_read_format_rar5_arm_filter_on_window_boundary.rar +M4F%R(1H'`0"-[P+2``(''(`'`/[_(`#_!``"(0$``/X(TB`!'O___P@``/W_ +M_Q``_]U84%"0_P1LAFVQ9,S,M[$`20"#__\`_P#_`/G___!DSR0V2+$`20`Z +M@R[_______\I:!<**-@P70D`KB1! Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2E9D15C3C45; Thu, 27 Jun 2019 14:03:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 884AA86F37; Thu, 27 Jun 2019 14:03:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 613C518504; Thu, 27 Jun 2019 14:03:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RE3XZg039006; Thu, 27 Jun 2019 14:03:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RE3XDC039005; Thu, 27 Jun 2019 14:03:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906271403.x5RE3XDC039005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 27 Jun 2019 14:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349455 - in head/sbin/bectl: . tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sbin/bectl: . tests X-SVN-Commit-Revision: 349455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 884AA86F37 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 14:03:34 -0000 Author: kevans Date: Thu Jun 27 14:03:32 2019 New Revision: 349455 URL: https://svnweb.freebsd.org/changeset/base/349455 Log: bectl(8): create non-recursive boot environments bectl advertises that it has the ability to create recursive and non-recursive boot environments. This patch implements that functionality using the be_create_depth API provided by libbe. With this patch, bectl now works as bectl(8) describes in regards to creating recursive/non-recursive boot environments. Submitted by: Rob Fairbanks (with minor changes) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20240 Modified: head/sbin/bectl/bectl.c head/sbin/bectl/tests/bectl_test.sh Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Thu Jun 27 13:37:34 2019 (r349454) +++ head/sbin/bectl/bectl.c Thu Jun 27 14:03:32 2019 (r349455) @@ -184,7 +184,8 @@ bectl_cmd_activate(int argc, char *argv[]) static int bectl_cmd_create(int argc, char *argv[]) { - char *atpos, *bootenv, *snapname, *source; + char snapshot[BE_MAXPATHLEN]; + char *atpos, *bootenv, *snapname; int err, opt; bool recursive; @@ -214,6 +215,8 @@ bectl_cmd_create(int argc, char *argv[]) } bootenv = *argv; + + err = BE_ERR_SUCCESS; if ((atpos = strchr(bootenv, '@')) != NULL) { /* * This is the "create a snapshot variant". No new boot @@ -221,24 +224,22 @@ bectl_cmd_create(int argc, char *argv[]) */ *atpos++ = '\0'; err = be_snapshot(be, bootenv, atpos, recursive, NULL); - } else if (snapname != NULL) { - if (strchr(snapname, '@') != NULL) - err = be_create_from_existing_snap(be, bootenv, - snapname); - else - err = be_create_from_existing(be, bootenv, snapname); } else { - if ((snapname = strchr(bootenv, '@')) != NULL) { - *(snapname++) = '\0'; - if ((err = be_snapshot(be, be_active_path(be), - snapname, true, NULL)) != BE_ERR_SUCCESS) - fprintf(stderr, "failed to create snapshot\n"); - asprintf(&source, "%s@%s", be_active_path(be), snapname); - err = be_create_from_existing_snap(be, bootenv, - source); - return (err); - } else - err = be_create(be, bootenv); + if (snapname == NULL) + /* Create from currently booted BE */ + err = be_snapshot(be, be_active_path(be), NULL, + recursive, snapshot); + else if (strchr(snapname, '@') != NULL) + /* Create from given snapshot */ + strlcpy(snapshot, snapname, sizeof(snapshot)); + else + /* Create from given BE */ + err = be_snapshot(be, snapname, NULL, recursive, + snapshot); + + if (err == BE_ERR_SUCCESS) + err = be_create_depth(be, bootenv, snapshot, + recursive == true ? -1 : 0); } switch (err) { Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Thu Jun 27 13:37:34 2019 (r349454) +++ head/sbin/bectl/tests/bectl_test.sh Thu Jun 27 14:03:32 2019 (r349455) @@ -99,11 +99,35 @@ bectl_create_body() mount=${cwd}/mnt bectl_create_setup ${zpool} ${disk} ${mount} + + # Create a child dataset that will be used to test creation + # of recursive and non-recursive boot environments. + atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ + ${zpool}/ROOT/default/usr + # Test standard creation, creation of a snapshot, and creation from a # snapshot. atf_check bectl -r ${zpool}/ROOT create -e default default2 atf_check bectl -r ${zpool}/ROOT create default2@test_snap atf_check bectl -r ${zpool}/ROOT create -e default2@test_snap default3 + + # Test standard creation, creation of a snapshot, and creation from a + # snapshot for recursive boot environments. + atf_check bectl -r ${zpool}/ROOT create -r -e default recursive + atf_check bectl -r ${zpool}/ROOT create -r recursive@test_snap + atf_check bectl -r ${zpool}/ROOT create -r -e recursive@test_snap recursive-snap + + # Test that non-recursive boot environments have no child datasets. + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/default2/usr" + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/default3/usr" + + # Test that recursive boot environments have child datasets. + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive/usr" + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive-snap/usr" } bectl_create_cleanup() { From owner-svn-src-all@freebsd.org Thu Jun 27 14:10:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC00D15C3E71; Thu, 27 Jun 2019 14:10:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6224687245; Thu, 27 Jun 2019 14:10:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BFC218533; Thu, 27 Jun 2019 14:10:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5REAxJv041618; Thu, 27 Jun 2019 14:10:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5REAxrw041617; Thu, 27 Jun 2019 14:10:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906271410.x5REAxrw041617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Jun 2019 14:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349456 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 349456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6224687245 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 14:10:59 -0000 Author: mav Date: Thu Jun 27 14:10:58 2019 New Revision: 349456 URL: https://svnweb.freebsd.org/changeset/base/349456 Log: MFC r349376: Fix strsep_quote() on strings without quotes. For strings without quotes and escapes dstptr and srcptr are equal, so zeroing *dstptr before checking *srcptr is not a good idea. In practice it means that in -maproot=65534:65533 everything after the colon is lost. The problem was there since r293305, but before r346976 it was covered by improper strsep_quote() usage. PR: 238725 Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Thu Jun 27 14:03:32 2019 (r349455) +++ stable/12/usr.sbin/mountd/mountd.c Thu Jun 27 14:10:58 2019 (r349456) @@ -351,8 +351,8 @@ strsep_quote(char **stringp, const char *delim) *dstptr++ = *srcptr++; } - *dstptr = 0; /* Terminate the string */ *stringp = (*srcptr == '\0') ? NULL : srcptr + 1; + *dstptr = 0; /* Terminate the string */ return (retval); } From owner-svn-src-all@freebsd.org Thu Jun 27 14:12:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB20015C40F9; Thu, 27 Jun 2019 14:12:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 826168765D; Thu, 27 Jun 2019 14:12:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58F4C186A3; Thu, 27 Jun 2019 14:12:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RECLZI044257; Thu, 27 Jun 2019 14:12:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RECLIJ044256; Thu, 27 Jun 2019 14:12:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906271412.x5RECLIJ044256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Jun 2019 14:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349457 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 349457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 826168765D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 14:12:22 -0000 Author: mav Date: Thu Jun 27 14:12:20 2019 New Revision: 349457 URL: https://svnweb.freebsd.org/changeset/base/349457 Log: MFC r349376: Fix strsep_quote() on strings without quotes. For strings without quotes and escapes dstptr and srcptr are equal, so zeroing *dstptr before checking *srcptr is not a good idea. In practice it means that in -maproot=65534:65533 everything after the colon is lost. The problem was there since r293305, but before r346976 it was covered by improper strsep_quote() usage. PR: 238725 Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Thu Jun 27 14:10:58 2019 (r349456) +++ stable/11/usr.sbin/mountd/mountd.c Thu Jun 27 14:12:20 2019 (r349457) @@ -349,8 +349,8 @@ strsep_quote(char **stringp, const char *delim) *dstptr++ = *srcptr++; } - *dstptr = 0; /* Terminate the string */ *stringp = (*srcptr == '\0') ? NULL : srcptr + 1; + *dstptr = 0; /* Terminate the string */ return (retval); } From owner-svn-src-all@freebsd.org Thu Jun 27 14:26:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE07E15C4778; Thu, 27 Jun 2019 14:26:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 137F388685; Thu, 27 Jun 2019 14:26:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEB3F1884C; Thu, 27 Jun 2019 14:26:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5REQvNi049631; Thu, 27 Jun 2019 14:26:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5REQvZA049630; Thu, 27 Jun 2019 14:26:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906271426.x5REQvZA049630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Jun 2019 14:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349458 - releng/11.3/usr.sbin/mountd X-SVN-Group: releng X-SVN-Commit-Author: mav X-SVN-Commit-Paths: releng/11.3/usr.sbin/mountd X-SVN-Commit-Revision: 349458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 137F388685 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 14:27:00 -0000 Author: mav Date: Thu Jun 27 14:26:57 2019 New Revision: 349458 URL: https://svnweb.freebsd.org/changeset/base/349458 Log: MFC r349376: Fix strsep_quote() on strings without quotes. For strings without quotes and escapes dstptr and srcptr are equal, so zeroing *dstptr before checking *srcptr is not a good idea. In practice it means that in -maproot=65534:65533 everything after the colon is lost. The problem was there since r293305, but before r346976 it was covered by improper strsep_quote() usage. PR: 238725 Approved by: re (gjb) Modified: releng/11.3/usr.sbin/mountd/mountd.c Directory Properties: releng/11.3/ (props changed) Modified: releng/11.3/usr.sbin/mountd/mountd.c ============================================================================== --- releng/11.3/usr.sbin/mountd/mountd.c Thu Jun 27 14:12:20 2019 (r349457) +++ releng/11.3/usr.sbin/mountd/mountd.c Thu Jun 27 14:26:57 2019 (r349458) @@ -343,8 +343,8 @@ strsep_quote(char **stringp, const char *delim) *dstptr++ = *srcptr++; } - *dstptr = 0; /* Terminate the string */ *stringp = (*srcptr == '\0') ? NULL : srcptr + 1; + *dstptr = 0; /* Terminate the string */ return (retval); } From owner-svn-src-all@freebsd.org Thu Jun 27 15:07:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A834A15C58C7; Thu, 27 Jun 2019 15:07:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F1A48A576; Thu, 27 Jun 2019 15:07:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2882018F79; Thu, 27 Jun 2019 15:07:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RF770m070617; Thu, 27 Jun 2019 15:07:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RF775Q070616; Thu, 27 Jun 2019 15:07:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906271507.x5RF775Q070616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Jun 2019 15:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349459 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 349459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F1A48A576 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 15:07:07 -0000 Author: avg Date: Thu Jun 27 15:07:06 2019 New Revision: 349459 URL: https://svnweb.freebsd.org/changeset/base/349459 Log: upgrade the warning printf-s in bus accessors to KASSERT-s After this change sys/bus.h includes sys/systm.h. Discussed with: cem, imp MFC after: 2 weeks Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Thu Jun 27 14:26:57 2019 (r349458) +++ head/sys/sys/bus.h Thu Jun 27 15:07:06 2019 (r349459) @@ -35,6 +35,7 @@ #include #include #include +#include /** * @defgroup NEWBUS newbus - a generic framework for managing devices @@ -813,12 +814,9 @@ static __inline type varp ## _get_ ## var(device_t dev int e; \ e = BUS_READ_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, &v); \ - if (e != 0) { \ - device_printf(dev, "failed to read ivar " \ - __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ - "error = %d\n", \ - device_get_nameunit(device_get_parent(dev)), e); \ - } \ + KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \ + __func__, device_get_nameunit(dev), \ + device_get_nameunit(device_get_parent(dev)), e)); \ return ((type) v); \ } \ \ @@ -828,12 +826,9 @@ static __inline void varp ## _set_ ## var(device_t dev int e; \ e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, v); \ - if (e != 0) { \ - device_printf(dev, "failed to write ivar " \ - __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ - "error = %d\n", \ - device_get_nameunit(device_get_parent(dev)), e); \ - } \ + KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \ + __func__, device_get_nameunit(dev), \ + device_get_nameunit(device_get_parent(dev)), e)); \ } /** From owner-svn-src-all@freebsd.org Thu Jun 27 15:46:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CDB15C6524; Thu, 27 Jun 2019 15:46:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 243208BB1A; Thu, 27 Jun 2019 15:46:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9F141962E; Thu, 27 Jun 2019 15:46:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RFk64I091266; Thu, 27 Jun 2019 15:46:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RFk68w091263; Thu, 27 Jun 2019 15:46:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906271546.x5RFk68w091263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Jun 2019 15:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349460 - in head: share/man/man4 sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/gpio X-SVN-Commit-Revision: 349460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 243208BB1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 15:46:07 -0000 Author: avg Date: Thu Jun 27 15:46:06 2019 New Revision: 349460 URL: https://svnweb.freebsd.org/changeset/base/349460 Log: gpiobus: provide a new hint, pin_list "pin_list" allows to specify child pins as a list of pin numbers. Existing hint "pins" serves the same purpose but with a 32-bit wide bit mask. One problem with that is that a controller can have more than 32 pins. One example is amdgpio. Also, a list of numbers is a little bit more human friendly than a matching bit mask. As a side note, it seems that in FDT pins are typically specified by their numbers as well. This commit also adds accessors for instance variables (IVARs) that define the child pins. My primary goal is to allow a child to be configured programmatically rather than via hints (assuming that FDT is not supported on a platform). Also, while a child should not care about specific pin numbers that are allocated to it, it could be interested in how many were actually assigned to it. While there, I removed "flags" instance variable. It was unused. Reviewed by: mizhka MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20459 Modified: head/share/man/man4/gpio.4 head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h Modified: head/share/man/man4/gpio.4 ============================================================================== --- head/share/man/man4/gpio.4 Thu Jun 27 15:07:06 2019 (r349459) +++ head/share/man/man4/gpio.4 Thu Jun 27 15:46:06 2019 (r349460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 26, 2019 +.Dd June 27, 2019 .Dt GPIO 4 .Os .Sh NAME @@ -109,7 +109,7 @@ based system these hints can be used to configure driv attached to .Nm pins: -.Bl -tag -width ".Va hint.driver.unit.pins" +.Bl -tag -width ".Va hint.driver.unit.pin_list" .It Va hint.driver.unit.at The .Nm gpiobus @@ -125,6 +125,20 @@ This is a bitmask of the pins on the .Nm gpiobus that are connected to the device. The pins will be allocated to the specified driver instance. +Only pins with numbers from 0 to 31 can be specified using this hint. +.It Va hint.driver.unit.pin_list +This is a list of pin numbers of pins on the +.Nm gpiobus +that are connected to the device. +The pins will be allocated to the specified driver instance. +This is a more user friendly alternative to the +.Ar pins +hint. +Additionally, this hint allows specifying pin numbers greater than 31. +The numbers can be decimal or hexadecimal with 0x prefix. +Any non-digit character can be used as a separator. +For example, it can be a comma, a slash or a space. +The separator can be followed by any number of space characters. .El .Pp The following Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Jun 27 15:07:06 2019 (r349459) +++ head/sys/dev/gpio/gpiobus.c Thu Jun 27 15:46:06 2019 (r349460) @@ -255,13 +255,6 @@ gpiobus_alloc_ivars(struct gpiobus_ivar *devi) M_NOWAIT | M_ZERO); if (devi->pins == NULL) return (ENOMEM); - devi->flags = malloc(sizeof(uint32_t) * devi->npins, M_DEVBUF, - M_NOWAIT | M_ZERO); - if (devi->flags == NULL) { - free(devi->pins, M_DEVBUF); - return (ENOMEM); - } - return (0); } @@ -269,14 +262,11 @@ void gpiobus_free_ivars(struct gpiobus_ivar *devi) { - if (devi->flags) { - free(devi->flags, M_DEVBUF); - devi->flags = NULL; - } if (devi->pins) { free(devi->pins, M_DEVBUF); devi->pins = NULL; } + devi->npins = 0; } int @@ -326,6 +316,34 @@ gpiobus_release_pin(device_t bus, uint32_t pin) } static int +gpiobus_acquire_child_pins(device_t dev, device_t child) +{ + struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + int i; + + for (i = 0; i < devi->npins; i++) { + /* Reserve the GPIO pin. */ + if (gpiobus_acquire_pin(dev, devi->pins[i]) != 0) { + device_printf(child, "cannot acquire pin %d\n", + devi->pins[i]); + while (--i >= 0) { + (void)gpiobus_release_pin(dev, + devi->pins[i]); + } + gpiobus_free_ivars(devi); + return (EBUSY); + } + } + for (i = 0; i < devi->npins; i++) { + /* Use the child name as pin name. */ + GPIOBUS_PIN_SETNAME(dev, devi->pins[i], + device_get_nameunit(child)); + + } + return (0); +} + +static int gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask) { struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); @@ -349,21 +367,70 @@ gpiobus_parse_pins(struct gpiobus_softc *sc, device_t for (i = 0; i < 32; i++) { if ((mask & (1 << i)) == 0) continue; - /* Reserve the GPIO pin. */ - if (gpiobus_acquire_pin(sc->sc_busdev, i) != 0) { - gpiobus_free_ivars(devi); - return (EINVAL); - } devi->pins[npins++] = i; - /* Use the child name as pin name. */ - GPIOBUS_PIN_SETNAME(sc->sc_busdev, i, - device_get_nameunit(child)); } + if (gpiobus_acquire_child_pins(sc->sc_busdev, child) != 0) + return (EINVAL); return (0); } static int +gpiobus_parse_pin_list(struct gpiobus_softc *sc, device_t child, + const char *pins) +{ + struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + const char *p; + char *endp; + unsigned long pin; + int i, npins; + + npins = 0; + p = pins; + for (;;) { + pin = strtoul(p, &endp, 0); + if (endp == p) + break; + npins++; + if (*endp == '\0') + break; + p = endp + 1; + } + + if (*endp != '\0') { + device_printf(child, "garbage in the pin list: %s\n", endp); + return (EINVAL); + } + if (npins == 0) { + device_printf(child, "empty pin list\n"); + return (EINVAL); + } + + devi->npins = npins; + if (gpiobus_alloc_ivars(devi) != 0) { + device_printf(child, "cannot allocate device ivars\n"); + return (EINVAL); + } + + i = 0; + p = pins; + for (;;) { + pin = strtoul(p, &endp, 0); + + devi->pins[i] = pin; + + if (*endp == '\0') + break; + i++; + p = endp + 1; + } + + if (gpiobus_acquire_child_pins(sc->sc_busdev, child) != 0) + return (EINVAL); + return (0); +} + +static int gpiobus_probe(device_t dev) { device_set_desc(dev, "GPIO bus"); @@ -539,16 +606,27 @@ gpiobus_hinted_child(device_t bus, const char *dname, struct gpiobus_softc *sc = GPIOBUS_SOFTC(bus); struct gpiobus_ivar *devi; device_t child; - int irq, pins; + const char *pins; + int irq, pinmask; child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = GPIOBUS_IVAR(child); - resource_int_value(dname, dunit, "pins", &pins); - if (gpiobus_parse_pins(sc, child, pins)) { - resource_list_free(&devi->rl); - free(devi, M_DEVBUF); - device_delete_child(bus, child); + if (resource_int_value(dname, dunit, "pins", &pinmask) == 0) { + if (gpiobus_parse_pins(sc, child, pinmask)) { + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return; + } } + else if (resource_string_value(dname, dunit, "pin_list", &pins) == 0) { + if (gpiobus_parse_pin_list(sc, child, pins)) { + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return; + } + } if (resource_int_value(dname, dunit, "irq", &irq) == 0) { if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) device_printf(bus, @@ -574,6 +652,61 @@ gpiobus_set_resource(device_t dev, device_t child, int return (0); } +static int +gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct gpiobus_ivar *devi; + + devi = GPIOBUS_IVAR(child); + switch (which) { + case GPIOBUS_IVAR_NPINS: + *result = devi->npins; + break; + case GPIOBUS_IVAR_PINS: + /* Children do not ever need to directly examine this. */ + return (ENOTSUP); + default: + return (ENOENT); + } + + return (0); +} + +static int +gpiobus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct gpiobus_ivar *devi; + const uint32_t *ptr; + int i; + + devi = GPIOBUS_IVAR(child); + switch (which) { + case GPIOBUS_IVAR_NPINS: + /* GPIO ivars are set once. */ + if (devi->npins != 0) { + return (EBUSY); + } + devi->npins = value; + if (gpiobus_alloc_ivars(devi) != 0) { + device_printf(child, "cannot allocate device ivars\n"); + devi->npins = 0; + return (ENOMEM); + } + break; + case GPIOBUS_IVAR_PINS: + ptr = (const uint32_t *)value; + for (i = 0; i < devi->npins; i++) + devi->pins[i] = ptr[i]; + if (gpiobus_acquire_child_pins(dev, child) != 0) + return (EBUSY); + break; + default: + return (ENOENT); + } + + return (0); +} + static struct resource * gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -833,6 +966,8 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_child_pnpinfo_str, gpiobus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, gpiobus_child_location_str), DEVMETHOD(bus_hinted_child, gpiobus_hinted_child), + DEVMETHOD(bus_read_ivar, gpiobus_read_ivar), + DEVMETHOD(bus_write_ivar, gpiobus_write_ivar), /* GPIO protocol */ DEVMETHOD(gpiobus_acquire_bus, gpiobus_acquire_bus), Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu Jun 27 15:07:06 2019 (r349459) +++ head/sys/dev/gpio/gpiobusvar.h Thu Jun 27 15:46:06 2019 (r349460) @@ -107,9 +107,21 @@ struct gpiobus_ivar { struct resource_list rl; /* isr resource list */ uint32_t npins; /* pins total */ - uint32_t *flags; /* pins flags */ uint32_t *pins; /* pins map */ }; + +enum gpiobus_ivars { + GPIOBUS_IVAR_NPINS = 10500, + GPIOBUS_IVAR_PINS, +}; + +#define GPIOBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(gpiobus, var, GPIOBUS, ivar, type) + +GPIOBUS_ACCESSOR(npins, NPINS, uint32_t) +GPIOBUS_ACCESSOR(pins, PINS, const uint32_t *) + +#undef GPIOBUS_ACCESSOR #ifdef FDT struct ofw_gpiobus_devinfo { From owner-svn-src-all@freebsd.org Thu Jun 27 15:48:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3155415C65E0; Thu, 27 Jun 2019 15:48:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 946058BCD7; Thu, 27 Jun 2019 15:48:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 353823DCAC5; Fri, 28 Jun 2019 01:47:53 +1000 (AEST) Date: Fri, 28 Jun 2019 01:47:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349459 - head/sys/sys In-Reply-To: <201906271507.x5RF775Q070616@repo.freebsd.org> Message-ID: <20190628012059.D2091@besplex.bde.org> References: <201906271507.x5RF775Q070616@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=3aoYDsRNsgoN-TxrW0EA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 946058BCD7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.955,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 15:48:03 -0000 On Thu, 27 Jun 2019, Andriy Gapon wrote: > Log: > upgrade the warning printf-s in bus accessors to KASSERT-s > > After this change sys/bus.h includes sys/systm.h. This is further namespace pollution. sys/systm.h is a prerequiste for all kernel headers except sys/param.h and the headers that that includes, since any kernel header (except sys/param.hm etc.) may have inlines which use features in systm.h, e.g., KASSERT() or an inline function. > Modified: head/sys/sys/bus.h > ============================================================================== > --- head/sys/sys/bus.h Thu Jun 27 14:26:57 2019 (r349458) > +++ head/sys/sys/bus.h Thu Jun 27 15:07:06 2019 (r349459) > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include This header used to be relatively clean, with no polluting includes. The following low-quality headers in sys already include sys/systm.h: - capsicum.h:#include - fail.h:#include - fbio.h:#include - intr.h:#include - libkern.h:#include - malloc.h:#include - mbuf.h:#include - pmckern.h:#include - proc.h:#include - refcount.h:#include - seqc.h:#include - sf_buf.h:#include - zutil.h:#include This is especially bad in: - libkern.h. systm.h includes libkern.h, so this recurses. The recursion is bounded by the reinclude guard. libkern.h was broken by adding KASSERT()s to it. It is a leaf header, so must be written carefully. - malloc.h and mbuf.h. I fixed all the include pollution in them. They are now much more polluted than before I cleaned them - proc.h. Almost everything includes this. Including sys/systm.h in it hdes the bug of not including sys/systm.h in the correct place in .c files. > /** > * @defgroup NEWBUS newbus - a generic framework for managing devices > @@ -813,12 +814,9 @@ static __inline type varp ## _get_ ## var(device_t dev > int e; \ > e = BUS_READ_IVAR(device_get_parent(dev), dev, \ > ivarp ## _IVAR_ ## ivar, &v); \ > - if (e != 0) { \ > - device_printf(dev, "failed to read ivar " \ > - __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ > - "error = %d\n", \ > - device_get_nameunit(device_get_parent(dev)), e); \ > - } \ > + KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \ > + __func__, device_get_nameunit(dev), \ > + device_get_nameunit(device_get_parent(dev)), e)); \ > return ((type) v); \ > } \ > \ Inline functions in headers generally cause namespace pollution, like here. Some headers use macros which don't have that problem. mbuf.h used to be like that. The cleaned version of it in FreeBSD-4 includes only sys/queue.h. It has rotted to include sys/systm.h, sys/refcount.h, vm/uma.h. sys/lock.h and sys/sdt.h. Bruce From owner-svn-src-all@freebsd.org Thu Jun 27 15:51:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59B3015C68CF; Thu, 27 Jun 2019 15:51:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 008818C210; Thu, 27 Jun 2019 15:51:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D06E1196AB; Thu, 27 Jun 2019 15:51:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RFpo0D095340; Thu, 27 Jun 2019 15:51:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RFpoPh095339; Thu, 27 Jun 2019 15:51:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906271551.x5RFpoPh095339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Jun 2019 15:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349461 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 349461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 008818C210 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 15:51:51 -0000 Author: avg Date: Thu Jun 27 15:51:50 2019 New Revision: 349461 URL: https://svnweb.freebsd.org/changeset/base/349461 Log: revert r349460, printf -> KASSERT in bus.h, until I can fix it I tested only kernel builds naively assuming that sys/bus.h cannot affect userland builds. Pointyhat to: me Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Thu Jun 27 15:46:06 2019 (r349460) +++ head/sys/sys/bus.h Thu Jun 27 15:51:50 2019 (r349461) @@ -35,7 +35,6 @@ #include #include #include -#include /** * @defgroup NEWBUS newbus - a generic framework for managing devices @@ -814,9 +813,12 @@ static __inline type varp ## _get_ ## var(device_t dev int e; \ e = BUS_READ_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, &v); \ - KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \ - __func__, device_get_nameunit(dev), \ - device_get_nameunit(device_get_parent(dev)), e)); \ + if (e != 0) { \ + device_printf(dev, "failed to read ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ return ((type) v); \ } \ \ @@ -826,9 +828,12 @@ static __inline void varp ## _set_ ## var(device_t dev int e; \ e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, v); \ - KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \ - __func__, device_get_nameunit(dev), \ - device_get_nameunit(device_get_parent(dev)), e)); \ + if (e != 0) { \ + device_printf(dev, "failed to write ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ } /** From owner-svn-src-all@freebsd.org Thu Jun 27 16:01:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FB8F15C6CFC; Thu, 27 Jun 2019 16:01:41 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 686928C7D5; Thu, 27 Jun 2019 16:01:40 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f49.google.com with SMTP id x144so1935503lfa.9; Thu, 27 Jun 2019 09:01:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=HcWqPngCeBhYZZe8lP6q1kctMIKX9sHtjVDxyTumER8=; b=K1iwAwQNONVKr3bOtIA0tt0XKXS3j4KEWwDYINRZSW0HKG50hv24+Ikb3iAn368YnP etNSqpG5ahIpWGuZ4/N8jK2qd01uOpvNylY6DT4ACI4YWAVi0TWHdWiYSGhEhp78vDL+ iRl6Mv0qNmJ6N3A+xd8eDSTdV0XGLjFRH/1HyNXRUOM8Fn69Sook1keCu1/QjdA5KdE0 A4owiZeOWgGS4aiNQcSQXKWK0h7L2S2e7jTE2cs1O6xDBRXODbBPZgIpGr/m8G/9slA+ lIyTftmITCRCPDus9qj8mMtUvkwqdNGiI6kTRFjiegZkRj3nyjbscrul+Q7KfVA9ZbpQ R8hw== X-Gm-Message-State: APjAAAUOzVxw7eAjWCkA4rhutbj7ujL5KtWcjsuZfA0R12vo1AwWhO+Z VinNL84wjv1Nh2jb3U1xOr41BpbMZ3g= X-Google-Smtp-Source: APXvYqzWncMhncUdZ53mFihYPfhk6XZZPUJ66Td7bTXSLMxCvNhbVKQI0DlsUoM2ACaIdOaz1jD4QQ== X-Received: by 2002:ac2:4a78:: with SMTP id q24mr2308877lfp.59.1561650844243; Thu, 27 Jun 2019 08:54:04 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 24sm697013ljs.63.2019.06.27.08.54.03 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 08:54:03 -0700 (PDT) Subject: Re: svn commit: r349459 - head/sys/sys To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906271507.x5RF775Q070616@repo.freebsd.org> <20190628012059.D2091@besplex.bde.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Thu, 27 Jun 2019 18:54:02 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190628012059.D2091@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 686928C7D5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.958,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 16:01:41 -0000 On 27/06/2019 18:47, Bruce Evans wrote: > On Thu, 27 Jun 2019, Andriy Gapon wrote: > >> Log: >>  upgrade the warning printf-s in bus accessors to KASSERT-s >> >>  After this change sys/bus.h includes sys/systm.h. > > This is further namespace pollution.  sys/systm.h is a prerequiste for > all kernel headers except sys/param.h and the headers that that includes, > since any kernel header (except sys/param.hm etc.) may have inlines which > use features in systm.h, e.g., KASSERT() or an inline function. Bruce, what do you think about amending style(9) to require that if sys/systm.h is to be included, then it must be included before any other header except for sys/param.h (and possibly sys/cdefs.h) ? -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Jun 27 16:48:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C804A15C78E0; Thu, 27 Jun 2019 16:48:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7556C8D9C3; Thu, 27 Jun 2019 16:48:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B57B1A03F; Thu, 27 Jun 2019 16:48:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RGmQi6022412; Thu, 27 Jun 2019 16:48:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RGmOHO022405; Thu, 27 Jun 2019 16:48:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906271648.x5RGmOHO022405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 27 Jun 2019 16:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349463 - in stable/12: lib/libkvm sys/riscv/riscv sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: lib/libkvm sys/riscv/riscv sys/vm X-SVN-Commit-Revision: 349463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7556C8D9C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 16:48:27 -0000 Author: markj Date: Thu Jun 27 16:48:24 2019 New Revision: 349463 URL: https://svnweb.freebsd.org/changeset/base/349463 Log: MFC r344827-344830, r344845: Implement minidump support for RISC-V. Added: stable/12/lib/libkvm/kvm_minidump_riscv.c - copied unchanged from r344829, head/lib/libkvm/kvm_minidump_riscv.c stable/12/lib/libkvm/kvm_riscv.h - copied, changed from r344829, head/lib/libkvm/kvm_riscv.h Modified: stable/12/lib/libkvm/Makefile stable/12/sys/riscv/riscv/minidump_machdep.c stable/12/sys/riscv/riscv/pmap.c stable/12/sys/riscv/riscv/uma_machdep.c stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libkvm/Makefile ============================================================================== --- stable/12/lib/libkvm/Makefile Thu Jun 27 16:30:25 2019 (r349462) +++ stable/12/lib/libkvm/Makefile Thu Jun 27 16:48:24 2019 (r349463) @@ -18,6 +18,7 @@ SRCS= kvm.c kvm_cptime.c kvm_getloadavg.c \ kvm_i386.c kvm_minidump_i386.c \ kvm_minidump_mips.c \ kvm_powerpc.c kvm_powerpc64.c \ + kvm_minidump_riscv.c \ kvm_sparc64.c INCS= kvm.h Copied: stable/12/lib/libkvm/kvm_minidump_riscv.c (from r344829, head/lib/libkvm/kvm_minidump_riscv.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libkvm/kvm_minidump_riscv.c Thu Jun 27 16:48:24 2019 (r349463, copy of r344829, head/lib/libkvm/kvm_minidump_riscv.c) @@ -0,0 +1,288 @@ +/*- + * Copyright (c) 2006 Peter Wemm + * Copyright (c) 2019 Mitchell Horne + * + * 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 the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * From: FreeBSD: src/lib/libkvm/kvm_minidump_amd64.c r261799 + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * RISC-V machine dependent routines for kvm and minidumps. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "../../sys/riscv/include/minidump.h" + +#include + +#include "kvm_private.h" +#include "kvm_riscv.h" + +#define riscv_round_page(x) roundup2((kvaddr_t)(x), RISCV_PAGE_SIZE) + +struct vmstate { + struct minidumphdr hdr; +}; + +static riscv_pt_entry_t +_riscv_pte_get(kvm_t *kd, u_long pteindex) +{ + riscv_pt_entry_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le64toh(*pte); +} + +static int +_riscv_minidump_probe(kvm_t *kd) +{ + + return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_RISCV) && + _kvm_is_minidump(kd)); +} + +static void +_riscv_minidump_freevtop(kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + free(vm); + kd->vmst = NULL; +} + +static int +_riscv_minidump_initvtop(kvm_t *kd) +{ + struct vmstate *vmst; + off_t off, sparse_off; + + vmst = _kvm_malloc(kd, sizeof(*vmst)); + if (vmst == NULL) { + _kvm_err(kd, kd->program, "cannot allocate vm"); + return (-1); + } + kd->vmst = vmst; + if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) != + sizeof(vmst->hdr)) { + _kvm_err(kd, kd->program, "cannot read dump header"); + return (-1); + } + if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, + sizeof(vmst->hdr.magic)) != 0) { + _kvm_err(kd, kd->program, "not a minidump for this platform"); + return (-1); + } + + vmst->hdr.version = le32toh(vmst->hdr.version); + if (vmst->hdr.version != MINIDUMP_VERSION) { + _kvm_err(kd, kd->program, "wrong minidump version. " + "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); + return (-1); + } + vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize); + vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize); + vmst->hdr.pmapsize = le32toh(vmst->hdr.pmapsize); + vmst->hdr.kernbase = le64toh(vmst->hdr.kernbase); + vmst->hdr.dmapphys = le64toh(vmst->hdr.dmapphys); + vmst->hdr.dmapbase = le64toh(vmst->hdr.dmapbase); + vmst->hdr.dmapend = le64toh(vmst->hdr.dmapend); + + /* Skip header and msgbuf */ + off = RISCV_PAGE_SIZE + riscv_round_page(vmst->hdr.msgbufsize); + + /* build physical address lookup table for sparse pages */ + sparse_off = off + riscv_round_page(vmst->hdr.bitmapsize) + + riscv_round_page(vmst->hdr.pmapsize); + if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, + RISCV_PAGE_SIZE, sizeof(uint64_t)) == -1) { + return (-1); + } + off += riscv_round_page(vmst->hdr.bitmapsize); + + if (_kvm_pmap_init(kd, vmst->hdr.pmapsize, off) == -1) { + return (-1); + } + off += riscv_round_page(vmst->hdr.pmapsize); + + return (0); +} + +static int +_riscv_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) +{ + struct vmstate *vm; + riscv_physaddr_t offset; + riscv_pt_entry_t l3; + kvaddr_t l3_index; + riscv_physaddr_t a; + off_t ofs; + + vm = kd->vmst; + offset = va & RISCV_PAGE_MASK; + + if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { + a = (va - vm->hdr.dmapbase + vm->hdr.dmapphys) & + ~RISCV_PAGE_MASK; + ofs = _kvm_pt_find(kd, a, RISCV_PAGE_SIZE); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_riscv_minidump_vatop: " + "direct map address 0x%jx not in minidump", + (uintmax_t)va); + goto invalid; + } + *pa = ofs + offset; + return (RISCV_PAGE_SIZE - offset); + } else if (va >= vm->hdr.kernbase) { + l3_index = (va - vm->hdr.kernbase) >> RISCV_L3_SHIFT; + if (l3_index >= vm->hdr.pmapsize / sizeof(l3)) + goto invalid; + l3 = _riscv_pte_get(kd, l3_index); + if ((l3 & RISCV_PTE_V) == 0 || (l3 & RISCV_PTE_RWX) == 0) { + _kvm_err(kd, kd->program, + "_riscv_minidump_vatop: pte not valid"); + goto invalid; + } + a = (l3 >> RISCV_PTE_PPN0_S) << RISCV_L3_SHIFT; + ofs = _kvm_pt_find(kd, a, RISCV_PAGE_SIZE); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_riscv_minidump_vatop: " + "physical address 0x%jx not in minidump", + (uintmax_t)a); + goto invalid; + } + *pa = ofs + offset; + return (RISCV_PAGE_SIZE - offset); + } else { + _kvm_err(kd, kd->program, + "_riscv_minidump_vatop: virtual address 0x%jx not minidumped", + (uintmax_t)va); + goto invalid; + } + +invalid: + _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va); + return (0); +} + +static int +_riscv_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) +{ + + if (ISALIVE(kd)) { + _kvm_err(kd, 0, + "_riscv_minidump_kvatop called in live kernel!"); + return (0); + } + return (_riscv_minidump_vatop(kd, va, pa)); +} + +static int +_riscv_native(kvm_t *kd __unused) +{ + +#ifdef __riscv + return (1); +#else + return (0); +#endif +} + +static vm_prot_t +_riscv_entry_to_prot(riscv_pt_entry_t pte) +{ + vm_prot_t prot = VM_PROT_READ; + + if ((pte & RISCV_PTE_W) != 0) + prot |= VM_PROT_WRITE; + if ((pte & RISCV_PTE_X) != 0) + prot |= VM_PROT_EXECUTE; + return prot; +} + +static int +_riscv_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm = kd->vmst; + u_long nptes = vm->hdr.pmapsize / sizeof(riscv_pt_entry_t); + u_long bmindex, dva, pa, pteindex, va; + struct kvm_bitmap bm; + vm_prot_t prot; + int ret = 0; + + if (!_kvm_bitmap_init(&bm, vm->hdr.bitmapsize, &bmindex)) + return (0); + + for (pteindex = 0; pteindex < nptes; pteindex++) { + riscv_pt_entry_t pte = _riscv_pte_get(kd, pteindex); + + if (((pte & RISCV_PTE_V) == 0) || + ((pte & RISCV_PTE_RWX) == 0)) + continue; + + va = vm->hdr.kernbase + (pteindex << RISCV_L3_SHIFT); + pa = (pte >> RISCV_PTE_PPN0_S) << RISCV_L3_SHIFT; + dva = vm->hdr.dmapbase + pa; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _riscv_entry_to_prot(pte), RISCV_PAGE_SIZE, 0)) { + goto out; + } + } + + while (_kvm_bitmap_next(&bm, &bmindex)) { + pa = bmindex * RISCV_PAGE_SIZE; + dva = vm->hdr.dmapbase + pa; + if (vm->hdr.dmapend < (dva + RISCV_PAGE_SIZE)) + break; + va = 0; + prot = VM_PROT_READ | VM_PROT_WRITE; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + prot, RISCV_PAGE_SIZE, 0)) { + goto out; + } + } + ret = 1; + +out: + _kvm_bitmap_deinit(&bm); + return (ret); +} + +static struct kvm_arch kvm_riscv_minidump = { + .ka_probe = _riscv_minidump_probe, + .ka_initvtop = _riscv_minidump_initvtop, + .ka_freevtop = _riscv_minidump_freevtop, + .ka_kvatop = _riscv_minidump_kvatop, + .ka_native = _riscv_native, + .ka_walk_pages = _riscv_minidump_walk_pages, +}; + +KVM_ARCH(kvm_riscv_minidump); Copied and modified: stable/12/lib/libkvm/kvm_riscv.h (from r344829, head/lib/libkvm/kvm_riscv.h) ============================================================================== --- head/lib/libkvm/kvm_riscv.h Tue Mar 5 23:59:55 2019 (r344829, copy source) +++ stable/12/lib/libkvm/kvm_riscv.h Thu Jun 27 16:48:24 2019 (r349463) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2015 John H. Baldwin - * Copyright (c) 2019 Mitchell Horne * All rights reserved. + * Copyright (c) 2019 Mitchell Horne * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/sys/riscv/riscv/minidump_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/minidump_machdep.c Thu Jun 27 16:30:25 2019 (r349462) +++ stable/12/sys/riscv/riscv/minidump_machdep.c Thu Jun 27 16:48:24 2019 (r349463) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2006 Peter Wemm + * Copyright (c) 2015 The FreeBSD Foundation * All rights reserved. + * Copyright (c) 2019 Mitchell Horne * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -53,9 +55,381 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct kerneldumpheader) == 512); CTASSERT(sizeof(*vm_page_dump) == 8); +uint64_t *vm_page_dump; +int vm_page_dump_size; + +static struct kerneldumpheader kdh; + +/* Handle chunked writes. */ +static size_t fragsz; +static void *dump_va; +static size_t counter, progress, dumpsize; + +static uint64_t tmpbuffer[PAGE_SIZE / sizeof(uint64_t)]; + +static struct { + int min_per; + int max_per; + int visited; +} progress_track[10] = { + { 0, 10, 0}, + { 10, 20, 0}, + { 20, 30, 0}, + { 30, 40, 0}, + { 40, 50, 0}, + { 50, 60, 0}, + { 60, 70, 0}, + { 70, 80, 0}, + { 80, 90, 0}, + { 90, 100, 0} +}; + +static void +report_progress(size_t progress, size_t dumpsize) +{ + int sofar, i; + + sofar = 100 - ((progress * 100) / dumpsize); + for (i = 0; i < nitems(progress_track); i++) { + if (sofar < progress_track[i].min_per || + sofar > progress_track[i].max_per) + continue; + if (progress_track[i].visited) + return; + progress_track[i].visited = 1; + printf("..%d%%", sofar); + return; + } +} + +static bool +is_dumpable(vm_paddr_t pa) +{ + vm_page_t m; + int i; + + if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) + return ((m->flags & PG_NODUMP) == 0); + + for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { + if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) + return (true); + } + return (false); +} + +static int +blk_flush(struct dumperinfo *di) +{ + int error; + + if (fragsz == 0) + return (0); + + error = dump_append(di, dump_va, 0, fragsz); + fragsz = 0; + return (error); +} + +/* + * Write a block of data to the dump file. + * + * Caller can provide data through a pointer or by specifying its + * physical address. + * + * XXX writes using pa should be no larger than PAGE_SIZE. + */ +static int +blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) +{ + size_t len; + int error, c; + u_int maxdumpsz; + + maxdumpsz = min(di->maxiosize, MAXDUMPPGS * PAGE_SIZE); + if (maxdumpsz == 0) /* seatbelt */ + maxdumpsz = PAGE_SIZE; + error = 0; + if ((sz % PAGE_SIZE) != 0) { + printf("size not page aligned\n"); + return (EINVAL); + } + if (ptr != NULL && pa != 0) { + printf("cant have both va and pa!\n"); + return (EINVAL); + } + if ((((uintptr_t)pa) % PAGE_SIZE) != 0) { + printf("address not page aligned %#lx\n", (uintptr_t)pa); + return (EINVAL); + } + if (ptr != NULL) { + /* + * If we're doing a virtual dump, flush any + * pre-existing pa pages. + */ + error = blk_flush(di); + if (error != 0) + return (error); + } + while (sz) { + len = maxdumpsz - fragsz; + if (len > sz) + len = sz; + counter += len; + progress -= len; + if (counter >> 22) { + report_progress(progress, dumpsize); + counter &= (1 << 22) - 1; + } + + wdog_kern_pat(WD_LASTVAL); + + if (ptr) { + error = dump_append(di, ptr, 0, len); + if (error != 0) + return (error); + ptr += len; + sz -= len; + } else { + dump_va = (void *)PHYS_TO_DMAP(pa); + fragsz += len; + pa += len; + sz -= len; + error = blk_flush(di); + if (error != 0) + return (error); + } + + /* Check for user abort */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf(" (CTRL-C to abort) "); + } + + return (0); +} + int minidumpsys(struct dumperinfo *di) { + pd_entry_t *l1, *l2; + pt_entry_t *l3; + struct minidumphdr mdhdr; + uint32_t pmapsize; + vm_offset_t va; + vm_paddr_t pa; + int error; + uint64_t bits; + int i, bit; + int retry_count; - panic("minidumpsys"); + retry_count = 0; +retry: + retry_count++; + error = 0; + pmapsize = 0; + + /* Build set of dumpable pages from kernel pmap */ + for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += L2_SIZE) { + pmapsize += PAGE_SIZE; + if (!pmap_get_tables(pmap_kernel(), va, &l1, &l2, &l3)) + continue; + + /* We should always be using the l2 table for kvm */ + if (l2 == NULL) + continue; + + /* l2 may be a superpage */ + if ((*l2 & PTE_RWX) != 0) { + pa = (*l2 >> PTE_PPN1_S) << L2_SHIFT; + for (i = 0; i < Ln_ENTRIES; i++, pa += PAGE_SIZE) { + if (is_dumpable(pa)) + dump_add_page(pa); + } + } else { + for (i = 0; i < Ln_ENTRIES; i++) { + if ((l3[i] & PTE_V) == 0) + continue; + pa = (l3[i] >> PTE_PPN0_S) * PAGE_SIZE; + if (is_dumpable(pa)) + dump_add_page(pa); + } + } + } + + /* Calculate dump size */ + dumpsize = pmapsize; + dumpsize += round_page(msgbufp->msg_size); + dumpsize += round_page(vm_page_dump_size); + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffsl(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + /* Clear out undumpable pages now if needed */ + if (is_dumpable(pa)) + dumpsize += PAGE_SIZE; + else + dump_drop_page(pa); + bits &= ~(1ul << bit); + } + } + dumpsize += PAGE_SIZE; + + progress = dumpsize; + + /* Initialize mdhdr */ + bzero(&mdhdr, sizeof(mdhdr)); + strcpy(mdhdr.magic, MINIDUMP_MAGIC); + mdhdr.version = MINIDUMP_VERSION; + mdhdr.msgbufsize = msgbufp->msg_size; + mdhdr.bitmapsize = vm_page_dump_size; + mdhdr.pmapsize = pmapsize; + mdhdr.kernbase = KERNBASE; + mdhdr.dmapphys = DMAP_MIN_PHYSADDR; + mdhdr.dmapbase = DMAP_MIN_ADDRESS; + mdhdr.dmapend = DMAP_MAX_ADDRESS; + + dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_RISCV_VERSION, + dumpsize); + + error = dump_start(di, &kdh); + if (error != 0) + goto fail; + + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); + + /* Dump minidump header */ + bzero(&tmpbuffer, sizeof(tmpbuffer)); + bcopy(&mdhdr, &tmpbuffer, sizeof(mdhdr)); + error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); + if (error) + goto fail; + + /* Dump msgbuf up front */ + error = blk_write(di, (char *)msgbufp->msg_ptr, 0, + round_page(msgbufp->msg_size)); + if (error) + goto fail; + + /* Dump bitmap */ + error = blk_write(di, (char *)vm_page_dump, 0, + round_page(vm_page_dump_size)); + if (error) + goto fail; + + /* Dump kernel page directory pages */ + bzero(&tmpbuffer, sizeof(tmpbuffer)); + for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += L2_SIZE) { + if (!pmap_get_tables(pmap_kernel(), va, &l1, &l2, &l3)) { + /* We always write a page, even if it is zero */ + error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); + if (error) + goto fail; + /* Flush, in case we reuse tmpbuffer in the same block */ + error = blk_flush(di); + if (error) + goto fail; + } else if ((*l2 & PTE_RWX) != 0) { + /* Generate fake l3 entries based on the l2 superpage */ + for (i = 0; i < Ln_ENTRIES; i++) { + tmpbuffer[i] = (*l2 | (i << PTE_PPN0_S)); + } + /* We always write a page, even if it is zero */ + error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); + if (error) + goto fail; + /* Flush, in case we reuse tmpbuffer in the same block */ + error = blk_flush(di); + if (error) + goto fail; + bzero(&tmpbuffer, sizeof(tmpbuffer)); + } else { + pa = (*l2 >> PTE_PPN0_S) * PAGE_SIZE; + + /* We always write a page, even if it is zero */ + error = blk_write(di, NULL, pa, PAGE_SIZE); + if (error) + goto fail; + } + } + + /* Dump memory chunks */ + /* XXX cluster it up and use blk_dump() */ + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffsl(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + error = blk_write(di, 0, pa, PAGE_SIZE); + if (error) + goto fail; + bits &= ~(1ul << bit); + } + } + + error = blk_flush(di); + if (error) + goto fail; + + error = dump_finish(di, &kdh); + if (error != 0) + goto fail; + + printf("\nDump complete\n"); + return (0); + +fail: + if (error < 0) + error = -error; + + printf("\n"); + if (error == ENOSPC) { + printf("Dump map grown while dumping. "); + if (retry_count < 5) { + printf("Retrying...\n"); + goto retry; + } + printf("Dump failed.\n"); + } + else if (error == ECANCELED) + printf("Dump aborted\n"); + else if (error == E2BIG) + printf("Dump failed. Partition too small.\n"); + else + printf("** DUMP FAILED (ERROR %d) **\n", error); + return (error); +} + +/* + * Add a page to the minidump bitmap. + */ +void +dump_add_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 6; /* 2^6 = 64 */ + bit = pa & 63; + atomic_set_long(&vm_page_dump[idx], 1ul << bit); +} + +/* + * Remove page from the minidump bitmap. + */ +void +dump_drop_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 6; /* 2^6 = 64 */ + bit = pa & 63; + atomic_clear_long(&vm_page_dump[idx], 1ul << bit); } Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Thu Jun 27 16:30:25 2019 (r349462) +++ stable/12/sys/riscv/riscv/pmap.c Thu Jun 27 16:48:24 2019 (r349463) @@ -630,7 +630,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, pa = pmap_early_vtophys(l1pt, freemempos); - /* Initialize phys_avail. */ + /* Initialize phys_avail and dump_avail. */ for (avail_slot = map_slot = physmem = 0; map_slot < physmap_idx * 2; map_slot += 2) { start = physmap[map_slot]; @@ -638,6 +638,9 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, if (start == end) continue; + dump_avail[map_slot] = start; + dump_avail[map_slot + 1] = end; + if (start >= kernstart && end <= pa) continue; @@ -1644,9 +1647,7 @@ free_pv_chunk(struct pv_chunk *pc) PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); -#if 0 /* TODO: For minidump */ dump_drop_page(m->phys_addr); -#endif vm_page_unwire_noq(m); vm_page_free(m); } @@ -1708,9 +1709,7 @@ retry: } PV_STAT(atomic_add_int(&pc_chunk_count, 1)); PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); -#if 0 /* TODO: This is for minidump */ dump_add_page(m->phys_addr); -#endif pc = (void *)PHYS_TO_DMAP(m->phys_addr); pc->pc_pmap = pmap; pc->pc_map[0] = PC_FREE0 & ~1ul; /* preallocated bit 0 */ @@ -4429,4 +4428,41 @@ pmap_is_valid_memattr(pmap_t pmap __unused, vm_memattr { return (mode >= VM_MEMATTR_DEVICE && mode <= VM_MEMATTR_WRITE_BACK); +} + +bool +pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l1, pd_entry_t **l2, + pt_entry_t **l3) +{ + pd_entry_t *l1p, *l2p; + + /* Get l1 directory entry. */ + l1p = pmap_l1(pmap, va); + *l1 = l1p; + + if (l1p == NULL || (pmap_load(l1p) & PTE_V) == 0) + return (false); + + if ((pmap_load(l1p) & PTE_RX) != 0) { + *l2 = NULL; + *l3 = NULL; + return (true); + } + + /* Get l2 directory entry. */ + l2p = pmap_l1_to_l2(l1p, va); + *l2 = l2p; + + if (l2p == NULL || (pmap_load(l2p) & PTE_V) == 0) + return (false); + + if ((pmap_load(l2p) & PTE_RX) != 0) { + *l3 = NULL; + return (true); + } + + /* Get l3 page table entry. */ + *l3 = pmap_l2_to_l3(l2p, va); + + return (true); } Modified: stable/12/sys/riscv/riscv/uma_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/uma_machdep.c Thu Jun 27 16:30:25 2019 (r349462) +++ stable/12/sys/riscv/riscv/uma_machdep.c Thu Jun 27 16:48:24 2019 (r349463) @@ -55,11 +55,8 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int if (m == NULL) return (NULL); pa = m->phys_addr; -#if 0 - /* RISCVTODO: minidump */ if ((wait & M_NODUMP) == 0) dump_add_page(pa); -#endif va = (void *)PHYS_TO_DMAP(pa); if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); @@ -73,10 +70,7 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla vm_paddr_t pa; pa = DMAP_TO_PHYS((vm_offset_t)mem); -#if 0 - /* RISCVTODO: minidump */ dump_drop_page(pa); -#endif m = PHYS_TO_VM_PAGE(pa); vm_page_unwire_noq(m); vm_page_free(m); Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Thu Jun 27 16:30:25 2019 (r349462) +++ stable/12/sys/vm/vm_page.c Thu Jun 27 16:48:24 2019 (r349463) @@ -612,7 +612,7 @@ vm_page_startup(vm_offset_t vaddr) #endif #if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ - defined(__i386__) || defined(__mips__) + defined(__i386__) || defined(__mips__) || defined(__riscv) /* * Allocate a bitmap to indicate that a random physical page * needs to be included in a minidump. @@ -637,7 +637,8 @@ vm_page_startup(vm_offset_t vaddr) #else (void)last_pa; #endif -#if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) || \ + defined(__riscv) /* * Include the UMA bootstrap pages and vm_page_dump in a crash dump. * When pmap_map() uses the direct map, they are not automatically @@ -752,7 +753,8 @@ vm_page_startup(vm_offset_t vaddr) high_avail = new_end; new_end = vm_reserv_startup(&vaddr, new_end, high_avail); #endif -#if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) || \ + defined(__riscv) /* * Include vm_page_array and vm_reserv_array in a crash dump. */ From owner-svn-src-all@freebsd.org Thu Jun 27 17:38:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E5E715C87FC; Thu, 27 Jun 2019 17:38:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id E1D198F3BB; Thu, 27 Jun 2019 17:38:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 162767E5C6A; Fri, 28 Jun 2019 03:37:58 +1000 (AEST) Date: Fri, 28 Jun 2019 03:37:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349459 - head/sys/sys In-Reply-To: Message-ID: <20190628032225.T2863@besplex.bde.org> References: <201906271507.x5RF775Q070616@repo.freebsd.org> <20190628012059.D2091@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=nlC_4_pT8q9DhB4Ho9EA:9 a=lAimr6Aa0iGmYpgNssEA:9 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: E1D198F3BB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.88 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.88)[-0.882,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 17:38:08 -0000 On Thu, 27 Jun 2019, Andriy Gapon wrote: > On 27/06/2019 18:47, Bruce Evans wrote: >> On Thu, 27 Jun 2019, Andriy Gapon wrote: >> >>> Log: >>> =C2=A0upgrade the warning printf-s in bus accessors to KASSERT-s >>> >>> =C2=A0After this change sys/bus.h includes sys/systm.h. >> >> This is further namespace pollution.=C2=A0 sys/systm.h is a prerequiste = for >> all kernel headers except sys/param.h and the headers that that includes= , >> since any kernel header (except sys/param.hm etc.) may have inlines whic= h >> use features in systm.h, e.g., KASSERT() or an inline function. > > what do you think about amending style(9) to require that if sys/systm.h = is to > be included, then it must be included before any other header except for > sys/param.h (and possibly sys/cdefs.h) ? It is not a style matter. sys/systm.h is just a prerequisite for almost all kernel code. Perhaps this can be enforced using #ifdef magic even for headers that don't currently use it. If it is to be included nested, then sys/param.h is the place to include it, but I don't like that since it is even less related to parameters than sys/param.h, and this would be a regression from minor depollution of sys/param.h. sys/systm.h is also kernel-only, and as you found, including it nested tends to break applications, so other headers that have the bug of including it tend to have _KERNEL ifdefs to avoid including it in applications. This is so fundamental that it doesn't have a "No user-serviceable parts inside" ifdef. Bruce From owner-svn-src-all@freebsd.org Thu Jun 27 18:08:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AFB615C918D; Thu, 27 Jun 2019 18:08:20 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5DB669A36; Thu, 27 Jun 2019 18:08:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B451ADD3; Thu, 27 Jun 2019 18:08:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RI8JGl064724; Thu, 27 Jun 2019 18:08:19 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RI8IuQ064721; Thu, 27 Jun 2019 18:08:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906271808.x5RI8IuQ064721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 27 Jun 2019 18:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349466 - in head/sys: conf dev/altera/msgdma mips/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/altera/msgdma mips/conf X-SVN-Commit-Revision: 349466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5DB669A36 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 18:08:20 -0000 Author: br Date: Thu Jun 27 18:08:18 2019 New Revision: 349466 URL: https://svnweb.freebsd.org/changeset/base/349466 Log: Add support for extended descriptor format to Altera mSGDMA driver. The format to use depends on hardware configuration (synthesis-time), so make it compile-time kernel option. Extended format allows DMA engine to operate with 64-bit memory addresses. Sponsored by: DARPA, AFRL Modified: head/sys/conf/options head/sys/dev/altera/msgdma/msgdma.c head/sys/dev/altera/msgdma/msgdma.h head/sys/mips/conf/BERI_DE4_BASE Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jun 27 17:59:15 2019 (r349465) +++ head/sys/conf/options Thu Jun 27 18:08:18 2019 (r349466) @@ -861,6 +861,12 @@ AH_INTERRUPT_DEBUGGING opt_ah.h # XXX do not use this for AR9130 AH_AR5416_INTERRUPT_MITIGATION opt_ah.h +# options for the Altera mSGDMA driver (altera_msgdma) +ALTERA_MSGDMA_DESC_STD opt_altera_msgdma.h +ALTERA_MSGDMA_DESC_EXT opt_altera_msgdma.h +ALTERA_MSGDMA_DESC_PF_STD opt_altera_msgdma.h +ALTERA_MSGDMA_DESC_PF_EXT opt_altera_msgdma.h + # options for the Broadcom BCM43xx driver (bwi) BWI_DEBUG opt_bwi.h BWI_DEBUG_VERBOSE opt_bwi.h Modified: head/sys/dev/altera/msgdma/msgdma.c ============================================================================== --- head/sys/dev/altera/msgdma/msgdma.c Thu Jun 27 17:59:15 2019 (r349465) +++ head/sys/dev/altera/msgdma/msgdma.c Thu Jun 27 18:08:18 2019 (r349466) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include "xdma_if.h" +#include "opt_altera_msgdma.h" #include @@ -470,8 +471,8 @@ msgdma_channel_submit_sg(device_t dev, struct xdma_cha struct msgdma_channel *chan; struct msgdma_desc *desc; struct msgdma_softc *sc; - uint32_t src_addr_lo; - uint32_t dst_addr_lo; + bus_addr_t src_addr_lo; + bus_addr_t dst_addr_lo; uint32_t len; uint32_t tmp; int i; @@ -481,14 +482,18 @@ msgdma_channel_submit_sg(device_t dev, struct xdma_cha chan = (struct msgdma_channel *)xchan->chan; for (i = 0; i < sg_n; i++) { - src_addr_lo = (uint32_t)sg[i].src_addr; - dst_addr_lo = (uint32_t)sg[i].dst_addr; + src_addr_lo = sg[i].src_addr; + dst_addr_lo = sg[i].dst_addr; len = (uint32_t)sg[i].len; dprintf("%s: src %x dst %x len %d\n", __func__, src_addr_lo, dst_addr_lo, len); desc = chan->descs[chan->idx_head]; +#if defined(ALTERA_MSGDMA_DESC_EXT) || defined(ALTERA_MSGDMA_DESC_PF_EXT) + desc->read_hi = htole32(src_addr_lo >> 32); + desc->write_hi = htole32(dst_addr_lo >> 32); +#endif desc->read_lo = htole32(src_addr_lo); desc->write_lo = htole32(dst_addr_lo); desc->length = htole32(len); Modified: head/sys/dev/altera/msgdma/msgdma.h ============================================================================== --- head/sys/dev/altera/msgdma/msgdma.h Thu Jun 27 17:59:15 2019 (r349465) +++ head/sys/dev/altera/msgdma/msgdma.h Thu Jun 27 18:08:18 2019 (r349466) @@ -30,6 +30,8 @@ * $FreeBSD$ */ +#include "opt_altera_msgdma.h" + /* Altera mSGDMA registers. */ #define DMA_STATUS 0x00 #define STATUS_RESETTING (1 << 6) @@ -75,22 +77,74 @@ #define WRITE4_DESC(_sc, _reg, _val) \ bus_space_write_4(_sc->bst_d, _sc->bsh_d, _reg, htole32(_val)) -/* Prefetcher-disabled descriptor format. */ -struct msgdma_desc_nonpf { - uint32_t src_addr; - uint32_t dst_addr; +#if defined(ALTERA_MSGDMA_DESC_STD) + +/* Standard descriptor format with prefetcher disabled. */ +struct msgdma_desc { + uint32_t read_lo; + uint32_t write_lo; uint32_t length; uint32_t control; }; -/* Prefetcher-enabled descriptor format. */ +#elif defined(ALTERA_MSGDMA_DESC_EXT) + +/* Extended descriptor format with prefetcher disabled. */ struct msgdma_desc { uint32_t read_lo; uint32_t write_lo; uint32_t length; + uint8_t write_burst; + uint8_t read_burst; + uint16_t seq_num; + uint16_t write_stride; + uint16_t read_stride; + uint32_t read_hi; + uint32_t write_hi; + uint32_t control; +}; + +#elif defined(ALTERA_MSGDMA_DESC_PF_STD) + +/* Standard descriptor format with prefetcher enabled. */ +struct msgdma_desc { + uint32_t read_lo; + uint32_t write_lo; + uint32_t length; uint32_t next; uint32_t transferred; uint32_t status; uint32_t reserved; uint32_t control; }; + +#elif defined(ALTERA_MSGDMA_DESC_PF_EXT) + +/* Extended descriptor format with prefetcher enabled. */ +struct msgdma_desc { + uint32_t read_lo; + uint32_t write_lo; + uint32_t length; + uint32_t next; + uint32_t transferred; + uint32_t status; + uint32_t reserved; + uint8_t write_burst; + uint8_t read_burst; + uint16_t seq_num; + uint16_t write_stride; + uint16_t read_stride; + uint32_t read_hi; + uint32_t write_hi; + uint32_t next_hi; + uint32_t reserved1; + uint32_t reserved2; + uint32_t reserved3; + uint32_t control; +}; + +#else + +#error "mSGDMA descriptor format (kernel option) is not set." + +#endif Modified: head/sys/mips/conf/BERI_DE4_BASE ============================================================================== --- head/sys/mips/conf/BERI_DE4_BASE Thu Jun 27 17:59:15 2019 (r349465) +++ head/sys/mips/conf/BERI_DE4_BASE Thu Jun 27 18:08:18 2019 (r349466) @@ -44,6 +44,7 @@ options DEVICE_POLLING # # DMA support # +options ALTERA_MSGDMA_DESC_PF_STD device xdma device altera_softdma device altera_msgdma From owner-svn-src-all@freebsd.org Thu Jun 27 19:18:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A024F15CAC8E; Thu, 27 Jun 2019 19:18:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDD046C1A1; Thu, 27 Jun 2019 19:18:50 +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 x5RJIhs2047340 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 27 Jun 2019 22:18:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x5RJIhs2047340 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x5RJIhBD047339; Thu, 27 Jun 2019 22:18:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Jun 2019 22:18:43 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349231 - in head/sys: kern sys ufs/ufs Message-ID: <20190627191843.GQ8697@kib.kiev.ua> References: <201906201413.x5KEDB5u010923@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906201413.x5KEDB5u010923@repo.freebsd.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 19:18:51 -0000 On Thu, Jun 20, 2019 at 02:13:11PM +0000, Alan Somers wrote: > Author: asomers > Date: Thu Jun 20 14:13:10 2019 > New Revision: 349231 > URL: https://svnweb.freebsd.org/changeset/base/349231 > > Log: > Add FIOBMAP2 ioctl > > This ioctl exposes VOP_BMAP information to userland. It can be used by > programs like fragmentation analyzers and optimized cp implementations. But > I'm using it to test fusefs's VOP_BMAP implementation. The "2" in the name > distinguishes it from the similar but incompatible FIBMAP ioctls in NetBSD > and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit block > number instead of 32-bit, and it also returns runp and runb. > > Reviewed by: mckusick > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D20705 > > Modified: > head/sys/kern/vfs_vnops.c > head/sys/sys/filio.h > head/sys/ufs/ufs/ufs_bmap.c > > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Thu Jun 20 13:59:46 2019 (r349230) > +++ head/sys/kern/vfs_vnops.c Thu Jun 20 14:13:10 2019 (r349231) > @@ -1458,6 +1458,25 @@ vn_stat(struct vnode *vp, struct stat *sb, struct ucre > return (0); > } > > +/* generic FIOBMAP2 implementation */ > +static int > +vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct ucred *cred) I do not like the fact that internal kernel function takes the user-visible structure which results in the mix of ABI and KBI. Traditionally we pass explicit arguments to kern_XXX, vn_XXX and similar internal implementations. > +{ > + struct vnode *vp = fp->f_vnode; Why do you pass fp to the function that 1. Has vn_ namespace, i.e. operating on vnode. 2. Only needs vnode to operate on. Please change the argument from fp to vp. You would need to pass f_cred as additional argument, or move mac check to vn_ioctl (I think this is a better approach). > + daddr_t lbn = arg->bn; Style: initialization in declaration. > + int error; > + > + vn_lock(vp, LK_SHARED | LK_RETRY); > +#ifdef MAC > + error = mac_vnode_check_read(cred, fp->f_cred, vp); > + if (error == 0) > +#endif > + error = VOP_BMAP(vp, lbn, NULL, &arg->bn, &arg->runp, > + &arg->runb); Wrong indent for continuation line. > + VOP_UNLOCK(vp, 0); > + return (error); > +} > + > /* > * File table vnode ioctl routine. > */ > @@ -1481,6 +1500,9 @@ vn_ioctl(struct file *fp, u_long com, void *data, stru > if (error == 0) > *(int *)data = vattr.va_size - fp->f_offset; > return (error); > + case FIOBMAP2: > + return (vn_ioc_bmap2(fp, (struct fiobmap2_arg*)data, Need space between fiobmap2_arg and '*'. > + active_cred)); Wrong indent. > case FIONBIO: > case FIOASYNC: > return (0); > > Modified: head/sys/sys/filio.h > ============================================================================== > --- head/sys/sys/filio.h Thu Jun 20 13:59:46 2019 (r349230) > +++ head/sys/sys/filio.h Thu Jun 20 14:13:10 2019 (r349231) > @@ -62,6 +62,13 @@ struct fiodgname_arg { > /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ > #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ > #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ > +struct fiobmap2_arg { > + int64_t bn; > + int runp; > + int runb; > +}; This structure has different layout for LP64 and ILP32, and you did not provided the compat shims. > +/* Get the file's bmap info for the logical block bn */ > +#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) > > #ifdef _KERNEL > #ifdef COMPAT_FREEBSD32 > > Modified: head/sys/ufs/ufs/ufs_bmap.c > ============================================================================== > --- head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 13:59:46 2019 (r349230) > +++ head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 14:13:10 2019 (r349231) > @@ -200,12 +200,15 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) > *bnp = blkptrtodb(ump, ip->i_din2->di_extb[-1 - bn]); > if (*bnp == 0) > *bnp = -1; > - if (nbp == NULL) > - panic("ufs_bmaparray: mapping ext data"); > + if (nbp == NULL) { > + /* indirect block not found */ > + return (EINVAL); > + } This (and next chunk) loose useful checks for in-kernel interfaces. > nbp->b_xflags |= BX_ALTDATA; > return (0); > } else { > - panic("ufs_bmaparray: blkno out of range"); > + /* blkno out of range */ > + return (EINVAL); > } > /* > * Since this is FFS independent code, we are out of From owner-svn-src-all@freebsd.org Thu Jun 27 19:36:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BEC715CB476; Thu, 27 Jun 2019 19:36:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5C186CB60; Thu, 27 Jun 2019 19:36:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A7191BDF7; Thu, 27 Jun 2019 19:36:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RJaUvr011405; Thu, 27 Jun 2019 19:36:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RJaU2n011404; Thu, 27 Jun 2019 19:36:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906271936.x5RJaU2n011404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 27 Jun 2019 19:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349467 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 349467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5C186CB60 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 19:36:31 -0000 Author: jhb Date: Thu Jun 27 19:36:30 2019 New Revision: 349467 URL: https://svnweb.freebsd.org/changeset/base/349467 Log: Hold an explicit reference on the socket for the aiotx task. Previously, the aiotx task relied on the aio jobs in the queue to hold a reference on the socket. However, when the last job is completed, there is nothing left to hold a reference to the socket buffer lock used to check if the queue is empty. In addition, if the last job on the queue is cancelled, the task can run with no queued jobs holding a reference to the socket buffer lock the task uses to notice the queue is empty. Fix these races by holding an explicit reference on the socket when the task is queued and dropping that reference when the task completes. Reviewed by: np MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20539 Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Jun 27 18:08:18 2019 (r349466) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Jun 27 19:36:30 2019 (r349467) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom.h" static void t4_aiotx_cancel(struct kaiocb *job); -static void t4_aiotx_queue_toep(struct toepcb *toep); +static void t4_aiotx_queue_toep(struct socket *so, struct toepcb *toep); static size_t aiotx_mbuf_pgoff(struct mbuf *m) @@ -785,7 +785,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep if (sowwakeup) { if (!TAILQ_EMPTY( &toep->aiotx_jobq)) - t4_aiotx_queue_toep( + t4_aiotx_queue_toep(so, toep); sowwakeup_locked(so); } else @@ -829,7 +829,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep } if (sowwakeup) { if (!TAILQ_EMPTY(&toep->aiotx_jobq)) - t4_aiotx_queue_toep(toep); + t4_aiotx_queue_toep(so, toep); sowwakeup_locked(so); } else SOCKBUF_UNLOCK(sb); @@ -1821,7 +1821,7 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header tls_ofld->sb_off -= plen; } if (!TAILQ_EMPTY(&toep->aiotx_jobq)) - t4_aiotx_queue_toep(toep); + t4_aiotx_queue_toep(so, toep); sowwakeup_locked(so); /* unlocks so_snd */ } SOCKBUF_UNLOCK_ASSERT(sb); @@ -2195,10 +2195,10 @@ static void t4_aiotx_task(void *context, int pending) { struct toepcb *toep = context; - struct inpcb *inp = toep->inp; - struct socket *so = inp->inp_socket; + struct socket *so; struct kaiocb *job; + so = toep->aiotx_so; CURVNET_SET(toep->vnet); SOCKBUF_LOCK(&so->so_snd); while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { @@ -2209,15 +2209,17 @@ t4_aiotx_task(void *context, int pending) t4_aiotx_process_job(toep, so, job); } - toep->aiotx_task_active = false; + toep->aiotx_so = NULL; SOCKBUF_UNLOCK(&so->so_snd); CURVNET_RESTORE(); free_toepcb(toep); + SOCK_LOCK(so); + sorele(so); } static void -t4_aiotx_queue_toep(struct toepcb *toep) +t4_aiotx_queue_toep(struct socket *so, struct toepcb *toep) { SOCKBUF_LOCK_ASSERT(&toep->inp->inp_socket->so_snd); @@ -2225,9 +2227,10 @@ t4_aiotx_queue_toep(struct toepcb *toep) CTR3(KTR_CXGBE, "%s: queueing aiotx task for tid %d, active = %s", __func__, toep->tid, toep->aiotx_task_active ? "true" : "false"); #endif - if (toep->aiotx_task_active) + if (toep->aiotx_so != NULL) return; - toep->aiotx_task_active = true; + soref(so); + toep->aiotx_so = so; hold_toepcb(toep); soaio_enqueue(&toep->aiotx_task); } @@ -2284,7 +2287,7 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j panic("new job was cancelled"); TAILQ_INSERT_TAIL(&toep->aiotx_jobq, job, list); if (sowriteable(so)) - t4_aiotx_queue_toep(toep); + t4_aiotx_queue_toep(so, toep); SOCKBUF_UNLOCK(&so->so_snd); return (0); } Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Jun 27 18:08:18 2019 (r349466) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Jun 27 19:36:30 2019 (r349467) @@ -194,7 +194,7 @@ struct toepcb { TAILQ_HEAD(, kaiocb) aiotx_jobq; struct task aiotx_task; - bool aiotx_task_active; + struct socket *aiotx_so; /* Tx software descriptor */ uint8_t txsd_total; From owner-svn-src-all@freebsd.org Thu Jun 27 20:01:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A392A15CC07F; Thu, 27 Jun 2019 20:01:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33E526DC07; Thu, 27 Jun 2019 20:01:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id x25so3647362ljh.2; Thu, 27 Jun 2019 13:01:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jc4DzYF5DK0JoRGxBnjUHfDk3UazJPSqip78WXkgR70=; b=P+Sf1GZuDxKmhMSCvrBXtEN6d9T1iec1qQyXjHKczmoNXNhcGTccyM6DQYgchdVRNk abSYeAS+Ka7o/Ae8Sn2+1p0tZpu1rsyrawEYMRMUg6CstZcSNc8sppAUnouk1ongBPZS KYz9ZLQHo0ZR6qGbGd54fBYNbYN1tqNv48ivJPq2DPmlmctJxFXjCqCkNFcPRZiqEQXK GCH0BE4aBsFMGi+EqHLfBLjq94a5JaleOQ9E85IJoChr/gpfCjGuSFfvHVnwoT5TvQYJ 5uhoc6qGactWRszYJ8QPynYElnyrtrmOPq3TLhpv25HuhI9hvNq61xqh/tuzQtggTILg 9/DA== X-Gm-Message-State: APjAAAUZKe8STtDwvRhOEKhMFueDeIRriBq8tKCEycPGJ+LqYpodjHpc FQSidrYVay/FGsEIYFoTn17g7YprCvtMN7usdYk= X-Google-Smtp-Source: APXvYqzH5Ft4rvMGCg69K7oL89kza2bd6n87Jvaq00OTodkh8cjEyymNU2PpJCCzrIydxy7sUdWV8SyMPvCuFgWB7a0= X-Received: by 2002:a2e:9cd1:: with SMTP id g17mr3912501ljj.234.1561665683465; Thu, 27 Jun 2019 13:01:23 -0700 (PDT) MIME-Version: 1.0 References: <201906201413.x5KEDB5u010923@repo.freebsd.org> <20190627191843.GQ8697@kib.kiev.ua> In-Reply-To: <20190627191843.GQ8697@kib.kiev.ua> From: Alan Somers Date: Thu, 27 Jun 2019 14:01:11 -0600 Message-ID: Subject: Re: svn commit: r349231 - in head/sys: kern sys ufs/ufs To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 33E526DC07 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.86 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.86)[-0.858,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 20:01:31 -0000 On Thu, Jun 27, 2019 at 1:18 PM Konstantin Belousov wrote: > > On Thu, Jun 20, 2019 at 02:13:11PM +0000, Alan Somers wrote: > > Author: asomers > > Date: Thu Jun 20 14:13:10 2019 > > New Revision: 349231 > > URL: https://svnweb.freebsd.org/changeset/base/349231 > > > > Log: > > Add FIOBMAP2 ioctl > > > > > This ioctl exposes VOP_BMAP information to userland. It can be used by > > programs like fragmentation analyzers and optimized cp implementations. But > > I'm using it to test fusefs's VOP_BMAP implementation. The "2" in the name > > distinguishes it from the similar but incompatible FIBMAP ioctls in NetBSD > > and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit block > > number instead of 32-bit, and it also returns runp and runb. > > > > Reviewed by: mckusick > > MFC after: 2 weeks > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D20705 > > > > Modified: > > head/sys/kern/vfs_vnops.c > > head/sys/sys/filio.h > > head/sys/ufs/ufs/ufs_bmap.c > > > > Modified: head/sys/kern/vfs_vnops.c > > ============================================================================== > > --- head/sys/kern/vfs_vnops.c Thu Jun 20 13:59:46 2019 (r349230) > > +++ head/sys/kern/vfs_vnops.c Thu Jun 20 14:13:10 2019 (r349231) > > @@ -1458,6 +1458,25 @@ vn_stat(struct vnode *vp, struct stat *sb, struct ucre > > return (0); > > } > > > > +/* generic FIOBMAP2 implementation */ > > +static int > > +vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct ucred *cred) > I do not like the fact that internal kernel function takes the > user-visible structure which results in the mix of ABI and KBI. > Traditionally we pass explicit arguments to kern_XXX, vn_XXX and similar > internal implementations. Ok. It will increase the number of function arguments, which is ugly, but I can do it if you prefer. > > > +{ > > + struct vnode *vp = fp->f_vnode; > Why do you pass fp to the function that > 1. Has vn_ namespace, i.e. operating on vnode. > 2. Only needs vnode to operate on. > Please change the argument from fp to vp. You would need to pass f_cred > as additional argument, or move mac check to vn_ioctl (I think this is > a better approach). Ok. > > > + daddr_t lbn = arg->bn; > Style: initialization in declaration. > > > + int error; > > + > > + vn_lock(vp, LK_SHARED | LK_RETRY); > > +#ifdef MAC > > + error = mac_vnode_check_read(cred, fp->f_cred, vp); > > + if (error == 0) > > +#endif > > + error = VOP_BMAP(vp, lbn, NULL, &arg->bn, &arg->runp, > > + &arg->runb); > Wrong indent for continuation line. > > > + VOP_UNLOCK(vp, 0); > > + return (error); > > +} > > + > > /* > > * File table vnode ioctl routine. > > */ > > @@ -1481,6 +1500,9 @@ vn_ioctl(struct file *fp, u_long com, void *data, stru > > if (error == 0) > > *(int *)data = vattr.va_size - fp->f_offset; > > return (error); > > + case FIOBMAP2: > > + return (vn_ioc_bmap2(fp, (struct fiobmap2_arg*)data, > Need space between fiobmap2_arg and '*'. > > + active_cred)); > Wrong indent. > > > case FIONBIO: > > case FIOASYNC: > > return (0); > > > > Modified: head/sys/sys/filio.h > > ============================================================================== > > --- head/sys/sys/filio.h Thu Jun 20 13:59:46 2019 (r349230) > > +++ head/sys/sys/filio.h Thu Jun 20 14:13:10 2019 (r349231) > > @@ -62,6 +62,13 @@ struct fiodgname_arg { > > /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ > > #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ > > #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ > > +struct fiobmap2_arg { > > + int64_t bn; > > + int runp; > > + int runb; > > +}; > This structure has different layout for LP64 and ILP32, and you did not > provided the compat shims. Really? How so? All of the fields have the same width on 64 and 32 bit archs, and there shouldn't be any need for padding, either. > > > +/* Get the file's bmap info for the logical block bn */ > > +#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) > > > > #ifdef _KERNEL > > #ifdef COMPAT_FREEBSD32 > > > > Modified: head/sys/ufs/ufs/ufs_bmap.c > > ============================================================================== > > --- head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 13:59:46 2019 (r349230) > > +++ head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 14:13:10 2019 (r349231) > > @@ -200,12 +200,15 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) > > *bnp = blkptrtodb(ump, ip->i_din2->di_extb[-1 - bn]); > > if (*bnp == 0) > > *bnp = -1; > > - if (nbp == NULL) > > - panic("ufs_bmaparray: mapping ext data"); > > + if (nbp == NULL) { > > + /* indirect block not found */ > > + return (EINVAL); > > + } > This (and next chunk) loose useful checks for in-kernel interfaces. mckusick disagrees with you on this. He thought that changing the panics into errors was a good idea. Note that ufs_bmap was already capable of returning errors that not all callers check. > > > nbp->b_xflags |= BX_ALTDATA; > > return (0); > > } else { > > - panic("ufs_bmaparray: blkno out of range"); > > + /* blkno out of range */ > > + return (EINVAL); > > } > > /* > > * Since this is FFS independent code, we are out of From owner-svn-src-all@freebsd.org Thu Jun 27 20:18:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7F7215CCBFD; Thu, 27 Jun 2019 20:18:11 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29A0F6F80A; Thu, 27 Jun 2019 20:18:10 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f169.google.com with SMTP id v24so3635802ljg.13; Thu, 27 Jun 2019 13:18:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=M2fLoie1gQSyGJG8zSw2sFty283gV5VWw55suzDYTRI=; b=tfp83SNeO77BeAQtcb5Q4fCYF+WQRCdrL7QYABuYUHfzqb44Hw0PVkzi5BzxvuvzDq /IUCvke5aFwUqNhDDetCSCIRmrTsPNzSRSvOLc1iVyr4Q9Ozl57p+MDWsBLfSnkxcXrP OQbf43OQ0T4x6FYCxIvtF2O2FcjlnNiHEgbLbsl2GwK0PwU49j3ICyS08dSkQzC6HJJj rAIS7jIz9qwLahq3EqicyXACWiuIR3eWX+53Z5OqX9JnhuSRjmDlNo0y7Qaa08roAiOT MB90btrtq0u1/oVlFWaJyYVgjsMROSN9y/ItrIyjQWBy3D3auaJ8nTOrLre/2NLDNBAV D4Bg== X-Gm-Message-State: APjAAAUyB4radOFmluZ/ozog3moDMK0qK9/h0v8xN514vGyVf+HP/cF9 kTu55JHt9lo/c6PtC5Ni/PFdIdPuLZQ= X-Google-Smtp-Source: APXvYqy1RTvl3OOsXcLNvYmfpI+IFTpaIRo811piQVDDNWSy24ymqnDWHUX9ZZRHkmtBLDbRoaXDvQ== X-Received: by 2002:a2e:a0d5:: with SMTP id f21mr3822842ljm.69.1561666681900; Thu, 27 Jun 2019 13:18:01 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id k4sm8335ljj.41.2019.06.27.13.17.59 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 13:18:00 -0700 (PDT) Subject: Re: svn commit: r349459 - head/sys/sys To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906271507.x5RF775Q070616@repo.freebsd.org> <20190628012059.D2091@besplex.bde.org> <20190628032225.T2863@besplex.bde.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Thu, 27 Jun 2019 23:17:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190628032225.T2863@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29A0F6F80A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 20:18:12 -0000 On 27/06/2019 20:37, Bruce Evans wrote: > On Thu, 27 Jun 2019, Andriy Gapon wrote: > >> On 27/06/2019 18:47, Bruce Evans wrote: >>> On Thu, 27 Jun 2019, Andriy Gapon wrote: >>> >>>> Log: >>>>  upgrade the warning printf-s in bus accessors to KASSERT-s >>>> >>>>  After this change sys/bus.h includes sys/systm.h. >>> >>> This is further namespace pollution.  sys/systm.h is a prerequiste for >>> all kernel headers except sys/param.h and the headers that that includes, >>> since any kernel header (except sys/param.hm etc.) may have inlines which >>> use features in systm.h, e.g., KASSERT() or an inline function. >> >> what do you think about amending style(9) to require that if sys/systm.h is to >> be included, then it must be included before any other header except for >> sys/param.h (and possibly sys/cdefs.h) ? > > It is not a style matter. I know... but style(9) documents sys/param.h for similar reasons. > sys/systm.h is just a prerequisite for almost > all kernel code.  Perhaps this can be enforced using #ifdef magic even > for headers that don't currently use it.  If it is to be included nested, > then sys/param.h is the place to include it, but I don't like that since > it is even less related to parameters than sys/param.h, and this would be > a regression from minor depollution of sys/param.h. > > sys/systm.h is also kernel-only, and as you found, including it nested > tends to break applications, so other headers that have the bug of > including it tend to have _KERNEL ifdefs to avoid including it in > applications.  This is so fundamental that it doesn't have a "No > user-serviceable parts inside" ifdef. I think that there is a trivial fix to my commit: moving the sys/systm.h include to the _KERNEL section of sys/bus.h. That's where its definitions are actually used. But I agree that there should be a better approach. -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Jun 27 20:34:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7DA615CDC7F; Thu, 27 Jun 2019 20:34:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9B37073D; Thu, 27 Jun 2019 20:34:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D9EE1C84C; Thu, 27 Jun 2019 20:34:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RKYpdo045980; Thu, 27 Jun 2019 20:34:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RKYpCE045979; Thu, 27 Jun 2019 20:34:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906272034.x5RKYpCE045979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 27 Jun 2019 20:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349469 - head/usr.bin/uname X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/uname X-SVN-Commit-Revision: 349469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D9B37073D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 20:34:52 -0000 Author: emaste Date: Thu Jun 27 20:34:50 2019 New Revision: 349469 URL: https://svnweb.freebsd.org/changeset/base/349469 Log: Expose the kernel's build-ID through `uname -b` After r348611 the kernel's build-ID is available via sysctl. Add a -b flag to uname to report it. Submitted by: Ali Mashtizadeh Reviewed by: markj, imp Relnotes: Yes Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20511 Modified: head/usr.bin/uname/uname.1 head/usr.bin/uname/uname.c Modified: head/usr.bin/uname/uname.1 ============================================================================== --- head/usr.bin/uname/uname.1 Thu Jun 27 20:18:12 2019 (r349468) +++ head/usr.bin/uname/uname.1 Thu Jun 27 20:34:50 2019 (r349469) @@ -28,7 +28,7 @@ .\" @(#)uname.1 8.3 (Berkeley) 4/8/94 .\" $FreeBSD$ .\" -.Dd May 31, 2017 +.Dd June 27, 2019 .Dt UNAME 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd display information about the system .Sh SYNOPSIS .Nm -.Op Fl aiKmnoprsUv +.Op Fl abiKmnoprsUv .Sh DESCRIPTION The .Nm @@ -53,6 +53,8 @@ Behave as though the options and .Fl v were specified. +.It Fl b +Write the kernel's linker-generated build-id to standard output. .It Fl i Write the kernel ident to standard output. .It Fl K @@ -152,3 +154,7 @@ and .Fl U extension flags appeared in .Fx 10.0 . +The +.Fl b +extension flag appeared in +.Fx 13.0 . Modified: head/usr.bin/uname/uname.c ============================================================================== --- head/usr.bin/uname/uname.c Thu Jun 27 20:18:12 2019 (r349468) +++ head/usr.bin/uname/uname.c Thu Jun 27 20:34:50 2019 (r349469) @@ -67,9 +67,10 @@ static const char sccsid[] = "@(#)uname.c 8.2 (Berkele #define IFLAG 0x40 #define UFLAG 0x80 #define KFLAG 0x100 +#define BFLAG 0x200 typedef void (*get_t)(void); -static get_t get_ident, get_platform, get_hostname, get_arch, +static get_t get_buildid, get_ident, get_platform, get_hostname, get_arch, get_release, get_sysname, get_kernvers, get_uservers, get_version; static void native_ident(void); @@ -81,11 +82,13 @@ static void native_sysname(void); static void native_version(void); static void native_kernvers(void); static void native_uservers(void); +static void native_buildid(void); static void print_uname(u_int); static void setup_get(void); static void usage(void); -static char *ident, *platform, *hostname, *arch, *release, *sysname, *version, *kernvers, *uservers; +static char *buildid, *ident, *platform, *hostname, *arch, *release, *sysname, + *version, *kernvers, *uservers; static int space; int @@ -97,11 +100,14 @@ main(int argc, char *argv[]) setup_get(); flags = 0; - while ((ch = getopt(argc, argv, "aiKmnoprsUv")) != -1) + while ((ch = getopt(argc, argv, "abiKmnoprsUv")) != -1) switch(ch) { case 'a': flags |= (MFLAG | NFLAG | RFLAG | SFLAG | VFLAG); break; + case 'b': + flags |= BFLAG; + break; case 'i': flags |= IFLAG; break; @@ -169,6 +175,7 @@ setup_get(void) CHECK_ENV("i", ident); CHECK_ENV("K", kernvers); CHECK_ENV("U", uservers); + CHECK_ENV("b", buildid); } #define PRINT_FLAG(flags,flag,var) \ @@ -194,6 +201,7 @@ print_uname(u_int flags) PRINT_FLAG(flags, IFLAG, ident); PRINT_FLAG(flags, KFLAG, kernvers); PRINT_FLAG(flags, UFLAG, uservers); + PRINT_FLAG(flags, BFLAG, buildid); printf("\n"); } @@ -261,6 +269,9 @@ NATIVE_SYSCTL2_GET(arch, CTL_HW, HW_MACHINE_ARCH) { NATIVE_SYSCTLNAME_GET(ident, "kern.ident") { } NATIVE_SET; +NATIVE_SYSCTLNAME_GET(buildid, "kern.build_id") { +} NATIVE_SET; + static void native_uservers(void) { @@ -282,6 +293,6 @@ native_kernvers(void) static void usage(void) { - fprintf(stderr, "usage: uname [-aiKmnoprsUv]\n"); + fprintf(stderr, "usage: uname [-abiKmnoprsUv]\n"); exit(1); } From owner-svn-src-all@freebsd.org Thu Jun 27 21:09:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B9D315CE667; Thu, 27 Jun 2019 21:09:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D996B717AA; Thu, 27 Jun 2019 21:09:48 +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 x5RL9erK073732 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 28 Jun 2019 00:09:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x5RL9erK073732 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x5RL9eA0073731; Fri, 28 Jun 2019 00:09:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 28 Jun 2019 00:09:40 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r349231 - in head/sys: kern sys ufs/ufs Message-ID: <20190627210940.GR8697@kib.kiev.ua> References: <201906201413.x5KEDB5u010923@repo.freebsd.org> <20190627191843.GQ8697@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 21:09:50 -0000 On Thu, Jun 27, 2019 at 02:01:11PM -0600, Alan Somers wrote: > On Thu, Jun 27, 2019 at 1:18 PM Konstantin Belousov wrote: > > > > On Thu, Jun 20, 2019 at 02:13:11PM +0000, Alan Somers wrote: > > > Author: asomers > > > Date: Thu Jun 20 14:13:10 2019 > > > New Revision: 349231 > > > URL: https://svnweb.freebsd.org/changeset/base/349231 > > > > > > Log: > > > Add FIOBMAP2 ioctl > > > > > > > > This ioctl exposes VOP_BMAP information to userland. It can be used by > > > programs like fragmentation analyzers and optimized cp implementations. But > > > I'm using it to test fusefs's VOP_BMAP implementation. The "2" in the name > > > distinguishes it from the similar but incompatible FIBMAP ioctls in NetBSD > > > and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit block > > > number instead of 32-bit, and it also returns runp and runb. > > > > > > Reviewed by: mckusick > > > MFC after: 2 weeks > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D20705 > > > > > > Modified: > > > head/sys/kern/vfs_vnops.c > > > head/sys/sys/filio.h > > > head/sys/ufs/ufs/ufs_bmap.c > > > > > > Modified: head/sys/kern/vfs_vnops.c > > > ============================================================================== > > > --- head/sys/kern/vfs_vnops.c Thu Jun 20 13:59:46 2019 (r349230) > > > +++ head/sys/kern/vfs_vnops.c Thu Jun 20 14:13:10 2019 (r349231) > > > @@ -1458,6 +1458,25 @@ vn_stat(struct vnode *vp, struct stat *sb, struct ucre > > > return (0); > > > } > > > > > > +/* generic FIOBMAP2 implementation */ > > > +static int > > > +vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct ucred *cred) > > I do not like the fact that internal kernel function takes the > > user-visible structure which results in the mix of ABI and KBI. > > Traditionally we pass explicit arguments to kern_XXX, vn_XXX and similar > > internal implementations. > > Ok. It will increase the number of function arguments, which is ugly, > but I can do it if you prefer. > > > > > > +{ > > > + struct vnode *vp = fp->f_vnode; > > Why do you pass fp to the function that > > 1. Has vn_ namespace, i.e. operating on vnode. > > 2. Only needs vnode to operate on. > > Please change the argument from fp to vp. You would need to pass f_cred > > as additional argument, or move mac check to vn_ioctl (I think this is > > a better approach). > > Ok. > > > > > > + daddr_t lbn = arg->bn; > > Style: initialization in declaration. > > > > > + int error; > > > + > > > + vn_lock(vp, LK_SHARED | LK_RETRY); > > > +#ifdef MAC > > > + error = mac_vnode_check_read(cred, fp->f_cred, vp); > > > + if (error == 0) > > > +#endif > > > + error = VOP_BMAP(vp, lbn, NULL, &arg->bn, &arg->runp, > > > + &arg->runb); > > Wrong indent for continuation line. > > > > > + VOP_UNLOCK(vp, 0); > > > + return (error); > > > +} > > > + > > > /* > > > * File table vnode ioctl routine. > > > */ > > > @@ -1481,6 +1500,9 @@ vn_ioctl(struct file *fp, u_long com, void *data, stru > > > if (error == 0) > > > *(int *)data = vattr.va_size - fp->f_offset; > > > return (error); > > > + case FIOBMAP2: > > > + return (vn_ioc_bmap2(fp, (struct fiobmap2_arg*)data, > > Need space between fiobmap2_arg and '*'. > > > + active_cred)); > > Wrong indent. > > > > > case FIONBIO: > > > case FIOASYNC: > > > return (0); > > > > > > Modified: head/sys/sys/filio.h > > > ============================================================================== > > > --- head/sys/sys/filio.h Thu Jun 20 13:59:46 2019 (r349230) > > > +++ head/sys/sys/filio.h Thu Jun 20 14:13:10 2019 (r349231) > > > @@ -62,6 +62,13 @@ struct fiodgname_arg { > > > /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ > > > #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ > > > #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ > > > +struct fiobmap2_arg { > > > + int64_t bn; > > > + int runp; > > > + int runb; > > > +}; > > This structure has different layout for LP64 and ILP32, and you did not > > provided the compat shims. > > Really? How so? All of the fields have the same width on 64 and 32 > bit archs, and there shouldn't be any need for padding, either. Sorry, you are right. > > > > > > +/* Get the file's bmap info for the logical block bn */ > > > +#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) > > > > > > #ifdef _KERNEL > > > #ifdef COMPAT_FREEBSD32 > > > > > > Modified: head/sys/ufs/ufs/ufs_bmap.c > > > ============================================================================== > > > --- head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 13:59:46 2019 (r349230) > > > +++ head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 14:13:10 2019 (r349231) > > > @@ -200,12 +200,15 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) > > > *bnp = blkptrtodb(ump, ip->i_din2->di_extb[-1 - bn]); > > > if (*bnp == 0) > > > *bnp = -1; > > > - if (nbp == NULL) > > > - panic("ufs_bmaparray: mapping ext data"); > > > + if (nbp == NULL) { > > > + /* indirect block not found */ > > > + return (EINVAL); > > > + } > > This (and next chunk) loose useful checks for in-kernel interfaces. > > mckusick disagrees with you on this. He thought that changing the > panics into errors was a good idea. Note that ufs_bmap was already > capable of returning errors that not all callers check. For user-callable code, this is of course the requirement. But for in-kernel use, IMO it makes the interfaces loose. From owner-svn-src-all@freebsd.org Thu Jun 27 21:45:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F045E15CF223; Thu, 27 Jun 2019 21:45:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93D1972AD2; Thu, 27 Jun 2019 21:45:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A5931D46A; Thu, 27 Jun 2019 21:45:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RLjfPp082798; Thu, 27 Jun 2019 21:45:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RLjfoo082797; Thu, 27 Jun 2019 21:45:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906272145.x5RLjfoo082797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 27 Jun 2019 21:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349470 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 93D1972AD2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 21:45:42 -0000 Author: jhb Date: Thu Jun 27 21:45:40 2019 New Revision: 349470 URL: https://svnweb.freebsd.org/changeset/base/349470 Log: Use __FBSDID() and sort #includes. No functional change. Modified: head/usr.sbin/bhyve/net_utils.c Modified: head/usr.sbin/bhyve/net_utils.c ============================================================================== --- head/usr.sbin/bhyve/net_utils.c Thu Jun 27 20:34:50 2019 (r349469) +++ head/usr.sbin/bhyve/net_utils.c Thu Jun 27 21:45:40 2019 (r349470) @@ -21,17 +21,21 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ -#include "net_utils.h" -#include "bhyverun.h" -#include +#include +__FBSDID("$FreeBSD$"); + +#include #include -#include -#include + #include +#include +#include +#include + +#include "bhyverun.h" +#include "net_utils.h" int net_parsemac(char *mac_str, uint8_t *mac_addr) From owner-svn-src-all@freebsd.org Thu Jun 27 21:48:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E54F615CF336; Thu, 27 Jun 2019 21:48:32 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 871F772D5B; Thu, 27 Jun 2019 21:48:32 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6825A20241; Thu, 27 Jun 2019 17:48:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 27 Jun 2019 17:48:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=5 OdQlXMjzArjBfKmAqhdIKW6iT3PA7DhTAilKANGuaY=; b=yjwdjUPzlJuZihuE/ 9iexOvO0+SmOh2VeBwROgImdy73YDWS8xtB0WO3HPv5kFufTgC+rVxmdQblQA0LV gAXSIkZxxKtV4YZI+CzgypSnLtGvE6T60/AENR4qXNSDVZdlAJFvnkJ92LbTjJlX gTugLD3NZyYJtjZR9EFc3X+fS6v5DKHcsLwxgEj0p1JykUuCXW8DhCj7jbXyjXU4 WXhWMeAbnFTXJd+qiOZUD3myjmUJelmb9/xXan0LaUtpFwxT5BNvDCocsjGB/37w TxV50524A/F/grfZim8JLG5k1ycAw90qcb5h8edSbvA6YPD336d7z4vqB0sVSMCq hQgLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=5OdQlXMjzArjBfKmAqhdIKW6iT3PA7DhTAilKANGu aY=; b=oUdpY+VT1xxGGPRxJs8tSOZ17JjddORvZzCAnDAw8IfNJE1XCHOjFZ7Z4 zg6EMx9Ne22a8QKHTp4YoZo5nc9/mEQZUEbLTG69nVgEjC+RUoM2aE/JItBCm/6T VWmF0V5KsC+TecwR9TDQx1qXz3OlMhkpFkWpVndawlCkx0BxCczs3W8IBvDWF5ui A3ecMiL8AKzDB20Jeij2+PaNuxyjzStQmeECT4HlTMDoumcuTeA06x/lY2Qu0q47 VOHc+QuAm4hOVWwHTrAzWn8BMAtvjblQiEY+niW6xv9b3n2O1NfbH2PAs/0KyD+N GIVEQHesmPeejaYoudt4vVzZ1WU8A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudelgddtvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutghothht ucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucffohhmrghinhepfh hrvggvsghsugdrohhrghenucfkphepudelvddrheehrdehgedriedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehstghothhtlhesshgrmhhstghordhorhhgnecuvehluhhsthgvrh fuihiivgeptd X-ME-Proxy: Received: from [10.178.24.8] (unknown [192.55.54.60]) by mail.messagingengine.com (Postfix) with ESMTPA id 19CEE380086; Thu, 27 Jun 2019 17:48:24 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r349231 - in head/sys: kern sys ufs/ufs From: Scott Long In-Reply-To: <20190627210940.GR8697@kib.kiev.ua> Date: Thu, 27 Jun 2019 15:48:23 -0600 Cc: Alan Somers , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <0988866D-918B-4800-ADE7-938E1EBD729C@samsco.org> References: <201906201413.x5KEDB5u010923@repo.freebsd.org> <20190627191843.GQ8697@kib.kiev.ua> <20190627210940.GR8697@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 871F772D5B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 21:48:33 -0000 > On Jun 27, 2019, at 3:09 PM, Konstantin Belousov = wrote: >=20 > On Thu, Jun 27, 2019 at 02:01:11PM -0600, Alan Somers wrote: >> On Thu, Jun 27, 2019 at 1:18 PM Konstantin Belousov = wrote: >>>=20 >>> On Thu, Jun 20, 2019 at 02:13:11PM +0000, Alan Somers wrote: >>>> Author: asomers >>>> Date: Thu Jun 20 14:13:10 2019 >>>> New Revision: 349231 >>>> URL: https://svnweb.freebsd.org/changeset/base/349231 >>>>=20 >>>> Log: >>>> Add FIOBMAP2 ioctl >>>=20 >>>>=20 >>>> This ioctl exposes VOP_BMAP information to userland. It can be = used by >>>> programs like fragmentation analyzers and optimized cp = implementations. But >>>> I'm using it to test fusefs's VOP_BMAP implementation. The "2" in = the name >>>> distinguishes it from the similar but incompatible FIBMAP ioctls = in NetBSD >>>> and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit = block >>>> number instead of 32-bit, and it also returns runp and runb. >>>>=20 >>>> Reviewed by: mckusick >>>> MFC after: 2 weeks >>>> Sponsored by: The FreeBSD Foundation >>>> Differential Revision: https://reviews.freebsd.org/D20705 >>>>=20 >>>> Modified: >>>> head/sys/kern/vfs_vnops.c >>>> head/sys/sys/filio.h >>>> head/sys/ufs/ufs/ufs_bmap.c >>>>=20 >>>> Modified: head/sys/kern/vfs_vnops.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/kern/vfs_vnops.c Thu Jun 20 13:59:46 2019 = (r349230) >>>> +++ head/sys/kern/vfs_vnops.c Thu Jun 20 14:13:10 2019 = (r349231) >>>> @@ -1458,6 +1458,25 @@ vn_stat(struct vnode *vp, struct stat *sb, = struct ucre >>>> return (0); >>>> } >>>>=20 >>>> +/* generic FIOBMAP2 implementation */ >>>> +static int >>>> +vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct = ucred *cred) >>> I do not like the fact that internal kernel function takes the >>> user-visible structure which results in the mix of ABI and KBI. >>> Traditionally we pass explicit arguments to kern_XXX, vn_XXX and = similar >>> internal implementations. >>=20 >> Ok. It will increase the number of function arguments, which is = ugly, >> but I can do it if you prefer. >>=20 >>>=20 >>>> +{ >>>> + struct vnode *vp =3D fp->f_vnode; >>> Why do you pass fp to the function that >>> 1. Has vn_ namespace, i.e. operating on vnode. >>> 2. Only needs vnode to operate on. >>> Please change the argument from fp to vp. You would need to pass = f_cred >>> as additional argument, or move mac check to vn_ioctl (I think this = is >>> a better approach). >>=20 >> Ok. >>=20 >>>=20 >>>> + daddr_t lbn =3D arg->bn; >>> Style: initialization in declaration. >>>=20 >>>> + int error; >>>> + >>>> + vn_lock(vp, LK_SHARED | LK_RETRY); >>>> +#ifdef MAC >>>> + error =3D mac_vnode_check_read(cred, fp->f_cred, vp); >>>> + if (error =3D=3D 0) >>>> +#endif >>>> + error =3D VOP_BMAP(vp, lbn, NULL, &arg->bn, = &arg->runp, >>>> + &arg->runb); >>> Wrong indent for continuation line. >>>=20 >>>> + VOP_UNLOCK(vp, 0); >>>> + return (error); >>>> +} >>>> + >>>> /* >>>> * File table vnode ioctl routine. >>>> */ >>>> @@ -1481,6 +1500,9 @@ vn_ioctl(struct file *fp, u_long com, void = *data, stru >>>> if (error =3D=3D 0) >>>> *(int *)data =3D vattr.va_size - = fp->f_offset; >>>> return (error); >>>> + case FIOBMAP2: >>>> + return (vn_ioc_bmap2(fp, (struct = fiobmap2_arg*)data, >>> Need space between fiobmap2_arg and '*'. >>>> + active_cred)); >>> Wrong indent. >>>=20 >>>> case FIONBIO: >>>> case FIOASYNC: >>>> return (0); >>>>=20 >>>> Modified: head/sys/sys/filio.h >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/sys/filio.h Thu Jun 20 13:59:46 2019 = (r349230) >>>> +++ head/sys/sys/filio.h Thu Jun 20 14:13:10 2019 = (r349231) >>>> @@ -62,6 +62,13 @@ struct fiodgname_arg { >>>> /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. = */ >>>> #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA = */ >>>> #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE = */ >>>> +struct fiobmap2_arg { >>>> + int64_t bn; >>>> + int runp; >>>> + int runb; >>>> +}; >>> This structure has different layout for LP64 and ILP32, and you did = not >>> provided the compat shims. >>=20 >> Really? How so? All of the fields have the same width on 64 and 32 >> bit archs, and there shouldn't be any need for padding, either. > Sorry, you are right. >=20 >>=20 >>>=20 >>>> +/* Get the file's bmap info for the logical block bn */ >>>> +#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) >>>>=20 >>>> #ifdef _KERNEL >>>> #ifdef COMPAT_FREEBSD32 >>>>=20 >>>> Modified: head/sys/ufs/ufs/ufs_bmap.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 13:59:46 2019 = (r349230) >>>> +++ head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 14:13:10 2019 = (r349231) >>>> @@ -200,12 +200,15 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) >>>> *bnp =3D blkptrtodb(ump, = ip->i_din2->di_extb[-1 - bn]); >>>> if (*bnp =3D=3D 0) >>>> *bnp =3D -1; >>>> - if (nbp =3D=3D NULL) >>>> - panic("ufs_bmaparray: mapping ext = data"); >>>> + if (nbp =3D=3D NULL) { >>>> + /* indirect block not found */ >>>> + return (EINVAL); >>>> + } >>> This (and next chunk) loose useful checks for in-kernel interfaces. >>=20 >> mckusick disagrees with you on this. He thought that changing the >> panics into errors was a good idea. Note that ufs_bmap was already >> capable of returning errors that not all callers check. > For user-callable code, this is of course the requirement. But for = in-kernel > use, IMO it makes the interfaces loose. I=E2=80=99m firmly in agreement on changing panics into errors. When = callers are encountered that don=E2=80=99t properly check and propagate the errors, = they should be fixed too. I=E2=80=99m not saying that it=E2=80=99s an easy = process and that we should just delete all panics, but it=E2=80=99s a goal that should be = vigorously pursued. Scott From owner-svn-src-all@freebsd.org Thu Jun 27 22:06:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948B415CF806; Thu, 27 Jun 2019 22:06:42 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30F7673603; Thu, 27 Jun 2019 22:06:42 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F422E1D831; Thu, 27 Jun 2019 22:06:41 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RM6f89093235; Thu, 27 Jun 2019 22:06:41 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RM6f52093234; Thu, 27 Jun 2019 22:06:41 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906272206.x5RM6f52093234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Thu, 27 Jun 2019 22:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349471 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 349471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 30F7673603 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 22:06:42 -0000 Author: bcran Date: Thu Jun 27 22:06:41 2019 New Revision: 349471 URL: https://svnweb.freebsd.org/changeset/base/349471 Log: Increase EFI_STAGING_SIZE to 100MB on x64 To avoid failures when the large 18MB nvidia.ko module is being loaded, increase EFI_STAGING_SIZE from 64MB to 100MB on x64 systems. Leave the other platforms at 64MB. Modified: head/stand/efi/loader/copy.c Modified: head/stand/efi/loader/copy.c ============================================================================== --- head/stand/efi/loader/copy.c Thu Jun 27 21:45:40 2019 (r349470) +++ head/stand/efi/loader/copy.c Thu Jun 27 22:06:41 2019 (r349471) @@ -176,7 +176,11 @@ out: #endif /* __i386__ || __amd64__ */ #ifndef EFI_STAGING_SIZE +#if defined(__amd64__) +#define EFI_STAGING_SIZE 100 +#else #define EFI_STAGING_SIZE 64 +#endif #endif EFI_PHYSICAL_ADDRESS staging, staging_end; From owner-svn-src-all@freebsd.org Thu Jun 27 22:18:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C394015CFAC6; Thu, 27 Jun 2019 22:18:22 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6919E73C3B; Thu, 27 Jun 2019 22:18:22 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41D6E1DA17; Thu, 27 Jun 2019 22:18:22 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RMIMxt098628; Thu, 27 Jun 2019 22:18:22 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RMIMKY098627; Thu, 27 Jun 2019 22:18:22 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201906272218.x5RMIMKY098627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 27 Jun 2019 22:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349472 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 349472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6919E73C3B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 22:18:22 -0000 Author: lwhsu Date: Thu Jun 27 22:18:21 2019 New Revision: 349472 URL: https://svnweb.freebsd.org/changeset/base/349472 Log: Follow r349460 to complete removing "flags" in struct gpiobus_ivar MFC with: r349460 Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu Jun 27 22:06:41 2019 (r349471) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu Jun 27 22:18:21 2019 (r349472) @@ -321,10 +321,8 @@ ofw_gpiobus_setup_devinfo(device_t bus, device_t child ofw_gpiobus_destroy_devinfo(bus, dinfo); return (NULL); } - for (i = 0; i < devi->npins; i++) { - devi->flags[i] = pins[i].flags; + for (i = 0; i < devi->npins; i++) devi->pins[i] = pins[i].pin; - } free(pins, M_DEVBUF); /* Parse the interrupt resources. */ if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) { From owner-svn-src-all@freebsd.org Thu Jun 27 22:34:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6713015D0227; Thu, 27 Jun 2019 22:34:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C91B74BB6; Thu, 27 Jun 2019 22:34:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBBD51DDCE; Thu, 27 Jun 2019 22:34:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RMY52D009148; Thu, 27 Jun 2019 22:34:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RMY5DP009147; Thu, 27 Jun 2019 22:34:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906272234.x5RMY5DP009147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 27 Jun 2019 22:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349474 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 349474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C91B74BB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 22:34:06 -0000 Author: jhb Date: Thu Jun 27 22:34:05 2019 New Revision: 349474 URL: https://svnweb.freebsd.org/changeset/base/349474 Log: Reject attempts to register a TCP stack being unloaded. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20617 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Jun 27 22:24:56 2019 (r349473) +++ head/sys/netinet/tcp_subr.c Thu Jun 27 22:34:05 2019 (r349474) @@ -798,8 +798,12 @@ register_tcp_functions_as_names(struct tcp_function_bl } } + if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { + *num_names = 0; + return (EINVAL); + } + refcount_init(&blk->tfb_refcnt, 0); - blk->tfb_flags = 0; blk->tfb_id = atomic_fetchadd_int(&next_tcp_stack_id, 1); for (i = 0; i < *num_names; i++) { n = malloc(sizeof(struct tcp_function), M_TCPFUNCTIONS, wait); From owner-svn-src-all@freebsd.org Thu Jun 27 22:50:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B9D615D063C; Thu, 27 Jun 2019 22:50:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D417E751B7; Thu, 27 Jun 2019 22:50:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FF321DFA1; Thu, 27 Jun 2019 22:50:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RMoBh3014581; Thu, 27 Jun 2019 22:50:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RMoBmk014580; Thu, 27 Jun 2019 22:50:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906272250.x5RMoBmk014580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 27 Jun 2019 22:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349475 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D417E751B7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 22:50:12 -0000 Author: jhb Date: Thu Jun 27 22:50:11 2019 New Revision: 349475 URL: https://svnweb.freebsd.org/changeset/base/349475 Log: Fix comment in sofree() to reference sbdestroy(). r160875 added sbdestroy() as a wrapper around sbrelease_internal to be called from sofree(), yet the comment added in the same revision to sofree() still mentions sbrelease_internal(). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20488 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Jun 27 22:34:05 2019 (r349474) +++ head/sys/kern/uipc_socket.c Thu Jun 27 22:50:11 2019 (r349475) @@ -1044,7 +1044,7 @@ sofree(struct socket *so) * * We used to do a lot of socket buffer and socket locking here, as * well as invoke sorflush() and perform wakeups. The direct call to - * dom_dispose() and sbrelease_internal() are an inlining of what was + * dom_dispose() and sbdestroy() are an inlining of what was * necessary from sorflush(). * * Notice that the socket buffer and kqueue state are torn down From owner-svn-src-all@freebsd.org Thu Jun 27 23:10:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C73F515D0E4C; Thu, 27 Jun 2019 23:10:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D63D75CC6; Thu, 27 Jun 2019 23:10:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A6001E376; Thu, 27 Jun 2019 23:10:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RNAf4Y027391; Thu, 27 Jun 2019 23:10:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RNAes5027389; Thu, 27 Jun 2019 23:10:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906272310.x5RNAes5027389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 27 Jun 2019 23:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349476 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 349476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D63D75CC6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 23:10:42 -0000 Author: rmacklem Date: Thu Jun 27 23:10:40 2019 New Revision: 349476 URL: https://svnweb.freebsd.org/changeset/base/349476 Log: Add non-blocking trylock variants for the rangelock functions. A future patch that will add a Linux compatible copy_file_range(2) syscall needs to be able to lock the byte ranges of two files concurrently. To do this without a risk of deadlock, a non-blocking variant of vn_rangelock_rlock() called vn_rangelock_tryrlock() was needed. This patch adds this, along with vn_rangelock_trywlock(), in order to do this. The patch also adds a couple of comments, that I hope clarify how the algorithm used in kern_rangelock.c works. Reviewed by: kib, asomers (previous version) Differential Revision: https://reviews.freebsd.org/D20645 Modified: head/sys/kern/kern_rangelock.c head/sys/sys/rangelock.h head/sys/sys/vnode.h Modified: head/sys/kern/kern_rangelock.c ============================================================================== --- head/sys/kern/kern_rangelock.c Thu Jun 27 22:50:11 2019 (r349475) +++ head/sys/kern/kern_rangelock.c Thu Jun 27 23:10:40 2019 (r349476) @@ -141,15 +141,33 @@ out: static void rangelock_unlock_locked(struct rangelock *lock, struct rl_q_entry *entry, - struct mtx *ilk) + struct mtx *ilk, bool do_calc_block) { MPASS(lock != NULL && entry != NULL && ilk != NULL); mtx_assert(ilk, MA_OWNED); - KASSERT(entry != lock->rl_currdep, ("stuck currdep")); + if (!do_calc_block) { + /* + * This is the case where rangelock_enqueue() has been called + * with trylock == true and just inserted this entry in the + * queue. + * If rl_currdep is this entry, rl_currdep needs to + * be set to the next entry in the rl_waiters list. + * However, since this entry is the last entry in the + * list, the next entry is NULL. + */ + if (lock->rl_currdep == entry) { + KASSERT(TAILQ_NEXT(lock->rl_currdep, rl_q_link) == NULL, + ("rangelock_enqueue: next entry not NULL")); + lock->rl_currdep = NULL; + } + } else + KASSERT(entry != lock->rl_currdep, ("stuck currdep")); + TAILQ_REMOVE(&lock->rl_waiters, entry, rl_q_link); - rangelock_calc_block(lock); + if (do_calc_block) + rangelock_calc_block(lock); mtx_unlock(ilk); if (curthread->td_rlqe == NULL) curthread->td_rlqe = entry; @@ -164,7 +182,7 @@ rangelock_unlock(struct rangelock *lock, void *cookie, MPASS(lock != NULL && cookie != NULL && ilk != NULL); mtx_lock(ilk); - rangelock_unlock_locked(lock, cookie, ilk); + rangelock_unlock_locked(lock, cookie, ilk, true); } /* @@ -185,7 +203,7 @@ rangelock_unlock_range(struct rangelock *lock, void *c mtx_lock(ilk); if (entry->rl_q_end == end) { - rangelock_unlock_locked(lock, cookie, ilk); + rangelock_unlock_locked(lock, cookie, ilk, true); return (NULL); } entry->rl_q_end = end; @@ -196,11 +214,11 @@ rangelock_unlock_range(struct rangelock *lock, void *c /* * Add the lock request to the queue of the pending requests for - * rangelock. Sleep until the request can be granted. + * rangelock. Sleep until the request can be granted unless trylock == true. */ static void * rangelock_enqueue(struct rangelock *lock, off_t start, off_t end, int mode, - struct mtx *ilk) + struct mtx *ilk, bool trylock) { struct rl_q_entry *entry; struct thread *td; @@ -226,11 +244,28 @@ rangelock_enqueue(struct rangelock *lock, off_t start, */ TAILQ_INSERT_TAIL(&lock->rl_waiters, entry, rl_q_link); + /* + * If rl_currdep == NULL, there is no entry waiting for a conflicting + * range to be resolved, so set rl_currdep to this entry. If there is + * no conflicting entry for this entry, rl_currdep will be set back to + * NULL by rangelock_calc_block(). + */ if (lock->rl_currdep == NULL) lock->rl_currdep = entry; rangelock_calc_block(lock); - while (!(entry->rl_q_flags & RL_LOCK_GRANTED)) + while (!(entry->rl_q_flags & RL_LOCK_GRANTED)) { + if (trylock) { + /* + * For this case, the range is not actually locked + * yet, but removal from the list requires the same + * steps, except for not doing a rangelock_calc_block() + * call, since rangelock_calc_block() was called above. + */ + rangelock_unlock_locked(lock, entry, ilk, false); + return (NULL); + } msleep(entry, ilk, 0, "range", 0); + } mtx_unlock(ilk); return (entry); } @@ -239,12 +274,28 @@ void * rangelock_rlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk) { - return (rangelock_enqueue(lock, start, end, RL_LOCK_READ, ilk)); + return (rangelock_enqueue(lock, start, end, RL_LOCK_READ, ilk, false)); } void * +rangelock_tryrlock(struct rangelock *lock, off_t start, off_t end, + struct mtx *ilk) +{ + + return (rangelock_enqueue(lock, start, end, RL_LOCK_READ, ilk, true)); +} + +void * rangelock_wlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk) { - return (rangelock_enqueue(lock, start, end, RL_LOCK_WRITE, ilk)); + return (rangelock_enqueue(lock, start, end, RL_LOCK_WRITE, ilk, false)); +} + +void * +rangelock_trywlock(struct rangelock *lock, off_t start, off_t end, + struct mtx *ilk) +{ + + return (rangelock_enqueue(lock, start, end, RL_LOCK_WRITE, ilk, true)); } Modified: head/sys/sys/rangelock.h ============================================================================== --- head/sys/sys/rangelock.h Thu Jun 27 22:50:11 2019 (r349475) +++ head/sys/sys/rangelock.h Thu Jun 27 23:10:40 2019 (r349476) @@ -75,7 +75,11 @@ void *rangelock_unlock_range(struct rangelock *lock, v off_t start, off_t end, struct mtx *ilk); void *rangelock_rlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk); +void *rangelock_tryrlock(struct rangelock *lock, off_t start, off_t end, + struct mtx *ilk); void *rangelock_wlock(struct rangelock *lock, off_t start, off_t end, + struct mtx *ilk); +void *rangelock_trywlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk); void rlqentry_free(struct rl_q_entry *rlqe); Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Jun 27 22:50:11 2019 (r349475) +++ head/sys/sys/vnode.h Thu Jun 27 23:10:40 2019 (r349476) @@ -720,8 +720,12 @@ int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t off VI_MTX(vp)) #define vn_rangelock_rlock(vp, start, end) \ rangelock_rlock(&(vp)->v_rl, (start), (end), VI_MTX(vp)) +#define vn_rangelock_tryrlock(vp, start, end) \ + rangelock_tryrlock(&(vp)->v_rl, (start), (end), VI_MTX(vp)) #define vn_rangelock_wlock(vp, start, end) \ rangelock_wlock(&(vp)->v_rl, (start), (end), VI_MTX(vp)) +#define vn_rangelock_trywlock(vp, start, end) \ + rangelock_trywlock(&(vp)->v_rl, (start), (end), VI_MTX(vp)) int vfs_cache_lookup(struct vop_lookup_args *ap); void vfs_timestamp(struct timespec *); From owner-svn-src-all@freebsd.org Thu Jun 27 23:14:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5ED415D106F for ; Thu, 27 Jun 2019 23:14:18 +0000 (UTC) (envelope-from info@onlinealxex.com.pl) Received: from shared-als140.rev.nazwa.pl (shared-als140.rev.nazwa.pl [85.128.175.140]) by mx1.freebsd.org (Postfix) with ESMTP id 019FD76122 for ; Thu, 27 Jun 2019 23:14:17 +0000 (UTC) (envelope-from info@onlinealxex.com.pl) X-Virus-Scanned: by amavisd-new using ClamAV (4) X-Spam-Flag: NO X-Spam-Score: -0.496 X-Spam-Level: X-Spam-Status: No, score=-0.496 tagged_above=-10 tests=[ALL_TRUSTED=-1, BAD_ENC_HEADER=0.001, FSL_HELO_NON_FQDN_1=0.001, HELO_NO_DOMAIN=0.001, HTML_MESSAGE=0.001, NAC_COMPANY=0.5] autolearn=disabled Received: from y55BPMXngT (unknown [185.237.97.233]) by aleksander23.nazwa.pl (Postfix) with ESMTP id 5FA131C5830 for ; Fri, 28 Jun 2019 01:13:41 +0200 (CEST) Thread-Topic: Quotation received from Chemworld Precious Stones - # 3/37691 - 30710 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=onlinealxex.com.pl; s=default; t=1561677221; bh=5q5kAyesBrjz0mkIHWImaUASnhTHmez3VmzTMkWrktY=; h=From:To:Subject; b=qkL72Cxl5hFuINnloN9GUCcD0YHtcv0S0EyqCTPLwS3PQUFdW1I7EwgomxJBouMFKvW/Usle14dz5Hapwvz9GPdJzKr4S8VyXRRLVislcebh3rIc++wQHKVnyZolfHLpJLDo+sNMo37l2A5crozsq3rKw7FfyA1iR78E3nXNdRM= thread-index: AdUtPfVoG2W2jrDcRdWoHX5q8mJdzA== From: =?utf-8?Q?Chemworld Precious Stones?= To: Subject: Quotation received from Chemworld Precious Stones - # 3/37691 - 30710 Date: Fri, 28 Jun 2019 02:13:41 +0300 Message-ID: <63632F57E98140D2A94E7CBDA6B0655E@y55BPMXngT> MIME-Version: 1.0 X-Mailer: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.3.9600.19003 X-Rspamd-Queue-Id: 019FD76122 X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=onlinealxex.com.pl header.s=default header.b=qkL72Cxl; dmarc=pass (policy=none) header.from=onlinealxex.com.pl; spf=pass (mx1.freebsd.org: domain of info@onlinealxex.com.pl designates 85.128.175.140 as permitted sender) smtp.mailfrom=info@onlinealxex.com.pl X-Spamd-Result: default: False [1.32 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.16)[-0.165,0]; R_DKIM_ALLOW(-0.20)[onlinealxex.com.pl:s=default]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.01)[ipnet: 85.128.160.0/19(-3.29), asn: 15967(3.31), country: PL(0.06)]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; DKIM_TRACE(0.00)[onlinealxex.com.pl:+]; MX_GOOD(-0.01)[cached: onlinealxex.com.pl]; MIME_BASE64_TEXT(0.10)[]; FROM_EXCESS_QP(1.20)[]; DMARC_POLICY_ALLOW(-0.50)[onlinealxex.com.pl,none]; NEURAL_HAM_LONG(-0.75)[-0.751,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:15967, ipnet:85.128.160.0/19, country:PL]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 23:14:18 -0000 UXVvdGF0aW9uIA0KDQpDb21wYW55OiBDSEVNV09STEQgUHJlY2lvdXMgU3RvbmVzIFdvcmxkV2lk ZSANCkFkZHJlc3M6IDFzdCBGbG9vciwgRmFraHJpIFRyYWRlIENlbnRyZSwgU2hhaHJhaC1lLUxp YXFhdCANCg0KDQpRdW90ZSAjOiAxNTMxNA0KIEp1biAyNywgMjAxOSANCg0KSGVsbG8gQ3VzdG9t ZXIgMTU4LCANCg0KWW91IGhhdmUgcmVjZWl2ZWQgYSBxdW90YXRpb24gZnJvbSBCdXJoYWFuIEFy c2hpZCBhdCBDSEVNV09STEQgUHJlY2lvdXMgU3RvbmVzIFdvcmxkV2lkZSAgaW4gcmVzcG9uc2Ug dG8geW91ciBxdWVyeSBmb3IgcW91YXRpb24gb2YgMTAwTVQgb2YgcmF3IERpYW1vbmRzLiANCg0K IyBJVEVNIFVOSVQgUFJJQ0UgDQoxIERpYW1vbmQgTW9kZWw6IFZ0NDExNS0wMiwgMS80JycsIDIy MHZhYyANCiAyMiw3NTAuMDAgLyBQaWVjZXMgIA0KMiBEaWFtb25kIE1vZGVsOiBWdDMwNy0wMiwg MS80JycsIDIyMHZhYyANCiAxMCwxNTAuMDAgLyBQaWVjZXMgIA0KMyBEaWFtb25kIE1vZGVsOiBW eHoyNjBrLCAxJycsIDIyMHZhYyANCiAyOCwwMDAuMDAgLyBQaWVjZXMgIA0KDQpWaWV3IEZ1bGwg UXVvdGF0aW9uIA0K From owner-svn-src-all@freebsd.org Thu Jun 27 23:37:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C067B15D1A9B; Thu, 27 Jun 2019 23:37:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6435A76D88; Thu, 27 Jun 2019 23:37:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A2441E882; Thu, 27 Jun 2019 23:37:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RNb9K9040446; Thu, 27 Jun 2019 23:37:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RNb9Yx040445; Thu, 27 Jun 2019 23:37:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906272337.x5RNb9Yx040445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 27 Jun 2019 23:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349477 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6435A76D88 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 23:37:10 -0000 Author: asomers Date: Thu Jun 27 23:37:09 2019 New Revision: 349477 URL: https://svnweb.freebsd.org/changeset/base/349477 Log: [skip ci] VOP_BMAP.9: fix diction in copyright header MFC after: 2 weeks MFC-With: r349230 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/VOP_BMAP.9 Modified: head/share/man/man9/VOP_BMAP.9 ============================================================================== --- head/share/man/man9/VOP_BMAP.9 Thu Jun 27 23:10:40 2019 (r349476) +++ head/share/man/man9/VOP_BMAP.9 Thu Jun 27 23:37:09 2019 (r349477) @@ -3,8 +3,8 @@ .\" .\" Copyright (c) 2019 The FreeBSD Foundation .\" -.\" This software was developed by BFF Storage Systems, LLC under sponsorship -.\" from the FreeBSD Foundation. +.\" This documentation was written by BFF Storage Systems, LLC under +.\" sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Thu Jun 27 23:39:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 643B615D1C14; Thu, 27 Jun 2019 23:39:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A99F76F8A; Thu, 27 Jun 2019 23:39:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 411741E883; Thu, 27 Jun 2019 23:39:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5RNd7uM040563; Thu, 27 Jun 2019 23:39:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5RNd7nx040562; Thu, 27 Jun 2019 23:39:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906272339.x5RNd7nx040562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 27 Jun 2019 23:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349478 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A99F76F8A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2019 23:39:08 -0000 Author: asomers Date: Thu Jun 27 23:39:06 2019 New Revision: 349478 URL: https://svnweb.freebsd.org/changeset/base/349478 Log: FIOBMAP2: inline vn_ioc_bmap2 Reported by: kib Reviewed by: kib MFC after: 2 weeks MFC-With: 349238 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20783 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 27 23:37:09 2019 (r349477) +++ head/sys/kern/vfs_vnops.c Thu Jun 27 23:39:06 2019 (r349478) @@ -1457,25 +1457,6 @@ vn_stat(struct vnode *vp, struct stat *sb, struct ucre return (0); } -/* generic FIOBMAP2 implementation */ -static int -vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct ucred *cred) -{ - struct vnode *vp = fp->f_vnode; - daddr_t lbn = arg->bn; - int error; - - vn_lock(vp, LK_SHARED | LK_RETRY); -#ifdef MAC - error = mac_vnode_check_read(cred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_BMAP(vp, lbn, NULL, &arg->bn, &arg->runp, - &arg->runb); - VOP_UNLOCK(vp, 0); - return (error); -} - /* * File table vnode ioctl routine. */ @@ -1485,6 +1466,7 @@ vn_ioctl(struct file *fp, u_long com, void *data, stru { struct vattr vattr; struct vnode *vp; + struct fiobmap2_arg *bmarg; int error; vp = fp->f_vnode; @@ -1500,8 +1482,17 @@ vn_ioctl(struct file *fp, u_long com, void *data, stru *(int *)data = vattr.va_size - fp->f_offset; return (error); case FIOBMAP2: - return (vn_ioc_bmap2(fp, (struct fiobmap2_arg*)data, - active_cred)); + bmarg = (struct fiobmap2_arg *)data; + vn_lock(vp, LK_SHARED | LK_RETRY); +#ifdef MAC + error = mac_vnode_check_read(active_cred, fp->f_cred, + vp); + if (error == 0) +#endif + error = VOP_BMAP(vp, bmarg->bn, NULL, + &bmarg->bn, &bmarg->runp, &bmarg->runb); + VOP_UNLOCK(vp, 0); + return (error); case FIONBIO: case FIOASYNC: return (0); From owner-svn-src-all@freebsd.org Fri Jun 28 00:00:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E7E15D24DF; Fri, 28 Jun 2019 00:00:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07B1777AAB; Fri, 28 Jun 2019 00:00:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D75401EBFF; Fri, 28 Jun 2019 00:00:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0028A051239; Fri, 28 Jun 2019 00:00:02 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S002og051238; Fri, 28 Jun 2019 00:00:02 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906280000.x5S002og051238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 28 Jun 2019 00:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349480 - releng/11.3/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/sys/conf X-SVN-Commit-Revision: 349480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 07B1777AAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:00:03 -0000 Author: gjb Date: Fri Jun 28 00:00:02 2019 New Revision: 349480 URL: https://svnweb.freebsd.org/changeset/base/349480 Log: Update releng/11.3 to RC3 as part of the 11.3-RELEASE cycle. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/11.3/sys/conf/newvers.sh Modified: releng/11.3/sys/conf/newvers.sh ============================================================================== --- releng/11.3/sys/conf/newvers.sh Thu Jun 27 23:50:54 2019 (r349479) +++ releng/11.3/sys/conf/newvers.sh Fri Jun 28 00:00:02 2019 (r349480) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="RC2" +BRANCH="RC3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jun 28 00:03:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2456115D2A03; Fri, 28 Jun 2019 00:03:30 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA39E80064; Fri, 28 Jun 2019 00:03:29 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 961B91EDA1; Fri, 28 Jun 2019 00:03:29 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S03TVg056292; Fri, 28 Jun 2019 00:03:29 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S03TA0056291; Fri, 28 Jun 2019 00:03:29 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280003.x5S03TA0056291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349481 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 349481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA39E80064 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:03:30 -0000 Author: mhorne Date: Fri Jun 28 00:03:29 2019 New Revision: 349481 URL: https://svnweb.freebsd.org/changeset/base/349481 Log: Add some missing RISC-V ELF defines This adds defines for the RISC-V specific e_flags values, and some of the missing static relocations. Reviewed by: markj Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D20766 Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Jun 28 00:00:02 2019 (r349480) +++ head/sys/sys/elf_common.h Fri Jun 28 00:03:29 2019 (r349481) @@ -369,6 +369,15 @@ typedef struct { #define EF_PPC_RELOCATABLE 0x00010000 #define EF_PPC_RELOCATABLE_LIB 0x00008000 +#define EF_RISCV_RVC 0x00000001 +#define EF_RISCV_FLOAT_ABI_MASK 0x00000006 +#define EF_RISCV_FLOAT_ABI_SOFT 0x00000000 +#define EF_RISCV_FLOAT_ABI_SINGLE 0x000002 +#define EF_RISCV_FLOAT_ABI_DOUBLE 0x000004 +#define EF_RISCV_FLOAT_ABI_QUAD 0x00000006 +#define EF_RISCV_RVE 0x00000008 +#define EF_RISCV_TSO 0x00000010 + #define EF_SPARC_EXT_MASK 0x00ffff00 #define EF_SPARC_32PLUS 0x00000100 #define EF_SPARC_SUN_US1 0x00000200 @@ -1310,6 +1319,17 @@ typedef struct { #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 +#define R_RISCV_RVC_LUI 46 +#define R_RISCV_GPREL_I 47 +#define R_RISCV_GPREL_S 48 +#define R_RISCV_TPREL_I 49 +#define R_RISCV_TPREL_S 50 +#define R_RISCV_RELAX 51 +#define R_RISCV_SUB6 52 +#define R_RISCV_SET6 53 +#define R_RISCV_SET8 54 +#define R_RISCV_SET16 55 +#define R_RISCV_SET32 56 #define R_SPARC_NONE 0 #define R_SPARC_8 1 From owner-svn-src-all@freebsd.org Fri Jun 28 00:10:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E807915D2B7A; Fri, 28 Jun 2019 00:10:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86B1D8023D; Fri, 28 Jun 2019 00:10:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73B741EDAC; Fri, 28 Jun 2019 00:10:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0ARjY056621; Fri, 28 Jun 2019 00:10:27 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0ARLh056619; Fri, 28 Jun 2019 00:10:27 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280010.x5S0ARLh056619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349482 - in head/contrib/elftoolchain: common readelf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/contrib/elftoolchain: common readelf X-SVN-Commit-Revision: 349482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86B1D8023D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:10:28 -0000 Author: mhorne Date: Fri Jun 28 00:10:26 2019 New Revision: 349482 URL: https://svnweb.freebsd.org/changeset/base/349482 Log: readelf: Add support for RISC-V specific e_flags Reviewed by: markj Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20767 Modified: head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Fri Jun 28 00:03:29 2019 (r349481) +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri Jun 28 00:10:26 2019 (r349482) @@ -33,7 +33,7 @@ * See: http://www.sco.com/developers/gabi/latest/ch4.intro.html * - The May 1998 (version 1.5) draft of "The ELF-64 object format". * - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips, - * ia64, and powerpc processors. + * ia64, powerpc, and RISC-V processors. * - The "Linkers and Libraries Guide", from Sun Microsystems. */ @@ -426,6 +426,22 @@ _ELF_DEFINE_EF(EF_PPC_RELOCATABLE, 0x00010000UL, \ "-mrelocatable flag") \ _ELF_DEFINE_EF(EF_PPC_RELOCATABLE_LIB, 0x00008000UL, \ "-mrelocatable-lib flag") \ +_ELF_DEFINE_EF(EF_RISCV_RVC, 0x00000001UL, \ + "Compressed instruction extension") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_MASK, 0x00000006UL, \ + "Floating point ABI") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_SOFT, 0x00000000UL, \ + "Software emulated floating point") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_SINGLE, 0x00000002UL, \ + "Single precision floating point") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_DOUBLE, 0x00000004UL, \ + "Double precision floating point") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_QUAD, 0x00000006UL, \ + "Quad precision floating point") \ +_ELF_DEFINE_EF(EF_RISCV_RVE, 0x00000008UL, \ + "Compressed instruction ABI") \ +_ELF_DEFINE_EF(EF_RISCV_TSO, 0x00000010UL, \ + "RVTSO memory consistency model") \ _ELF_DEFINE_EF(EF_SPARC_EXT_MASK, 0x00ffff00UL, \ "Vendor Extension mask") \ _ELF_DEFINE_EF(EF_SPARC_32PLUS, 0x00000100UL, \ Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Jun 28 00:03:29 2019 (r349481) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Jun 28 00:10:26 2019 (r349482) @@ -431,6 +431,13 @@ static struct eflags_desc powerpc_eflags_desc[] = { {0, NULL} }; +static struct eflags_desc riscv_eflags_desc[] = { + {EF_RISCV_RVC, "RVC"}, + {EF_RISCV_RVE, "RVE"}, + {EF_RISCV_TSO, "TSO"}, + {0, NULL} +}; + static struct eflags_desc sparc_eflags_desc[] = { {EF_SPARC_32PLUS, "v8+"}, {EF_SPARC_SUN_US1, "ultrasparcI"}, @@ -2293,6 +2300,23 @@ dump_eflags(struct readelf *re, uint64_t e_flags) case EM_PPC: case EM_PPC64: edesc = powerpc_eflags_desc; + break; + case EM_RISCV: + switch (e_flags & EF_RISCV_FLOAT_ABI_MASK) { + case EF_RISCV_FLOAT_ABI_SOFT: + printf(", soft-float ABI"); + break; + case EF_RISCV_FLOAT_ABI_SINGLE: + printf(", single-float ABI"); + break; + case EF_RISCV_FLOAT_ABI_DOUBLE: + printf(", double-float ABI"); + break; + case EF_RISCV_FLOAT_ABI_QUAD: + printf(", quad-float ABI"); + break; + } + edesc = riscv_eflags_desc; break; case EM_SPARC: case EM_SPARC32PLUS: From owner-svn-src-all@freebsd.org Fri Jun 28 00:14:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 135C315D2DFF; Fri, 28 Jun 2019 00:14:14 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77B2C80664; Fri, 28 Jun 2019 00:14:13 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BF161EF4F; Fri, 28 Jun 2019 00:14:13 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0EDhP061578; Fri, 28 Jun 2019 00:14:13 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0ECxH061576; Fri, 28 Jun 2019 00:14:12 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280014.x5S0ECxH061576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349483 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77B2C80664 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:14:14 -0000 Author: mhorne Date: Fri Jun 28 00:14:12 2019 New Revision: 349483 URL: https://svnweb.freebsd.org/changeset/base/349483 Log: libelftc: add RISC-V bfd targets This adds the following targets: elf32-riscv, elf64-riscv, elf64-riscv-freebsd Reviewed by: emaste, markj, jkoshy@users.sourceforge.net Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20768 Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Fri Jun 28 00:10:26 2019 (r349482) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Fri Jun 28 00:14:12 2019 (r349483) @@ -76,6 +76,9 @@ Known descriptor names and their properties include: .It Li elf32-powerpc Ta ELF Ta MSB Ta 32 .It Li elf32-powerpc-freebsd Ta ELF Ta MSB Ta 32 .It Li elf32-powerpcle Ta ELF Ta LSB Ta 32 +.It Li elf32-riscv Ta ELF Ta LSB Ta 32 +.It Li elf64-riscv Ta ELF Ta LSB Ta 64 +.It Li elf64-riscv-freebsd Ta ELF Ta LSB Ta 64 .It Li elf32-sh Ta ELF Ta MSB Ta 32 .It Li elf32-shl Ta ELF Ta LSB Ta 32 .It Li elf32-sh-nbsd Ta ELF Ta MSB Ta 32 Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Fri Jun 28 00:10:26 2019 (r349482) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Fri Jun 28 00:14:12 2019 (r349483) @@ -316,6 +316,31 @@ struct _Elftc_Bfd_Target _libelftc_targets[] = { }, { + .bt_name = "elf32-riscv", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS32, + .bt_machine = EM_RISCV, + }, + + { + .bt_name = "elf64-riscv", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_RISCV, + }, + + { + .bt_name = "elf64-riscv-freebsd", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2MSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_RISCV, + .bt_osabi = ELFOSABI_FREEBSD, + }, + + { .bt_name = "elf64-sh64", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2MSB, From owner-svn-src-all@freebsd.org Fri Jun 28 00:36:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19CF015D336F; Fri, 28 Jun 2019 00:36:28 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF13080EC3; Fri, 28 Jun 2019 00:36:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A81D1F2CF; Fri, 28 Jun 2019 00:36:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0aRbR071941; Fri, 28 Jun 2019 00:36:27 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0aRxM071939; Fri, 28 Jun 2019 00:36:27 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280036.x5S0aRxM071939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349484 - in stable/12/sys/riscv: include riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/sys/riscv: include riscv X-SVN-Commit-Revision: 349484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF13080EC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:36:28 -0000 Author: mhorne Date: Fri Jun 28 00:36:26 2019 New Revision: 349484 URL: https://svnweb.freebsd.org/changeset/base/349484 Log: MFC r346021: RISC-V: initialize pcpu slightly earlier In certain scenarios, it is possible for PCPU data to be accessed before it has been initialized (e.g. during printf if the kernel was built with the TSLOG option). Initialize the PCPU pointer for hart 0 at the beginning of initriscv() rather than near the end. Approved by: markj (mentor) Modified: stable/12/sys/riscv/include/pcpu.h stable/12/sys/riscv/riscv/machdep.c Modified: stable/12/sys/riscv/include/pcpu.h ============================================================================== --- stable/12/sys/riscv/include/pcpu.h Fri Jun 28 00:14:12 2019 (r349483) +++ stable/12/sys/riscv/include/pcpu.h Fri Jun 28 00:36:26 2019 (r349484) @@ -54,7 +54,6 @@ struct pcb; struct pcpu; -extern struct pcpu *pcpup; static inline struct pcpu * get_pcpu(void) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:14:12 2019 (r349483) +++ stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:36:26 2019 (r349484) @@ -123,8 +123,6 @@ cpuset_t all_harts; extern int *end; extern int *initstack_end; -struct pcpu *pcpup; - uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs); uintptr_t @@ -632,6 +630,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask static void init_proc0(vm_offset_t kstack) { + struct pcpu *pcpup; pcpup = &__pcpu[0]; @@ -807,6 +806,7 @@ void initriscv(struct riscv_bootparams *rvbp) { struct mem_region mem_regions[FDT_MEM_REGIONS]; + struct pcpu *pcpup; vm_offset_t rstart, rend; vm_offset_t s, e; int mem_regions_sz; @@ -815,6 +815,16 @@ initriscv(struct riscv_bootparams *rvbp) caddr_t kmdp; int i; + /* Set the pcpu data, this is needed by pmap_bootstrap */ + pcpup = &__pcpu[0]; + pcpu_init(pcpup, 0, sizeof(struct pcpu)); + pcpup->pc_hart = boot_hart; + + /* Set the pcpu pointer */ + __asm __volatile("mv gp, %0" :: "r"(pcpup)); + + PCPU_SET(curthread, &thread0); + /* Set the module data location */ lastaddr = fake_preload_metadata(rvbp); @@ -857,16 +867,6 @@ initriscv(struct riscv_bootparams *rvbp) } } #endif - - /* Set the pcpu data, this is needed by pmap_bootstrap */ - pcpup = &__pcpu[0]; - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - pcpup->pc_hart = boot_hart; - - /* Set the pcpu pointer */ - __asm __volatile("mv gp, %0" :: "r"(pcpup)); - - PCPU_SET(curthread, &thread0); /* Do basic tuning, hz etc */ init_param1(); From owner-svn-src-all@freebsd.org Fri Jun 28 00:43:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071E315D36CA; Fri, 28 Jun 2019 00:43:41 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3078138D; Fri, 28 Jun 2019 00:43:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 700B41F470; Fri, 28 Jun 2019 00:43:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0hegI077023; Fri, 28 Jun 2019 00:43:40 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0hcnU077014; Fri, 28 Jun 2019 00:43:38 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280043.x5S0hcnU077014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349485 - in stable/12/sys: conf riscv/include riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/sys: conf riscv/include riscv/riscv X-SVN-Commit-Revision: 349485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C3078138D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:43:41 -0000 Author: mhorne Date: Fri Jun 28 00:43:38 2019 New Revision: 349485 URL: https://svnweb.freebsd.org/changeset/base/349485 Log: MFC 348835-348836: Fix global pointer relaxations in the RISC-V kernel The gp register is intended to used by the linker as another means of performing relaxations, and should point to the small data section (.sdata). Currently gp is being used as the pcpu pointer within the kernel, but the more appropriate choice for this is the tp register, which is unused. Swap existing usage of gp with tp within the kernel, and set up gp properly at boot with the value of __global_pointer$ for all harts. Approved by: markj (mentor, implicit) Modified: stable/12/sys/conf/ldscript.riscv stable/12/sys/riscv/include/asm.h stable/12/sys/riscv/include/pcpu.h stable/12/sys/riscv/riscv/exception.S stable/12/sys/riscv/riscv/locore.S stable/12/sys/riscv/riscv/machdep.c stable/12/sys/riscv/riscv/mp_machdep.c stable/12/sys/riscv/riscv/swtch.S stable/12/sys/riscv/riscv/vm_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/ldscript.riscv ============================================================================== --- stable/12/sys/conf/ldscript.riscv Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/conf/ldscript.riscv Fri Jun 28 00:43:38 2019 (r349485) @@ -84,7 +84,11 @@ SECTIONS can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ . = ALIGN(8); - .sdata : { *(.sdata) } + .sdata : + { + __global_pointer$ = . + 0x800; + *(.sdata) + } _edata = .; PROVIDE (edata = .); /* Ensure __bss_start is associated with the next section in case orphan Modified: stable/12/sys/riscv/include/asm.h ============================================================================== --- stable/12/sys/riscv/include/asm.h Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/include/asm.h Fri Jun 28 00:43:38 2019 (r349485) @@ -59,7 +59,7 @@ .set alias,sym #define SET_FAULT_HANDLER(handler, tmp) \ - ld tmp, PC_CURTHREAD(gp); \ + ld tmp, PC_CURTHREAD(tp); \ ld tmp, TD_PCB(tmp); /* Load the pcb */ \ sd handler, PCB_ONFAULT(tmp) /* Set the handler */ Modified: stable/12/sys/riscv/include/pcpu.h ============================================================================== --- stable/12/sys/riscv/include/pcpu.h Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/include/pcpu.h Fri Jun 28 00:43:38 2019 (r349485) @@ -60,7 +60,7 @@ get_pcpu(void) { struct pcpu *pcpu; - __asm __volatile("mv %0, gp" : "=&r"(pcpu)); + __asm __volatile("mv %0, tp" : "=&r"(pcpu)); return (pcpu); } @@ -70,7 +70,7 @@ get_curthread(void) { struct thread *td; - __asm __volatile("ld %0, 0(gp)" : "=&r"(td)); + __asm __volatile("ld %0, 0(tp)" : "=&r"(td)); return (td); } Modified: stable/12/sys/riscv/riscv/exception.S ============================================================================== --- stable/12/sys/riscv/riscv/exception.S Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/riscv/exception.S Fri Jun 28 00:43:38 2019 (r349485) @@ -44,11 +44,18 @@ __FBSDID("$FreeBSD$"); addi sp, sp, -(TF_SIZE) sd ra, (TF_RA)(sp) - sd tp, (TF_TP)(sp) -.if \el == 0 /* We came from userspace. Load our pcpu */ +.if \el == 0 /* We came from userspace. */ sd gp, (TF_GP)(sp) - ld gp, (TF_SIZE)(sp) +.option push +.option norelax + /* Load the kernel's global pointer */ + la gp, __global_pointer$ +.option pop + + /* Load our pcpu */ + sd tp, (TF_TP)(sp) + ld tp, (TF_SIZE)(sp) .endif sd t0, (TF_T + 0 * 8)(sp) @@ -81,16 +88,6 @@ __FBSDID("$FreeBSD$"); sd a6, (TF_A + 6 * 8)(sp) sd a7, (TF_A + 7 * 8)(sp) -#if 0 - /* XXX: temporary test: spin if stack is not kernel one */ -.if \el == 1 /* kernel */ - mv t0, sp - srli t0, t0, 63 -1: - beqz t0, 1b -.endif -#endif - .if \el == 1 /* Store kernel sp */ li t1, TF_SIZE @@ -138,13 +135,15 @@ __FBSDID("$FreeBSD$"); ld t0, (TF_SP)(sp) csrw sscratch, t0 - /* And store our pcpu */ - sd gp, (TF_SIZE)(sp) + /* Store our pcpu */ + sd tp, (TF_SIZE)(sp) + ld tp, (TF_TP)(sp) + + /* And restore the user's global pointer */ ld gp, (TF_GP)(sp) .endif ld ra, (TF_RA)(sp) - ld tp, (TF_TP)(sp) ld t0, (TF_T + 0 * 8)(sp) ld t1, (TF_T + 1 * 8)(sp) @@ -185,7 +184,7 @@ __FBSDID("$FreeBSD$"); 1: csrci sstatus, (SSTATUS_SIE) - ld a1, PC_CURTHREAD(gp) + ld a1, PC_CURTHREAD(tp) lw a2, TD_FLAGS(a1) li a3, (TDF_ASTPENDING|TDF_NEEDRESCHED) Modified: stable/12/sys/riscv/riscv/locore.S ============================================================================== --- stable/12/sys/riscv/riscv/locore.S Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/riscv/locore.S Fri Jun 28 00:43:38 2019 (r349485) @@ -171,12 +171,18 @@ va: li t0, 0 csrw sscratch, t0 + /* Set the global pointer */ +.option push +.option norelax + la gp, __global_pointer$ +.option pop + /* Initialize stack pointer */ la s3, initstack_end mv sp, s3 addi sp, sp, -PCB_SIZE - /* Clear BSS */ + /* Clear BSS */ la s0, _C_LABEL(__bss_start) la s1, _C_LABEL(_end) 1: @@ -251,12 +257,6 @@ virt_map: hart_lottery: .space 4 - /* Not in use, but required for linking. */ - .align 3 - .globl __global_pointer$ -__global_pointer$: - .space 8 - .globl init_pt_va init_pt_va: .quad pagetable_l2 /* XXX: Keep page tables VA */ @@ -323,6 +323,12 @@ mpva: /* Ensure sscratch is zero */ li t0, 0 csrw sscratch, t0 + + /* Set the global pointer */ +.option push +.option norelax + la gp, __global_pointer$ +.option pop call init_secondary END(mpentry) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:43:38 2019 (r349485) @@ -821,7 +821,7 @@ initriscv(struct riscv_bootparams *rvbp) pcpup->pc_hart = boot_hart; /* Set the pcpu pointer */ - __asm __volatile("mv gp, %0" :: "r"(pcpup)); + __asm __volatile("mv tp, %0" :: "r"(pcpup)); PCPU_SET(curthread, &thread0); Modified: stable/12/sys/riscv/riscv/mp_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/mp_machdep.c Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/riscv/mp_machdep.c Fri Jun 28 00:43:38 2019 (r349485) @@ -233,7 +233,7 @@ init_secondary(uint64_t hart) /* Setup the pcpu pointer */ pcpup = &__pcpu[cpuid]; - __asm __volatile("mv gp, %0" :: "r"(pcpup)); + __asm __volatile("mv tp, %0" :: "r"(pcpup)); /* Workaround: make sure wfi doesn't halt the hart */ csr_set(sie, SIE_SSIE); Modified: stable/12/sys/riscv/riscv/swtch.S ============================================================================== --- stable/12/sys/riscv/riscv/swtch.S Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/riscv/swtch.S Fri Jun 28 00:43:38 2019 (r349485) @@ -217,15 +217,14 @@ ENTRY(cpu_throw) mv a0, s0 /* Store the new curthread */ - sd a0, PC_CURTHREAD(gp) + sd a0, PC_CURTHREAD(tp) /* And the new pcb */ ld x13, TD_PCB(a0) - sd x13, PC_CURPCB(gp) + sd x13, PC_CURPCB(tp) /* Load registers */ ld ra, (PCB_RA)(x13) ld sp, (PCB_SP)(x13) - ld tp, (PCB_TP)(x13) /* s[0-11] */ ld s0, (PCB_S + 0 * 8)(x13) @@ -267,10 +266,10 @@ END(cpu_throw) */ ENTRY(cpu_switch) /* Store the new curthread */ - sd a1, PC_CURTHREAD(gp) + sd a1, PC_CURTHREAD(tp) /* And the new pcb */ ld x13, TD_PCB(a1) - sd x13, PC_CURPCB(gp) + sd x13, PC_CURPCB(tp) /* Save the old context. */ ld x13, TD_PCB(a0) @@ -278,7 +277,6 @@ ENTRY(cpu_switch) /* Store ra, sp and the callee-saved registers */ sd ra, (PCB_RA)(x13) sd sp, (PCB_SP)(x13) - sd tp, (PCB_TP)(x13) /* s[0-11] */ sd s0, (PCB_S + 0 * 8)(x13) @@ -340,7 +338,6 @@ ENTRY(cpu_switch) ld x13, TD_PCB(a1) /* Restore the registers */ - ld tp, (PCB_TP)(x13) ld ra, (PCB_RA)(x13) ld sp, (PCB_SP)(x13) @@ -429,15 +426,16 @@ ENTRY(fork_trampoline) ld a6, (TF_A + 6 * 8)(sp) ld a7, (TF_A + 7 * 8)(sp) - /* Load user ra and sp */ + /* Load user ra and gp */ ld ra, (TF_RA)(sp) + ld gp, (TF_GP)(sp) /* * Store our pcpup on stack, we will load it back * on kernel mode trap. */ - sd gp, (TF_SIZE)(sp) - ld gp, (TF_GP)(sp) + sd tp, (TF_SIZE)(sp) + ld tp, (TF_TP)(sp) /* Save kernel stack so we can use it doing a user trap */ addi sp, sp, TF_SIZE @@ -454,6 +452,7 @@ ENTRY(savectx) sd ra, (PCB_RA)(a0) sd sp, (PCB_SP)(a0) sd tp, (PCB_TP)(a0) + sd gp, (PCB_GP)(a0) /* s[0-11] */ sd s0, (PCB_S + 0 * 8)(a0) Modified: stable/12/sys/riscv/riscv/vm_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/vm_machdep.c Fri Jun 28 00:36:26 2019 (r349484) +++ stable/12/sys/riscv/riscv/vm_machdep.c Fri Jun 28 00:43:38 2019 (r349485) @@ -69,23 +69,12 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t { struct pcb *pcb2; struct trapframe *tf; - register_t val; if ((flags & RFPROC) == 0) return; - if (td1 == curthread) { - /* - * Save the tp. These normally happen in cpu_switch, - * but if userland changes this then forks this may - * not have happened. - */ - __asm __volatile("mv %0, tp" : "=&r"(val)); - td1->td_pcb->pcb_tp = val; + /* RISCVTODO: save the FPU state here */ - /* RISCVTODO: save the FPU state here */ - } - pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; @@ -205,15 +194,15 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * int cpu_set_user_tls(struct thread *td, void *tls_base) { - struct pcb *pcb; if ((uintptr_t)tls_base >= VM_MAXUSER_ADDRESS) return (EINVAL); - pcb = td->td_pcb; - pcb->pcb_tp = (register_t)tls_base + TP_OFFSET; - if (td == curthread) - __asm __volatile("mv tp, %0" :: "r"(pcb->pcb_tp)); + /* + * The user TLS is set by modifying the trapframe's tp value, which + * will be restored when returning to userspace. + */ + td->td_frame->tf_tp = (register_t)tls_base + TP_OFFSET; return (0); } From owner-svn-src-all@freebsd.org Fri Jun 28 00:50:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCED515D37FD; Fri, 28 Jun 2019 00:50:01 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27DA781537; Fri, 28 Jun 2019 00:50:01 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00DB31F477; Fri, 28 Jun 2019 00:50:01 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0o0bM077372; Fri, 28 Jun 2019 00:50:00 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0o0mp077371; Fri, 28 Jun 2019 00:50:00 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280050.x5S0o0mp077371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349486 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 349486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27DA781537 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:50:02 -0000 Author: mhorne Date: Fri Jun 28 00:50:00 2019 New Revision: 349486 URL: https://svnweb.freebsd.org/changeset/base/349486 Log: MFC r348837: Add TSLOG events to initriscv() Approved by: markj (mentor, implicit) Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:43:38 2019 (r349485) +++ stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:50:00 2019 (r349486) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -815,6 +816,8 @@ initriscv(struct riscv_bootparams *rvbp) caddr_t kmdp; int i; + TSRAW(&thread0, TS_ENTER, __func__, NULL); + /* Set the pcpu data, this is needed by pmap_bootstrap */ pcpup = &__pcpu[0]; pcpu_init(pcpup, 0, sizeof(struct pcpu)); @@ -887,6 +890,8 @@ initriscv(struct riscv_bootparams *rvbp) kdb_init(); early_boot = 0; + + TSEXIT(); } #undef bzero From owner-svn-src-all@freebsd.org Fri Jun 28 00:53:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69BC515D39D8; Fri, 28 Jun 2019 00:53:28 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6408191D; Fri, 28 Jun 2019 00:53:28 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CE671F628; Fri, 28 Jun 2019 00:53:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0rRQN082289; Fri, 28 Jun 2019 00:53:27 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0rRO0082288; Fri, 28 Jun 2019 00:53:27 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280053.x5S0rRO0082288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349487 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 349487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B6408191D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:53:28 -0000 Author: mhorne Date: Fri Jun 28 00:53:27 2019 New Revision: 349487 URL: https://svnweb.freebsd.org/changeset/base/349487 Log: MFC r348838: Announce real and available memory at boot Approved by: markj (mentor, implicit) Modified: stable/12/sys/riscv/riscv/machdep.c stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:50:00 2019 (r349486) +++ stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:53:27 2019 (r349487) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -139,7 +140,34 @@ cpu_startup(void *dummy) identify_cpu(); + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)realmem), + ptoa((uintmax_t)realmem) / (1024 * 1024)); + + /* + * Display any holes after the first chunk of extended memory. + */ + if (bootverbose) { + int indx; + + printf("Physical memory chunk(s):\n"); + for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { + vm_paddr_t size; + + size = phys_avail[indx + 1] - phys_avail[indx]; + printf( + "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); + } + } + vm_ksubmap_init(&kmi); + + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / (1024 * 1024)); + bufinit(); vm_pager_bufferinit(); } Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Fri Jun 28 00:50:00 2019 (r349486) +++ stable/12/sys/riscv/riscv/pmap.c Fri Jun 28 00:53:27 2019 (r349487) @@ -640,6 +640,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, continue; dump_avail[map_slot] = start; dump_avail[map_slot + 1] = end; + realmem += atop((vm_offset_t)(end - start)); if (start >= kernstart && end <= pa) continue; From owner-svn-src-all@freebsd.org Fri Jun 28 00:56:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BC8D15D3A83; Fri, 28 Jun 2019 00:56:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E58E681B1D; Fri, 28 Jun 2019 00:56:26 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC0781F62A; Fri, 28 Jun 2019 00:56:26 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0uQhU082486; Fri, 28 Jun 2019 00:56:26 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0uQa5082485; Fri, 28 Jun 2019 00:56:26 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280056.x5S0uQa5082485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349488 - stable/12/sys/riscv/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/conf X-SVN-Commit-Revision: 349488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E58E681B1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:56:27 -0000 Author: mhorne Date: Fri Jun 28 00:56:26 2019 New Revision: 349488 URL: https://svnweb.freebsd.org/changeset/base/349488 Log: MFC r348839: Clean up some GENERIC options Approved by: markj (mentor) Modified: stable/12/sys/riscv/conf/GENERIC Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/conf/GENERIC ============================================================================== --- stable/12/sys/riscv/conf/GENERIC Fri Jun 28 00:53:27 2019 (r349487) +++ stable/12/sys/riscv/conf/GENERIC Fri Jun 28 00:56:26 2019 (r349488) @@ -22,12 +22,8 @@ cpu RISCV ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -# makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support -# FIXME: linker error. "--relax and -r may not be used together" -makeoptions WITHOUT_MODULES="usb otusfw mwlfw ispfw mwlfw ralfw rtwnfw" -# makeoptions NO_MODULES - options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET @@ -53,11 +49,11 @@ options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. -# options GEOM_RAID # Soft RAID functionality. +options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support -# options STACK # stack(9) support +options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores From owner-svn-src-all@freebsd.org Fri Jun 28 00:58:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD8BB15D3B7D; Fri, 28 Jun 2019 00:58:55 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 736DF81D52; Fri, 28 Jun 2019 00:58:55 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DEBA1F62C; Fri, 28 Jun 2019 00:58:55 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S0wtKp082632; Fri, 28 Jun 2019 00:58:55 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S0wtXt082631; Fri, 28 Jun 2019 00:58:55 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280058.x5S0wtXt082631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 00:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349489 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 349489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 736DF81D52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 00:58:56 -0000 Author: mhorne Date: Fri Jun 28 00:58:54 2019 New Revision: 349489 URL: https://svnweb.freebsd.org/changeset/base/349489 Log: MFC r348840: Remove unused mcall_trap() function Approved by: markj (mentor, implicit) Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:56:26 2019 (r349488) +++ stable/12/sys/riscv/riscv/machdep.c Fri Jun 28 00:58:54 2019 (r349489) @@ -125,15 +125,6 @@ cpuset_t all_harts; extern int *end; extern int *initstack_end; -uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs); - -uintptr_t -mcall_trap(uintptr_t mcause, uintptr_t* regs) -{ - - return (0); -} - static void cpu_startup(void *dummy) { From owner-svn-src-all@freebsd.org Fri Jun 28 01:01:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B36C815D3D9A; Fri, 28 Jun 2019 01:01:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 559AC81FA5; Fri, 28 Jun 2019 01:01:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 115641F79A; Fri, 28 Jun 2019 01:01:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S11tCP087632; Fri, 28 Jun 2019 01:01:55 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S11tqs087628; Fri, 28 Jun 2019 01:01:55 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280101.x5S11tqs087628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 01:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349490 - in stable/12/sys/riscv: include riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/sys/riscv: include riscv X-SVN-Commit-Revision: 349490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 559AC81FA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:01:57 -0000 Author: mhorne Date: Fri Jun 28 01:01:54 2019 New Revision: 349490 URL: https://svnweb.freebsd.org/changeset/base/349490 Log: MFC r348886: RISC-V: expose extension bits in AT_HWCAP Approved by: markj (mentor, implicit) Modified: stable/12/sys/riscv/include/elf.h stable/12/sys/riscv/include/md_var.h stable/12/sys/riscv/riscv/elf_machdep.c stable/12/sys/riscv/riscv/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/elf.h ============================================================================== --- stable/12/sys/riscv/include/elf.h Fri Jun 28 00:58:54 2019 (r349489) +++ stable/12/sys/riscv/include/elf.h Fri Jun 28 01:01:54 2019 (r349490) @@ -105,4 +105,15 @@ __ElfType(Auxinfo); /* TODO: set correct value */ #define ET_DYN_LOAD_ADDR 0x100000 +/* Flags passed in AT_HWCAP */ +#define HWCAP_ISA_BIT(c) (1 << ((c) - 'A')) +#define HWCAP_ISA_I HWCAP_ISA_BIT('I') +#define HWCAP_ISA_M HWCAP_ISA_BIT('M') +#define HWCAP_ISA_A HWCAP_ISA_BIT('A') +#define HWCAP_ISA_F HWCAP_ISA_BIT('F') +#define HWCAP_ISA_D HWCAP_ISA_BIT('D') +#define HWCAP_ISA_C HWCAP_ISA_BIT('C') +#define HWCAP_ISA_G \ + (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/12/sys/riscv/include/md_var.h ============================================================================== --- stable/12/sys/riscv/include/md_var.h Fri Jun 28 00:58:54 2019 (r349489) +++ stable/12/sys/riscv/include/md_var.h Fri Jun 28 01:01:54 2019 (r349490) @@ -38,6 +38,7 @@ extern char sigcode[]; extern int szsigcode; extern uint64_t *vm_page_dump; extern int vm_page_dump_size; +extern u_long elf_hwcap; struct dumperinfo; Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Fri Jun 28 00:58:54 2019 (r349489) +++ stable/12/sys/riscv/riscv/elf_machdep.c Fri Jun 28 01:01:54 2019 (r349490) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +u_long elf_hwcap; + struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, @@ -89,6 +91,7 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &elf_hwcap, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: stable/12/sys/riscv/riscv/identcpu.c ============================================================================== --- stable/12/sys/riscv/riscv/identcpu.c Fri Jun 28 00:58:54 2019 (r349489) +++ stable/12/sys/riscv/riscv/identcpu.c Fri Jun 28 01:01:54 2019 (r349490) @@ -32,18 +32,28 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); #include +#include +#include #include #include -#include #include #include +#include +#include #include +#ifdef FDT +#include +#include +#endif + char machine[] = "riscv"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, @@ -87,6 +97,84 @@ const struct cpu_implementers cpu_implementers[] = { { CPU_IMPL_UCB_ROCKET, "UC Berkeley Rocket" }, CPU_IMPLEMENTER_NONE, }; + +#ifdef FDT +/* + * The ISA string is made up of a small prefix (e.g. rv64) and up to 26 letters + * indicating the presence of the 26 possible standard extensions. Therefore 32 + * characters will be sufficient. + */ +#define ISA_NAME_MAXLEN 32 +#define ISA_PREFIX ("rv" __XSTRING(__riscv_xlen)) +#define ISA_PREFIX_LEN (sizeof(ISA_PREFIX) - 1) + +static void +fill_elf_hwcap(void *dummy __unused) +{ + u_long caps[256] = {0}; + char isa[ISA_NAME_MAXLEN]; + u_long hwcap; + phandle_t node; + ssize_t len; + int i; + + caps['i'] = caps['I'] = HWCAP_ISA_I; + caps['m'] = caps['M'] = HWCAP_ISA_M; + caps['a'] = caps['A'] = HWCAP_ISA_A; +#ifdef FPE + caps['f'] = caps['F'] = HWCAP_ISA_F; + caps['d'] = caps['D'] = HWCAP_ISA_D; +#endif + caps['c'] = caps['C'] = HWCAP_ISA_C; + + node = OF_finddevice("/cpus"); + if (node == -1) { + if (bootverbose) + printf("fill_elf_hwcap: Can't find cpus node\n"); + return; + } + + /* + * Iterate through the CPUs and examine their ISA string. While we + * could assign elf_hwcap to be whatever the boot CPU supports, to + * handle the (unusual) case of running a system with hetergeneous + * ISAs, keep only the extension bits that are common to all harts. + */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if (!fdt_is_compatible_strict(node, "riscv")) { + if (bootverbose) + printf("fill_elf_hwcap: Can't find cpu\n"); + return; + } + + len = OF_getprop(node, "riscv,isa", isa, sizeof(isa)); + KASSERT(len <= ISA_NAME_MAXLEN, ("ISA string truncated")); + if (len == -1) { + if (bootverbose) + printf("fill_elf_hwcap: " + "Can't find riscv,isa property\n"); + return; + } else if (strncmp(isa, ISA_PREFIX, ISA_PREFIX_LEN) != 0) { + if (bootverbose) + printf("fill_elf_hwcap: " + "Unsupported ISA string: %s\n", isa); + return; + } + + hwcap = 0; + for (i = ISA_PREFIX_LEN; i < len; i++) + hwcap |= caps[(unsigned char)isa[i]]; + + if (elf_hwcap != 0) + elf_hwcap &= hwcap; + else + elf_hwcap = hwcap; + + } +} + +SYSINIT(identcpu, SI_SUB_CPU, SI_ORDER_ANY, fill_elf_hwcap, NULL); +#endif void identify_cpu(void) From owner-svn-src-all@freebsd.org Fri Jun 28 01:03:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECBB915D3E56; Fri, 28 Jun 2019 01:03:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCBE82310; Fri, 28 Jun 2019 01:03:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66AE01F7CE; Fri, 28 Jun 2019 01:03:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S13uqx087762; Fri, 28 Jun 2019 01:03:56 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S13uZA087761; Fri, 28 Jun 2019 01:03:56 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280103.x5S13uZA087761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 01:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349491 - stable/12/usr.bin/procstat X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/usr.bin/procstat X-SVN-Commit-Revision: 349491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DCBE82310 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:03:57 -0000 Author: mhorne Date: Fri Jun 28 01:03:55 2019 New Revision: 349491 URL: https://svnweb.freebsd.org/changeset/base/349491 Log: MFC r348887: procstat: Recognize HWCAP and HWCAP2 with auxv command Approved by: markj (mentor, implicit) Modified: stable/12/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/procstat/procstat_auxv.c ============================================================================== --- stable/12/usr.bin/procstat/procstat_auxv.c Fri Jun 28 01:01:54 2019 (r349490) +++ stable/12/usr.bin/procstat/procstat_auxv.c Fri Jun 28 01:03:55 2019 (r349491) @@ -185,6 +185,18 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ prefix, "AT_EHDRFLAGS", (u_long)auxv[i].a_un.a_val); break; #endif +#ifdef AT_HWCAP + case AT_HWCAP: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_HWCAP/%#lx}\n", + prefix, "AT_HWCAP", (u_long)auxv[i].a_un.a_val); + break; +#endif +#ifdef AT_HWCAP2 + case AT_HWCAP2: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_HWCAP2/%#lx}\n", + prefix, "AT_HWCAP2", (u_long)auxv[i].a_un.a_val); + break; +#endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", prefix, auxv[i].a_type, auxv[i].a_un.a_val); From owner-svn-src-all@freebsd.org Fri Jun 28 01:07:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44B3A15D3EFE; Fri, 28 Jun 2019 01:07:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF43D8246C; Fri, 28 Jun 2019 01:07:19 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B80EE1F7CF; Fri, 28 Jun 2019 01:07:19 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S17J00087951; Fri, 28 Jun 2019 01:07:19 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S17JgG087950; Fri, 28 Jun 2019 01:07:19 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906280107.x5S17JgG087950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 28 Jun 2019 01:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349492 - stable/11/usr.bin/procstat X-SVN-Group: stable-11 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/11/usr.bin/procstat X-SVN-Commit-Revision: 349492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF43D8246C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:07:20 -0000 Author: mhorne Date: Fri Jun 28 01:07:19 2019 New Revision: 349492 URL: https://svnweb.freebsd.org/changeset/base/349492 Log: MFC r348887: procstat: Recognize HWCAP and HWCAP2 with auxv command Approved by: markj (mentor, implicit) Modified: stable/11/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/procstat/procstat_auxv.c ============================================================================== --- stable/11/usr.bin/procstat/procstat_auxv.c Fri Jun 28 01:03:55 2019 (r349491) +++ stable/11/usr.bin/procstat/procstat_auxv.c Fri Jun 28 01:07:19 2019 (r349492) @@ -185,6 +185,18 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ prefix, "AT_EHDRFLAGS", (u_long)auxv[i].a_un.a_val); break; #endif +#ifdef AT_HWCAP + case AT_HWCAP: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_HWCAP/%#lx}\n", + prefix, "AT_HWCAP", (u_long)auxv[i].a_un.a_val); + break; +#endif +#ifdef AT_HWCAP2 + case AT_HWCAP2: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_HWCAP2/%#lx}\n", + prefix, "AT_HWCAP2", (u_long)auxv[i].a_un.a_val); + break; +#endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", prefix, auxv[i].a_type, auxv[i].a_un.a_val); From owner-svn-src-all@freebsd.org Fri Jun 28 01:17:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7C1115D436F; Fri, 28 Jun 2019 01:17:34 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5576F829D6; Fri, 28 Jun 2019 01:17:34 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37F3A1F988; Fri, 28 Jun 2019 01:17:34 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S1HXhP093268; Fri, 28 Jun 2019 01:17:33 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S1HXfK093267; Fri, 28 Jun 2019 01:17:33 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906280117.x5S1HXfK093267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 28 Jun 2019 01:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349493 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 349493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5576F829D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:17:34 -0000 Author: bcran Date: Fri Jun 28 01:17:33 2019 New Revision: 349493 URL: https://svnweb.freebsd.org/changeset/base/349493 Log: Add missing ACPI GICv2 MSI/MSI-X attachment This lets PCIe MSI-X device interrupts work on the MACCHIATObin (Marvell Armada 8k), which allows e.g. the Intel igb NIC to fully work. Submitted by: Greg V Reviewed by: mw, bcran Differential Revision: https://reviews.freebsd.org/D20775 Modified: head/sys/arm/arm/gic_acpi.c Modified: head/sys/arm/arm/gic_acpi.c ============================================================================== --- head/sys/arm/arm/gic_acpi.c Fri Jun 28 01:07:19 2019 (r349492) +++ head/sys/arm/arm/gic_acpi.c Fri Jun 28 01:17:33 2019 (r349493) @@ -331,9 +331,21 @@ arm_gicv2m_acpi_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static int +arm_gicv2m_acpi_attach(device_t dev) +{ + struct arm_gicv2m_softc *sc; + + sc = device_get_softc(dev); + sc->sc_xref = ACPI_MSI_XREF; + + return (arm_gicv2m_attach(dev)); +} + static device_method_t arm_gicv2m_acpi_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arm_gicv2m_acpi_probe), + DEVMETHOD(device_attach, arm_gicv2m_acpi_attach), /* End */ DEVMETHOD_END From owner-svn-src-all@freebsd.org Fri Jun 28 01:19:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D229915D43FE; Fri, 28 Jun 2019 01:19:09 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD6682B53; Fri, 28 Jun 2019 01:19:09 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 397D71F998; Fri, 28 Jun 2019 01:19:09 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S1J9T5093377; Fri, 28 Jun 2019 01:19:09 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S1J9xb093376; Fri, 28 Jun 2019 01:19:09 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906280119.x5S1J9xb093376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 28 Jun 2019 01:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349494 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 349494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FD6682B53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:19:10 -0000 Author: bcran Date: Fri Jun 28 01:19:08 2019 New Revision: 349494 URL: https://svnweb.freebsd.org/changeset/base/349494 Log: Add ACPI entries for Synopsys Designware UARTs used on ARM platforms This fixes (userspace) console on the Marvell MACCHIATObin in ACPI mode with latest TianoCore EDK2 firmware. Submitted by: Greg V Reviewed by: mw, bcran Differential Revision: https://reviews.freebsd.org/D20765 Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Fri Jun 28 01:17:33 2019 (r349493) +++ head/sys/dev/uart/uart_dev_ns8250.c Fri Jun 28 01:19:08 2019 (r349494) @@ -415,6 +415,9 @@ struct uart_class uart_ns8250_class = { static struct acpi_uart_compat_data acpi_compat_data[] = { {"AMD0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, {"AMDI0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"MRVL0001", &uart_ns8250_class, 0, 2, 0, 200000000, UART_F_BUSY_DETECT, "Marvell / Synopsys Designware UART"}, + {"SCX0006", &uart_ns8250_class, 0, 2, 0, 62500000, UART_F_BUSY_DETECT, "SynQuacer / Synopsys Designware UART"}, + {"HISI0031", &uart_ns8250_class, 0, 2, 0, 200000000, UART_F_BUSY_DETECT, "HiSilicon / Synopsys Designware UART"}, {"PNP0500", &uart_ns8250_class, 0, 0, 0, 0, 0, "Standard PC COM port"}, {"PNP0501", &uart_ns8250_class, 0, 0, 0, 0, 0, "16550A-compatible COM port"}, {"PNP0502", &uart_ns8250_class, 0, 0, 0, 0, 0, "Multiport serial device (non-intelligent 16550)"}, From owner-svn-src-all@freebsd.org Fri Jun 28 01:53:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 920A615D4E8E; Fri, 28 Jun 2019 01:53:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC4083ADB; Fri, 28 Jun 2019 01:53:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ABF52003A; Fri, 28 Jun 2019 01:53:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S1rYCh013967; Fri, 28 Jun 2019 01:53:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S1rYuq013965; Fri, 28 Jun 2019 01:53:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906280153.x5S1rYuq013965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 28 Jun 2019 01:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349495 - vendor/bzip2 X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/bzip2 X-SVN-Commit-Revision: 349495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EC4083ADB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:53:35 -0000 Author: delphij Date: Fri Jun 28 01:53:34 2019 New Revision: 349495 URL: https://svnweb.freebsd.org/changeset/base/349495 Log: Update upgrade instructions. PR: 238843 Modified: vendor/bzip2/FREEBSD-Xlist vendor/bzip2/FREEBSD-upgrade Modified: vendor/bzip2/FREEBSD-Xlist ============================================================================== --- vendor/bzip2/FREEBSD-Xlist Fri Jun 28 01:19:08 2019 (r349494) +++ vendor/bzip2/FREEBSD-Xlist Fri Jun 28 01:53:34 2019 (r349495) @@ -22,3 +22,5 @@ *manual.xml *mk251.c *xmlproc.sh +prepare-release.sh +release-update.sh Modified: vendor/bzip2/FREEBSD-upgrade ============================================================================== --- vendor/bzip2/FREEBSD-upgrade Fri Jun 28 01:19:08 2019 (r349494) +++ vendor/bzip2/FREEBSD-upgrade Fri Jun 28 01:53:34 2019 (r349495) @@ -1,16 +1,13 @@ $FreeBSD$ Julian Seward's bzip2 - originals can be found at: http://www.bzip.org/downloads.html + originals can be found at: https://www.sourceware.org/bzip2/downloads.html -Imported by: - svn import -m "Virgin import (trimmed) of Bzip2 version 1.0.6." - Notes: The following log shows details of trimming: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - tar xvfz bzip2-1.0.6.tar.gz -X FREEBSD-Xlist - cd bzip2-1.0.6 + tar xvfz bzip2-1.0.7.tar.gz -X FREEBSD-Xlist + cd bzip2-1.0.7 uuencode sample1.bz2 sample1.bz2 > sample1.bz2.uu uuencode sample2.bz2 sample2.bz2 > sample2.bz2.uu uuencode sample3.bz2 sample3.bz2 > sample3.bz2.uu @@ -23,4 +20,4 @@ Notes: sed -i '' -e 's/begin [0-7][0-7][0-7] /begin 644 /g' *.uu obrien@FreeBSD.org -1 Oct 2010 +27 Jun 2019 From owner-svn-src-all@freebsd.org Fri Jun 28 01:54:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 569B315D4ED1; Fri, 28 Jun 2019 01:54:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F402D83BF4; Fri, 28 Jun 2019 01:54:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C75FB2003C; Fri, 28 Jun 2019 01:54:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S1sB34014074; Fri, 28 Jun 2019 01:54:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S1s75G014053; Fri, 28 Jun 2019 01:54:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906280154.x5S1s75G014053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 28 Jun 2019 01:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349496 - vendor/bzip2/dist X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/bzip2/dist X-SVN-Commit-Revision: 349496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F402D83BF4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:54:12 -0000 Author: delphij Date: Fri Jun 28 01:54:07 2019 New Revision: 349496 URL: https://svnweb.freebsd.org/changeset/base/349496 Log: Vendor import bzip2 -- upgrade to version 1.0.7. Modified: vendor/bzip2/dist/CHANGES vendor/bzip2/dist/LICENSE vendor/bzip2/dist/Makefile vendor/bzip2/dist/Makefile-libbz2_so vendor/bzip2/dist/README vendor/bzip2/dist/README.COMPILATION.PROBLEMS vendor/bzip2/dist/blocksort.c vendor/bzip2/dist/bzip2.1 vendor/bzip2/dist/bzip2.c vendor/bzip2/dist/bzip2recover.c vendor/bzip2/dist/bzlib.c vendor/bzip2/dist/bzlib.h vendor/bzip2/dist/bzlib_private.h vendor/bzip2/dist/compress.c vendor/bzip2/dist/crctable.c vendor/bzip2/dist/decompress.c vendor/bzip2/dist/huffman.c vendor/bzip2/dist/randtable.c vendor/bzip2/dist/spewG.c vendor/bzip2/dist/unzcrash.c vendor/bzip2/dist/words2 Modified: vendor/bzip2/dist/CHANGES ============================================================================== --- vendor/bzip2/dist/CHANGES Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/CHANGES Fri Jun 28 01:54:07 2019 (r349496) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies Izdebski. * Make the documentation build on Ubuntu 10.04 + +1.0.7 (27 Jun 19) +~~~~~~~~~~~~~~~~~ + +* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH + +* bzip2: Fix return value when combining --test,-t and -q. + +* bzip2recover: Fix buffer overflow for large argv[0] + +* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189) + +* Make sure nSelectors is not out of range (CVE-2019-12900) Modified: vendor/bzip2/dist/LICENSE ============================================================================== --- vendor/bzip2/dist/LICENSE Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/LICENSE Fri Jun 28 01:54:07 2019 (r349496) @@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Julian Seward, jseward@acm.org +bzip2/libbzip2 version 1.0.7 of 27 June 2019 -------------------------------------------------------------------------- Modified: vendor/bzip2/dist/Makefile ============================================================================== --- vendor/bzip2/dist/Makefile Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/Makefile Fri Jun 28 01:54:07 2019 (r349496) @@ -3,7 +3,7 @@ # lossless, block-sorting data compression. # # bzip2/libbzip2 version 1.0.6 of 6 September 2010 -# Copyright (C) 1996-2010 Julian Seward +# Copyright (C) 1996-2010 Julian Seward # # Please read the WARNING, DISCLAIMER and PATENTS sections in the # README file. @@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c distclean: clean rm -f manual.ps manual.html manual.pdf -DISTNAME=bzip2-1.0.6 +DISTNAME=bzip2-1.0.7 dist: check manual rm -f $(DISTNAME) ln -s -f . $(DISTNAME) Modified: vendor/bzip2/dist/Makefile-libbz2_so ============================================================================== --- vendor/bzip2/dist/Makefile-libbz2_so Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/Makefile-libbz2_so Fri Jun 28 01:54:07 2019 (r349496) @@ -1,6 +1,6 @@ # This Makefile builds a shared version of the library, -# libbz2.so.1.0.6, with soname libbz2.so.1.0, +# libbz2.so.1.0.7, with soname libbz2.so.1.0, # at least on x86-Linux (RedHat 7.2), # with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98). # Please see the README file for some important info @@ -11,7 +11,7 @@ # lossless, block-sorting data compression. # # bzip2/libbzip2 version 1.0.6 of 6 September 2010 -# Copyright (C) 1996-2010 Julian Seward +# Copyright (C) 1996-2010 Julian Seward # # Please read the WARNING, DISCLAIMER and PATENTS sections in the # README file. @@ -35,13 +35,13 @@ OBJS= blocksort.o \ bzlib.o all: $(OBJS) - $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS) - $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 + $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.7 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.7 rm -f libbz2.so.1.0 - ln -s libbz2.so.1.0.6 libbz2.so.1.0 + ln -s libbz2.so.1.0.7 libbz2.so.1.0 clean: - rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared + rm -f $(OBJS) bzip2.o libbz2.so.1.0.7 libbz2.so.1.0 bzip2-shared blocksort.o: blocksort.c $(CC) $(CFLAGS) -c blocksort.c Modified: vendor/bzip2/dist/README ============================================================================== --- vendor/bzip2/dist/README Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/README Fri Jun 28 01:54:07 2019 (r349496) @@ -6,8 +6,8 @@ This version is fully compatible with the previous pub This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in this file. @@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. It's difficult for me to support compilation on all these platforms. My approach is to collect binaries for these platforms, and put them -on the master web site (http://www.bzip.org). Look there. However +on the master web site (https://sourceware.org/bzip2/). Look there. However (FWIW), bzip2-1.0.X is very standard ANSI C and should compile unmodified with MS Visual C. If you have difficulties building, you might want to read README.COMPILATION.PROBLEMS. @@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ? * Many small improvements in file and flag handling. * A Y2K statement. -WHAT'S NEW IN 1.0.0 ? +WHAT'S NEW IN 1.0.x ? See the CHANGES file. -WHAT'S NEW IN 1.0.2 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.3 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.4 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.5 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.6 ? - - See the CHANGES file. - - I hope you find bzip2 useful. Feel free to contact me at - jseward@bzip.org + jseward@acm.org if you have any suggestions or queries. Many people mailed me with comments, suggestions and patches after the releases of bzip-0.15, bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this feedback. I thank you for your comments. -bzip2's "home" is http://www.bzip.org/ +bzip2's "home" is https://sourceware.org/bzip2/ Julian Seward -jseward@bzip.org +jseward@acm.org Cambridge, UK. 18 July 1996 (version 0.15) @@ -213,3 +192,4 @@ Cambridge, UK. 20 December 2006 (bzip2, version 1.0.4) 10 December 2007 (bzip2, version 1.0.5) 6 Sept 2010 (bzip2, version 1.0.6) +27 June 2019 (bzip2, version 1.0.7) Modified: vendor/bzip2/dist/README.COMPILATION.PROBLEMS ============================================================================== --- vendor/bzip2/dist/README.COMPILATION.PROBLEMS Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/README.COMPILATION.PROBLEMS Fri Jun 28 01:54:07 2019 (r349496) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -12,7 +12,7 @@ This program is released under the terms of the licens in the file LICENSE. ------------------------------------------------------------------ -bzip2-1.0.6 should compile without problems on the vast majority of +bzip2 should compile without problems on the vast majority of platforms. Using the supplied Makefile, I've built and tested it myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ 6.0 and nmake, you can build a native Win32 version too. Large file Modified: vendor/bzip2/dist/blocksort.c ============================================================================== --- vendor/bzip2/dist/blocksort.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/blocksort.c Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap, bhtab [ 0 .. 2+(nblock/32) ] destroyed */ -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) +#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31)) +#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31)) +#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31))) #define WORD_BH(zz) bhtab[(zz) >> 5] #define UNALIGNED_BH(zz) ((zz) & 0x01f) Modified: vendor/bzip2/dist/bzip2.1 ============================================================================== --- vendor/bzip2/dist/bzip2.1 Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/bzip2.1 Fri Jun 28 01:54:07 2019 (r349496) @@ -1,7 +1,7 @@ .PU .TH bzip2 1 .SH NAME -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7 .br bzcat \- decompresses files to stdout .br @@ -405,7 +405,7 @@ I/O error messages are not as helpful as they could be tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. -This manual page pertains to version 1.0.6 of +This manual page pertains to version 1.0.7 of .I bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions @@ -427,9 +427,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer. .SH AUTHOR -Julian Seward, jsewardbzip.org. +Julian Seward, jseward@acm.org. -http://www.bzip.org +https://sourceware.org/bzip2/ The ideas embodied in .I bzip2 Modified: vendor/bzip2/dist/bzip2.c ============================================================================== --- vendor/bzip2/dist/bzip2.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/bzip2.c Fri Jun 28 01:54:07 2019 (r349496) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -554,7 +554,7 @@ static Bool testStream ( FILE *zStream ) { BZFILE* bzf = NULL; - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; + Int32 bzerr, bzerr_dummy, ret, streamNo, i; UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; @@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream ) streamNo++; while (bzerr == BZ_OK) { - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); + BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; } if (bzerr != BZ_STREAM_END) goto errhandler; @@ -749,7 +749,7 @@ void panic ( const Char* s ) "\n%s: PANIC -- internal consistency error:\n" "\t%s\n" "\tThis is a BUG. Please report it to me at:\n" - "\tjseward@bzip.org\n", + "\tjseward@acm.org\n", progName, s ); showFileNames(); cleanUpAndFail( 3 ); @@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (1) and (2).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (1)\n" - " or (2), feel free to report it to me at: jseward@bzip.org.\n" + " or (2), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (2) and (3).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (2)\n" - " or (3), feel free to report it to me at: jseward@bzip.org.\n" + " or (3), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -1609,7 +1609,7 @@ void license ( void ) " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.6 source distribution.\n" + " in the bzip2 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -2003,12 +2003,14 @@ IntNative main ( IntNative argc, Char *argv[] ) testf ( aa->name ); } } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); + if (testFailsExist) { + if (noisy) { + fprintf ( stderr, + "\n" + "You can use the `bzip2recover' program to attempt to recover\n" + "data from undamaged sections of corrupted files.\n\n" + ); + } setExit(2); exit(exitValue); } Modified: vendor/bzip2/dist/bzip2recover.c ============================================================================== --- vendor/bzip2/dist/bzip2recover.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/bzip2recover.c Fri Jun 28 01:54:07 2019 (r349496) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv ) UInt32 buffHi, buffLo, blockCRC; Char* p; - strcpy ( progName, argv[0] ); + strncpy ( progName, argv[0], BZ_MAX_FILENAME-1); + progName[BZ_MAX_FILENAME-1]='\0'; inFileName[0] = outFileName[0] = 0; fprintf ( stderr, - "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); + "bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" ); if (argc != 2) { fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", @@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv ) bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); bsPutUInt32 ( bsWr, blockCRC ); bsClose ( bsWr ); + outFile = NULL; } if (wrBlock >= rbCtr) break; wrBlock++; Modified: vendor/bzip2/dist/bzlib.c ============================================================================== --- vendor/bzip2/dist/bzlib.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/bzlib.c Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -43,7 +43,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" "This is a bug in bzip2/libbzip2, %s.\n" - "Please report it to me at: jseward@bzip.org. If this happened\n" + "Please report it to me at: jseward@acm.org. If this happened\n" "when you were using some program which uses libbzip2 as a\n" "component, you should also report this bug to the author(s)\n" "of that program. Please make an effort to report this bug;\n" Modified: vendor/bzip2/dist/bzlib.h ============================================================================== --- vendor/bzip2/dist/bzlib.h Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/bzlib.h Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: vendor/bzip2/dist/bzlib_private.h ============================================================================== --- vendor/bzip2/dist/bzlib_private.h Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/bzlib_private.h Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -36,7 +36,7 @@ /*-- General stuff. --*/ -#define BZ_VERSION "1.0.6, 6-Sept-2010" +#define BZ_VERSION "1.0.7, 27-Jun-2019" typedef char Char; typedef unsigned char Bool; Modified: vendor/bzip2/dist/compress.c ============================================================================== --- vendor/bzip2/dist/compress.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/compress.c Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: vendor/bzip2/dist/crctable.c ============================================================================== --- vendor/bzip2/dist/crctable.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/crctable.c Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: vendor/bzip2/dist/decompress.c ============================================================================== --- vendor/bzip2/dist/decompress.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/decompress.c Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s ) /*--- Now the selectors ---*/ GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); - if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); + if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1) RETURN(BZ_DATA_ERROR); + if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); for (i = 0; i < nSelectors; i++) { j = 0; while (True) { Modified: vendor/bzip2/dist/huffman.c ============================================================================== --- vendor/bzip2/dist/huffman.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/huffman.c Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: vendor/bzip2/dist/randtable.c ============================================================================== --- vendor/bzip2/dist/randtable.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/randtable.c Fri Jun 28 01:54:07 2019 (r349496) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: vendor/bzip2/dist/spewG.c ============================================================================== --- vendor/bzip2/dist/spewG.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/spewG.c Fri Jun 28 01:54:07 2019 (r349496) @@ -13,8 +13,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: vendor/bzip2/dist/unzcrash.c ============================================================================== --- vendor/bzip2/dist/unzcrash.c Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/unzcrash.c Fri Jun 28 01:54:07 2019 (r349496) @@ -17,8 +17,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: vendor/bzip2/dist/words2 ============================================================================== --- vendor/bzip2/dist/words2 Fri Jun 28 01:53:34 2019 (r349495) +++ vendor/bzip2/dist/words2 Fri Jun 28 01:54:07 2019 (r349496) @@ -1,5 +1,5 @@ Checking test results. If any of the four "cmp"s which follow report any differences, something is wrong. If you can't easily -figure out what, please let me know (jseward@bzip.org). +figure out what, please let me know (jseward@acm.org). From owner-svn-src-all@freebsd.org Fri Jun 28 01:58:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5D6A15D4F77; Fri, 28 Jun 2019 01:58:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51FBF83D76; Fri, 28 Jun 2019 01:58:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ECDD2003D; Fri, 28 Jun 2019 01:58:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S1vxKr014288; Fri, 28 Jun 2019 01:57:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S1vxdp014287; Fri, 28 Jun 2019 01:57:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906280157.x5S1vxdp014287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 28 Jun 2019 01:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349497 - vendor/bzip2/1.0.7 X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/bzip2/1.0.7 X-SVN-Commit-Revision: 349497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51FBF83D76 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 01:58:00 -0000 Author: delphij Date: Fri Jun 28 01:57:59 2019 New Revision: 349497 URL: https://svnweb.freebsd.org/changeset/base/349497 Log: "Tag" the Bzip2 1.0.7 vendor import. Added: vendor/bzip2/1.0.7/ - copied from r349496, vendor/bzip2/dist/ From owner-svn-src-all@freebsd.org Fri Jun 28 02:14:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C55C15D53E3; Fri, 28 Jun 2019 02:14:55 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01AC08458A; Fri, 28 Jun 2019 02:14:55 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8B9D20397; Fri, 28 Jun 2019 02:14:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S2EsnM024676; Fri, 28 Jun 2019 02:14:54 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S2EsME024675; Fri, 28 Jun 2019 02:14:54 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906280214.x5S2EsME024675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 28 Jun 2019 02:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349498 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01AC08458A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 02:14:55 -0000 Author: dougm Date: Fri Jun 28 02:14:54 2019 New Revision: 349498 URL: https://svnweb.freebsd.org/changeset/base/349498 Log: If vm_map_protect fails with KERN_RESOURCE_SHORTAGE, be sure to simplify modified entries before returning. Reviewed by: alc, markj (earlier version), kib (earlier version) Approved by: kib, markj (mentors, implicit) Differential Revision: https://reviews.freebsd.org/D20753 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jun 28 01:57:59 2019 (r349497) +++ head/sys/vm/vm_map.c Fri Jun 28 02:14:54 2019 (r349498) @@ -2454,6 +2454,7 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off vm_object_t obj; struct ucred *cred; vm_prot_t old_prot; + int rv; if (start == end) return (KERN_SUCCESS); @@ -2508,10 +2509,13 @@ again: } /* - * Do an accounting pass for private read-only mappings that - * now will do cow due to allowed write (e.g. debugger sets - * breakpoint on text segment) + * Before changing the protections, try to reserve swap space for any + * private (i.e., copy-on-write) mappings that are transitioning from + * read-only to read/write access. If a reservation fails, break out + * of this loop early and let the next loop simplify the entries, since + * some may now be mergeable. */ + rv = KERN_SUCCESS; vm_map_clip_start(map, entry, start); for (current = entry; current->start < end; current = current->next) { @@ -2529,8 +2533,9 @@ again: if (obj == NULL || (current->eflags & MAP_ENTRY_NEEDS_COPY)) { if (!swap_reserve(current->end - current->start)) { - vm_map_unlock(map); - return (KERN_RESOURCE_SHORTAGE); + rv = KERN_RESOURCE_SHORTAGE; + end = current->end; + break; } crhold(cred); current->cred = cred; @@ -2553,8 +2558,9 @@ again: obj, current)); if (!swap_reserve(ptoa(obj->size))) { VM_OBJECT_WUNLOCK(obj); - vm_map_unlock(map); - return (KERN_RESOURCE_SHORTAGE); + rv = KERN_RESOURCE_SHORTAGE; + end = current->end; + break; } crhold(cred); @@ -2564,11 +2570,14 @@ again: } /* - * Go back and fix up protections. [Note that clipping is not - * necessary the second time.] + * If enough swap space was available, go back and fix up protections. + * Otherwise, just simplify entries, since some may have been modified. + * [Note that clipping is not necessary the second time.] */ - for (current = entry; current->start < end; current = current->next) { - if ((current->eflags & MAP_ENTRY_GUARD) != 0) + for (current = entry; current->start < end; + vm_map_simplify_entry(map, current), current = current->next) { + if (rv != KERN_SUCCESS || + (current->eflags & MAP_ENTRY_GUARD) != 0) continue; old_prot = current->protection; @@ -2603,10 +2612,9 @@ again: current->protection & MASK(current)); #undef MASK } - vm_map_simplify_entry(map, current); } vm_map_unlock(map); - return (KERN_SUCCESS); + return (rv); } /* From owner-svn-src-all@freebsd.org Fri Jun 28 02:21:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CFDF15D5633; Fri, 28 Jun 2019 02:21:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8F5E84ABB; Fri, 28 Jun 2019 02:21:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 759F1204FF; Fri, 28 Jun 2019 02:21:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S2LhE8029234; Fri, 28 Jun 2019 02:21:43 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S2LhGN029232; Fri, 28 Jun 2019 02:21:43 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906280221.x5S2LhGN029232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 28 Jun 2019 02:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349499 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 349499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8F5E84ABB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 02:21:50 -0000 Author: np Date: Fri Jun 28 02:21:42 2019 New Revision: 349499 URL: https://svnweb.freebsd.org/changeset/base/349499 Log: cxgbe/iw_cxgbe: Remove unused field from the endpoint structure. MFC after: 3 days Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Jun 28 02:14:54 2019 (r349498) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Jun 28 02:21:42 2019 (r349499) @@ -528,7 +528,6 @@ set_tcpinfo(struct c4iw_ep *ep) ep->hwtid = toep->tid; ep->snd_seq = tp->snd_nxt; ep->rcv_seq = tp->rcv_nxt; - ep->emss = max(tp->t_maxseg, 128); done: INP_WUNLOCK(inp); return (rc); Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Jun 28 02:14:54 2019 (r349498) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Jun 28 02:21:42 2019 (r349499) @@ -862,7 +862,6 @@ struct c4iw_ep { u32 tx_chan; u32 mtu; u16 mss; - u16 emss; u16 plen; u16 rss_qid; u16 txq_idx; From owner-svn-src-all@freebsd.org Fri Jun 28 02:41:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 394DC15D5C83; Fri, 28 Jun 2019 02:41:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D39F0855B6; Fri, 28 Jun 2019 02:41:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFF1D2071A; Fri, 28 Jun 2019 02:41:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S2fIlO038970; Fri, 28 Jun 2019 02:41:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S2fIt3038967; Fri, 28 Jun 2019 02:41:18 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906280241.x5S2fIt3038967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 28 Jun 2019 02:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349500 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 349500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D39F0855B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 02:41:19 -0000 Author: np Date: Fri Jun 28 02:41:17 2019 New Revision: 349500 URL: https://svnweb.freebsd.org/changeset/base/349500 Log: cxgbe/t4_tom: Fix regression in t_maxseg usage within t4_tom. t_maxseg was changed in r293284 to not have any adjustment for TCP timestamps. t4_tom inadvertently went back to pre-r293284 semantics in r332506. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jun 28 02:21:42 2019 (r349499) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jun 28 02:41:17 2019 (r349500) @@ -327,31 +327,33 @@ send_reset(struct adapter *sc, struct toepcb *toep, ui * reported by HW to FreeBSD's native format. */ static void -assign_rxopt(struct tcpcb *tp, unsigned int opt) +assign_rxopt(struct tcpcb *tp, uint16_t opt) { struct toepcb *toep = tp->t_toe; struct inpcb *inp = tp->t_inpcb; struct adapter *sc = td_adapter(toep->td); - int n; INP_LOCK_ASSERT(inp); + toep->tcp_opt = opt; + toep->mtu_idx = G_TCPOPT_MSS(opt); + tp->t_maxseg = sc->params.mtus[toep->mtu_idx]; if (inp->inp_inc.inc_flags & INC_ISIPV6) - n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + tp->t_maxseg -= sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else - n = sizeof(struct ip) + sizeof(struct tcphdr); - tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(opt)] - n; + tp->t_maxseg -= sizeof(struct ip) + sizeof(struct tcphdr); + toep->emss = tp->t_maxseg; if (G_TCPOPT_TSTAMP(opt)) { tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ tp->ts_recent = 0; /* hmmm */ tp->ts_recent_age = tcp_ts_getticks(); - tp->t_maxseg -= TCPOLEN_TSTAMP_APPA; + toep->emss -= TCPOLEN_TSTAMP_APPA; } - CTR5(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), mss %u", __func__, - toep->tid, G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)], - tp->t_maxseg); + CTR6(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), t_maxseg %u, emss %u", + __func__, toep->tid, toep->mtu_idx, + sc->params.mtus[G_TCPOPT_MSS(opt)], tp->t_maxseg, toep->emss); if (G_TCPOPT_SACK(opt)) tp->t_flags |= TF_SACK_PERMIT; /* should already be set */ @@ -399,7 +401,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->irs = irs; tcp_rcvseqinit(tp); - tp->rcv_wnd = toep->opt0_rcv_bufsize << 10; + tp->rcv_wnd = (u_int)toep->opt0_rcv_bufsize << 10; tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; @@ -421,7 +423,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui ftxp.snd_nxt = tp->snd_nxt; ftxp.rcv_nxt = tp->rcv_nxt; ftxp.snd_space = bufsize; - ftxp.mss = tp->t_maxseg; + ftxp.mss = toep->emss; send_flowc_wr(toep, &ftxp); soisconnected(so); @@ -613,7 +615,7 @@ write_tx_wr(void *dst, struct toepcb *toep, unsigned i if (txalign > 0) { struct tcpcb *tp = intotcpcb(toep->inp); - if (plen < 2 * tp->t_maxseg) + if (plen < 2 * toep->emss) txwr->lsodisable_to_flags |= htobe32(F_FW_OFLD_TX_DATA_WR_LSODISABLE); else Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Fri Jun 28 02:21:42 2019 (r349499) +++ head/sys/dev/cxgbe/tom/t4_tom.c Fri Jun 28 02:41:17 2019 (r349500) @@ -851,8 +851,7 @@ remove_tid(struct adapter *sc, int tid, int ntids) * What mtu_idx to use, given a 4-tuple. Note that both s->mss and tcp_mssopt * have the MSS that we should advertise in our SYN. Advertised MSS doesn't * account for any TCP options so the effective MSS (only payload, no headers or - * options) could be different. We fill up tp->t_maxseg with the effective MSS - * at the end of the 3-way handshake. + * options) could be different. */ int find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri Jun 28 02:21:42 2019 (r349499) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Jun 28 02:41:17 2019 (r349500) @@ -181,7 +181,10 @@ struct toepcb { u_int tx_nocompl; /* tx WR credits since last compl request */ u_int plen_nocompl; /* payload since last compl request */ - int opt0_rcv_bufsize; /* XXX: save full opt0/opt2 for later? */ + uint16_t opt0_rcv_bufsize; /* XXX: save full opt0/opt2 for later? */ + uint16_t mtu_idx; + uint16_t emss; + uint16_t tcp_opt; u_int ulp_mode; /* ULP mode */ void *ulpcb; From owner-svn-src-all@freebsd.org Fri Jun 28 04:02:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02DFE15D721F; Fri, 28 Jun 2019 04:02:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9934F87C0C; Fri, 28 Jun 2019 04:02:57 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 463462168C; Fri, 28 Jun 2019 04:02:57 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S42vZP083701; Fri, 28 Jun 2019 04:02:57 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S42vnm083699; Fri, 28 Jun 2019 04:02:57 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906280402.x5S42vnm083699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 28 Jun 2019 04:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349501 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 349501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9934F87C0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.921,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 04:02:58 -0000 Author: np Date: Fri Jun 28 04:02:56 2019 New Revision: 349501 URL: https://svnweb.freebsd.org/changeset/base/349501 Log: cxgbe/t4_tom: Mark the socket's receive as done before calling handle_ddp_close. This eliminates a bad race where an aio_ddp_requeue that happened to run after handle_ddp_close could bump up the active count. Discussed with: jhb@ MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jun 28 02:41:17 2019 (r349500) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jun 28 04:02:56 2019 (r349501) @@ -1253,6 +1253,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head tp->rcv_nxt++; /* FIN */ so = inp->inp_socket; + socantrcvmore(so); if (toep->ulp_mode == ULP_MODE_TCPDDP) { DDP_LOCK(toep); if (__predict_false(toep->ddp.flags & @@ -1260,7 +1261,6 @@ do_peer_close(struct sge_iq *iq, const struct rss_head handle_ddp_close(toep, tp, cpl->rcv_nxt); DDP_UNLOCK(toep); } - socantrcvmore(so); if (toep->ulp_mode != ULP_MODE_RDMA) { KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt), From owner-svn-src-all@freebsd.org Fri Jun 28 04:28:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA0A915D7922; Fri, 28 Jun 2019 04:28:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 897F788853; Fri, 28 Jun 2019 04:28:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A79F219DE; Fri, 28 Jun 2019 04:28:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S4SXSM094526; Fri, 28 Jun 2019 04:28:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S4SXhf094525; Fri, 28 Jun 2019 04:28:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906280428.x5S4SXhf094525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 28 Jun 2019 04:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349503 - head/contrib/ipfilter/man X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/man X-SVN-Commit-Revision: 349503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 897F788853 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 04:28:34 -0000 Author: cy Date: Fri Jun 28 04:28:32 2019 New Revision: 349503 URL: https://svnweb.freebsd.org/changeset/base/349503 Log: Document the -B, binary logfile, and the -C config file options. Reference the ipmon.5 man page and ipmon.conf. PR: 238816 MFC after: 1 week Modified: head/contrib/ipfilter/man/ipmon.8 Modified: head/contrib/ipfilter/man/ipmon.8 ============================================================================== --- head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:18:10 2019 (r349502) +++ head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:28:32 2019 (r349503) @@ -7,6 +7,10 @@ ipmon \- monitors /dev/ipl for logged packets [ .B \-abBDFhnpstvxX ] [ +.B "\-B " +] [ +.B "\-B " +] [ .B "\-N " ] [ .B "\-L " @@ -92,6 +96,10 @@ Enable logging of the raw, unformatted binary data to \fI\fP file. This can be read, later, using \fBipmon\fP with the \fB-f\fP option. .TP +.B \-C +This option specifies a file to be used to specify optional extra actions +when it sees specific log entries from the kernel. +.TP .B \-D Cause ipmon to turn itself into a daemon. Using subshells or backgrounding of ipmon is not required to turn it into an orphan so it can run indefinitely. @@ -178,9 +186,11 @@ recorded data. .br /dev/ipstate .br +/etc/ipmon.conf +.br /etc/services .SH SEE ALSO -ipl(4), ipf(8), ipfstat(8), ipnat(8) +ipl(4), ipmon(5), ipf(8), ipfstat(8), ipnat(8) .SH BUGS .PP If you find any, please send email to me at darrenr@pobox.com From owner-svn-src-all@freebsd.org Fri Jun 28 04:52:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335C215D7E52; Fri, 28 Jun 2019 04:52:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C51D58928A; Fri, 28 Jun 2019 04:52:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 828AA21EE3; Fri, 28 Jun 2019 04:52:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S4qOfA007687; Fri, 28 Jun 2019 04:52:24 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S4qOpn007686; Fri, 28 Jun 2019 04:52:24 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906280452.x5S4qOpn007686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 28 Jun 2019 04:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349504 - head/contrib/ipfilter/man X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/man X-SVN-Commit-Revision: 349504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C51D58928A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 04:52:25 -0000 Author: cy Date: Fri Jun 28 04:52:24 2019 New Revision: 349504 URL: https://svnweb.freebsd.org/changeset/base/349504 Log: Fix a typo. PR: 238816 MFC after: 1 week X-MFC with: r349503 Modified: head/contrib/ipfilter/man/ipmon.8 Modified: head/contrib/ipfilter/man/ipmon.8 ============================================================================== --- head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:28:32 2019 (r349503) +++ head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:52:24 2019 (r349504) @@ -9,7 +9,7 @@ ipmon \- monitors /dev/ipl for logged packets ] [ .B "\-B " ] [ -.B "\-B " +.B "\-C " ] [ .B "\-N " ] [ From owner-svn-src-all@freebsd.org Fri Jun 28 05:11:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 634FB15D8341; Fri, 28 Jun 2019 05:11:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 101FB89B57; Fri, 28 Jun 2019 05:11:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE9D822105; Fri, 28 Jun 2019 05:11:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5S5B55Q019700; Fri, 28 Jun 2019 05:11:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5S5B25N019677; Fri, 28 Jun 2019 05:11:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906280511.x5S5B25N019677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 28 Jun 2019 05:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349505 - head/contrib/bzip2 X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/contrib/bzip2 X-SVN-Commit-Revision: 349505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 101FB89B57 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 05:11:06 -0000 Author: delphij Date: Fri Jun 28 05:11:02 2019 New Revision: 349505 URL: https://svnweb.freebsd.org/changeset/base/349505 Log: Upgrade to Bzip2 version 1.0.7. MFC after: 3 days Modified: head/contrib/bzip2/CHANGES head/contrib/bzip2/LICENSE head/contrib/bzip2/README head/contrib/bzip2/README.COMPILATION.PROBLEMS head/contrib/bzip2/blocksort.c head/contrib/bzip2/bzip2.1 head/contrib/bzip2/bzip2.c head/contrib/bzip2/bzip2recover.c head/contrib/bzip2/bzlib.c head/contrib/bzip2/bzlib.h head/contrib/bzip2/bzlib_private.h head/contrib/bzip2/compress.c head/contrib/bzip2/crctable.c head/contrib/bzip2/decompress.c head/contrib/bzip2/huffman.c head/contrib/bzip2/randtable.c head/contrib/bzip2/spewG.c head/contrib/bzip2/unzcrash.c head/contrib/bzip2/words2 Directory Properties: head/contrib/bzip2/ (props changed) Modified: head/contrib/bzip2/CHANGES ============================================================================== --- head/contrib/bzip2/CHANGES Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/CHANGES Fri Jun 28 05:11:02 2019 (r349505) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies Izdebski. * Make the documentation build on Ubuntu 10.04 + +1.0.7 (27 Jun 19) +~~~~~~~~~~~~~~~~~ + +* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH + +* bzip2: Fix return value when combining --test,-t and -q. + +* bzip2recover: Fix buffer overflow for large argv[0] + +* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189) + +* Make sure nSelectors is not out of range (CVE-2019-12900) Modified: head/contrib/bzip2/LICENSE ============================================================================== --- head/contrib/bzip2/LICENSE Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/LICENSE Fri Jun 28 05:11:02 2019 (r349505) @@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Julian Seward, jseward@acm.org +bzip2/libbzip2 version 1.0.7 of 27 June 2019 -------------------------------------------------------------------------- Modified: head/contrib/bzip2/README ============================================================================== --- head/contrib/bzip2/README Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/README Fri Jun 28 05:11:02 2019 (r349505) @@ -6,8 +6,8 @@ This version is fully compatible with the previous pub This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in this file. @@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. It's difficult for me to support compilation on all these platforms. My approach is to collect binaries for these platforms, and put them -on the master web site (http://www.bzip.org). Look there. However +on the master web site (https://sourceware.org/bzip2/). Look there. However (FWIW), bzip2-1.0.X is very standard ANSI C and should compile unmodified with MS Visual C. If you have difficulties building, you might want to read README.COMPILATION.PROBLEMS. @@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ? * Many small improvements in file and flag handling. * A Y2K statement. -WHAT'S NEW IN 1.0.0 ? +WHAT'S NEW IN 1.0.x ? See the CHANGES file. -WHAT'S NEW IN 1.0.2 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.3 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.4 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.5 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.6 ? - - See the CHANGES file. - - I hope you find bzip2 useful. Feel free to contact me at - jseward@bzip.org + jseward@acm.org if you have any suggestions or queries. Many people mailed me with comments, suggestions and patches after the releases of bzip-0.15, bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this feedback. I thank you for your comments. -bzip2's "home" is http://www.bzip.org/ +bzip2's "home" is https://sourceware.org/bzip2/ Julian Seward -jseward@bzip.org +jseward@acm.org Cambridge, UK. 18 July 1996 (version 0.15) @@ -213,3 +192,4 @@ Cambridge, UK. 20 December 2006 (bzip2, version 1.0.4) 10 December 2007 (bzip2, version 1.0.5) 6 Sept 2010 (bzip2, version 1.0.6) +27 June 2019 (bzip2, version 1.0.7) Modified: head/contrib/bzip2/README.COMPILATION.PROBLEMS ============================================================================== --- head/contrib/bzip2/README.COMPILATION.PROBLEMS Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/README.COMPILATION.PROBLEMS Fri Jun 28 05:11:02 2019 (r349505) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -12,7 +12,7 @@ This program is released under the terms of the licens in the file LICENSE. ------------------------------------------------------------------ -bzip2-1.0.6 should compile without problems on the vast majority of +bzip2 should compile without problems on the vast majority of platforms. Using the supplied Makefile, I've built and tested it myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ 6.0 and nmake, you can build a native Win32 version too. Large file Modified: head/contrib/bzip2/blocksort.c ============================================================================== --- head/contrib/bzip2/blocksort.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/blocksort.c Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap, bhtab [ 0 .. 2+(nblock/32) ] destroyed */ -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) +#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31)) +#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31)) +#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31))) #define WORD_BH(zz) bhtab[(zz) >> 5] #define UNALIGNED_BH(zz) ((zz) & 0x01f) Modified: head/contrib/bzip2/bzip2.1 ============================================================================== --- head/contrib/bzip2/bzip2.1 Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/bzip2.1 Fri Jun 28 05:11:02 2019 (r349505) @@ -1,6 +1,6 @@ .TH bzip2 1 .SH NAME -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7 .br bzcat \- decompresses files to stdout .br @@ -404,7 +404,7 @@ I/O error messages are not as helpful as they could be tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. -This manual page pertains to version 1.0.6 of +This manual page pertains to version 1.0.7 of .I bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions @@ -426,9 +426,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer. .SH AUTHOR -Julian Seward, jsewardbzip.org. +Julian Seward, jseward@acm.org. -http://www.bzip.org +https://sourceware.org/bzip2/ The ideas embodied in .I bzip2 Modified: head/contrib/bzip2/bzip2.c ============================================================================== --- head/contrib/bzip2/bzip2.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/bzip2.c Fri Jun 28 05:11:02 2019 (r349505) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -554,7 +554,7 @@ static Bool testStream ( FILE *zStream ) { BZFILE* bzf = NULL; - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; + Int32 bzerr, bzerr_dummy, ret, streamNo, i; UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; @@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream ) streamNo++; while (bzerr == BZ_OK) { - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); + BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; } if (bzerr != BZ_STREAM_END) goto errhandler; @@ -749,7 +749,7 @@ void panic ( const Char* s ) "\n%s: PANIC -- internal consistency error:\n" "\t%s\n" "\tThis is a BUG. Please report it to me at:\n" - "\tjseward@bzip.org\n", + "\tjseward@acm.org\n", progName, s ); showFileNames(); cleanUpAndFail( 3 ); @@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (1) and (2).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (1)\n" - " or (2), feel free to report it to me at: jseward@bzip.org.\n" + " or (2), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (2) and (3).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (2)\n" - " or (3), feel free to report it to me at: jseward@bzip.org.\n" + " or (3), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -1609,7 +1609,7 @@ void license ( void ) " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.6 source distribution.\n" + " in the bzip2 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -2005,12 +2005,14 @@ IntNative main ( IntNative argc, Char *argv[] ) testf ( aa->name ); } } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); + if (testFailsExist) { + if (noisy) { + fprintf ( stderr, + "\n" + "You can use the `bzip2recover' program to attempt to recover\n" + "data from undamaged sections of corrupted files.\n\n" + ); + } setExit(2); exit(exitValue); } Modified: head/contrib/bzip2/bzip2recover.c ============================================================================== --- head/contrib/bzip2/bzip2recover.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/bzip2recover.c Fri Jun 28 05:11:02 2019 (r349505) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv ) UInt32 buffHi, buffLo, blockCRC; Char* p; - strcpy ( progName, argv[0] ); + strncpy ( progName, argv[0], BZ_MAX_FILENAME-1); + progName[BZ_MAX_FILENAME-1]='\0'; inFileName[0] = outFileName[0] = 0; fprintf ( stderr, - "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); + "bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" ); if (argc != 2) { fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", @@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv ) bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); bsPutUInt32 ( bsWr, blockCRC ); bsClose ( bsWr ); + outFile = NULL; } if (wrBlock >= rbCtr) break; wrBlock++; Modified: head/contrib/bzip2/bzlib.c ============================================================================== --- head/contrib/bzip2/bzlib.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/bzlib.c Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -47,7 +47,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" "This is a bug in bzip2/libbzip2, %s.\n" - "Please report it to me at: jseward@bzip.org. If this happened\n" + "Please report it to me at: jseward@acm.org. If this happened\n" "when you were using some program which uses libbzip2 as a\n" "component, you should also report this bug to the author(s)\n" "of that program. Please make an effort to report this bug;\n" Modified: head/contrib/bzip2/bzlib.h ============================================================================== --- head/contrib/bzip2/bzlib.h Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/bzlib.h Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/bzlib_private.h ============================================================================== --- head/contrib/bzip2/bzlib_private.h Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/bzlib_private.h Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -36,7 +36,7 @@ /*-- General stuff. --*/ -#define BZ_VERSION "1.0.6, 6-Sept-2010" +#define BZ_VERSION "1.0.7, 27-Jun-2019" typedef char Char; typedef unsigned char Bool; Modified: head/contrib/bzip2/compress.c ============================================================================== --- head/contrib/bzip2/compress.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/compress.c Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/crctable.c ============================================================================== --- head/contrib/bzip2/crctable.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/crctable.c Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/decompress.c ============================================================================== --- head/contrib/bzip2/decompress.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/decompress.c Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s ) /*--- Now the selectors ---*/ GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); - if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); + if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1) RETURN(BZ_DATA_ERROR); + if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); for (i = 0; i < nSelectors; i++) { j = 0; while (True) { Modified: head/contrib/bzip2/huffman.c ============================================================================== --- head/contrib/bzip2/huffman.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/huffman.c Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/randtable.c ============================================================================== --- head/contrib/bzip2/randtable.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/randtable.c Fri Jun 28 05:11:02 2019 (r349505) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/spewG.c ============================================================================== --- head/contrib/bzip2/spewG.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/spewG.c Fri Jun 28 05:11:02 2019 (r349505) @@ -13,8 +13,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/unzcrash.c ============================================================================== --- head/contrib/bzip2/unzcrash.c Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/unzcrash.c Fri Jun 28 05:11:02 2019 (r349505) @@ -17,8 +17,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/words2 ============================================================================== --- head/contrib/bzip2/words2 Fri Jun 28 04:52:24 2019 (r349504) +++ head/contrib/bzip2/words2 Fri Jun 28 05:11:02 2019 (r349505) @@ -1,5 +1,5 @@ Checking test results. If any of the four "cmp"s which follow report any differences, something is wrong. If you can't easily -figure out what, please let me know (jseward@bzip.org). +figure out what, please let me know (jseward@acm.org). From owner-svn-src-all@freebsd.org Fri Jun 28 05:12:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF78C15D83D5; Fri, 28 Jun 2019 05:12:32 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7086889EC6; Fri, 28 Jun 2019 05:12:32 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf1-x443.google.com with SMTP id x15so2362544pfq.0; Thu, 27 Jun 2019 22:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zuYwX4AI91e7QlyQoVABAbC2aJOdhCi8K8TeifDwgrc=; b=NNlzEfbUQPeTiGBUe3ibGJ2l648k6TmRY2trbzzTQN+ZYtx+Sau7X8EUEaFCIBzpsb 8EA9jZVYPjatRr38LfwBjhvBqt5IJT42ddV+kJgF/hTYRYVk8bZvigrZxa11EEJzzS2H FeNaH1ab24aBHg3Qg0yjdC/rl3vhFZVr9mqwxE1QVLsx5tcUYffOqVW7rWOaXPi0xb2x SrKqkZt5Fb/V2UaJGwYcip9dtvqMA4FHDip6V9Ef0XuXFV0nL0e0bngpII9bVCFoscLr FNCbp10F1K0Cdz2FKYid679S6BYuh8QixqU1MlyVYoi5DZ9/grMQ3TabORcBE5EtWzhA 3nNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:cc:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=zuYwX4AI91e7QlyQoVABAbC2aJOdhCi8K8TeifDwgrc=; b=Qd8us/92bq4VHLoJCaXcEDKwhnvNtiimfTzH7DcQwwbIKiW0wj2RBzz2Z/X4NzANPL Et1oUog3T3sJO9mDZv6tTIwe1uvJwjf9tgpKHTDctdfiKV/RPgqoI24G4lUJpiioTfsn ziD4pHwCj4ptUexqVV5P6x2aLOEN04UYaMWc/YinQc3pdv5dDIpooxo2HKmBQvDhujyV FY9KFK0I1dEF2spYPJ2n6N408LhdSwX79IZMUjG1vmKVqplrk/R0o/6KEWyHmUY269EG ISyZZ5AcJbbXTx53eEFypZsoDAFeltW5eqkB6SwlrXGn41yBMGEjRL0Xa8uoHcb4U6x3 MzCQ== X-Gm-Message-State: APjAAAXav4zq9/LY5CofVZd/P2QwXLZsdVkNS1vZ9KAWgMRFytDGrY+M 1CyipLjI0aqovQjsqOxo0i+LGqV0 X-Google-Smtp-Source: APXvYqw0OQuFKL7Nw8+Rfhi4gzDtlu2subXYmDHof06CjdrhbYNn2tAn8/mM8MV/EGvolYWZuH4wmw== X-Received: by 2002:a65:55ca:: with SMTP id k10mr7530817pgs.14.1561698750960; Thu, 27 Jun 2019 22:12:30 -0700 (PDT) Received: from [192.168.1.103] (180-150-68-130.b49644.syd.nbn.aussiebb.net. [180.150.68.130]) by smtp.gmail.com with ESMTPSA id v184sm860194pfb.82.2019.06.27.22.12.28 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 22:12:30 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r349505 - head/contrib/bzip2 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906280511.x5S5B25N019677@repo.freebsd.org> Cc: Xin LI From: Kubilay Kocak Message-ID: <60eaa49c-cd73-c807-bf4e-57e56f1efb73@FreeBSD.org> Date: Fri, 28 Jun 2019 15:12:26 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <201906280511.x5S5B25N019677@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7086889EC6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 05:12:33 -0000 On 28/06/2019 3:11 pm, Xin LI wrote: > Author: delphij > Date: Fri Jun 28 05:11:02 2019 > New Revision: 349505 > URL: https://svnweb.freebsd.org/changeset/base/349505 > > Log: > Upgrade to Bzip2 version 1.0.7. PR: 238843 > MFC after: 3 days > > Modified: > head/contrib/bzip2/CHANGES > head/contrib/bzip2/LICENSE > head/contrib/bzip2/README > head/contrib/bzip2/README.COMPILATION.PROBLEMS > head/contrib/bzip2/blocksort.c > head/contrib/bzip2/bzip2.1 > head/contrib/bzip2/bzip2.c > head/contrib/bzip2/bzip2recover.c > head/contrib/bzip2/bzlib.c > head/contrib/bzip2/bzlib.h > head/contrib/bzip2/bzlib_private.h > head/contrib/bzip2/compress.c > head/contrib/bzip2/crctable.c > head/contrib/bzip2/decompress.c > head/contrib/bzip2/huffman.c > head/contrib/bzip2/randtable.c > head/contrib/bzip2/spewG.c > head/contrib/bzip2/unzcrash.c > head/contrib/bzip2/words2 > Directory Properties: > head/contrib/bzip2/ (props changed) > > Modified: head/contrib/bzip2/CHANGES > ============================================================================== > --- head/contrib/bzip2/CHANGES Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/CHANGES Fri Jun 28 05:11:02 2019 (r349505) > @@ -2,8 +2,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies > Izdebski. > > * Make the documentation build on Ubuntu 10.04 > + > +1.0.7 (27 Jun 19) > +~~~~~~~~~~~~~~~~~ > + > +* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH > + > +* bzip2: Fix return value when combining --test,-t and -q. > + > +* bzip2recover: Fix buffer overflow for large argv[0] > + > +* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189) > + > +* Make sure nSelectors is not out of range (CVE-2019-12900) > > Modified: head/contrib/bzip2/LICENSE > ============================================================================== > --- head/contrib/bzip2/LICENSE Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/LICENSE Fri Jun 28 05:11:02 2019 (r349505) > @@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD > NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS > SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > -Julian Seward, jseward@bzip.org > -bzip2/libbzip2 version 1.0.6 of 6 September 2010 > +Julian Seward, jseward@acm.org > +bzip2/libbzip2 version 1.0.7 of 27 June 2019 > > -------------------------------------------------------------------------- > > Modified: head/contrib/bzip2/README > ============================================================================== > --- head/contrib/bzip2/README Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/README Fri Jun 28 05:11:02 2019 (r349505) > @@ -6,8 +6,8 @@ This version is fully compatible with the previous pub > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > -bzip2/libbzip2 version 1.0.6 of 6 September 2010 > -Copyright (C) 1996-2010 Julian Seward > +bzip2/libbzip2 version 1.0.7 of 27 June 2019 > +Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in this file. > > @@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. > > It's difficult for me to support compilation on all these platforms. > My approach is to collect binaries for these platforms, and put them > -on the master web site (http://www.bzip.org). Look there. However > +on the master web site (https://sourceware.org/bzip2/). Look there. However > (FWIW), bzip2-1.0.X is very standard ANSI C and should compile > unmodified with MS Visual C. If you have difficulties building, you > might want to read README.COMPILATION.PROBLEMS. > @@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ? > * Many small improvements in file and flag handling. > * A Y2K statement. > > -WHAT'S NEW IN 1.0.0 ? > +WHAT'S NEW IN 1.0.x ? > > See the CHANGES file. > > -WHAT'S NEW IN 1.0.2 ? > - > - See the CHANGES file. > - > -WHAT'S NEW IN 1.0.3 ? > - > - See the CHANGES file. > - > -WHAT'S NEW IN 1.0.4 ? > - > - See the CHANGES file. > - > -WHAT'S NEW IN 1.0.5 ? > - > - See the CHANGES file. > - > -WHAT'S NEW IN 1.0.6 ? > - > - See the CHANGES file. > - > - > I hope you find bzip2 useful. Feel free to contact me at > - jseward@bzip.org > + jseward@acm.org > if you have any suggestions or queries. Many people mailed me with > comments, suggestions and patches after the releases of bzip-0.15, > bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, > 1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this > feedback. I thank you for your comments. > > -bzip2's "home" is http://www.bzip.org/ > +bzip2's "home" is https://sourceware.org/bzip2/ > > Julian Seward > -jseward@bzip.org > +jseward@acm.org > Cambridge, UK. > > 18 July 1996 (version 0.15) > @@ -213,3 +192,4 @@ Cambridge, UK. > 20 December 2006 (bzip2, version 1.0.4) > 10 December 2007 (bzip2, version 1.0.5) > 6 Sept 2010 (bzip2, version 1.0.6) > +27 June 2019 (bzip2, version 1.0.7) > > Modified: head/contrib/bzip2/README.COMPILATION.PROBLEMS > ============================================================================== > --- head/contrib/bzip2/README.COMPILATION.PROBLEMS Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/README.COMPILATION.PROBLEMS Fri Jun 28 05:11:02 2019 (r349505) > @@ -2,8 +2,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > -bzip2/libbzip2 version 1.0.6 of 6 September 2010 > -Copyright (C) 1996-2010 Julian Seward > +bzip2/libbzip2 version 1.0.7 of 27 June 2019 > +Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -12,7 +12,7 @@ This program is released under the terms of the licens > in the file LICENSE. > ------------------------------------------------------------------ > > -bzip2-1.0.6 should compile without problems on the vast majority of > +bzip2 should compile without problems on the vast majority of > platforms. Using the supplied Makefile, I've built and tested it > myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ > 6.0 and nmake, you can build a native Win32 version too. Large file > > Modified: head/contrib/bzip2/blocksort.c > ============================================================================== > --- head/contrib/bzip2/blocksort.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/blocksort.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap, > bhtab [ 0 .. 2+(nblock/32) ] destroyed > */ > > -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) > -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) > -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) > +#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31)) > +#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31)) > +#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31))) > #define WORD_BH(zz) bhtab[(zz) >> 5] > #define UNALIGNED_BH(zz) ((zz) & 0x01f) > > > Modified: head/contrib/bzip2/bzip2.1 > ============================================================================== > --- head/contrib/bzip2/bzip2.1 Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/bzip2.1 Fri Jun 28 05:11:02 2019 (r349505) > @@ -1,6 +1,6 @@ > .TH bzip2 1 > .SH NAME > -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 > +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7 > .br > bzcat \- decompresses files to stdout > .br > @@ -404,7 +404,7 @@ I/O error messages are not as helpful as they could be > tries hard to detect I/O errors and exit cleanly, but the details of > what the problem is sometimes seem rather misleading. > > -This manual page pertains to version 1.0.6 of > +This manual page pertains to version 1.0.7 of > .I bzip2. > Compressed data created by this version is entirely forwards and > backwards compatible with the previous public releases, versions > @@ -426,9 +426,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer. > > > .SH AUTHOR > -Julian Seward, jsewardbzip.org. > +Julian Seward, jseward@acm.org. > > -http://www.bzip.org > +https://sourceware.org/bzip2/ > > The ideas embodied in > .I bzip2 > > Modified: head/contrib/bzip2/bzip2.c > ============================================================================== > --- head/contrib/bzip2/bzip2.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/bzip2.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -7,8 +7,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -554,7 +554,7 @@ static > Bool testStream ( FILE *zStream ) > { > BZFILE* bzf = NULL; > - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; > + Int32 bzerr, bzerr_dummy, ret, streamNo, i; > UChar obuf[5000]; > UChar unused[BZ_MAX_UNUSED]; > Int32 nUnused; > @@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream ) > streamNo++; > > while (bzerr == BZ_OK) { > - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); > + BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); > if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; > } > if (bzerr != BZ_STREAM_END) goto errhandler; > @@ -749,7 +749,7 @@ void panic ( const Char* s ) > "\n%s: PANIC -- internal consistency error:\n" > "\t%s\n" > "\tThis is a BUG. Please report it to me at:\n" > - "\tjseward@bzip.org\n", > + "\tjseward@acm.org\n", > progName, s ); > showFileNames(); > cleanUpAndFail( 3 ); > @@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) > " The user's manual, Section 4.3, has more info on (1) and (2).\n" > " \n" > " If you suspect this is a bug in bzip2, or are unsure about (1)\n" > - " or (2), feel free to report it to me at: jseward@bzip.org.\n" > + " or (2), feel free to report it to me at: jseward@acm.org.\n" > " Section 4.3 of the user's manual describes the info a useful\n" > " bug report should have. If the manual is available on your\n" > " system, please try and read it before mailing me. If you don't\n" > @@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) > " The user's manual, Section 4.3, has more info on (2) and (3).\n" > " \n" > " If you suspect this is a bug in bzip2, or are unsure about (2)\n" > - " or (3), feel free to report it to me at: jseward@bzip.org.\n" > + " or (3), feel free to report it to me at: jseward@acm.org.\n" > " Section 4.3 of the user's manual describes the info a useful\n" > " bug report should have. If the manual is available on your\n" > " system, please try and read it before mailing me. If you don't\n" > @@ -1609,7 +1609,7 @@ void license ( void ) > " \n" > " This program is free software; you can redistribute it and/or modify\n" > " it under the terms set out in the LICENSE file, which is included\n" > - " in the bzip2-1.0.6 source distribution.\n" > + " in the bzip2 source distribution.\n" > " \n" > " This program is distributed in the hope that it will be useful,\n" > " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" > @@ -2005,12 +2005,14 @@ IntNative main ( IntNative argc, Char *argv[] ) > testf ( aa->name ); > } > } > - if (testFailsExist && noisy) { > - fprintf ( stderr, > - "\n" > - "You can use the `bzip2recover' program to attempt to recover\n" > - "data from undamaged sections of corrupted files.\n\n" > - ); > + if (testFailsExist) { > + if (noisy) { > + fprintf ( stderr, > + "\n" > + "You can use the `bzip2recover' program to attempt to recover\n" > + "data from undamaged sections of corrupted files.\n\n" > + ); > + } > setExit(2); > exit(exitValue); > } > > Modified: head/contrib/bzip2/bzip2recover.c > ============================================================================== > --- head/contrib/bzip2/bzip2recover.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/bzip2recover.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -7,8 +7,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv ) > UInt32 buffHi, buffLo, blockCRC; > Char* p; > > - strcpy ( progName, argv[0] ); > + strncpy ( progName, argv[0], BZ_MAX_FILENAME-1); > + progName[BZ_MAX_FILENAME-1]='\0'; > inFileName[0] = outFileName[0] = 0; > > fprintf ( stderr, > - "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); > + "bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" ); > > if (argc != 2) { > fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", > @@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv ) > bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); > bsPutUInt32 ( bsWr, blockCRC ); > bsClose ( bsWr ); > + outFile = NULL; > } > if (wrBlock >= rbCtr) break; > wrBlock++; > > Modified: head/contrib/bzip2/bzlib.c > ============================================================================== > --- head/contrib/bzip2/bzlib.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/bzlib.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -47,7 +47,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) > fprintf(stderr, > "\n\nbzip2/libbzip2: internal error number %d.\n" > "This is a bug in bzip2/libbzip2, %s.\n" > - "Please report it to me at: jseward@bzip.org. If this happened\n" > + "Please report it to me at: jseward@acm.org. If this happened\n" > "when you were using some program which uses libbzip2 as a\n" > "component, you should also report this bug to the author(s)\n" > "of that program. Please make an effort to report this bug;\n" > > Modified: head/contrib/bzip2/bzlib.h > ============================================================================== > --- head/contrib/bzip2/bzlib.h Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/bzlib.h Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > > Modified: head/contrib/bzip2/bzlib_private.h > ============================================================================== > --- head/contrib/bzip2/bzlib_private.h Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/bzlib_private.h Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -36,7 +36,7 @@ > > /*-- General stuff. --*/ > > -#define BZ_VERSION "1.0.6, 6-Sept-2010" > +#define BZ_VERSION "1.0.7, 27-Jun-2019" > > typedef char Char; > typedef unsigned char Bool; > > Modified: head/contrib/bzip2/compress.c > ============================================================================== > --- head/contrib/bzip2/compress.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/compress.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > > Modified: head/contrib/bzip2/crctable.c > ============================================================================== > --- head/contrib/bzip2/crctable.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/crctable.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > > Modified: head/contrib/bzip2/decompress.c > ============================================================================== > --- head/contrib/bzip2/decompress.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/decompress.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > @@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s ) > > /*--- Now the selectors ---*/ > GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); > - if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); > + if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); > GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); > - if (nSelectors < 1) RETURN(BZ_DATA_ERROR); > + if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); > for (i = 0; i < nSelectors; i++) { > j = 0; > while (True) { > > Modified: head/contrib/bzip2/huffman.c > ============================================================================== > --- head/contrib/bzip2/huffman.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/huffman.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > > Modified: head/contrib/bzip2/randtable.c > ============================================================================== > --- head/contrib/bzip2/randtable.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/randtable.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -8,8 +8,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > > Modified: head/contrib/bzip2/spewG.c > ============================================================================== > --- head/contrib/bzip2/spewG.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/spewG.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -13,8 +13,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > > Modified: head/contrib/bzip2/unzcrash.c > ============================================================================== > --- head/contrib/bzip2/unzcrash.c Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/unzcrash.c Fri Jun 28 05:11:02 2019 (r349505) > @@ -17,8 +17,8 @@ > This file is part of bzip2/libbzip2, a program and library for > lossless, block-sorting data compression. > > - bzip2/libbzip2 version 1.0.6 of 6 September 2010 > - Copyright (C) 1996-2010 Julian Seward > + bzip2/libbzip2 version 1.0.7 of 27 June 2019 > + Copyright (C) 1996-2010 Julian Seward > > Please read the WARNING, DISCLAIMER and PATENTS sections in the > README file. > > Modified: head/contrib/bzip2/words2 > ============================================================================== > --- head/contrib/bzip2/words2 Fri Jun 28 04:52:24 2019 (r349504) > +++ head/contrib/bzip2/words2 Fri Jun 28 05:11:02 2019 (r349505) > @@ -1,5 +1,5 @@ > > Checking test results. If any of the four "cmp"s which follow > report any differences, something is wrong. If you can't easily > -figure out what, please let me know (jseward@bzip.org). > +figure out what, please let me know (jseward@acm.org). > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Fri Jun 28 09:23:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F38C15DD082; Fri, 28 Jun 2019 09:23:09 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 919E46A003; Fri, 28 Jun 2019 09:23:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f65.google.com with SMTP id u19so2560315ior.9; Fri, 28 Jun 2019 02:23:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=I53FWSJHImXvmyYxBTkIAeHd9Qlt9XXJzqOYRxhctxs=; b=H9qbsFSUMo5XZ5/8f4nUr2s2Fpp4xchrM4t4xX6jJRagGfzW6oOG1P4vXHOaSmJNgJ KnCPfvN/cokcXwVtZk9Pl+JZ5a/P+0a0ZZR+ZWwtXxregI+hLM3VNQmDcKoj9PFQJTuz 4OTRKuTesSzIV0WP9VLg/OCsrfAGxHLbEJlX8vYNmxDb2WsS29V+LdLANGIW0NngG+72 ta3kflARM3GAQ+KlWgGnGsjcSUqagj8EkxLgPbi6UXHSt8w71Iyrkrg/+CNy6pU5rZZH eG1N6W11vQWeXRi6NUTAhDiryrU7eBnJ5qb17ZnpOeD/vv0znmC+Su2GVnFnUUiar8Nv DHDA== X-Gm-Message-State: APjAAAWz8EiUWCSdHu7G0zU7W3xcQGqZVj2f9Ahvl9TjEh2P+N8PaYs/ Ht/qGXUTm5kaSYn3dGf5CVUleA3mBj8= X-Google-Smtp-Source: APXvYqxTmJctPSr5Ls84RTS7z2oIxZhHH1SmyfzRndSPsp8Ytqc/aXreesXvqsq5zIE1+Nuh9Q3kvA== X-Received: by 2002:a5e:8518:: with SMTP id i24mr9502919ioj.149.1561713781236; Fri, 28 Jun 2019 02:23:01 -0700 (PDT) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com. [209.85.166.47]) by smtp.gmail.com with ESMTPSA id v26sm1415272iom.88.2019.06.28.02.22.58 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 02:22:59 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id e3so11003796ioc.12; Fri, 28 Jun 2019 02:22:58 -0700 (PDT) X-Received: by 2002:a5d:8ccc:: with SMTP id k12mr9757897iot.141.1561713778598; Fri, 28 Jun 2019 02:22:58 -0700 (PDT) MIME-Version: 1.0 References: <201906201413.x5KEDB5u010923@repo.freebsd.org> <20190627191843.GQ8697@kib.kiev.ua> <20190627210940.GR8697@kib.kiev.ua> <0988866D-918B-4800-ADE7-938E1EBD729C@samsco.org> In-Reply-To: <0988866D-918B-4800-ADE7-938E1EBD729C@samsco.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 28 Jun 2019 11:22:47 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r349231 - in head/sys: kern sys ufs/ufs To: Scott Long Cc: Alan Somers , Konstantin Belousov , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 919E46A003 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 09:23:09 -0000 To this end, __result_use_check can help ensure no unchecked callers are missed when panics are downgraded to errors. (In OneFS, the macro has the imo more memorable name =E2=80=9C__must_check=E2=80=9D. Cheers, Conrad On Thu, Jun 27, 2019 at 23:48 Scott Long wrote: > > > > On Jun 27, 2019, at 3:09 PM, Konstantin Belousov > wrote: > > > > On Thu, Jun 27, 2019 at 02:01:11PM -0600, Alan Somers wrote: > >> On Thu, Jun 27, 2019 at 1:18 PM Konstantin Belousov < > kostikbel@gmail.com> wrote: > >>> > >>> On Thu, Jun 20, 2019 at 02:13:11PM +0000, Alan Somers wrote: > >>>> Author: asomers > >>>> Date: Thu Jun 20 14:13:10 2019 > >>>> New Revision: 349231 > >>>> URL: https://svnweb.freebsd.org/changeset/base/349231 > >>>> > >>>> Log: > >>>> Add FIOBMAP2 ioctl > >>> > >>>> > >>>> This ioctl exposes VOP_BMAP information to userland. It can be used > by > >>>> programs like fragmentation analyzers and optimized cp > implementations. But > >>>> I'm using it to test fusefs's VOP_BMAP implementation. The "2" in > the name > >>>> distinguishes it from the similar but incompatible FIBMAP ioctls in > NetBSD > >>>> and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit > block > >>>> number instead of 32-bit, and it also returns runp and runb. > >>>> > >>>> Reviewed by: mckusick > >>>> MFC after: 2 weeks > >>>> Sponsored by: The FreeBSD Foundation > >>>> Differential Revision: https://reviews.freebsd.org/D20705 > >>>> > >>>> Modified: > >>>> head/sys/kern/vfs_vnops.c > >>>> head/sys/sys/filio.h > >>>> head/sys/ufs/ufs/ufs_bmap.c > >>>> > >>>> Modified: head/sys/kern/vfs_vnops.c > >>>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >>>> --- head/sys/kern/vfs_vnops.c Thu Jun 20 13:59:46 2019 > (r349230) > >>>> +++ head/sys/kern/vfs_vnops.c Thu Jun 20 14:13:10 2019 > (r349231) > >>>> @@ -1458,6 +1458,25 @@ vn_stat(struct vnode *vp, struct stat *sb, > struct ucre > >>>> return (0); > >>>> } > >>>> > >>>> +/* generic FIOBMAP2 implementation */ > >>>> +static int > >>>> +vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct ucre= d > *cred) > >>> I do not like the fact that internal kernel function takes the > >>> user-visible structure which results in the mix of ABI and KBI. > >>> Traditionally we pass explicit arguments to kern_XXX, vn_XXX and > similar > >>> internal implementations. > >> > >> Ok. It will increase the number of function arguments, which is ugly, > >> but I can do it if you prefer. > >> > >>> > >>>> +{ > >>>> + struct vnode *vp =3D fp->f_vnode; > >>> Why do you pass fp to the function that > >>> 1. Has vn_ namespace, i.e. operating on vnode. > >>> 2. Only needs vnode to operate on. > >>> Please change the argument from fp to vp. You would need to pass > f_cred > >>> as additional argument, or move mac check to vn_ioctl (I think this i= s > >>> a better approach). > >> > >> Ok. > >> > >>> > >>>> + daddr_t lbn =3D arg->bn; > >>> Style: initialization in declaration. > >>> > >>>> + int error; > >>>> + > >>>> + vn_lock(vp, LK_SHARED | LK_RETRY); > >>>> +#ifdef MAC > >>>> + error =3D mac_vnode_check_read(cred, fp->f_cred, vp); > >>>> + if (error =3D=3D 0) > >>>> +#endif > >>>> + error =3D VOP_BMAP(vp, lbn, NULL, &arg->bn, &arg->runp= , > >>>> + &arg->runb); > >>> Wrong indent for continuation line. > >>> > >>>> + VOP_UNLOCK(vp, 0); > >>>> + return (error); > >>>> +} > >>>> + > >>>> /* > >>>> * File table vnode ioctl routine. > >>>> */ > >>>> @@ -1481,6 +1500,9 @@ vn_ioctl(struct file *fp, u_long com, void > *data, stru > >>>> if (error =3D=3D 0) > >>>> *(int *)data =3D vattr.va_size - > fp->f_offset; > >>>> return (error); > >>>> + case FIOBMAP2: > >>>> + return (vn_ioc_bmap2(fp, (struct > fiobmap2_arg*)data, > >>> Need space between fiobmap2_arg and '*'. > >>>> + active_cred)); > >>> Wrong indent. > >>> > >>>> case FIONBIO: > >>>> case FIOASYNC: > >>>> return (0); > >>>> > >>>> Modified: head/sys/sys/filio.h > >>>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >>>> --- head/sys/sys/filio.h Thu Jun 20 13:59:46 2019 > (r349230) > >>>> +++ head/sys/sys/filio.h Thu Jun 20 14:13:10 2019 > (r349231) > >>>> @@ -62,6 +62,13 @@ struct fiodgname_arg { > >>>> /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ > >>>> #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ > >>>> #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ > >>>> +struct fiobmap2_arg { > >>>> + int64_t bn; > >>>> + int runp; > >>>> + int runb; > >>>> +}; > >>> This structure has different layout for LP64 and ILP32, and you did n= ot > >>> provided the compat shims. > >> > >> Really? How so? All of the fields have the same width on 64 and 32 > >> bit archs, and there shouldn't be any need for padding, either. > > Sorry, you are right. > > > >> > >>> > >>>> +/* Get the file's bmap info for the logical block bn */ > >>>> +#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) > >>>> > >>>> #ifdef _KERNEL > >>>> #ifdef COMPAT_FREEBSD32 > >>>> > >>>> Modified: head/sys/ufs/ufs/ufs_bmap.c > >>>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >>>> --- head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 13:59:46 2019 > (r349230) > >>>> +++ head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 14:13:10 2019 > (r349231) > >>>> @@ -200,12 +200,15 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) > >>>> *bnp =3D blkptrtodb(ump, ip->i_din2->di_extb[-1= - > bn]); > >>>> if (*bnp =3D=3D 0) > >>>> *bnp =3D -1; > >>>> - if (nbp =3D=3D NULL) > >>>> - panic("ufs_bmaparray: mapping ext > data"); > >>>> + if (nbp =3D=3D NULL) { > >>>> + /* indirect block not found */ > >>>> + return (EINVAL); > >>>> + } > >>> This (and next chunk) loose useful checks for in-kernel interfaces. > >> > >> mckusick disagrees with you on this. He thought that changing the > >> panics into errors was a good idea. Note that ufs_bmap was already > >> capable of returning errors that not all callers check. > > For user-callable code, this is of course the requirement. But for > in-kernel > > use, IMO it makes the interfaces loose. > > I=E2=80=99m firmly in agreement on changing panics into errors. When cal= lers are > encountered that don=E2=80=99t properly check and propagate the errors, t= hey > should be fixed too. I=E2=80=99m not saying that it=E2=80=99s an easy pr= ocess and that > we should just delete all panics, but it=E2=80=99s a goal that should be = vigorously > pursued. > > Scott > > > > From owner-svn-src-all@freebsd.org Fri Jun 28 10:17:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 164D315DE137; Fri, 28 Jun 2019 10:17:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 5E30E6B943; Fri, 28 Jun 2019 10:17:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 32D5B149D2D; Fri, 28 Jun 2019 20:16:53 +1000 (AEST) Date: Fri, 28 Jun 2019 20:16:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349459 - head/sys/sys In-Reply-To: Message-ID: <20190628192001.K982@besplex.bde.org> References: <201906271507.x5RF775Q070616@repo.freebsd.org> <20190628012059.D2091@besplex.bde.org> <20190628032225.T2863@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=nlC_4_pT8q9DhB4Ho9EA:9 a=y87RR0B9tQQI9nNFtbYA:9 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: 5E30E6B943 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 10:17:03 -0000 On Thu, 27 Jun 2019, Andriy Gapon wrote: > On 27/06/2019 20:37, Bruce Evans wrote: >> On Thu, 27 Jun 2019, Andriy Gapon wrote: >> >>> On 27/06/2019 18:47, Bruce Evans wrote: >>>> On Thu, 27 Jun 2019, Andriy Gapon wrote: >>>> >>>>> Log: >>>>> =C2=A0upgrade the warning printf-s in bus accessors to KASSERT-s >>>>> >>>>> =C2=A0After this change sys/bus.h includes sys/systm.h. >>>> >>>> This is further namespace pollution.=C2=A0 sys/systm.h is a prerequist= e for >>>> all kernel headers except sys/param.h and the headers that that includ= es, >>>> since any kernel header (except sys/param.hm etc.) may have inlines wh= ich >>>> use features in systm.h, e.g., KASSERT() or an inline function. >>> >>> what do you think about amending style(9) to require that if sys/systm.= h is to >>> be included, then it must be included before any other header except fo= r >>> sys/param.h (and possibly sys/cdefs.h) ? >> >> It is not a style matter. > > I know... but style(9) documents sys/param.h for similar reasons. > >> sys/systm.h is just a prerequisite for almost >> all kernel code.=C2=A0 Perhaps this can be enforced using #ifdef magic e= ven >> for headers that don't currently use it.=C2=A0 If it is to be included n= ested, >> then sys/param.h is the place to include it, but I don't like that since >> it is even less related to parameters than sys/param.h, and this would b= e >> a regression from minor depollution of sys/param.h. >> >> sys/systm.h is also kernel-only, and as you found, including it nested >> tends to break applications, so other headers that have the bug of >> including it tend to have _KERNEL ifdefs to avoid including it in >> applications.=C2=A0 This is so fundamental that it doesn't have a "No >> user-serviceable parts inside" ifdef. > > I think that there is a trivial fix to my commit: moving the sys/systm.h = include > to the _KERNEL section of sys/bus.h. That's where its definitions are ac= tually > used. > But I agree that there should be a better approach. I did a quick check of how many .c files are missing includes of sys/systm.= h. In an old version of FreeBSD, my normal kernel has about 1100 object files, and about 89 of these broke when a KASSERT() was added to sys/bus.h without adding the pollution. That is many more than I expected. Many of these errors are in automatically generated bus if.c files. E.g., the include list in acpi_if.c is: #include #include #include #include #include #include #include #include "acpi_if.h" Here sys/bus.h and sys/types.h and the contrib include are in the .m file, and the others are automatically generated. Including sys/types.h is nonsense since sys/param.h already included it and sys/bus.h already used typedefs in it. The generation also misorders sys/queue.h and mangles the formatting of the contrib include (in the .m file, it is separated by spaces). Here the .m file should know sys/bus.h's prerequisites and add them all except sys/param.h and sys/systm.h, or maybe the include of sys/bus.h should be auto-generated too (my test kernel has 25 foo_if.c files and 21 of these include sys/bus.c). Most of the generated if.c files include sys/systm.h by nested pollution anyway. Just not early enough to actually work. E.g., in acpi_if.c, the above 8 includes expand to 45 lines, 144 words and 2679 chars in =2Edepend.acpi_if.o according to wc. The word count of 144 is approximately the number of includes. sys/systm.h is first included deeply nested in contrib/..../acpi.h. 11 of the 25 generated foo_if.c end up never including sys/systm.h. Of the remaining 64 files that fail to compile, all except 7 including 1 maintained by me (cy_pci.c) *blush* end up including sys/systm.h. The other 57 apparently include it either misordered in the .c file or via nested pollution. After removing all nested includes of sys/systm.h in headers, only another 50 object files fail to build. most of the extras are for libkern functions (20 for str*() alone). libkern was polluted.h relatively recently as part of unimproving the implementation of bcd conversion APIs from macros to inlines with KASSERT()s. The KASSERT()s were a bad fix for missing sanity checks of bcd data in callers. Bruce From owner-svn-src-all@freebsd.org Fri Jun 28 10:38:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6381615DE63C; Fri, 28 Jun 2019 10:38:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDDA26C2C8; Fri, 28 Jun 2019 10:38:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1935257FF; Fri, 28 Jun 2019 10:38:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SAcvAm088281; Fri, 28 Jun 2019 10:38:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SAcv5f088278; Fri, 28 Jun 2019 10:38:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906281038.x5SAcv5f088278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Jun 2019 10:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349506 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 349506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDDA26C2C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 10:38:58 -0000 Author: hselasky Date: Fri Jun 28 10:38:56 2019 New Revision: 349506 URL: https://svnweb.freebsd.org/changeset/base/349506 Log: Implement API for draining EPOCH(9) callbacks. The epoch_drain_callbacks() function is used to drain all pending callbacks which have been invoked by prior epoch_call() function calls on the same epoch. This function is useful when there are shared memory structure(s) referred to by the epoch callback(s) which are not refcounted and are rarely freed. The typical place for calling this function is right before freeing or invalidating the shared resource(s) used by the epoch callback(s). This function can sleep and is not optimized for performance. Differential Revision: https://reviews.freebsd.org/D20109 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/share/man/man9/Makefile head/share/man/man9/epoch.9 head/sys/kern/subr_epoch.c head/sys/sys/epoch.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jun 28 05:11:02 2019 (r349505) +++ head/share/man/man9/Makefile Fri Jun 28 10:38:56 2019 (r349506) @@ -945,6 +945,15 @@ MLINKS+=drbr.9 drbr_free.9 \ MLINKS+=DRIVER_MODULE.9 DRIVER_MODULE_ORDERED.9 \ DRIVER_MODULE.9 EARLY_DRIVER_MODULE.9 \ DRIVER_MODULE.9 EARLY_DRIVER_MODULE_ORDERED.9 +MLINKS+=epoch.9 epoch_context.9 \ + epoch.9 epoch_alloc.9 \ + epoch.9 epoch_free.9 \ + epoch.9 epoch_enter.9 \ + epoch.9 epoch_exit.9 \ + epoch.9 epoch_wait.9 \ + epoch.9 epoch_call.9 \ + epoch.9 epoch_drain_callbacks.9 \ + epoch.9 in_epoch.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEFINE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Fri Jun 28 05:11:02 2019 (r349505) +++ head/share/man/man9/epoch.9 Fri Jun 28 10:38:56 2019 (r349506) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2018 +.Dd June 28, 2019 .Dt EPOCH 9 .Os .Sh NAME @@ -38,6 +38,7 @@ .Nm epoch_exit , .Nm epoch_wait , .Nm epoch_call , +.Nm epoch_drain_callbacks , .Nm in_epoch , .Nd kernel epoch based reclamation .Sh SYNOPSIS @@ -60,6 +61,8 @@ .Fn epoch_wait_preempt "epoch_t epoch" .Ft void .Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback) (epoch_context_t)" +.Ft void +.Fn epoch_drain_callbacks "epoch_t epoch" .Ft int .Fn in_epoch "epoch_t epoch" .Sh DESCRIPTION @@ -120,6 +123,18 @@ routines must be used and the caller can no longer mod in place. An item to be modified must be handled with copy on write and frees must be deferred until after a grace period has elapsed. +.Pp +The +.Fn epoch_drain_callbacks +function is used to drain all pending callbacks which have been invoked by prior +.Fn epoch_call +function calls on the same epoch. +This function is useful when there are shared memory structure(s) +referred to by the epoch callback(s) which are not refcounted and are +rarely freed. +The typical place for calling this function is right before freeing or +invalidating the shared resource(s) used by the epoch callback(s). +This function can sleep and is not optimized for performance. .Sh RETURN VALUES .Fn in_epoch curepoch will return 1 if curthread is in curepoch, 0 otherwise. Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri Jun 28 05:11:02 2019 (r349505) +++ head/sys/kern/subr_epoch.c Fri Jun 28 10:38:56 2019 (r349506) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,6 +65,8 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re TAILQ_HEAD (epoch_tdlist, epoch_tracker); typedef struct epoch_record { ck_epoch_record_t er_record; + struct epoch_context er_drain_ctx; + struct epoch *er_parent; volatile struct epoch_tdlist er_tdlist; volatile uint32_t er_gen; uint32_t er_cpuid; @@ -74,6 +77,9 @@ struct epoch { epoch_record_t e_pcpu_record; int e_idx; int e_flags; + struct sx e_drain_sx; + struct mtx e_drain_mtx; + volatile int e_drain_count; }; /* arbitrary --- needs benchmarking */ @@ -178,6 +184,7 @@ epoch_ctor(epoch_t epoch) ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); er->er_cpuid = cpu; + er->er_parent = epoch; } } @@ -203,6 +210,8 @@ epoch_alloc(int flags) MPASS(epoch_count < MAX_EPOCHS - 2); epoch->e_flags = flags; epoch->e_idx = epoch_count; + sx_init(&epoch->e_drain_sx, "epoch-drain-sx"); + mtx_init(&epoch->e_drain_mtx, "epoch-drain-mtx", NULL, MTX_DEF); allepochs[epoch_count++] = epoch; return (epoch); } @@ -210,18 +219,13 @@ epoch_alloc(int flags) void epoch_free(epoch_t epoch) { -#ifdef INVARIANTS - struct epoch_record *er; - int cpu; - CPU_FOREACH(cpu) { - er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); - MPASS(TAILQ_EMPTY(&er->er_tdlist)); - } -#endif + epoch_drain_callbacks(epoch); allepochs[epoch->e_idx] = NULL; epoch_wait(global_epoch); uma_zfree_pcpu(pcpu_zone_record, epoch->e_pcpu_record); + mtx_destroy(&epoch->e_drain_mtx); + sx_destroy(&epoch->e_drain_sx); free(epoch, M_EPOCH); } @@ -655,6 +659,83 @@ int in_epoch(epoch_t epoch) { return (in_epoch_verbose(epoch, 0)); +} + +static void +epoch_drain_cb(struct epoch_context *ctx) +{ + struct epoch *epoch = + __containerof(ctx, struct epoch_record, er_drain_ctx)->er_parent; + + if (atomic_fetchadd_int(&epoch->e_drain_count, -1) == 1) { + mtx_lock(&epoch->e_drain_mtx); + wakeup(epoch); + mtx_unlock(&epoch->e_drain_mtx); + } +} + +void +epoch_drain_callbacks(epoch_t epoch) +{ + epoch_record_t er; + struct thread *td; + int was_bound; + int old_pinned; + int old_cpu; + int cpu; + + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "epoch_drain_callbacks() may sleep!"); + + /* too early in boot to have epoch set up */ + if (__predict_false(epoch == NULL)) + return; +#if !defined(EARLY_AP_STARTUP) + if (__predict_false(inited < 2)) + return; +#endif + DROP_GIANT(); + + sx_xlock(&epoch->e_drain_sx); + mtx_lock(&epoch->e_drain_mtx); + + td = curthread; + thread_lock(td); + old_cpu = PCPU_GET(cpuid); + old_pinned = td->td_pinned; + was_bound = sched_is_bound(td); + sched_unbind(td); + td->td_pinned = 0; + + CPU_FOREACH(cpu) + epoch->e_drain_count++; + CPU_FOREACH(cpu) { + er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); + sched_bind(td, cpu); + epoch_call(epoch, &er->er_drain_ctx, &epoch_drain_cb); + } + + /* restore CPU binding, if any */ + if (was_bound != 0) { + sched_bind(td, old_cpu); + } else { + /* get thread back to initial CPU, if any */ + if (old_pinned != 0) + sched_bind(td, old_cpu); + sched_unbind(td); + } + /* restore pinned after bind */ + td->td_pinned = old_pinned; + + thread_unlock(td); + + while (epoch->e_drain_count != 0) + msleep(epoch, &epoch->e_drain_mtx, PZERO, "EDRAIN", 0); + + mtx_unlock(&epoch->e_drain_mtx); + sx_xunlock(&epoch->e_drain_sx); + + PICKUP_GIANT(); } void Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Fri Jun 28 05:11:02 2019 (r349505) +++ head/sys/sys/epoch.h Fri Jun 28 10:38:56 2019 (r349506) @@ -69,6 +69,7 @@ epoch_t epoch_alloc(int flags); void epoch_free(epoch_t epoch); void epoch_wait(epoch_t epoch); void epoch_wait_preempt(epoch_t epoch); +void epoch_drain_callbacks(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(epoch_t epoch); int in_epoch_verbose(epoch_t epoch, int dump_onfail); From owner-svn-src-all@freebsd.org Fri Jun 28 10:49:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4678C15DEA04; Fri, 28 Jun 2019 10:49:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E08CD6C8D6; Fri, 28 Jun 2019 10:49:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D57259B9; Fri, 28 Jun 2019 10:49:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SAn4tR093469; Fri, 28 Jun 2019 10:49:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SAn4op093468; Fri, 28 Jun 2019 10:49:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906281049.x5SAn4op093468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Jun 2019 10:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349507 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 349507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E08CD6C8D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 10:49:05 -0000 Author: hselasky Date: Fri Jun 28 10:49:04 2019 New Revision: 349507 URL: https://svnweb.freebsd.org/changeset/base/349507 Log: Need to wait for epoch callbacks to complete before detaching a network interface. This particularly manifests itself when an INP has multicast options attached during a network interface detach. Then the IPv4 and IPv6 leave group call which results from freeing the multicast address, may access a freed ifnet structure. These are the steps to reproduce: service mdnsd onestart # installed from ports ifconfig epair create ifconfig epair0a 0/24 up ifconfig epair0a destroy Tested by: pho @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Jun 28 10:38:56 2019 (r349506) +++ head/sys/net/if.c Fri Jun 28 10:49:04 2019 (r349507) @@ -1127,6 +1127,15 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc curvnet->vnet_ifcnt--; #endif epoch_wait_preempt(net_epoch_preempt); + + /* + * Ensure all pending EPOCH(9) callbacks have been executed. This + * fixes issues about late destruction of multicast options + * which lead to leave group calls, which in turn access the + * belonging ifnet structure: + */ + epoch_drain_callbacks(net_epoch_preempt); + /* * In any case (destroy or vmove) detach us from the groups * and remove/wait for pending events on the taskq. From owner-svn-src-all@freebsd.org Fri Jun 28 10:53:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA3DF15DEC2E; Fri, 28 Jun 2019 10:53:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 3170D6CD31; Fri, 28 Jun 2019 10:53:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 1193F14AEDA; Fri, 28 Jun 2019 20:53:55 +1000 (AEST) Date: Fri, 28 Jun 2019 20:53:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349503 - head/contrib/ipfilter/man In-Reply-To: <201906280428.x5S4SXhf094525@repo.freebsd.org> Message-ID: <20190628202903.J1192@besplex.bde.org> References: <201906280428.x5S4SXhf094525@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=Dw3HR1N7fkTZfM9K41MA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 3170D6CD31 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.996,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 10:54:00 -0000 On Fri, 28 Jun 2019, Cy Schubert wrote: > Log: > Document the -B, binary logfile, and the -C config file options. > Reference the ipmon.5 man page and ipmon.conf. > > PR: 238816 > MFC after: 1 week > > Modified: > head/contrib/ipfilter/man/ipmon.8 > > Modified: head/contrib/ipfilter/man/ipmon.8 > ============================================================================== > --- head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:18:10 2019 (r349502) > +++ head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:28:32 2019 (r349503) > @@ -7,6 +7,10 @@ ipmon \- monitors /dev/ipl for logged packets > [ > .B \-abBDFhnpstvxX -B was misdocumented as a flag here, and still is. > ] [ > +.B "\-B " > +] [ This file isn't written in mdoc. This gives errors starting with misformatting the SYNOPIS. The most obvious ones are: - split lines are not properly indented - splitting is done in bad places (after '[' for [ ] - unusual quoting. mdoc would not put angle brackets and spaces around 'filename. These brackets and spaces seem to be mostly hard-coded using .B and literals. - bad rendering or for square brackets around NSI. These square brackets mean optional options as usual, but are not rendered normally. The .B macro apparently gives normal rendering for outer square brackets, but the inner square brackets around NSI use the same rendering as the letters. - various misorderings: -N before -L, -f after -[NLoOPS; NSI randomly ordered. The recent fixes to the usage message have the correct order for [-NLf], and different misformatting for split lines, so are hard to compare with the man page. This commit makes the usage message out of date again. Bruce From owner-svn-src-all@freebsd.org Fri Jun 28 12:01:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 725E415B3C11; Fri, 28 Jun 2019 12:01:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 000EF6F02B; Fri, 28 Jun 2019 12:01:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id gpZ7hsoxKldkPgpZ8hstz8; Fri, 28 Jun 2019 06:01:19 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=JzwRw_2MAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=KN_jujpiJkyYWXqJCzAA:9 a=CjuIK1q_8ugA:10 a=_bBvcJC8wCc67rcU61zu:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 7F4333FB; Fri, 28 Jun 2019 05:01:16 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5SC1Gdx006426; Fri, 28 Jun 2019 05:01:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5SC1FE4006423; Fri, 28 Jun 2019 05:01:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906281201.x5SC1FE4006423@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Bruce Evans cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349503 - head/contrib/ipfilter/man In-Reply-To: Message from Bruce Evans of "Fri, 28 Jun 2019 20:53:54 +1000." <20190628202903.J1192@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 28 Jun 2019 05:01:15 -0700 X-CMAE-Envelope: MS4wfMO2KBBjKMpqdcvWuAvX2YEAe5i87RE6sahoy9W/xW5p+GLDUMMOvtoLwf4gLuJh/KbmUUGHaSyuKbrriUTsnQ3ggkBTMXcsm0KPIJOtNrp7xpogfJCk IaeJMcmBKTXcKo2oGNlBS1FtAF5b6T5tgdKUl25oCZhvtnLNrGrRm5/sBzGrLOPwT1QpOSPegHnUq0UXoyV58+b3rK0gDuzh+JmHDyuxOFPCNxDyvNcfNKgb PJ6+mBvuuzhjwTRvLb6N+GTz7Xj8hFcKXN9DdJEGGxUNz+HxRt7mqozlUo7eODcUDc5gVcddol7CCuPc0fR9HQ== X-Rspamd-Queue-Id: 000EF6F02B X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.23 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; FREEMAIL_TO(0.00)[optusnet.com.au]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; IP_SCORE(-2.56)[ip: (-6.87), ipnet: 64.59.128.0/20(-3.28), asn: 6327(-2.54), country: CA(-0.09)]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 12:01:23 -0000 In message <20190628202903.J1192@besplex.bde.org>, Bruce Evans writes: > On Fri, 28 Jun 2019, Cy Schubert wrote: > > > Log: > > Document the -B, binary logfile, and the -C config file options. > > Reference the ipmon.5 man page and ipmon.conf. > > > > PR: 238816 > > MFC after: 1 week > > > > Modified: > > head/contrib/ipfilter/man/ipmon.8 > > > > Modified: head/contrib/ipfilter/man/ipmon.8 > > =========================================================================== > === > > --- head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:18:10 2019 > (r349502) > > +++ head/contrib/ipfilter/man/ipmon.8 Fri Jun 28 04:28:32 2019 > (r349503) > > @@ -7,6 +7,10 @@ ipmon \- monitors /dev/ipl for logged packets > > [ > > .B \-abBDFhnpstvxX > > -B was misdocumented as a flag here, and still is. > > > ] [ > > +.B "\-B " > > +] [ > > This file isn't written in mdoc. This gives errors starting with > misformatting the SYNOPIS. The most obvious ones are: > - split lines are not properly indented > - splitting is done in bad places (after '[' for [ ] > - unusual quoting. mdoc would not put angle brackets and spaces around > 'filename. These brackets and spaces seem to be mostly hard-coded > using .B and literals. > - bad rendering or for square brackets around NSI. These square brackets > mean optional options as usual, but are not rendered normally. The .B > macro apparently gives normal rendering for outer square brackets, but > the inner square brackets around NSI use the same rendering as the letters > . > - various misorderings: -N before -L, -f after -[NLoOPS; NSI randomly > ordered. > > The recent fixes to the usage message have the correct order for [-NLf], > and different misformatting for split lines, so are hard to compare with > the man page. > > This commit makes the usage message out of date again. Agreed, the ipfilter man pages should be rewritten into mandoc and synced with usage(). I considered doing that but as PR grew and no one suggested it, rewriting the man page is out of scope for the PR. It is something I considered but best left for after more important bugs are fixed. So yes, these issues are in my queue. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. > > Bruce From owner-svn-src-all@freebsd.org Fri Jun 28 15:49:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9902915C4C99; Fri, 28 Jun 2019 15:49:15 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A9B876649; Fri, 28 Jun 2019 15:49:15 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EDE2D78; Fri, 28 Jun 2019 15:49:15 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SFnFEa049048; Fri, 28 Jun 2019 15:49:15 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SFnF5J049047; Fri, 28 Jun 2019 15:49:15 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906281549.x5SFnF5J049047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 28 Jun 2019 15:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349508 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A9B876649 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 15:49:15 -0000 Author: luporl Date: Fri Jun 28 15:49:14 2019 New Revision: 349508 URL: https://svnweb.freebsd.org/changeset/base/349508 Log: Fix missing powerpc64 in _LLVM_TARGET_FILT This change was originally in D20378. Making it in a new diff since it's a bugfix. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: emaste, luporl Differential Revision: https://reviews.freebsd.org/D20756 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Jun 28 10:49:04 2019 (r349507) +++ head/share/mk/src.opts.mk Fri Jun 28 15:49:14 2019 (r349508) @@ -269,7 +269,7 @@ __LLVM_TARGETS= \ powerpc \ sparc \ x86 -__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/ +__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/:S/powerpc64/powerpc/ .for __llt in ${__LLVM_TARGETS} # Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. .if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} From owner-svn-src-all@freebsd.org Fri Jun 28 15:52:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43F3615C51BA; Fri, 28 Jun 2019 15:52:41 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9C2776C9E; Fri, 28 Jun 2019 15:52:40 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7F13F36; Fri, 28 Jun 2019 15:52:40 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SFqe1O053850; Fri, 28 Jun 2019 15:52:40 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SFqe2D053849; Fri, 28 Jun 2019 15:52:40 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906281552.x5SFqe2D053849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 28 Jun 2019 15:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349509 - head/contrib/file/magic/Magdir X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/contrib/file/magic/Magdir X-SVN-Commit-Revision: 349509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9C2776C9E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 15:52:41 -0000 Author: luporl Date: Fri Jun 28 15:52:40 2019 New Revision: 349509 URL: https://svnweb.freebsd.org/changeset/base/349509 Log: [PowerPC64] Add ABI flags to 'file' magic The distinction between ELF header version and OpenPOWER ELF ABI version is confusing for most of people, so this adds text to "file" output to make it clear about which OpenPOWER ELF ABI version binary was built for. The strings used in this change are based on "64-Bit ELF V2 ABI Specification/3.1. ELF Header" document available at http://openpowerfoundation.org/wp-content/uploads/resources/leabi/content/dbdoclet.50655241_97607.html Example: $ file t1-Flag2 -m -m contrib/file/magic/Magdir/elf t1-Flag2: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.0 (1300033), FreeBSD-style, not stripped Submitted by: alfredo.junior_eldorado.org.br Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D20771 Modified: head/contrib/file/magic/Magdir/elf Modified: head/contrib/file/magic/Magdir/elf ============================================================================== --- head/contrib/file/magic/Magdir/elf Fri Jun 28 15:49:14 2019 (r349508) +++ head/contrib/file/magic/Magdir/elf Fri Jun 28 15:52:40 2019 (r349509) @@ -108,6 +108,9 @@ >18 leshort 19 Intel 80960, >18 leshort 20 PowerPC or cisco 4500, >18 leshort 21 64-bit PowerPC or cisco 7500, +>>48 lelong 0 Unspecified or Power ELF V1 ABI, +>>48 lelong 1 Power ELF V1 ABI, +>>48 lelong 2 OpenPOWER ELF V2 ABI, >18 leshort 22 IBM S/390, >18 leshort 23 Cell SPU, >18 leshort 24 cisco SVIP, From owner-svn-src-all@freebsd.org Fri Jun 28 16:00:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A7E815C5488; Fri, 28 Jun 2019 16:00:56 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 333FD77065; Fri, 28 Jun 2019 16:00:56 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EB57F68; Fri, 28 Jun 2019 16:00:56 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SG0tF8057786; Fri, 28 Jun 2019 16:00:55 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SG0tPC057785; Fri, 28 Jun 2019 16:00:55 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906281600.x5SG0tPC057785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 28 Jun 2019 16:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349510 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 349510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 333FD77065 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 16:00:56 -0000 Author: luporl Date: Fri Jun 28 16:00:55 2019 New Revision: 349510 URL: https://svnweb.freebsd.org/changeset/base/349510 Log: [PowerPC64] readelf: print description for 'e_flags' in ELF header (ABI type) This prints out description text with the meaning of 'Flags' value in PowerPC64. Example: $ readelf -h ~/tmp/t1-Flag2 ELF Header: Magic: 7f 45 4c 46 02 02 01 09 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, big endian Version: 1 (current) OS/ABI: FreeBSD ABI Version: 0 Type: EXEC (Executable file) Machine: PowerPC 64-bit Version: 0x1 Entry point address: 0x10010000 Start of program headers: 64 (bytes into file) Start of section headers: 209368 (bytes into file) Flags: 0x2, OpenPOWER ELF V2 ABI Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 10 Size of section headers: 64 (bytes) Number of section headers: 34 Section header string table index: 31 Submitted by: alfredo.junior_eldorado.org.br Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D20782 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Jun 28 15:52:40 2019 (r349509) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Jun 28 16:00:55 2019 (r349510) @@ -2297,8 +2297,15 @@ dump_eflags(struct readelf *re, uint64_t e_flags) } edesc = mips_eflags_desc; break; - case EM_PPC: case EM_PPC64: + switch (e_flags) { + case 0: printf(", Unspecified or Power ELF V1 ABI"); break; + case 1: printf(", Power ELF V1 ABI"); break; + case 2: printf(", OpenPOWER ELF V2 ABI"); break; + default: break; + } + /* explicit fall through*/ + case EM_PPC: edesc = powerpc_eflags_desc; break; case EM_RISCV: From owner-svn-src-all@freebsd.org Fri Jun 28 16:42:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91F9415C6033; Fri, 28 Jun 2019 16:42:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EA87802DC; Fri, 28 Jun 2019 16:42:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 039C617E6; Fri, 28 Jun 2019 16:42:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SGgipH080182; Fri, 28 Jun 2019 16:42:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SGgisF080181; Fri, 28 Jun 2019 16:42:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906281642.x5SGgisF080181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 28 Jun 2019 16:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349511 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 349511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EA87802DC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 16:42:45 -0000 Author: kib Date: Fri Jun 28 16:42:44 2019 New Revision: 349511 URL: https://svnweb.freebsd.org/changeset/base/349511 Log: Typo. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Fri Jun 28 16:00:55 2019 (r349510) +++ head/lib/libc/sys/procctl.2 Fri Jun 28 16:42:44 2019 (r349511) @@ -91,7 +91,7 @@ The image flag and set-uid might prevent ASLR enableme .It Dv PROC_ASLR_FORCE_DISABLE Request that ASLR is disabled after execution. Same notes as for -.Dv PROC_ASKR_FORCE_ENABLE +.Dv PROC_ASLR_FORCE_ENABLE apply. .It Dv PROC_ASLR_NOFORCE Use system-wide configured policy for ASLR. From owner-svn-src-all@freebsd.org Fri Jun 28 16:45:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C9915C60ED; Fri, 28 Jun 2019 16:45:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2409E80449; Fri, 28 Jun 2019 16:45:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 74296138A5; Fri, 28 Jun 2019 16:45:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r349482 - in head/contrib/elftoolchain: common readelf To: Mitchell Horne , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906280010.x5S0ARLh056619@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 28 Jun 2019 09:45:09 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906280010.x5S0ARLh056619@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2409E80449 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 16:45:11 -0000 On 6/27/19 5:10 PM, Mitchell Horne wrote: > Author: mhorne > Date: Fri Jun 28 00:10:26 2019 > New Revision: 349482 > URL: https://svnweb.freebsd.org/changeset/base/349482 > > Log: > readelf: Add support for RISC-V specific e_flags > > Reviewed by: markj > Approved by: markj (mentor) > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D20767 > > Modified: > head/contrib/elftoolchain/common/elfdefinitions.h > head/contrib/elftoolchain/readelf/readelf.c > > Modified: head/contrib/elftoolchain/common/elfdefinitions.h > ============================================================================== > --- head/contrib/elftoolchain/common/elfdefinitions.h Fri Jun 28 00:03:29 2019 (r349481) > +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri Jun 28 00:10:26 2019 (r349482) > @@ -426,6 +426,22 @@ _ELF_DEFINE_EF(EF_PPC_RELOCATABLE, 0x00010000UL, \ > "-mrelocatable flag") \ > _ELF_DEFINE_EF(EF_PPC_RELOCATABLE_LIB, 0x00008000UL, \ > "-mrelocatable-lib flag") \ > +_ELF_DEFINE_EF(EF_RISCV_RVE, 0x00000008UL, \ > + "Compressed instruction ABI") \ I don't think this description for RVE is quite right. RVE is for RV32E which is not using compressed ('C') instructions, but using a smaller register file (16 GPRs instead of 32) which is in theory intended for embedded / microprocessor variants. The riscv-elf-psabi-doc describes it as: EF_RISCV_RVE (0x0008): This bit is set when the binary targets the E ABI. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Jun 28 18:03:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB1C115C776D; Fri, 28 Jun 2019 18:03:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D55D825E3; Fri, 28 Jun 2019 18:03:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65F192530; Fri, 28 Jun 2019 18:03:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SI3EcZ021984; Fri, 28 Jun 2019 18:03:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SI3E7B021983; Fri, 28 Jun 2019 18:03:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906281803.x5SI3E7B021983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 28 Jun 2019 18:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349512 - head/usr.bin/proccontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/proccontrol X-SVN-Commit-Revision: 349512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D55D825E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 18:03:15 -0000 Author: kib Date: Fri Jun 28 18:03:13 2019 New Revision: 349512 URL: https://svnweb.freebsd.org/changeset/base/349512 Log: Mention proccontrol(1) -m kpti. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/usr.bin/proccontrol/proccontrol.1 Modified: head/usr.bin/proccontrol/proccontrol.1 ============================================================================== --- head/usr.bin/proccontrol/proccontrol.1 Fri Jun 28 16:42:44 2019 (r349511) +++ head/usr.bin/proccontrol/proccontrol.1 Fri Jun 28 18:03:13 2019 (r349512) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2019 +.Dd June 28, 2019 .Dt PROCCONTROL 1 .Os .Sh NAME @@ -66,6 +66,8 @@ Note that process is only allowed to enable tracing fo not for any other process. .It Ar trapcap Controls the signalling of capability mode access violations. +.It Ar kpti +Controls the KPTI enable, AMD64 only. .El .Pp The From owner-svn-src-all@freebsd.org Fri Jun 28 19:27:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A502515C9996; Fri, 28 Jun 2019 19:27:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A4F2852A2; Fri, 28 Jun 2019 19:27:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 238FE33B8; Fri, 28 Jun 2019 19:27:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SJRkNk064327; Fri, 28 Jun 2019 19:27:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SJRkLg064326; Fri, 28 Jun 2019 19:27:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906281927.x5SJRkLg064326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 28 Jun 2019 19:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349514 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 349514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A4F2852A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 19:27:46 -0000 Author: np Date: Fri Jun 28 19:27:45 2019 New Revision: 349514 URL: https://svnweb.freebsd.org/changeset/base/349514 Log: cxgbe/t4_tom: the AIO tx job queue must be empty by the time the driver releases the offload resources associated with the tid. Reviewed by: jhb@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20798 Modified: head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Fri Jun 28 18:48:02 2019 (r349513) +++ head/sys/dev/cxgbe/tom/t4_tom.c Fri Jun 28 19:27:45 2019 (r349514) @@ -294,6 +294,7 @@ release_offload_resources(struct toepcb *toep) if (toep->ulp_mode == ULP_MODE_TCPDDP) ddp_assert_empty(toep); #endif + MPASS(TAILQ_EMPTY(&toep->aiotx_jobq)); if (toep->l2te) t4_l2t_release(toep->l2te); From owner-svn-src-all@freebsd.org Fri Jun 28 19:37:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FFCF15C9DE3; Fri, 28 Jun 2019 19:37:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D48FB85910; Fri, 28 Jun 2019 19:37:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA2E53728; Fri, 28 Jun 2019 19:37:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SJbm0M069685; Fri, 28 Jun 2019 19:37:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SJbmiC069684; Fri, 28 Jun 2019 19:37:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906281937.x5SJbmiC069684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 28 Jun 2019 19:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349515 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D48FB85910 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 19:37:49 -0000 Author: jhb Date: Fri Jun 28 19:37:48 2019 New Revision: 349515 URL: https://svnweb.freebsd.org/changeset/base/349515 Log: Use a tab after #define for EXT_* constants. This matches other #define's in this manpage as well as . Sponsored by: Netflix Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Fri Jun 28 19:27:45 2019 (r349514) +++ head/share/man/man9/mbuf.9 Fri Jun 28 19:37:48 2019 (r349515) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2017 +.Dd June 28, 2019 .Dt MBUF 9 .Os .\" @@ -247,17 +247,17 @@ types are defined as follows: The available external buffer types are defined as follows: .Bd -literal /* external buffer types */ -#define EXT_CLUSTER 1 /* mbuf cluster */ -#define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */ -#define EXT_JUMBOP 3 /* jumbo cluster 4096 bytes */ -#define EXT_JUMBO9 4 /* jumbo cluster 9216 bytes */ -#define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ -#define EXT_PACKET 6 /* mbuf+cluster from packet zone */ -#define EXT_MBUF 7 /* external mbuf reference */ -#define EXT_NET_DRV 252 /* custom ext_buf provided by net driver(s) */ -#define EXT_MOD_TYPE 253 /* custom module's ext_buf type */ -#define EXT_DISPOSABLE 254 /* can throw this buffer away w/page flipping */ -#define EXT_EXTREF 255 /* has externally maintained ref_cnt ptr */ +#define EXT_CLUSTER 1 /* mbuf cluster */ +#define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */ +#define EXT_JUMBOP 3 /* jumbo cluster 4096 bytes */ +#define EXT_JUMBO9 4 /* jumbo cluster 9216 bytes */ +#define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ +#define EXT_PACKET 6 /* mbuf+cluster from packet zone */ +#define EXT_MBUF 7 /* external mbuf reference */ +#define EXT_NET_DRV 252 /* custom ext_buf provided by net driver(s) */ +#define EXT_MOD_TYPE 253 /* custom module's ext_buf type */ +#define EXT_DISPOSABLE 254 /* can throw this buffer away w/page flipping */ +#define EXT_EXTREF 255 /* has externally maintained ref_cnt ptr */ .Ed .Pp If the From owner-svn-src-all@freebsd.org Fri Jun 28 19:49:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA38615CA292; Fri, 28 Jun 2019 19:49:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71CAD85EE8; Fri, 28 Jun 2019 19:49:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6357338E3; Fri, 28 Jun 2019 19:49:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SJnmWB074967; Fri, 28 Jun 2019 19:49:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SJnmFr074966; Fri, 28 Jun 2019 19:49:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906281949.x5SJnmFr074966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 28 Jun 2019 19:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349516 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71CAD85EE8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 19:49:49 -0000 Author: jhb Date: Fri Jun 28 19:49:47 2019 New Revision: 349516 URL: https://svnweb.freebsd.org/changeset/base/349516 Log: Sync mbuf flags, types, and external buffer types with . Sponsored by: Netflix Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Fri Jun 28 19:37:48 2019 (r349515) +++ head/share/man/man9/mbuf.9 Fri Jun 28 19:49:47 2019 (r349516) @@ -209,11 +209,21 @@ The .Vt mbuf flag bits are defined as follows: .Bd -literal -/* mbuf flags */ #define M_EXT 0x00000001 /* has associated external storage */ #define M_PKTHDR 0x00000002 /* start of record */ #define M_EOR 0x00000004 /* end of record */ #define M_RDONLY 0x00000008 /* associated data marked read-only */ +#define M_NOMAP 0x00000100 /* mbuf data is unmapped (soon from Drew) */ +#define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ +#define M_BCAST 0x00000010 /* send/received as link-level broadcast */ +#define M_MCAST 0x00000020 /* send/received as link-level multicast */ +#define M_PROMISC 0x00000040 /* packet was not for us */ +#define M_VLANTAG 0x00000080 /* ether_vtag is valid */ +#define M_TSTMP 0x00000400 /* rcv_tstmp field is valid */ +#define M_TSTMP_HPREC 0x00000800 /* rcv_tstmp is high-prec, typically + hw-stamped on port (useful for IEEE 1588 + and 802.1AS) */ + #define M_PROTO1 0x00001000 /* protocol-specific */ #define M_PROTO2 0x00002000 /* protocol-specific */ #define M_PROTO3 0x00004000 /* protocol-specific */ @@ -226,27 +236,34 @@ flag bits are defined as follows: #define M_PROTO10 0x00200000 /* protocol-specific */ #define M_PROTO11 0x00400000 /* protocol-specific */ #define M_PROTO12 0x00800000 /* protocol-specific */ - -/* mbuf pkthdr flags (also stored in m_flags) */ -#define M_BCAST 0x00000010 /* send/received as link-level broadcast */ -#define M_MCAST 0x00000020 /* send/received as link-level multicast */ .Ed .Pp The available .Vt mbuf types are defined as follows: .Bd -literal -/* mbuf types */ #define MT_DATA 1 /* dynamic (data) allocation */ #define MT_HEADER MT_DATA /* packet header */ + +#define MT_VENDOR1 4 /* for vendor-internal use */ +#define MT_VENDOR2 5 /* for vendor-internal use */ +#define MT_VENDOR3 6 /* for vendor-internal use */ +#define MT_VENDOR4 7 /* for vendor-internal use */ + #define MT_SONAME 8 /* socket name */ + +#define MT_EXP1 9 /* for experimental use */ +#define MT_EXP2 10 /* for experimental use */ +#define MT_EXP3 11 /* for experimental use */ +#define MT_EXP4 12 /* for experimental use */ + #define MT_CONTROL 14 /* extra-data protocol message */ -#define MT_OOBDATA 15 /* expedited data */ +#define MT_EXTCONTROL 15 /* control message with externalized contents */ +#define MT_OOBDATA 16 /* expedited data */ .Ed .Pp The available external buffer types are defined as follows: .Bd -literal -/* external buffer types */ #define EXT_CLUSTER 1 /* mbuf cluster */ #define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */ #define EXT_JUMBOP 3 /* jumbo cluster 4096 bytes */ @@ -254,6 +271,18 @@ The available external buffer types are defined as fol #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference */ +#define EXT_RXRING 8 /* data in NIC receive ring */ + +#define EXT_VENDOR1 224 /* for vendor-internal use */ +#define EXT_VENDOR2 225 /* for vendor-internal use */ +#define EXT_VENDOR3 226 /* for vendor-internal use */ +#define EXT_VENDOR4 227 /* for vendor-internal use */ + +#define EXT_EXP1 244 /* for experimental use */ +#define EXT_EXP2 245 /* for experimental use */ +#define EXT_EXP3 246 /* for experimental use */ +#define EXT_EXP4 247 /* for experimental use */ + #define EXT_NET_DRV 252 /* custom ext_buf provided by net driver(s) */ #define EXT_MOD_TYPE 253 /* custom module's ext_buf type */ #define EXT_DISPOSABLE 254 /* can throw this buffer away w/page flipping */ From owner-svn-src-all@freebsd.org Fri Jun 28 19:57:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEB3D15CA4F6; Fri, 28 Jun 2019 19:57:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40D3C86358; Fri, 28 Jun 2019 19:57:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAF833B22; Fri, 28 Jun 2019 19:57:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SJvgO5080086; Fri, 28 Jun 2019 19:57:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SJvgNI080084; Fri, 28 Jun 2019 19:57:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906281957.x5SJvgNI080084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 28 Jun 2019 19:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349517 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 349517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40D3C86358 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 19:57:44 -0000 Author: np Date: Fri Jun 28 19:57:42 2019 New Revision: 349517 URL: https://svnweb.freebsd.org/changeset/base/349517 Log: cxgbe/t4_tom: Tweaks to some of the AIO related CTRs. Reviewed by: jhb@ MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jun 28 19:49:47 2019 (r349516) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jun 28 19:57:42 2019 (r349517) @@ -724,8 +724,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); #ifdef VERBOSE_TRACES - CTR4(KTR_CXGBE, "%s: tid %d toep flags %#x tp flags %#x drop %d", - __func__, toep->tid, toep->flags, tp->t_flags); + CTR5(KTR_CXGBE, "%s: tid %d toep flags %#x tp flags %#x drop %d", + __func__, toep->tid, toep->flags, tp->t_flags, drop); #endif if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) return; @@ -1244,8 +1244,10 @@ do_peer_close(struct sge_iq *iq, const struct rss_head INP_WLOCK(inp); tp = intotcpcb(inp); - CTR5(KTR_CXGBE, "%s: tid %u (%s), toep_flags 0x%x, inp %p", __func__, - tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, inp); + CTR6(KTR_CXGBE, + "%s: tid %u (%s), toep_flags 0x%x, ddp_flags 0x%x, inp %p", + __func__, tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, + toep->ddp.flags, inp); if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; @@ -2227,7 +2229,7 @@ t4_aiotx_queue_toep(struct socket *so, struct toepcb * SOCKBUF_LOCK_ASSERT(&toep->inp->inp_socket->so_snd); #ifdef VERBOSE_TRACES CTR3(KTR_CXGBE, "%s: queueing aiotx task for tid %d, active = %s", - __func__, toep->tid, toep->aiotx_task_active ? "true" : "false"); + __func__, toep->tid, toep->aiotx_so != NULL ? "true" : "false"); #endif if (toep->aiotx_so != NULL) return; @@ -2283,7 +2285,7 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j SOCKBUF_LOCK(&so->so_snd); #ifdef VERBOSE_TRACES - CTR2(KTR_CXGBE, "%s: queueing %p", __func__, job); + CTR3(KTR_CXGBE, "%s: queueing %p for tid %u", __func__, job, toep->tid); #endif if (!aio_set_cancel_function(job, t4_aiotx_cancel)) panic("new job was cancelled"); Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Fri Jun 28 19:49:47 2019 (r349516) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Fri Jun 28 19:57:42 2019 (r349517) @@ -263,8 +263,8 @@ complete_ddp_buffer(struct toepcb *toep, struct ddp_bu } else toep->ddp.active_id ^= 1; #ifdef VERBOSE_TRACES - CTR2(KTR_CXGBE, "%s: ddp_active_id = %d", __func__, - toep->ddp.active_id); + CTR3(KTR_CXGBE, "%s: tid %u, ddp_active_id = %d", __func__, + toep->tid, toep->ddp.active_id); #endif } else { KASSERT(toep->ddp.active_count != 0 && @@ -534,8 +534,8 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report tp->rcv_wnd -= len; #endif #ifdef VERBOSE_TRACES - CTR4(KTR_CXGBE, "%s: DDP[%d] placed %d bytes (%#x)", __func__, db_idx, - len, report); + CTR5(KTR_CXGBE, "%s: tid %u, DDP[%d] placed %d bytes (%#x)", __func__, + toep->tid, db_idx, len, report); #endif /* receive buffer autosize */ @@ -574,8 +574,9 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report } else { copied = job->aio_received; #ifdef VERBOSE_TRACES - CTR4(KTR_CXGBE, "%s: completing %p (copied %ld, placed %d)", - __func__, job, copied, len); + CTR5(KTR_CXGBE, + "%s: tid %u, completing %p (copied %ld, placed %d)", + __func__, toep->tid, job, copied, len); #endif aio_complete(job, copied + len, 0); t4_rcvd(&toep->td->tod, tp); @@ -1792,8 +1793,9 @@ sbcopy: } #ifdef VERBOSE_TRACES - CTR5(KTR_CXGBE, "%s: scheduling %p for DDP[%d] (flags %#lx/%#lx)", - __func__, job, db_idx, ddp_flags, ddp_flags_mask); + CTR6(KTR_CXGBE, + "%s: tid %u, scheduling %p for DDP[%d] (flags %#lx/%#lx)", __func__, + toep->tid, job, db_idx, ddp_flags, ddp_flags_mask); #endif /* Give the chip the go-ahead. */ t4_wrq_tx(sc, wr); @@ -1919,7 +1921,7 @@ t4_aio_queue_ddp(struct socket *so, struct kaiocb *job */ #ifdef VERBOSE_TRACES - CTR2(KTR_CXGBE, "%s: queueing %p", __func__, job); + CTR3(KTR_CXGBE, "%s: queueing %p for tid %u", __func__, job, toep->tid); #endif if (!aio_set_cancel_function(job, t4_aio_cancel_queued)) panic("new job was cancelled"); From owner-svn-src-all@freebsd.org Fri Jun 28 20:28:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D378415CABEB; Fri, 28 Jun 2019 20:28:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79E0C86F31; Fri, 28 Jun 2019 20:28:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 670394063; Fri, 28 Jun 2019 20:28:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SKSLus095894; Fri, 28 Jun 2019 20:28:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SKSL8p095893; Fri, 28 Jun 2019 20:28:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906282028.x5SKSL8p095893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 28 Jun 2019 20:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349518 - in stable: 11/release 12/release X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release 12/release X-SVN-Commit-Revision: 349518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79E0C86F31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 20:28:22 -0000 Author: gjb Date: Fri Jun 28 20:28:20 2019 New Revision: 349518 URL: https://svnweb.freebsd.org/changeset/base/349518 Log: MFC r349372: Include files containing metadata specific to the branch in the directory where the individual distribution sets exist. The new metadata files include the build date, svn branch, and revision of the build. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/release/Makefile.mirrors Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/release/Makefile.mirrors Directory Properties: stable/12/ (props changed) Modified: stable/11/release/Makefile.mirrors ============================================================================== --- stable/11/release/Makefile.mirrors Fri Jun 28 19:57:42 2019 (r349517) +++ stable/11/release/Makefile.mirrors Fri Jun 28 20:28:20 2019 (r349518) @@ -19,6 +19,7 @@ FTPDIR?= ${RELEASEDIR}/ftp-stage .if exists(${RELEASEDIR}) STAGE_TARGETS?= iso-images-stage .endif +SRCBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} .if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) . if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != "" @@ -202,6 +203,9 @@ iso-images-stage: .if exists(${RELEASEDIR}/ftp) mkdir -p ${FTP_DIR} cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} + echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE + echo ${SRCBRANCH} > ${FTP_DIR}/SRCBRANCH + echo r${SVNREVISION} > ${FTP_DIR}/REVISION cd ${TLD}/${TARGET} && \ ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ ${REVISION}-${BRANCH} From owner-svn-src-all@freebsd.org Fri Jun 28 20:28:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C94415CABF4; Fri, 28 Jun 2019 20:28:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D841786F33; Fri, 28 Jun 2019 20:28:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B17204064; Fri, 28 Jun 2019 20:28:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SKSLpT095900; Fri, 28 Jun 2019 20:28:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SKSL7N095899; Fri, 28 Jun 2019 20:28:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906282028.x5SKSL7N095899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 28 Jun 2019 20:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349518 - in stable: 11/release 12/release X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release 12/release X-SVN-Commit-Revision: 349518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D841786F33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 20:28:22 -0000 Author: gjb Date: Fri Jun 28 20:28:20 2019 New Revision: 349518 URL: https://svnweb.freebsd.org/changeset/base/349518 Log: MFC r349372: Include files containing metadata specific to the branch in the directory where the individual distribution sets exist. The new metadata files include the build date, svn branch, and revision of the build. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/12/release/Makefile.mirrors Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/Makefile.mirrors Directory Properties: stable/11/ (props changed) Modified: stable/12/release/Makefile.mirrors ============================================================================== --- stable/12/release/Makefile.mirrors Fri Jun 28 19:57:42 2019 (r349517) +++ stable/12/release/Makefile.mirrors Fri Jun 28 20:28:20 2019 (r349518) @@ -19,6 +19,7 @@ FTPDIR?= ${RELEASEDIR}/ftp-stage .if exists(${RELEASEDIR}) STAGE_TARGETS?= iso-images-stage .endif +SRCBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} .if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) . if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != "" @@ -185,6 +186,9 @@ iso-images-stage: .if exists(${RELEASEDIR}/ftp) mkdir -p ${FTP_DIR} cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} + echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE + echo ${SRCBRANCH} > ${FTP_DIR}/SRCBRANCH + echo r${SVNREVISION} > ${FTP_DIR}/REVISION cd ${TLD}/${TARGET} && \ ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ ${REVISION}-${BRANCH} From owner-svn-src-all@freebsd.org Fri Jun 28 20:40:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 329A615CB448; Fri, 28 Jun 2019 20:40:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC756877CB; Fri, 28 Jun 2019 20:40:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8672424D; Fri, 28 Jun 2019 20:40:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SKeslD003491; Fri, 28 Jun 2019 20:40:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SKes90003490; Fri, 28 Jun 2019 20:40:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906282040.x5SKes90003490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 28 Jun 2019 20:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349519 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC756877CB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 20:40:55 -0000 Author: kib Date: Fri Jun 28 20:40:54 2019 New Revision: 349519 URL: https://svnweb.freebsd.org/changeset/base/349519 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Fri Jun 28 20:28:20 2019 (r349518) +++ head/sys/kern/kern_umtx.c Fri Jun 28 20:40:54 2019 (r349519) @@ -2624,7 +2624,8 @@ do_cv_broadcast(struct thread *td, struct ucond *cv) } static int -do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, struct _umtx_time *timeout) +do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, + struct _umtx_time *timeout) { struct abs_timeout timo; struct umtx_q *uq; From owner-svn-src-all@freebsd.org Fri Jun 28 22:12:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBEC315CD533; Fri, 28 Jun 2019 22:12:44 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8E38AD11; Fri, 28 Jun 2019 22:12:44 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 468F953B3; Fri, 28 Jun 2019 22:12:44 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMCixo054512; Fri, 28 Jun 2019 22:12:44 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMChwt054510; Fri, 28 Jun 2019 22:12:43 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201906282212.x5SMChwt054510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 28 Jun 2019 22:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349520 - in head: sbin/etherswitchcfg sys/dev/etherswitch X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: in head: sbin/etherswitchcfg sys/dev/etherswitch X-SVN-Commit-Revision: 349520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C8E38AD11 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:12:45 -0000 Author: loos Date: Fri Jun 28 22:12:43 2019 New Revision: 349520 URL: https://svnweb.freebsd.org/changeset/base/349520 Log: Add the 'drop tagged' flag support for ethernet switch ports. This is intended to drop all 802.1q tagged packets on a port. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 head/sbin/etherswitchcfg/etherswitchcfg.c head/sys/dev/etherswitch/etherswitch.h Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.8 Fri Jun 28 20:40:54 2019 (r349519) +++ head/sbin/etherswitchcfg/etherswitchcfg.8 Fri Jun 28 22:12:43 2019 (r349520) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2016 +.Dd June 28, 2019 .Dt ETHERSWITCHCFG 8 .Os .Sh NAME @@ -147,6 +147,10 @@ MAC addresses. Disable the first lock option. Note that sometimes you need to reset the switch to really disable this option. +.It Cm droptagged +Drop packets with a VLAN tag. +.It Fl droptagged +Disable the drop tagged packets option. .It Cm dropuntagged Drop packets without a VLAN tag. .It Fl dropuntagged Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Fri Jun 28 20:40:54 2019 (r349519) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Fri Jun 28 22:12:43 2019 (r349520) @@ -215,6 +215,8 @@ set_port_flag(struct cfg *cfg, int argc, char *argv[]) f = ETHERSWITCH_PORT_ADDTAG; else if (strcasecmp(flag, "firstlock") == 0) f = ETHERSWITCH_PORT_FIRSTLOCK; + else if (strcasecmp(flag, "droptagged") == 0) + f = ETHERSWITCH_PORT_DROPTAGGED; else if (strcasecmp(flag, "dropuntagged") == 0) f = ETHERSWITCH_PORT_DROPUNTAGGED; else if (strcasecmp(flag, "doubletag") == 0) @@ -871,6 +873,8 @@ static struct cmds cmds[] = { { MODE_PORT, "-doubletag", 0, set_port_flag }, { MODE_PORT, "firstlock", 0, set_port_flag }, { MODE_PORT, "-firstlock", 0, set_port_flag }, + { MODE_PORT, "droptagged", 0, set_port_flag }, + { MODE_PORT, "-droptagged", 0, set_port_flag }, { MODE_PORT, "dropuntagged", 0, set_port_flag }, { MODE_PORT, "-dropuntagged", 0, set_port_flag }, { MODE_CONFIG, "vlan_mode", 1, set_vlan_mode }, Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Fri Jun 28 20:40:54 2019 (r349519) +++ head/sys/dev/etherswitch/etherswitch.h Fri Jun 28 22:12:43 2019 (r349520) @@ -64,8 +64,10 @@ typedef struct etherswitch_conf etherswitch_conf_t; #define ETHERSWITCH_PORT_DROPUNTAGGED (1 << 4) #define ETHERSWITCH_PORT_DOUBLE_TAG (1 << 5) #define ETHERSWITCH_PORT_INGRESS (1 << 6) +#define ETHERSWITCH_PORT_DROPTAGGED (1 << 7) #define ETHERSWITCH_PORT_FLAGS_BITS \ -"\020\1CPUPORT\2STRIPTAG\3ADDTAG\4FIRSTLOCK\5DROPUNTAGGED\6QinQ\7INGRESS" +"\020\1CPUPORT\2STRIPTAG\3ADDTAG\4FIRSTLOCK\5DROPUNTAGGED\6QinQ\7INGRESS" \ +"\10DROPTAGGED" #define ETHERSWITCH_PORT_MAX_LEDS 3 From owner-svn-src-all@freebsd.org Fri Jun 28 22:19:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4E9615CD638; Fri, 28 Jun 2019 22:19:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81A928AED3; Fri, 28 Jun 2019 22:19:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5741253BA; Fri, 28 Jun 2019 22:19:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMJpuS054827; Fri, 28 Jun 2019 22:19:51 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMJpfg054825; Fri, 28 Jun 2019 22:19:51 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201906282219.x5SMJpfg054825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 28 Jun 2019 22:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349521 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/dev/etherswitch/e6000sw X-SVN-Commit-Revision: 349521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 81A928AED3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:19:52 -0000 Author: loos Date: Fri Jun 28 22:19:50 2019 New Revision: 349521 URL: https://svnweb.freebsd.org/changeset/base/349521 Log: Add the 802.1q support for the Marvell e6000 series of ethernet switches. Tested on: espressobin, Clearfog, SG-3100 and others Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/etherswitch/e6000sw/e6000swreg.h Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Fri Jun 28 22:12:43 2019 (r349520) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Fri Jun 28 22:19:50 2019 (r349521) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2015 Semihalf * Copyright (c) 2015 Stormshield + * Copyright (c) 2018-2019, Rubicon Communications, LLC (Netgate) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,7 +61,16 @@ MALLOC_DEFINE(M_E6000SW, "e6000sw", "e6000sw switch"); #define E6000SW_UNLOCK(_sc) sx_unlock(&(_sc)->sx) #define E6000SW_LOCK_ASSERT(_sc, _what) sx_assert(&(_sc)->sx, (_what)) #define E6000SW_TRYLOCK(_sc) sx_tryxlock(&(_sc)->sx) +#define E6000SW_WAITREADY(_sc, _reg, _bit) \ + e6000sw_waitready((_sc), REG_GLOBAL, (_reg), (_bit)) +#define E6000SW_WAITREADY2(_sc, _reg, _bit) \ + e6000sw_waitready((_sc), REG_GLOBAL2, (_reg), (_bit)) +#define MDIO_READ(dev, addr, reg) \ + MDIO_READREG(device_get_parent(dev), (addr), (reg)) +#define MDIO_WRITE(dev, addr, reg, val) \ + MDIO_WRITEREG(device_get_parent(dev), (addr), (reg), (val)) + typedef struct e6000sw_softc { device_t dev; phandle_t node; @@ -71,6 +81,7 @@ typedef struct e6000sw_softc { device_t miibus[E6000SW_MAX_PORTS]; struct proc *kproc; + int vlans[E6000SW_NUM_VLANS]; uint32_t swid; uint32_t vlan_mode; uint32_t cpuports_mask; @@ -80,13 +91,12 @@ typedef struct e6000sw_softc { int phy_base; int sw_addr; int num_ports; - boolean_t multi_chip; } e6000sw_softc_t; static etherswitch_info_t etherswitch_info = { .es_nports = 0, .es_nvlangroups = 0, - .es_vlan_caps = ETHERSWITCH_VLAN_PORT, + .es_vlan_caps = ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOT1Q, .es_name = "Marvell 6000 series switch" }; @@ -100,10 +110,12 @@ static int e6000sw_readphy(device_t, int, int); static int e6000sw_writephy(device_t, int, int, int); static etherswitch_info_t* e6000sw_getinfo(device_t); static int e6000sw_getconf(device_t, etherswitch_conf_t *); +static int e6000sw_setconf(device_t, etherswitch_conf_t *); static void e6000sw_lock(device_t); static void e6000sw_unlock(device_t); static int e6000sw_getport(device_t, etherswitch_port_t *); static int e6000sw_setport(device_t, etherswitch_port_t *); +static int e6000sw_set_vlan_mode(e6000sw_softc_t *, uint32_t); static int e6000sw_readreg_wrapper(device_t, int); static int e6000sw_writereg_wrapper(device_t, int, int); static int e6000sw_readphy_wrapper(device_t, int, int); @@ -113,10 +125,11 @@ static int e6000sw_setvgroup_wrapper(device_t, ethersw static int e6000sw_setvgroup(device_t, etherswitch_vlangroup_t *); static int e6000sw_getvgroup(device_t, etherswitch_vlangroup_t *); static void e6000sw_setup(device_t, e6000sw_softc_t *); -static void e6000sw_port_vlan_conf(e6000sw_softc_t *); static void e6000sw_tick(void *); static void e6000sw_set_atustat(device_t, e6000sw_softc_t *, int, int); static int e6000sw_atu_flush(device_t, e6000sw_softc_t *, int); +static int e6000sw_vtu_flush(e6000sw_softc_t *); +static int e6000sw_vtu_update(e6000sw_softc_t *, int, int, int, int, int); static __inline void e6000sw_writereg(e6000sw_softc_t *, int, int, int); static __inline uint32_t e6000sw_readreg(e6000sw_softc_t *, int, int); static int e6000sw_ifmedia_upd(struct ifnet *); @@ -124,7 +137,7 @@ static void e6000sw_ifmedia_sts(struct ifnet *, struct static int e6000sw_atu_mac_table(device_t, e6000sw_softc_t *, struct atu_opt *, int); static int e6000sw_get_pvid(e6000sw_softc_t *, int, int *); -static int e6000sw_set_pvid(e6000sw_softc_t *, int, int); +static void e6000sw_set_pvid(e6000sw_softc_t *, int, int); static __inline bool e6000sw_is_cpuport(e6000sw_softc_t *, int); static __inline bool e6000sw_is_fixedport(e6000sw_softc_t *, int); static __inline bool e6000sw_is_fixed25port(e6000sw_softc_t *, int); @@ -150,6 +163,7 @@ static device_method_t e6000sw_methods[] = { /* etherswitch interface */ DEVMETHOD(etherswitch_getinfo, e6000sw_getinfo), DEVMETHOD(etherswitch_getconf, e6000sw_getconf), + DEVMETHOD(etherswitch_setconf, e6000sw_setconf), DEVMETHOD(etherswitch_lock, e6000sw_lock), DEVMETHOD(etherswitch_unlock, e6000sw_unlock), DEVMETHOD(etherswitch_getport, e6000sw_getport), @@ -175,17 +189,7 @@ DRIVER_MODULE(etherswitch, e6000sw, etherswitch_driver DRIVER_MODULE(miibus, e6000sw, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(e6000sw, mdio, 1, 1, 1); -#define SMI_CMD 0 -#define SMI_CMD_BUSY (1 << 15) -#define SMI_CMD_OP_READ ((2 << 10) | SMI_CMD_BUSY | (1 << 12)) -#define SMI_CMD_OP_WRITE ((1 << 10) | SMI_CMD_BUSY | (1 << 12)) -#define SMI_DATA 1 -#define MDIO_READ(dev, addr, reg) \ - MDIO_READREG(device_get_parent(dev), (addr), (reg)) -#define MDIO_WRITE(dev, addr, reg, val) \ - MDIO_WRITEREG(device_get_parent(dev), (addr), (reg), (val)) - static void e6000sw_identify(driver_t *driver, device_t parent) { @@ -217,16 +221,10 @@ e6000sw_probe(device_t dev) if (OF_getencprop(sc->node, "reg", &sc->sw_addr, sizeof(sc->sw_addr)) < 0) return (ENXIO); + if (sc->sw_addr < 0 || sc->sw_addr > 32) + return (ENXIO); /* - * According to the Linux source code, all of the Switch IDs we support - * are multi_chip capable, and should go into multi-chip mode if the - * sw_addr != 0. - */ - if (!OF_hasprop(sc->node, "single-chip-addressing") && sc->sw_addr != 0) - sc->multi_chip = true; - - /* * Create temporary lock, just to satisfy assertions, * when obtaining the switch ID. Destroy immediately afterwards. */ @@ -396,8 +394,14 @@ e6000sw_attach(device_t dev) err = 0; sc = device_get_softc(dev); - if (sc->multi_chip) - device_printf(dev, "multi-chip addressing mode\n"); + /* + * According to the Linux source code, all of the Switch IDs we support + * are multi_chip capable, and should go into multi-chip mode if the + * sw_addr != 0. + */ + if (MVSWITCH_MULTICHIP(sc)) + device_printf(dev, "multi-chip addressing mode (%#x)\n", + sc->sw_addr); else device_printf(dev, "single-chip addressing mode\n"); @@ -470,7 +474,11 @@ e6000sw_attach(device_t dev) etherswitch_info.es_nports = sc->num_ports; /* Default to port vlan. */ - e6000sw_port_vlan_conf(sc); + e6000sw_set_vlan_mode(sc, ETHERSWITCH_VLAN_PORT); + + reg = e6000sw_readreg(sc, REG_GLOBAL, SWITCH_GLOBAL_STATUS); + if (reg & SWITCH_GLOBAL_STATUS_IR) + device_printf(dev, "switch is ready.\n"); E6000SW_UNLOCK(sc); bus_generic_probe(dev); @@ -487,21 +495,19 @@ out_fail: return (err); } -static __inline int -e6000sw_poll_done(e6000sw_softc_t *sc) +static int +e6000sw_waitready(e6000sw_softc_t *sc, uint32_t phy, uint32_t reg, + uint32_t busybit) { int i; - for (i = 0; i < E6000SW_SMI_TIMEOUT; i++) { - - if ((e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG) & - (1 << PHY_CMD_SMI_BUSY)) == 0) + for (i = 0; i < E6000SW_RETRIES; i++) { + if ((e6000sw_readreg(sc, phy, reg) & busybit) == 0) return (0); - - pause("e6000sw PHY poll", hz/1000); + DELAY(1); } - return (ETIMEDOUT); + return (1); } /* @@ -513,7 +519,6 @@ e6000sw_readphy(device_t dev, int phy, int reg) { e6000sw_softc_t *sc; uint32_t val; - int err; sc = device_get_softc(dev); if (!e6000sw_is_phyport(sc, phy) || reg >= E6000SW_NUM_PHY_REGS) { @@ -522,24 +527,17 @@ e6000sw_readphy(device_t dev, int phy, int reg) } E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); - - err = e6000sw_poll_done(sc); - if (err != 0) { + if (E6000SW_WAITREADY2(sc, SMI_PHY_CMD_REG, SMI_CMD_BUSY)) { device_printf(dev, "Timeout while waiting for switch\n"); - return (err); + return (ETIMEDOUT); } - val = 1 << PHY_CMD_SMI_BUSY; - val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE; - val |= PHY_CMD_OPCODE_READ << PHY_CMD_OPCODE; - val |= (reg << PHY_CMD_REG_ADDR) & PHY_CMD_REG_ADDR_MASK; - val |= (phy << PHY_CMD_DEV_ADDR) & PHY_CMD_DEV_ADDR_MASK; - e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, val); - - err = e6000sw_poll_done(sc); - if (err != 0) { + e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, + SMI_CMD_OP_C22_READ | (reg & SMI_CMD_REG_ADDR_MASK) | + ((phy << SMI_CMD_DEV_ADDR) & SMI_CMD_DEV_ADDR_MASK)); + if (E6000SW_WAITREADY2(sc, SMI_PHY_CMD_REG, SMI_CMD_BUSY)) { device_printf(dev, "Timeout while waiting for switch\n"); - return (err); + return (ETIMEDOUT); } val = e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG); @@ -551,8 +549,6 @@ static int e6000sw_writephy(device_t dev, int phy, int reg, int data) { e6000sw_softc_t *sc; - uint32_t val; - int err; sc = device_get_softc(dev); if (!e6000sw_is_phyport(sc, phy) || reg >= E6000SW_NUM_PHY_REGS) { @@ -561,27 +557,18 @@ e6000sw_writephy(device_t dev, int phy, int reg, int d } E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); - - err = e6000sw_poll_done(sc); - if (err != 0) { + if (E6000SW_WAITREADY2(sc, SMI_PHY_CMD_REG, SMI_CMD_BUSY)) { device_printf(dev, "Timeout while waiting for switch\n"); - return (err); + return (ETIMEDOUT); } - val = 1 << PHY_CMD_SMI_BUSY; - val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE; - val |= PHY_CMD_OPCODE_WRITE << PHY_CMD_OPCODE; - val |= (reg << PHY_CMD_REG_ADDR) & PHY_CMD_REG_ADDR_MASK; - val |= (phy << PHY_CMD_DEV_ADDR) & PHY_CMD_DEV_ADDR_MASK; e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG, data & PHY_DATA_MASK); - e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, val); + e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, + SMI_CMD_OP_C22_WRITE | (reg & SMI_CMD_REG_ADDR_MASK) | + ((phy << SMI_CMD_DEV_ADDR) & SMI_CMD_DEV_ADDR_MASK)); - err = e6000sw_poll_done(sc); - if (err != 0) - device_printf(dev, "Timeout while waiting for switch\n"); - - return (err); + return (0); } static int @@ -625,6 +612,22 @@ e6000sw_getconf(device_t dev, etherswitch_conf_t *conf return (0); } +static int +e6000sw_setconf(device_t dev, etherswitch_conf_t *conf) +{ + struct e6000sw_softc *sc; + + /* Set the VLAN mode. */ + sc = device_get_softc(dev); + if (conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) { + E6000SW_LOCK(sc); + e6000sw_set_vlan_mode(sc, conf->vlan_mode); + E6000SW_UNLOCK(sc); + } + + return (0); +} + static void e6000sw_lock(device_t dev) { @@ -653,6 +656,7 @@ e6000sw_getport(device_t dev, etherswitch_port_t *p) struct mii_data *mii; int err; struct ifmediareq *ifmr; + uint32_t reg; e6000sw_softc_t *sc = device_get_softc(dev); E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); @@ -662,10 +666,17 @@ e6000sw_getport(device_t dev, etherswitch_port_t *p) if (!e6000sw_is_portenabled(sc, p->es_port)) return (0); - err = 0; E6000SW_LOCK(sc); e6000sw_get_pvid(sc, p->es_port, &p->es_pvid); + /* Port flags. */ + reg = e6000sw_readreg(sc, REG_PORT(p->es_port), PORT_CONTROL2); + if (reg & PORT_CONTROL2_DISC_TAGGED) + p->es_flags |= ETHERSWITCH_PORT_DROPTAGGED; + if (reg & PORT_CONTROL2_DISC_UNTAGGED) + p->es_flags |= ETHERSWITCH_PORT_DROPUNTAGGED; + + err = 0; if (e6000sw_is_fixedport(sc, p->es_port)) { if (e6000sw_is_cpuport(sc, p->es_port)) p->es_flags |= ETHERSWITCH_PORT_CPU; @@ -695,6 +706,7 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) e6000sw_softc_t *sc; int err; struct mii_data *mii; + uint32_t reg; sc = device_get_softc(dev); E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); @@ -704,6 +716,18 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) if (!e6000sw_is_portenabled(sc, p->es_port)) return (0); + /* Port flags. */ + reg = e6000sw_readreg(sc, REG_PORT(p->es_port), PORT_CONTROL2); + if (p->es_flags & ETHERSWITCH_PORT_DROPTAGGED) + reg |= PORT_CONTROL2_DISC_TAGGED; + else + reg &= ~PORT_CONTROL2_DISC_TAGGED; + if (p->es_flags & ETHERSWITCH_PORT_DROPUNTAGGED) + reg |= PORT_CONTROL2_DISC_UNTAGGED; + else + reg &= ~PORT_CONTROL2_DISC_UNTAGGED; + e6000sw_writereg(sc, REG_PORT(p->es_port), PORT_CONTROL2, reg); + err = 0; E6000SW_LOCK(sc); if (p->es_pvid != 0) @@ -718,6 +742,128 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p) return (err); } +static __inline void +e6000sw_port_vlan_assign(e6000sw_softc_t *sc, int port, uint32_t fid, + uint32_t members) +{ + uint32_t reg; + + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); + reg &= ~(PORT_MASK(sc) | PORT_VLAN_MAP_FID_MASK); + reg |= members & PORT_MASK(sc) & ~(1 << port); + reg |= (fid << PORT_VLAN_MAP_FID) & PORT_VLAN_MAP_FID_MASK; + e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, reg); + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL1); + reg &= ~PORT_CONTROL1_FID_MASK; + reg |= (fid >> 4) & PORT_CONTROL1_FID_MASK; + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL1, reg); +} + +static int +e6000sw_init_vlan(struct e6000sw_softc *sc) +{ + int i, port, ret; + uint32_t members; + + /* Disable all ports */ + for (port = 0; port < sc->num_ports; port++) { + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, + (ret & ~PORT_CONTROL_ENABLE)); + } + + /* Flush VTU. */ + e6000sw_vtu_flush(sc); + + for (port = 0; port < sc->num_ports; port++) { + /* Reset the egress and frame mode. */ + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); + ret &= ~(PORT_CONTROL_EGRESS | PORT_CONTROL_FRAME); + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, ret); + + /* Set the the 802.1q mode. */ + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL2); + ret &= ~PORT_CONTROL2_DOT1Q; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) + ret |= PORT_CONTROL2_DOT1Q; + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL2, ret); + } + + for (port = 0; port < sc->num_ports; port++) { + if (!e6000sw_is_portenabled(sc, port)) + continue; + + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); + + /* Set port priority */ + ret &= ~PORT_VID_PRIORITY_MASK; + + /* Set VID map */ + ret &= ~PORT_VID_DEF_VID_MASK; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) + ret |= 1; + else + ret |= (port + 1); + e6000sw_writereg(sc, REG_PORT(port), PORT_VID, ret); + } + + /* Assign the member ports to each origin port. */ + for (port = 0; port < sc->num_ports; port++) { + members = 0; + if (e6000sw_is_portenabled(sc, port)) { + for (i = 0; i < sc->num_ports; i++) { + if (i == port || !e6000sw_is_portenabled(sc, i)) + continue; + members |= (1 << i); + } + } + /* Default to FID 0. */ + e6000sw_port_vlan_assign(sc, port, 0, members); + } + + /* Reset internal VLAN table. */ + for (i = 0; i < nitems(sc->vlans); i++) + sc->vlans[i] = 0; + + /* Create default VLAN (1). */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + sc->vlans[0] = 1; + e6000sw_vtu_update(sc, 0, sc->vlans[0], 1, 0, sc->ports_mask); + } + + /* Enable all ports */ + for (port = 0; port < sc->num_ports; port++) { + if (!e6000sw_is_portenabled(sc, port)) + continue; + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, + (ret | PORT_CONTROL_ENABLE)); + } + + return (0); +} + +static int +e6000sw_set_vlan_mode(struct e6000sw_softc *sc, uint32_t mode) +{ + + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + switch (mode) { + case ETHERSWITCH_VLAN_PORT: + sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + etherswitch_info.es_nvlangroups = sc->num_ports; + return (e6000sw_init_vlan(sc)); + break; + case ETHERSWITCH_VLAN_DOT1Q: + sc->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + etherswitch_info.es_nvlangroups = E6000SW_NUM_VLANS; + return (e6000sw_init_vlan(sc)); + break; + default: + return (EINVAL); + } +} + /* * Registers in this switch are divided into sections, specified in * documentation. So as to access any of them, section index and reg index @@ -825,24 +971,6 @@ e6000sw_getvgroup_wrapper(device_t dev, etherswitch_vl return (ret); } -static __inline void -e6000sw_port_vlan_assign(e6000sw_softc_t *sc, int port, uint32_t fid, - uint32_t members) -{ - uint32_t reg; - - reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); - reg &= ~PORT_VLAN_MAP_TABLE_MASK; - reg &= ~PORT_VLAN_MAP_FID_MASK; - reg |= members & PORT_VLAN_MAP_TABLE_MASK & ~(1 << port); - reg |= (fid << PORT_VLAN_MAP_FID) & PORT_VLAN_MAP_FID_MASK; - e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, reg); - reg = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL_1); - reg &= ~PORT_CONTROL_1_FID_MASK; - reg |= (fid >> 4) & PORT_CONTROL_1_FID_MASK; - e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL_1, reg); -} - static int e6000sw_set_port_vlan(e6000sw_softc_t *sc, etherswitch_vlangroup_t *vg) { @@ -857,13 +985,41 @@ e6000sw_set_port_vlan(e6000sw_softc_t *sc, etherswitch return (EINVAL); } - e6000sw_port_vlan_assign(sc, port, port + 1, vg->es_untagged_ports); + e6000sw_port_vlan_assign(sc, port, 0, vg->es_untagged_ports); vg->es_vid = port | ETHERSWITCH_VID_VALID; return (0); } static int +e6000sw_set_dot1q_vlan(e6000sw_softc_t *sc, etherswitch_vlangroup_t *vg) +{ + int i, vlan; + + vlan = vg->es_vid & ETHERSWITCH_VID_MASK; + + /* Set VLAN to '0' removes it from table. */ + if (vlan == 0) { + e6000sw_vtu_update(sc, VTU_PURGE, + sc->vlans[vg->es_vlangroup], 0, 0, 0); + sc->vlans[vg->es_vlangroup] = 0; + return (0); + } + + /* Is this VLAN already in table ? */ + for (i = 0; i < etherswitch_info.es_nvlangroups; i++) + if (i != vg->es_vlangroup && vlan == sc->vlans[i]) + return (EINVAL); + + sc->vlans[vg->es_vlangroup] = vlan; + e6000sw_vtu_update(sc, 0, vlan, vg->es_vlangroup + 1, + vg->es_member_ports & sc->ports_mask, + vg->es_untagged_ports & sc->ports_mask); + + return (0); +} + +static int e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) { e6000sw_softc_t *sc; @@ -873,6 +1029,8 @@ e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_ if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) return (e6000sw_set_port_vlan(sc, vg)); + else if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) + return (e6000sw_set_dot1q_vlan(sc, vg)); return (EINVAL); } @@ -892,17 +1050,66 @@ e6000sw_get_port_vlan(e6000sw_softc_t *sc, etherswitch } reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); - vg->es_untagged_ports = vg->es_member_ports = - reg & PORT_VLAN_MAP_TABLE_MASK; + vg->es_untagged_ports = vg->es_member_ports = reg & PORT_MASK(sc); vg->es_vid = port | ETHERSWITCH_VID_VALID; vg->es_fid = (reg & PORT_VLAN_MAP_FID_MASK) >> PORT_VLAN_MAP_FID; - reg = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL_1); - vg->es_fid |= (reg & PORT_CONTROL_1_FID_MASK) << 4; + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL1); + vg->es_fid |= (reg & PORT_CONTROL1_FID_MASK) << 4; return (0); } static int +e6000sw_get_dot1q_vlan(e6000sw_softc_t *sc, etherswitch_vlangroup_t *vg) +{ + int i, port; + uint32_t reg; + + vg->es_fid = 0; + vg->es_vid = sc->vlans[vg->es_vlangroup]; + vg->es_untagged_ports = vg->es_member_ports = 0; + if (vg->es_vid == 0) + return (0); + + if (E6000SW_WAITREADY(sc, VTU_OPERATION, VTU_BUSY)) { + device_printf(sc->dev, "VTU unit is busy, cannot access\n"); + return (EBUSY); + } + + e6000sw_writereg(sc, REG_GLOBAL, VTU_VID, vg->es_vid - 1); + + reg = e6000sw_readreg(sc, REG_GLOBAL, VTU_OPERATION); + reg &= ~VTU_OP_MASK; + reg |= VTU_GET_NEXT | VTU_BUSY; + e6000sw_writereg(sc, REG_GLOBAL, VTU_OPERATION, reg); + if (E6000SW_WAITREADY(sc, VTU_OPERATION, VTU_BUSY)) { + device_printf(sc->dev, "Timeout while reading\n"); + return (EBUSY); + } + + reg = e6000sw_readreg(sc, REG_GLOBAL, VTU_VID); + if (reg == VTU_VID_MASK || (reg & VTU_VID_VALID) == 0) + return (EINVAL); + if ((reg & VTU_VID_MASK) != vg->es_vid) + return (EINVAL); + + vg->es_vid |= ETHERSWITCH_VID_VALID; + reg = e6000sw_readreg(sc, REG_GLOBAL, VTU_DATA); + for (i = 0; i < sc->num_ports; i++) { + if (i == VTU_PPREG(sc)) + reg = e6000sw_readreg(sc, REG_GLOBAL, VTU_DATA2); + port = (reg >> VTU_PORT(sc, i)) & VTU_PORT_MASK; + if (port == VTU_PORT_UNTAGGED) { + vg->es_untagged_ports |= (1 << i); + vg->es_member_ports |= (1 << i); + } else if (port == VTU_PORT_TAGGED) + vg->es_member_ports |= (1 << i); + } + + return (0); +} + +static int e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) { e6000sw_softc_t *sc; @@ -912,6 +1119,8 @@ e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_ if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) return (e6000sw_get_port_vlan(sc, vg)); + else if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) + return (e6000sw_get_dot1q_vlan(sc, vg)); return (EINVAL); } @@ -978,7 +1187,7 @@ e6000sw_readreg(e6000sw_softc_t *sc, int addr, int reg E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); - if (!sc->multi_chip) + if (!MVSWITCH_MULTICHIP(sc)) return (MDIO_READ(sc->dev, addr, reg) & 0xffff); if (e6000sw_smi_waitready(sc, sc->sw_addr)) { @@ -986,7 +1195,8 @@ e6000sw_readreg(e6000sw_softc_t *sc, int addr, int reg return (0xffff); } MDIO_WRITE(sc->dev, sc->sw_addr, SMI_CMD, - SMI_CMD_OP_READ | (addr << 5) | reg); + SMI_CMD_OP_C22_READ | (reg & SMI_CMD_REG_ADDR_MASK) | + ((addr << SMI_CMD_DEV_ADDR) & SMI_CMD_DEV_ADDR_MASK)); if (e6000sw_smi_waitready(sc, sc->sw_addr)) { printf("e6000sw: readreg timeout\n"); return (0xffff); @@ -1001,7 +1211,7 @@ e6000sw_writereg(e6000sw_softc_t *sc, int addr, int re E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); - if (!sc->multi_chip) { + if (!MVSWITCH_MULTICHIP(sc)) { MDIO_WRITE(sc->dev, addr, reg, val); return; } @@ -1012,11 +1222,8 @@ e6000sw_writereg(e6000sw_softc_t *sc, int addr, int re } MDIO_WRITE(sc->dev, sc->sw_addr, SMI_DATA, val); MDIO_WRITE(sc->dev, sc->sw_addr, SMI_CMD, - SMI_CMD_OP_WRITE | (addr << 5) | reg); - if (e6000sw_smi_waitready(sc, sc->sw_addr)) { - printf("e6000sw: readreg timeout\n"); - return; - } + SMI_CMD_OP_C22_WRITE | (reg & SMI_CMD_REG_ADDR_MASK) | + ((addr << SMI_CMD_DEV_ADDR) & SMI_CMD_DEV_ADDR_MASK)); } static __inline bool @@ -1056,14 +1263,15 @@ e6000sw_is_portenabled(e6000sw_softc_t *sc, int port) return ((sc->ports_mask & (1 << port)) ? true : false); } -static __inline int +static __inline void e6000sw_set_pvid(e6000sw_softc_t *sc, int port, int pvid) { + uint32_t reg; - e6000sw_writereg(sc, REG_PORT(port), PORT_VID, pvid & - PORT_VID_DEF_VID_MASK); - - return (0); + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); + reg &= ~PORT_VID_DEF_VID_MASK; + reg |= (pvid & PORT_VID_DEF_VID_MASK); + e6000sw_writereg(sc, REG_PORT(port), PORT_VID, reg); } static __inline int @@ -1114,7 +1322,7 @@ e6000sw_update_ifmedia(uint16_t portstatus, u_int *med } static void -e6000sw_tick (void *arg) +e6000sw_tick(void *arg) { e6000sw_softc_t *sc; struct mii_data *mii; @@ -1159,12 +1367,13 @@ e6000sw_tick (void *arg) static void e6000sw_setup(device_t dev, e6000sw_softc_t *sc) { - uint16_t atu_ctrl, atu_age; + uint32_t atu_ctrl; - /* Set aging time */ - e6000sw_writereg(sc, REG_GLOBAL, ATU_CONTROL, - (E6000SW_DEFAULT_AGETIME << ATU_CONTROL_AGETIME) | - (1 << ATU_CONTROL_LEARN2ALL)); + /* Set aging time. */ + atu_ctrl = e6000sw_readreg(sc, REG_GLOBAL, ATU_CONTROL); + atu_ctrl &= ~ATU_CONTROL_AGETIME_MASK; + atu_ctrl |= E6000SW_DEFAULT_AGETIME << ATU_CONTROL_AGETIME; + e6000sw_writereg(sc, REG_GLOBAL, ATU_CONTROL, atu_ctrl); /* Send all with specific mac address to cpu port */ e6000sw_writereg(sc, REG_GLOBAL2, MGMT_EN_2x, MGMT_EN_ALL); @@ -1183,76 +1392,9 @@ e6000sw_setup(device_t dev, e6000sw_softc_t *sc) e6000sw_atu_flush(dev, sc, NO_OPERATION); e6000sw_atu_mac_table(dev, sc, NULL, NO_OPERATION); e6000sw_set_atustat(dev, sc, 0, COUNT_ALL); - - /* Set ATU AgeTime to 15 seconds */ - atu_age = 1; - - atu_ctrl = e6000sw_readreg(sc, REG_GLOBAL, ATU_CONTROL); - - /* Set new AgeTime field */ - atu_ctrl &= ~ATU_CONTROL_AGETIME_MASK; - e6000sw_writereg(sc, REG_GLOBAL, ATU_CONTROL, atu_ctrl | - (atu_age << ATU_CONTROL_AGETIME)); } static void -e6000sw_port_vlan_conf(e6000sw_softc_t *sc) -{ - int i, port, ret; - uint32_t members; - - /* Disable all ports */ - for (port = 0; port < sc->num_ports; port++) { - ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); - e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, - (ret & ~PORT_CONTROL_ENABLE)); - } - - /* Set port priority */ - for (port = 0; port < sc->num_ports; port++) { - if (!e6000sw_is_portenabled(sc, port)) - continue; - ret = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); - ret &= ~PORT_VID_PRIORITY_MASK; - e6000sw_writereg(sc, REG_PORT(port), PORT_VID, ret); - } - - /* Set VID map */ - for (port = 0; port < sc->num_ports; port++) { - if (!e6000sw_is_portenabled(sc, port)) - continue; - ret = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); - ret &= ~PORT_VID_DEF_VID_MASK; - ret |= (port + 1); - e6000sw_writereg(sc, REG_PORT(port), PORT_VID, ret); - } - - /* Enable all ports */ - for (port = 0; port < sc->num_ports; port++) { - if (!e6000sw_is_portenabled(sc, port)) - continue; - ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); - e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, - (ret | PORT_CONTROL_ENABLE)); - } - - /* Set VLAN mode. */ - sc->vlan_mode = ETHERSWITCH_VLAN_PORT; - etherswitch_info.es_nvlangroups = sc->num_ports; - for (port = 0; port < sc->num_ports; port++) { - members = 0; - if (e6000sw_is_portenabled(sc, port)) { - for (i = 0; i < sc->num_ports; i++) { - if (i == port || !e6000sw_is_portenabled(sc, i)) - continue; - members |= (1 << i); - } - } - e6000sw_port_vlan_assign(sc, port, port + 1, members); - } -} - -static void e6000sw_set_atustat(device_t dev, e6000sw_softc_t *sc, int bin, int flag) { uint16_t ret; @@ -1268,7 +1410,6 @@ e6000sw_atu_mac_table(device_t dev, e6000sw_softc_t *s { uint16_t ret_opt; uint16_t ret_data; - int retries; if (flag == NO_OPERATION) return (0); @@ -1278,41 +1419,34 @@ e6000sw_atu_mac_table(device_t dev, e6000sw_softc_t *s return (EINVAL); } - ret_opt = e6000sw_readreg(sc, REG_GLOBAL, ATU_OPERATION); - - if (ret_opt & ATU_UNIT_BUSY) { - device_printf(dev, "ATU unit is busy, cannot access" - "register\n"); + if (E6000SW_WAITREADY(sc, ATU_OPERATION, ATU_UNIT_BUSY)) { + device_printf(dev, "ATU unit is busy, cannot access\n"); return (EBUSY); - } else { - if(flag & LOAD_FROM_FIB) { - ret_data = e6000sw_readreg(sc, REG_GLOBAL, ATU_DATA); - e6000sw_writereg(sc, REG_GLOBAL2, ATU_DATA, (ret_data & - ~ENTRY_STATE)); - } - e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR01, atu->mac_01); - e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR23, atu->mac_23); - e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR45, atu->mac_45); - e6000sw_writereg(sc, REG_GLOBAL, ATU_FID, atu->fid); + } - e6000sw_writereg(sc, REG_GLOBAL, ATU_OPERATION, (ret_opt | - ATU_UNIT_BUSY | flag)); + ret_opt = e6000sw_readreg(sc, REG_GLOBAL, ATU_OPERATION); + if (flag & LOAD_FROM_FIB) { + ret_data = e6000sw_readreg(sc, REG_GLOBAL, ATU_DATA); + e6000sw_writereg(sc, REG_GLOBAL2, ATU_DATA, (ret_data & + ~ENTRY_STATE)); + } + e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR01, atu->mac_01); + e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR23, atu->mac_23); + e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR45, atu->mac_45); + e6000sw_writereg(sc, REG_GLOBAL, ATU_FID, atu->fid); - retries = E6000SW_RETRIES; - while (--retries & (e6000sw_readreg(sc, REG_GLOBAL, - ATU_OPERATION) & ATU_UNIT_BUSY)) - DELAY(1); + e6000sw_writereg(sc, REG_GLOBAL, ATU_OPERATION, + (ret_opt | ATU_UNIT_BUSY | flag)); - if (retries == 0) - device_printf(dev, "Timeout while flushing\n"); - else if (flag & GET_NEXT_IN_FIB) { - atu->mac_01 = e6000sw_readreg(sc, REG_GLOBAL, - ATU_MAC_ADDR01); - atu->mac_23 = e6000sw_readreg(sc, REG_GLOBAL, - ATU_MAC_ADDR23); - atu->mac_45 = e6000sw_readreg(sc, REG_GLOBAL, - ATU_MAC_ADDR45); - } + if (E6000SW_WAITREADY(sc, ATU_OPERATION, ATU_UNIT_BUSY)) + device_printf(dev, "Timeout while waiting ATU\n"); + else if (flag & GET_NEXT_IN_FIB) { + atu->mac_01 = e6000sw_readreg(sc, REG_GLOBAL, + ATU_MAC_ADDR01); + atu->mac_23 = e6000sw_readreg(sc, REG_GLOBAL, + ATU_MAC_ADDR23); + atu->mac_45 = e6000sw_readreg(sc, REG_GLOBAL, + ATU_MAC_ADDR45); } return (0); @@ -1321,26 +1455,85 @@ e6000sw_atu_mac_table(device_t dev, e6000sw_softc_t *s static int e6000sw_atu_flush(device_t dev, e6000sw_softc_t *sc, int flag) { - uint16_t ret; - int retries; + uint32_t reg; if (flag == NO_OPERATION) return (0); - ret = e6000sw_readreg(sc, REG_GLOBAL, ATU_OPERATION); - if (ret & ATU_UNIT_BUSY) { - device_printf(dev, "Atu unit is busy, cannot flush\n"); + if (E6000SW_WAITREADY(sc, ATU_OPERATION, ATU_UNIT_BUSY)) { + device_printf(dev, "ATU unit is busy, cannot access\n"); return (EBUSY); - } else { - e6000sw_writereg(sc, REG_GLOBAL, ATU_OPERATION, (ret | - ATU_UNIT_BUSY | flag)); - retries = E6000SW_RETRIES; - while (--retries & (e6000sw_readreg(sc, REG_GLOBAL, - ATU_OPERATION) & ATU_UNIT_BUSY)) - DELAY(1); + } + reg = e6000sw_readreg(sc, REG_GLOBAL, ATU_OPERATION); + e6000sw_writereg(sc, REG_GLOBAL, ATU_OPERATION, + (reg | ATU_UNIT_BUSY | flag)); + if (E6000SW_WAITREADY(sc, ATU_OPERATION, ATU_UNIT_BUSY)) + device_printf(dev, "Timeout while flushing ATU\n"); - if (retries == 0) - device_printf(dev, "Timeout while flushing\n"); + return (0); +} + +static int +e6000sw_vtu_flush(e6000sw_softc_t *sc) +{ + + if (E6000SW_WAITREADY(sc, VTU_OPERATION, VTU_BUSY)) { + device_printf(sc->dev, "VTU unit is busy, cannot access\n"); + return (EBUSY); + } + + e6000sw_writereg(sc, REG_GLOBAL, VTU_OPERATION, VTU_FLUSH | VTU_BUSY); + if (E6000SW_WAITREADY(sc, VTU_OPERATION, VTU_BUSY)) { + device_printf(sc->dev, "Timeout while flushing VTU\n"); + return (ETIMEDOUT); + } + + return (0); +} + +static int +e6000sw_vtu_update(e6000sw_softc_t *sc, int purge, int vid, int fid, + int members, int untagged) +{ + int i, op; + uint32_t data[2]; + + if (E6000SW_WAITREADY(sc, VTU_OPERATION, VTU_BUSY)) { + device_printf(sc->dev, "VTU unit is busy, cannot access\n"); + return (EBUSY); + } + + *data = (vid & VTU_VID_MASK); + if (purge == 0) + *data |= VTU_VID_VALID; + e6000sw_writereg(sc, REG_GLOBAL, VTU_VID, *data); + + if (purge == 0) { + data[0] = 0; + data[1] = 0; + for (i = 0; i < sc->num_ports; i++) { + if ((untagged & (1 << i)) != 0) + data[i / VTU_PPREG(sc)] |= + VTU_PORT_UNTAGGED << VTU_PORT(sc, i); + else if ((members & (1 << i)) != 0) + data[i / VTU_PPREG(sc)] |= + VTU_PORT_TAGGED << VTU_PORT(sc, i); + else + data[i / VTU_PPREG(sc)] |= + VTU_PORT_DISCARD << VTU_PORT(sc, i); + } + e6000sw_writereg(sc, REG_GLOBAL, VTU_DATA, data[0]); + e6000sw_writereg(sc, REG_GLOBAL, VTU_DATA2, data[1]); + e6000sw_writereg(sc, REG_GLOBAL, VTU_FID, + fid & VTU_FID_MASK(sc)); + op = VTU_LOAD; + } else + op = VTU_PURGE; + + e6000sw_writereg(sc, REG_GLOBAL, VTU_OPERATION, op | VTU_BUSY); + if (E6000SW_WAITREADY(sc, VTU_OPERATION, VTU_BUSY)) { + device_printf(sc->dev, "Timeout while flushing VTU\n"); + return (ETIMEDOUT); } return (0); Modified: head/sys/dev/etherswitch/e6000sw/e6000swreg.h ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000swreg.h Fri Jun 28 22:12:43 2019 (r349520) +++ head/sys/dev/etherswitch/e6000sw/e6000swreg.h Fri Jun 28 22:19:50 2019 (r349521) @@ -29,7 +29,7 @@ */ #ifndef _E6000SWREG_H_ -#define _E6000SWREG_H_ +#define _E6000SWREG_H_ struct atu_opt { uint16_t mac_01; @@ -50,20 +50,21 @@ struct atu_opt { #define MV88E6176 0x1760 #define MVSWITCH(_sc, id) ((_sc)->swid == (id)) +#define MVSWITCH_MULTICHIP(_sc) ((_sc)->sw_addr != 0) /* * Switch Registers */ -#define REG_GLOBAL 0x1b -#define REG_GLOBAL2 0x1c -#define REG_PORT(p) (0x10 + (p)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 28 22:28:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC53E15CD905; Fri, 28 Jun 2019 22:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5C28B3BA; Fri, 28 Jun 2019 22:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 589C85560; Fri, 28 Jun 2019 22:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMSq9l059798; Fri, 28 Jun 2019 22:28:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMSquS059797; Fri, 28 Jun 2019 22:28:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906282228.x5SMSquS059797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Jun 2019 22:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349522 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 349522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D5C28B3BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:28:53 -0000 Author: hselasky Date: Fri Jun 28 22:28:51 2019 New Revision: 349522 URL: https://svnweb.freebsd.org/changeset/base/349522 Log: Need to apply the PCIM_BAR_MEM_BASE mask to the physical memory address before returning it to the user. Some of the least significant bits have special meaning and should be masked away. Discussed with: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Fri Jun 28 22:19:50 2019 (r349521) +++ head/sys/dev/pci/pci_user.c Fri Jun 28 22:28:51 2019 (r349522) @@ -855,6 +855,7 @@ pci_bar_mmap(device_t pcidev, struct pci_bar_mmap *pbm struct thread *td; struct sglist *sg; struct pci_map *pm; + vm_paddr_t membase; vm_paddr_t pbase; vm_size_t plen; vm_offset_t addr; @@ -877,8 +878,9 @@ pci_bar_mmap(device_t pcidev, struct pci_bar_mmap *pbm return (EBUSY); /* XXXKIB enable if _ACTIVATE */ if (!PCI_BAR_MEM(pm->pm_value)) return (EIO); - pbase = trunc_page(pm->pm_value); - plen = round_page(pm->pm_value + ((pci_addr_t)1 << pm->pm_size)) - + membase = pm->pm_value & PCIM_BAR_MEM_BASE; + pbase = trunc_page(membase); + plen = round_page(membase + ((pci_addr_t)1 << pm->pm_size)) - pbase; prot = VM_PROT_READ | (((pbm->pbm_flags & PCIIO_BAR_MMAP_RW) != 0) ? VM_PROT_WRITE : 0); @@ -910,7 +912,7 @@ pci_bar_mmap(device_t pcidev, struct pci_bar_mmap *pbm } pbm->pbm_map_base = (void *)addr; pbm->pbm_map_length = plen; - pbm->pbm_bar_off = pm->pm_value - pbase; + pbm->pbm_bar_off = membase - pbase; pbm->pbm_bar_length = (pci_addr_t)1 << pm->pm_size; out: From owner-svn-src-all@freebsd.org Fri Jun 28 22:31:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD04E15CD9F6; Fri, 28 Jun 2019 22:31:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73BF48B81A; Fri, 28 Jun 2019 22:31:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DEF356D5; Fri, 28 Jun 2019 22:31:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMVu48064617; Fri, 28 Jun 2019 22:31:56 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMVrAH064604; Fri, 28 Jun 2019 22:31:53 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906282231.x5SMVrAH064604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 28 Jun 2019 22:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349523 - in stable/12: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive lib/li... X-SVN-Group: stable-12 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/12: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive lib/libarchive/tests usr.bin/bs... X-SVN-Commit-Revision: 349523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73BF48B81A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:31:57 -0000 Author: mm Date: Fri Jun 28 22:31:53 2019 New Revision: 349523 URL: https://svnweb.freebsd.org/changeset/base/349523 Log: MFC r348993,349135: Sync libarchive with vendor including security fixes r348993: - version bumped to 3.4.0 - check_symlinks_fsobj() without chdir() and fchdir() - bsdtar.1 manpage fixes - patches from OpenBSD to libarchive_fe/passphrase.c r349135: PR #1212: RAR5 reader - window_mask was not updated correctly (OSS-Fuzz 15278) OSS-Fuzz 15120: RAR reader - extend use after free bugfix Added: stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu - copied unchanged from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu - copied unchanged from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu Modified: stable/12/contrib/libarchive/NEWS stable/12/contrib/libarchive/README.md stable/12/contrib/libarchive/libarchive/archive.h stable/12/contrib/libarchive/libarchive/archive_entry.h stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/12/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c stable/12/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/12/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/12/contrib/libarchive/libarchive_fe/line_reader.c stable/12/contrib/libarchive/libarchive_fe/passphrase.c stable/12/contrib/libarchive/tar/bsdtar.1 stable/12/lib/libarchive/config_freebsd.h stable/12/lib/libarchive/tests/Makefile stable/12/usr.bin/bsdcat/Makefile stable/12/usr.bin/cpio/Makefile stable/12/usr.bin/tar/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/libarchive/NEWS ============================================================================== --- stable/12/contrib/libarchive/NEWS Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/NEWS Fri Jun 28 22:31:53 2019 (r349523) @@ -1,3 +1,7 @@ +Jun 11, 2019: libarchive 3.4.0 released + +May 18, 2019: Fixes for reading Android APK and JAR archives + Apr 16, 2019: Support for non-recursive list and extract Apr 14, 2019: New tar option: --exclude-vcs @@ -6,7 +10,7 @@ Mar 27, 2019: Support for file and directory symlinks Mar 12, 2019: Important fixes for storing file attributes and flags -Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 decompression in ZIP files Oct 06, 2018: RAR 5.0 reader Modified: stable/12/contrib/libarchive/README.md ============================================================================== --- stable/12/contrib/libarchive/README.md Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/README.md Fri Jun 28 22:31:53 2019 (r349523) @@ -81,6 +81,7 @@ Currently, the library automatically detects and reads * Binary cpio (big-endian or little-endian) * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives Modified: stable/12/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive.h Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/archive.h Fri Jun 28 22:31:53 2019 (r349523) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.3" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.0" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/12/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_entry.h Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/archive_entry.h Fri Jun 28 22:31:53 2019 (r349523) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c Fri Jun 28 22:31:53 2019 (r349523) @@ -1027,6 +1027,7 @@ archive_read_format_rar_read_data(struct archive_read if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); rar->start_new_table = 1; + rar->ppmd_valid = 0; } break; Modified: stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:31:53 2019 (r349523) @@ -1125,6 +1125,13 @@ static void init_header(struct archive_read* a) { a->archive.archive_format_name = "RAR5"; } +static void init_window_mask(struct rar5* rar) { + if (rar->cstate.window_size) + rar->cstate.window_mask = rar->cstate.window_size - 1; + else + rar->cstate.window_mask = 0; +} + enum HEADER_FLAGS { HFL_EXTRA_DATA = 0x0001, HFL_DATA = 0x0002, @@ -1672,6 +1679,7 @@ static int process_head_file(struct archive_read* a, s /* Values up to 64M should fit into ssize_t on every * architecture. */ rar->cstate.window_size = (ssize_t) window_size; + init_window_mask(rar); rar->file.solid = (compression_info & SOLID) > 0; rar->file.service = 0; @@ -2235,10 +2243,7 @@ static int rar5_read_header(struct archive_read *a, static void init_unpack(struct rar5* rar) { rar->file.calculated_crc32 = 0; - if (rar->cstate.window_size) - rar->cstate.window_mask = rar->cstate.window_size - 1; - else - rar->cstate.window_mask = 0; + init_window_mask(rar); free(rar->cstate.window_buf); free(rar->cstate.filtered_buf); @@ -2851,7 +2856,7 @@ static int do_uncompress_block(struct archive_read* a, * - Values lower than 256 are just bytes. Those codes * can be stored in the output buffer directly. * - * - Code 256 defines a new filter, which is later used to + * - Code 256 defines a new filter, which is later used to * ransform the data block accordingly to the filter type. * The data block needs to be fully uncompressed first. * @@ -3906,7 +3911,7 @@ static int rar5_read_data_skip(struct archive_read *a) /* Turn off "skip mode". */ rar->skip_mode--; - if(ret < 0) { + if(ret < 0 || ret == ARCHIVE_EOF) { /* Propagate any potential error conditions * to the caller. */ return ret; Modified: stable/12/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Fri Jun 28 22:31:53 2019 (r349523) @@ -60,7 +60,7 @@ static int archive_filter_b64encode_write(struct archi const void *, size_t); static int archive_filter_b64encode_close(struct archive_write_filter *); static int archive_filter_b64encode_free(struct archive_write_filter *); -static void b64_encode(struct archive_string *, const unsigned char *, size_t); +static void la_b64_encode(struct archive_string *, const unsigned char *, size_t); static int64_t atol8(const char *, size_t); static const char base64[] = { @@ -180,7 +180,7 @@ archive_filter_b64encode_open(struct archive_write_fil } static void -b64_encode(struct archive_string *as, const unsigned char *p, size_t len) +la_b64_encode(struct archive_string *as, const unsigned char *p, size_t len) { int c; @@ -234,12 +234,12 @@ archive_filter_b64encode_write(struct archive_write_fi } if (state->hold_len < LBYTES) return (ret); - b64_encode(&state->encoded_buff, state->hold, LBYTES); + la_b64_encode(&state->encoded_buff, state->hold, LBYTES); state->hold_len = 0; } for (; length >= LBYTES; length -= LBYTES, p += LBYTES) - b64_encode(&state->encoded_buff, p, LBYTES); + la_b64_encode(&state->encoded_buff, p, LBYTES); /* Save remaining bytes. */ if (length > 0) { @@ -270,7 +270,7 @@ archive_filter_b64encode_close(struct archive_write_fi /* Flush remaining bytes. */ if (state->hold_len != 0) - b64_encode(&state->encoded_buff, state->hold, state->hold_len); + la_b64_encode(&state->encoded_buff, state->hold, state->hold_len); archive_string_sprintf(&state->encoded_buff, "====\n"); /* Write the last block */ archive_write_set_bytes_in_last_block(f->archive, 1); Modified: stable/12/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jun 28 22:31:53 2019 (r349523) @@ -165,6 +165,10 @@ __FBSDID("$FreeBSD$"); #define O_NOFOLLOW 0 #endif +#ifndef AT_FDCWD +#define AT_FDCWD -100 +#endif + struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; @@ -348,6 +352,8 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) + +static int la_opendirat(int, const char *); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -401,6 +407,37 @@ static ssize_t _archive_write_disk_data_block(struct a size_t, int64_t); static int +la_opendirat(int fd, const char *path) { + const int flags = O_CLOEXEC +#if defined(O_BINARY) + | O_BINARY +#endif +#if defined(O_DIRECTORY) + | O_DIRECTORY +#endif +#if defined(O_PATH) + | O_PATH +#elif defined(O_SEARCH) + | O_SEARCH +#elif defined(O_EXEC) + | O_EXEC +#else + | O_RDONLY +#endif + ; + +#if !defined(HAVE_OPENAT) + if (fd != AT_FDCWD) { + errno = ENOTSUP; + return (-1); + } else + return (open(fd, path, flags)); +#else + return (openat(fd, path, flags)); +#endif +} + +static int lazy_stat(struct archive_write_disk *a) { if (a->pst != NULL) { @@ -1909,7 +1946,7 @@ edit_deep_directories(struct archive_write_disk *a) return; /* Try to record our starting dir. */ - a->restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + a->restore_pwd = la_opendirat(AT_FDCWD, "."); __archive_ensure_cloexec_flag(a->restore_pwd); if (a->restore_pwd < 0) return; @@ -2342,7 +2379,7 @@ _archive_write_disk_close(struct archive *_a) { struct archive_write_disk *a = (struct archive_write_disk *)_a; struct fixup_entry *next, *p; - int ret; + int fd, ret; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2353,21 +2390,33 @@ _archive_write_disk_close(struct archive *_a) p = sort_dir_list(a->fixup_list); while (p != NULL) { + fd = -1; a->pst = NULL; /* Mark stat cache as out-of-date. */ + if (p->fixup & + (TODO_TIMES | TODO_MODE_BASE | TODO_ACLS | TODO_FFLAGS)) { + fd = open(p->name, + O_WRONLY | O_BINARY | O_NOFOLLOW | O_CLOEXEC); + } if (p->fixup & TODO_TIMES) { - set_times(a, -1, p->mode, p->name, + set_times(a, fd, p->mode, p->name, p->atime, p->atime_nanos, p->birthtime, p->birthtime_nanos, p->mtime, p->mtime_nanos, p->ctime, p->ctime_nanos); } - if (p->fixup & TODO_MODE_BASE) + if (p->fixup & TODO_MODE_BASE) { +#ifdef HAVE_FCHMOD + if (fd >= 0) + fchmod(fd, p->mode); + else +#endif chmod(p->name, p->mode); + } if (p->fixup & TODO_ACLS) - archive_write_disk_set_acls(&a->archive, -1, p->name, - &p->acl, p->mode); + archive_write_disk_set_acls(&a->archive, fd, + p->name, &p->acl, p->mode); if (p->fixup & TODO_FFLAGS) - set_fflags_platform(a, -1, p->name, + set_fflags_platform(a, fd, p->name, p->mode, p->fflags_set, 0); if (p->fixup & TODO_MAC_METADATA) set_mac_metadata(a, p->name, p->mac_metadata, @@ -2376,6 +2425,8 @@ _archive_write_disk_close(struct archive *_a) archive_acl_clear(&p->acl); free(p->mac_metadata); free(p->name); + if (fd >= 0) + close(fd); free(p); p = next; } @@ -2540,8 +2591,6 @@ fsobj_error(int *a_eno, struct archive_string *a_estr, * scan the path and both can be optimized by comparing against other * recent paths. */ -/* TODO: Extend this to support symlinks on Windows Vista and later. */ - /* * Checks the given path to see if any elements along it are symlinks. Returns * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. @@ -2550,7 +2599,8 @@ static int check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags) { -#if !defined(HAVE_LSTAT) +#if !defined(HAVE_LSTAT) && \ + !(defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT)) /* Platform doesn't have lstat, so we can't look for symlinks. */ (void)path; /* UNUSED */ (void)error_number; /* UNUSED */ @@ -2565,7 +2615,10 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar char c; int r; struct stat st; - int restore_pwd; + int chdir_fd; +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + int fd; +#endif /* Nothing to do here if name is empty */ if(path[0] == '\0') @@ -2586,9 +2639,9 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * c holds what used to be in *tail * last is 1 if this is the last tail */ - restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); - __archive_ensure_cloexec_flag(restore_pwd); - if (restore_pwd < 0) { + chdir_fd = la_opendirat(AT_FDCWD, "."); + __archive_ensure_cloexec_flag(chdir_fd); + if (chdir_fd < 0) { fsobj_error(a_eno, a_estr, errno, "Could not open ", path); return (ARCHIVE_FATAL); @@ -2621,7 +2674,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar c = tail[0]; tail[0] = '\0'; /* Check that we haven't hit a symlink. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, AT_SYMLINK_NOFOLLOW); +#else r = lstat(head, &st); +#endif if (r != 0) { tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ @@ -2647,7 +2704,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } } else if (S_ISDIR(st.st_mode)) { if (!last) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not chdir ", path); @@ -2664,7 +2733,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * so we can overwrite it with the * item being extracted. */ - if (unlink(head)) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not remove symlink ", @@ -2694,7 +2768,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, 0, "Cannot remove intervening " @@ -2712,7 +2791,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * This is needed to extract hardlinks over * symlinks. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, 0); +#else r = la_stat(head, &st); +#endif if (r != 0) { tail[0] = c; if (errno == ENOENT) { @@ -2725,7 +2808,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } } else if (S_ISDIR(st.st_mode)) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, @@ -2761,16 +2856,21 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } /* Catches loop exits via break */ tail[0] = c; -#ifdef HAVE_FCHDIR +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + /* If we operate with openat(), fstatat() and unlinkat() there was + * no chdir(), so just close the fd */ + if (chdir_fd >= 0) + close(chdir_fd); +#elif HAVE_FCHDIR /* If we changed directory above, restore it here. */ - if (restore_pwd >= 0) { - r = fchdir(restore_pwd); + if (chdir_fd >= 0) { + r = fchdir(chdir_fd); if (r != 0) { fsobj_error(a_eno, a_estr, errno, "chdir() failure", ""); } - close(restore_pwd); - restore_pwd = -1; + close(chdir_fd); + chdir_fd = -1; if (r != 0) { res = (ARCHIVE_FATAL); } @@ -3387,6 +3487,7 @@ static int set_mode(struct archive_write_disk *a, int mode) { int r = ARCHIVE_OK; + int r2; mode &= 07777; /* Strip off file type bits. */ if (a->todo & TODO_SGID_CHECK) { @@ -3480,21 +3581,19 @@ set_mode(struct archive_write_disk *a, int mode) * post-extract fixup, which is handled elsewhere. */ #ifdef HAVE_FCHMOD - if (a->fd >= 0) { - if (fchmod(a->fd, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } - } else + if (a->fd >= 0) + r2 = fchmod(a->fd, mode); + else #endif - /* If this platform lacks fchmod(), then - * we'll just use chmod(). */ - if (chmod(a->name, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } + /* If this platform lacks fchmod(), then + * we'll just use chmod(). */ + r2 = chmod(a->name, mode); + + if (r2 != 0) { + archive_set_error(&a->archive, errno, + "Can't set permissions to 0%o", (int)mode); + r = ARCHIVE_WARN; + } } return (r); } Modified: stable/12/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/test/test_read_format_rar.c Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/test/test_read_format_rar.c Fri Jun 28 22:31:53 2019 (r349523) @@ -3776,6 +3776,35 @@ DEFINE_TEST(test_read_format_rar_ppmd_use_after_free) assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_ppmd_use_after_free2) +{ + uint8_t buf[16]; + const char* reffile = "test_read_format_rar_ppmd_use_after_free2.rar"; + + struct archive_entry *ae; + struct archive *a; + + extract_reference_file(reffile); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_filter_all(a)); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); + + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } Modified: stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:28:51 2019 (r349522) +++ stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:31:53 2019 (r349523) @@ -1194,3 +1194,24 @@ DEFINE_TEST(test_read_format_rar5_fileattr) EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_different_window_size) +{ + char buf[4096]; + PROLOGUE("test_read_format_rar5_different_window_size.rar"); + + /* Return codes of those calls are ignored, because this sample file + * is invalid. However, the unpacker shouldn't produce any SIGSEGV + * errors during processing. */ + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + EPILOGUE(); +} Copied: stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu (from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu Fri Jun 28 22:31:53 2019 (r349523, copy of r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) @@ -0,0 +1,675 @@ +begin 600 test_read_format_rar5_different_window_size.rar +M4F%R(1H'`0"-[P+2``'#M#P\7P$'`0"-[P+2``7#`/KZ^OKZA5N8F)B8F)@` +MF`*8T@7"F!=A_________P$$_____________________R%285(A&@?_____ +M_________________V@`[E##M#P\7P$'`0"-[P+2``7"87)26`!W=%)A\"T@`"QP\)`'(A&@\"T@`" +MQP\`"7(AFC`!&B/2+0`"*"%285(A&@<8`0"-[P+2``7#10!A4B$:!Q@!`#)S +M-/_______U)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1 +MT='1T='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\` +M`"\O``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$``/____\3]O;V]O;_ +M_S\``/]!(.VG+R\``/]!(.T)__^PWOS_```O+S$``/8@[;L````````````` +M-3XR9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q< +M7#)<7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E +M9"XR9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF +M+BX**%)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1T='1 +MT='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\``"\O +M``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$````````3]O;V]O;__S\` +M`/]!(.VG+R\``/]!(.T)__^PWOS_```O+P```/8@[;L`````````````-38R +M9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7#)< +M7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E9"XR +M9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF+E)A +M\"T@`"PP<KJZNKJZNKJZNKJZNKJZNKJ +MZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK#P\/#P\/#P\/#R\-MP\/# +MP\/#P\/#P\/#P\/#P\/#`\"T@`#QP\`"2$:TB,M``(H(5)A4B$:!Q@!`(WO`M(`!0`````````````` +M`````````0``````_____P#_965E965E965E965E965E965E8'-T/2X*+@HN +M"C(P-S`W,&EA='EAEQ<*EQ<7%PO7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7%PR7%PV7#!D:6=E +M\"T@`%PP`:!P`$9P`` +M````````[P+2``+'#P`)`"X),AP`_0$`%___"0`N"3(<`/T!`!?__Q%287(A +M_Q%287(A&H\Q`"@HW,@```/V-[P+2 +M``+'`"X),1P`_0$`%___$5)A<@$`C>\"T@`%PP`:!P`$9P``````````[P+2 +M``+'#P`)`"X),AP`_0$`%___$5)A\"T@`#QP\`"2$:TB,M``DA +M&M(C+0`"*"%285(A&@<8`0"-[P+2``7#`!H'`/R8__]E965E965E965E965E +M965E965@6%R(0HN"@HF+B8N"B@*+@HN"BY0 +M7B]A,C5I-F1G97-T/2X*+@HN"@HF+BX*"@HF+BX**`HN"BX*+E!<-3,R-C)D +M+W-.="`@6W-T/3TN"BX*+@H*)BXN"B@*+@HN"BY07#4S,C8A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A+@H*)BXN+EPV7#)D:6=E\"T@`%```` +M```````````````````!``````#_____```O+P``_T$@[?___[#>`/\`AH:Q +M;?;V]@.J_O;_S_\`Q+[?$?;?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?___?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W_^[XP## +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````#_________ +M__________________________________________\````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````"`````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````+8````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````!287(A&@\"T@`%PF%R4E@`=W1287(A&@EFZ>45J>E"(8*1QP&#AP1O__`````!X````````````` +MNKJZNKJZN@'U``"R____`````!X```"````````````````````````````` +M`"Q!`````````"T`%0``:#H`6@$M\"T@`"PP<< +MP@2```#_;24``F<<`0(`#@```0!02P@#`"8F)@!`___/0T+_____\?__K2-T +M='3_______[______R9"____,3,U__\3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3 +M$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$R8J8BQB`/______0D)"0D)"0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D+;V]O;V]O;V]O;V]O;-C8V +M-C8V&4PA`C8V-C8V-C8V-C8V-C8V&4PA`C8V-C8V-C8V-C8V-C8H*"@H*"@H +M*"@H*"@H(1H'`0"-[P(H*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`` +M````````````````````````````V]O;V]L`VP````#;V]L`VR@H*"@H*#8V +M-C8V-C8V-C8VEC8V-C8V-C8VV]O;``````````````````````````````#; +MV]O;VP#;`````-O;VP#;``````````````````````!"0D)"0D)"0D)S0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0EU=75)A4B$:!V%R0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0MO;V]O;V]O; +MV]O;V]LV-C8V-C893"$"-C8V-C8V-C8V-C8V-C893"$"-C8V-C8V-C8V-C8V +M-B@H*"@H*"@H*"@H*"@A&@\" +M*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````````````````````` +M`````````-O;V]O;`-L`````V]O;`-L``````````````````````$)"0D)" +M0D)"0G-"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"75U=4F%2(1H'87)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)" +MV]O;V]O;V]O;V]O;VS8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V-AE,(0(V-C8V +M-C8V-C8V-C8V*"@H*"@H*"@H*"@H*"$:!P$`C>\"*"@H*"@H-C8V-C8V-C8V +M-C:6-C8V-C8V-C;;V]L``````````````````````````````-O;V]O;`-L` +M````V]O;`-LH*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`````````` +M````````````````````V]O;V]L`VP````#;V]L`VP`````````````````` +M````0D)"0D)"0D)"\"T@`%PT4```!&%<\"T@`%PF%R4E@`=W1287(A&@7EY0H```#EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>5W=V%R(2\O+R`N"@H*75U=75U9R,C(R,C(R,C(R,C(R"<.`'\` +M``I=70!=!UU=7=D`Y>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY4$X.#@X]C@X+3@X.#@X.#@X.#@X.#@X.#@X +M.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#AR.#@X.#@X.#@X.#@X.#@X.#@X +M.#@X./DX.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X\"T@`%P_J%6YB8F)B8F`"8`IC2!<*8%V'_ +M________`03_____________________(5)A4B$:!___________________ +M____:`#N4,.T/#Q?`0 Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B20015CDC36; Fri, 28 Jun 2019 22:33:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0F158B9DB; Fri, 28 Jun 2019 22:33:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 719C25704; Fri, 28 Jun 2019 22:33:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMXls5064760; Fri, 28 Jun 2019 22:33:47 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMXjln064749; Fri, 28 Jun 2019 22:33:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906282233.x5SMXjln064749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 28 Jun 2019 22:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349524 - in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive lib/li... X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive lib/libarchive/tests usr.bin/bs... X-SVN-Commit-Revision: 349524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0F158B9DB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:33:48 -0000 Author: mm Date: Fri Jun 28 22:33:44 2019 New Revision: 349524 URL: https://svnweb.freebsd.org/changeset/base/349524 Log: MFC r348993,349135: Sync libarchive with vendor including security fixes r348993: - version bumped to 3.4.0 - check_symlinks_fsobj() without chdir() and fchdir() - bsdtar.1 manpage fixes - patches from OpenBSD to libarchive_fe/passphrase.c r349135: PR #1212: RAR5 reader - window_mask was not updated correctly (OSS-Fuzz 15278) OSS-Fuzz 15120: RAR reader - extend use after free bugfix Added: stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu - copied unchanged from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu - copied unchanged from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu Modified: stable/11/contrib/libarchive/NEWS stable/11/contrib/libarchive/README.md stable/11/contrib/libarchive/libarchive/archive.h stable/11/contrib/libarchive/libarchive/archive_entry.h stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/11/contrib/libarchive/libarchive_fe/line_reader.c stable/11/contrib/libarchive/libarchive_fe/passphrase.c stable/11/contrib/libarchive/tar/bsdtar.1 stable/11/lib/libarchive/config_freebsd.h stable/11/lib/libarchive/tests/Makefile stable/11/usr.bin/bsdcat/Makefile stable/11/usr.bin/cpio/Makefile stable/11/usr.bin/tar/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/NEWS ============================================================================== --- stable/11/contrib/libarchive/NEWS Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/NEWS Fri Jun 28 22:33:44 2019 (r349524) @@ -1,3 +1,7 @@ +Jun 11, 2019: libarchive 3.4.0 released + +May 18, 2019: Fixes for reading Android APK and JAR archives + Apr 16, 2019: Support for non-recursive list and extract Apr 14, 2019: New tar option: --exclude-vcs @@ -6,7 +10,7 @@ Mar 27, 2019: Support for file and directory symlinks Mar 12, 2019: Important fixes for storing file attributes and flags -Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 decompression in ZIP files Oct 06, 2018: RAR 5.0 reader Modified: stable/11/contrib/libarchive/README.md ============================================================================== --- stable/11/contrib/libarchive/README.md Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/README.md Fri Jun 28 22:33:44 2019 (r349524) @@ -81,6 +81,7 @@ Currently, the library automatically detects and reads * Binary cpio (big-endian or little-endian) * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives Modified: stable/11/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive.h Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/archive.h Fri Jun 28 22:33:44 2019 (r349524) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.3" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.0" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/11/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.h Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/archive_entry.h Fri Jun 28 22:33:44 2019 (r349524) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c Fri Jun 28 22:33:44 2019 (r349524) @@ -1027,6 +1027,7 @@ archive_read_format_rar_read_data(struct archive_read if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); rar->start_new_table = 1; + rar->ppmd_valid = 0; } break; Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:33:44 2019 (r349524) @@ -1125,6 +1125,13 @@ static void init_header(struct archive_read* a) { a->archive.archive_format_name = "RAR5"; } +static void init_window_mask(struct rar5* rar) { + if (rar->cstate.window_size) + rar->cstate.window_mask = rar->cstate.window_size - 1; + else + rar->cstate.window_mask = 0; +} + enum HEADER_FLAGS { HFL_EXTRA_DATA = 0x0001, HFL_DATA = 0x0002, @@ -1672,6 +1679,7 @@ static int process_head_file(struct archive_read* a, s /* Values up to 64M should fit into ssize_t on every * architecture. */ rar->cstate.window_size = (ssize_t) window_size; + init_window_mask(rar); rar->file.solid = (compression_info & SOLID) > 0; rar->file.service = 0; @@ -2235,10 +2243,7 @@ static int rar5_read_header(struct archive_read *a, static void init_unpack(struct rar5* rar) { rar->file.calculated_crc32 = 0; - if (rar->cstate.window_size) - rar->cstate.window_mask = rar->cstate.window_size - 1; - else - rar->cstate.window_mask = 0; + init_window_mask(rar); free(rar->cstate.window_buf); free(rar->cstate.filtered_buf); @@ -2851,7 +2856,7 @@ static int do_uncompress_block(struct archive_read* a, * - Values lower than 256 are just bytes. Those codes * can be stored in the output buffer directly. * - * - Code 256 defines a new filter, which is later used to + * - Code 256 defines a new filter, which is later used to * ransform the data block accordingly to the filter type. * The data block needs to be fully uncompressed first. * @@ -3906,7 +3911,7 @@ static int rar5_read_data_skip(struct archive_read *a) /* Turn off "skip mode". */ rar->skip_mode--; - if(ret < 0) { + if(ret < 0 || ret == ARCHIVE_EOF) { /* Propagate any potential error conditions * to the caller. */ return ret; Modified: stable/11/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Fri Jun 28 22:33:44 2019 (r349524) @@ -60,7 +60,7 @@ static int archive_filter_b64encode_write(struct archi const void *, size_t); static int archive_filter_b64encode_close(struct archive_write_filter *); static int archive_filter_b64encode_free(struct archive_write_filter *); -static void b64_encode(struct archive_string *, const unsigned char *, size_t); +static void la_b64_encode(struct archive_string *, const unsigned char *, size_t); static int64_t atol8(const char *, size_t); static const char base64[] = { @@ -180,7 +180,7 @@ archive_filter_b64encode_open(struct archive_write_fil } static void -b64_encode(struct archive_string *as, const unsigned char *p, size_t len) +la_b64_encode(struct archive_string *as, const unsigned char *p, size_t len) { int c; @@ -234,12 +234,12 @@ archive_filter_b64encode_write(struct archive_write_fi } if (state->hold_len < LBYTES) return (ret); - b64_encode(&state->encoded_buff, state->hold, LBYTES); + la_b64_encode(&state->encoded_buff, state->hold, LBYTES); state->hold_len = 0; } for (; length >= LBYTES; length -= LBYTES, p += LBYTES) - b64_encode(&state->encoded_buff, p, LBYTES); + la_b64_encode(&state->encoded_buff, p, LBYTES); /* Save remaining bytes. */ if (length > 0) { @@ -270,7 +270,7 @@ archive_filter_b64encode_close(struct archive_write_fi /* Flush remaining bytes. */ if (state->hold_len != 0) - b64_encode(&state->encoded_buff, state->hold, state->hold_len); + la_b64_encode(&state->encoded_buff, state->hold, state->hold_len); archive_string_sprintf(&state->encoded_buff, "====\n"); /* Write the last block */ archive_write_set_bytes_in_last_block(f->archive, 1); Modified: stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jun 28 22:33:44 2019 (r349524) @@ -165,6 +165,10 @@ __FBSDID("$FreeBSD$"); #define O_NOFOLLOW 0 #endif +#ifndef AT_FDCWD +#define AT_FDCWD -100 +#endif + struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; @@ -348,6 +352,8 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) + +static int la_opendirat(int, const char *); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -401,6 +407,37 @@ static ssize_t _archive_write_disk_data_block(struct a size_t, int64_t); static int +la_opendirat(int fd, const char *path) { + const int flags = O_CLOEXEC +#if defined(O_BINARY) + | O_BINARY +#endif +#if defined(O_DIRECTORY) + | O_DIRECTORY +#endif +#if defined(O_PATH) + | O_PATH +#elif defined(O_SEARCH) + | O_SEARCH +#elif defined(O_EXEC) + | O_EXEC +#else + | O_RDONLY +#endif + ; + +#if !defined(HAVE_OPENAT) + if (fd != AT_FDCWD) { + errno = ENOTSUP; + return (-1); + } else + return (open(fd, path, flags)); +#else + return (openat(fd, path, flags)); +#endif +} + +static int lazy_stat(struct archive_write_disk *a) { if (a->pst != NULL) { @@ -1909,7 +1946,7 @@ edit_deep_directories(struct archive_write_disk *a) return; /* Try to record our starting dir. */ - a->restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + a->restore_pwd = la_opendirat(AT_FDCWD, "."); __archive_ensure_cloexec_flag(a->restore_pwd); if (a->restore_pwd < 0) return; @@ -2342,7 +2379,7 @@ _archive_write_disk_close(struct archive *_a) { struct archive_write_disk *a = (struct archive_write_disk *)_a; struct fixup_entry *next, *p; - int ret; + int fd, ret; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2353,21 +2390,33 @@ _archive_write_disk_close(struct archive *_a) p = sort_dir_list(a->fixup_list); while (p != NULL) { + fd = -1; a->pst = NULL; /* Mark stat cache as out-of-date. */ + if (p->fixup & + (TODO_TIMES | TODO_MODE_BASE | TODO_ACLS | TODO_FFLAGS)) { + fd = open(p->name, + O_WRONLY | O_BINARY | O_NOFOLLOW | O_CLOEXEC); + } if (p->fixup & TODO_TIMES) { - set_times(a, -1, p->mode, p->name, + set_times(a, fd, p->mode, p->name, p->atime, p->atime_nanos, p->birthtime, p->birthtime_nanos, p->mtime, p->mtime_nanos, p->ctime, p->ctime_nanos); } - if (p->fixup & TODO_MODE_BASE) + if (p->fixup & TODO_MODE_BASE) { +#ifdef HAVE_FCHMOD + if (fd >= 0) + fchmod(fd, p->mode); + else +#endif chmod(p->name, p->mode); + } if (p->fixup & TODO_ACLS) - archive_write_disk_set_acls(&a->archive, -1, p->name, - &p->acl, p->mode); + archive_write_disk_set_acls(&a->archive, fd, + p->name, &p->acl, p->mode); if (p->fixup & TODO_FFLAGS) - set_fflags_platform(a, -1, p->name, + set_fflags_platform(a, fd, p->name, p->mode, p->fflags_set, 0); if (p->fixup & TODO_MAC_METADATA) set_mac_metadata(a, p->name, p->mac_metadata, @@ -2376,6 +2425,8 @@ _archive_write_disk_close(struct archive *_a) archive_acl_clear(&p->acl); free(p->mac_metadata); free(p->name); + if (fd >= 0) + close(fd); free(p); p = next; } @@ -2540,8 +2591,6 @@ fsobj_error(int *a_eno, struct archive_string *a_estr, * scan the path and both can be optimized by comparing against other * recent paths. */ -/* TODO: Extend this to support symlinks on Windows Vista and later. */ - /* * Checks the given path to see if any elements along it are symlinks. Returns * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. @@ -2550,7 +2599,8 @@ static int check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags) { -#if !defined(HAVE_LSTAT) +#if !defined(HAVE_LSTAT) && \ + !(defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT)) /* Platform doesn't have lstat, so we can't look for symlinks. */ (void)path; /* UNUSED */ (void)error_number; /* UNUSED */ @@ -2565,7 +2615,10 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar char c; int r; struct stat st; - int restore_pwd; + int chdir_fd; +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + int fd; +#endif /* Nothing to do here if name is empty */ if(path[0] == '\0') @@ -2586,9 +2639,9 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * c holds what used to be in *tail * last is 1 if this is the last tail */ - restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); - __archive_ensure_cloexec_flag(restore_pwd); - if (restore_pwd < 0) { + chdir_fd = la_opendirat(AT_FDCWD, "."); + __archive_ensure_cloexec_flag(chdir_fd); + if (chdir_fd < 0) { fsobj_error(a_eno, a_estr, errno, "Could not open ", path); return (ARCHIVE_FATAL); @@ -2621,7 +2674,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar c = tail[0]; tail[0] = '\0'; /* Check that we haven't hit a symlink. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, AT_SYMLINK_NOFOLLOW); +#else r = lstat(head, &st); +#endif if (r != 0) { tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ @@ -2647,7 +2704,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } } else if (S_ISDIR(st.st_mode)) { if (!last) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not chdir ", path); @@ -2664,7 +2733,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * so we can overwrite it with the * item being extracted. */ - if (unlink(head)) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not remove symlink ", @@ -2694,7 +2768,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, 0, "Cannot remove intervening " @@ -2712,7 +2791,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * This is needed to extract hardlinks over * symlinks. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, 0); +#else r = la_stat(head, &st); +#endif if (r != 0) { tail[0] = c; if (errno == ENOENT) { @@ -2725,7 +2808,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } } else if (S_ISDIR(st.st_mode)) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, @@ -2761,16 +2856,21 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } /* Catches loop exits via break */ tail[0] = c; -#ifdef HAVE_FCHDIR +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + /* If we operate with openat(), fstatat() and unlinkat() there was + * no chdir(), so just close the fd */ + if (chdir_fd >= 0) + close(chdir_fd); +#elif HAVE_FCHDIR /* If we changed directory above, restore it here. */ - if (restore_pwd >= 0) { - r = fchdir(restore_pwd); + if (chdir_fd >= 0) { + r = fchdir(chdir_fd); if (r != 0) { fsobj_error(a_eno, a_estr, errno, "chdir() failure", ""); } - close(restore_pwd); - restore_pwd = -1; + close(chdir_fd); + chdir_fd = -1; if (r != 0) { res = (ARCHIVE_FATAL); } @@ -3387,6 +3487,7 @@ static int set_mode(struct archive_write_disk *a, int mode) { int r = ARCHIVE_OK; + int r2; mode &= 07777; /* Strip off file type bits. */ if (a->todo & TODO_SGID_CHECK) { @@ -3480,21 +3581,19 @@ set_mode(struct archive_write_disk *a, int mode) * post-extract fixup, which is handled elsewhere. */ #ifdef HAVE_FCHMOD - if (a->fd >= 0) { - if (fchmod(a->fd, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } - } else + if (a->fd >= 0) + r2 = fchmod(a->fd, mode); + else #endif - /* If this platform lacks fchmod(), then - * we'll just use chmod(). */ - if (chmod(a->name, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } + /* If this platform lacks fchmod(), then + * we'll just use chmod(). */ + r2 = chmod(a->name, mode); + + if (r2 != 0) { + archive_set_error(&a->archive, errno, + "Can't set permissions to 0%o", (int)mode); + r = ARCHIVE_WARN; + } } return (r); } Modified: stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c Fri Jun 28 22:33:44 2019 (r349524) @@ -3776,6 +3776,35 @@ DEFINE_TEST(test_read_format_rar_ppmd_use_after_free) assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_ppmd_use_after_free2) +{ + uint8_t buf[16]; + const char* reffile = "test_read_format_rar_ppmd_use_after_free2.rar"; + + struct archive_entry *ae; + struct archive *a; + + extract_reference_file(reffile); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_filter_all(a)); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); + + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } Modified: stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:31:53 2019 (r349523) +++ stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:33:44 2019 (r349524) @@ -1194,3 +1194,24 @@ DEFINE_TEST(test_read_format_rar5_fileattr) EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_different_window_size) +{ + char buf[4096]; + PROLOGUE("test_read_format_rar5_different_window_size.rar"); + + /* Return codes of those calls are ignored, because this sample file + * is invalid. However, the unpacker shouldn't produce any SIGSEGV + * errors during processing. */ + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + EPILOGUE(); +} Copied: stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu (from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu Fri Jun 28 22:33:44 2019 (r349524, copy of r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) @@ -0,0 +1,675 @@ +begin 600 test_read_format_rar5_different_window_size.rar +M4F%R(1H'`0"-[P+2``'#M#P\7P$'`0"-[P+2``7#`/KZ^OKZA5N8F)B8F)@` +MF`*8T@7"F!=A_________P$$_____________________R%285(A&@?_____ +M_________________V@`[E##M#P\7P$'`0"-[P+2``7"87)26`!W=%)A\"T@`"QP\)`'(A&@\"T@`" +MQP\`"7(AFC`!&B/2+0`"*"%285(A&@<8`0"-[P+2``7#10!A4B$:!Q@!`#)S +M-/_______U)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1 +MT='1T='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\` +M`"\O``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$``/____\3]O;V]O;_ +M_S\``/]!(.VG+R\``/]!(.T)__^PWOS_```O+S$``/8@[;L````````````` +M-3XR9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q< +M7#)<7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E +M9"XR9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF +M+BX**%)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1T='1 +MT='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\``"\O +M``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$````````3]O;V]O;__S\` +M`/]!(.VG+R\``/]!(.T)__^PWOS_```O+P```/8@[;L`````````````-38R +M9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7#)< +M7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E9"XR +M9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF+E)A +M\"T@`"PP<KJZNKJZNKJZNKJZNKJZNKJ +MZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK#P\/#P\/#P\/#R\-MP\/# +MP\/#P\/#P\/#P\/#P\/#`\"T@`#QP\`"2$:TB,M``(H(5)A4B$:!Q@!`(WO`M(`!0`````````````` +M`````````0``````_____P#_965E965E965E965E965E965E8'-T/2X*+@HN +M"C(P-S`W,&EA='EAEQ<*EQ<7%PO7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7%PR7%PV7#!D:6=E +M\"T@`%PP`:!P`$9P`` +M````````[P+2``+'#P`)`"X),AP`_0$`%___"0`N"3(<`/T!`!?__Q%287(A +M_Q%287(A&H\Q`"@HW,@```/V-[P+2 +M``+'`"X),1P`_0$`%___$5)A<@$`C>\"T@`%PP`:!P`$9P``````````[P+2 +M``+'#P`)`"X),AP`_0$`%___$5)A\"T@`#QP\`"2$:TB,M``DA +M&M(C+0`"*"%285(A&@<8`0"-[P+2``7#`!H'`/R8__]E965E965E965E965E +M965E965@6%R(0HN"@HF+B8N"B@*+@HN"BY0 +M7B]A,C5I-F1G97-T/2X*+@HN"@HF+BX*"@HF+BX**`HN"BX*+E!<-3,R-C)D +M+W-.="`@6W-T/3TN"BX*+@H*)BXN"B@*+@HN"BY07#4S,C8A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A+@H*)BXN+EPV7#)D:6=E\"T@`%```` +M```````````````````!``````#_____```O+P``_T$@[?___[#>`/\`AH:Q +M;?;V]@.J_O;_S_\`Q+[?$?;?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?___?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W_^[XP## +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````#_________ +M__________________________________________\````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````"`````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````+8````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````!287(A&@\"T@`%PF%R4E@`=W1287(A&@EFZ>45J>E"(8*1QP&#AP1O__`````!X````````````` +MNKJZNKJZN@'U``"R____`````!X```"````````````````````````````` +M`"Q!`````````"T`%0``:#H`6@$M\"T@`"PP<< +MP@2```#_;24``F<<`0(`#@```0!02P@#`"8F)@!`___/0T+_____\?__K2-T +M='3_______[______R9"____,3,U__\3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3 +M$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$R8J8BQB`/______0D)"0D)"0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D+;V]O;V]O;V]O;V]O;-C8V +M-C8V&4PA`C8V-C8V-C8V-C8V-C8V&4PA`C8V-C8V-C8V-C8V-C8H*"@H*"@H +M*"@H*"@H(1H'`0"-[P(H*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`` +M````````````````````````````V]O;V]L`VP````#;V]L`VR@H*"@H*#8V +M-C8V-C8V-C8VEC8V-C8V-C8VV]O;``````````````````````````````#; +MV]O;VP#;`````-O;VP#;``````````````````````!"0D)"0D)"0D)S0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0EU=75)A4B$:!V%R0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0MO;V]O;V]O; +MV]O;V]LV-C8V-C893"$"-C8V-C8V-C8V-C8V-C893"$"-C8V-C8V-C8V-C8V +M-B@H*"@H*"@H*"@H*"@A&@\" +M*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````````````````````` +M`````````-O;V]O;`-L`````V]O;`-L``````````````````````$)"0D)" +M0D)"0G-"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"75U=4F%2(1H'87)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)" +MV]O;V]O;V]O;V]O;VS8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V-AE,(0(V-C8V +M-C8V-C8V-C8V*"@H*"@H*"@H*"@H*"$:!P$`C>\"*"@H*"@H-C8V-C8V-C8V +M-C:6-C8V-C8V-C;;V]L``````````````````````````````-O;V]O;`-L` +M````V]O;`-LH*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`````````` +M````````````````````V]O;V]L`VP````#;V]L`VP`````````````````` +M````0D)"0D)"0D)"\"T@`%PT4```!&%<\"T@`%PF%R4E@`=W1287(A&@7EY0H```#EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>5W=V%R(2\O+R`N"@H*75U=75U9R,C(R,C(R,C(R,C(R"<.`'\` +M``I=70!=!UU=7=D`Y>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY4$X.#@X]C@X+3@X.#@X.#@X.#@X.#@X.#@X +M.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#AR.#@X.#@X.#@X.#@X.#@X.#@X +M.#@X./DX.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X\"T@`%P_J%6YB8F)B8F`"8`IC2!<*8%V'_ +M________`03_____________________(5)A4B$:!___________________ +M____:`#N4,.T/#Q?`0 Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AA9D15CDD82; Fri, 28 Jun 2019 22:36:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2549B8BC5D; Fri, 28 Jun 2019 22:36:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA5AB5717; Fri, 28 Jun 2019 22:36:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMaTtI064927; Fri, 28 Jun 2019 22:36:29 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMaRme064913; Fri, 28 Jun 2019 22:36:27 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906282236.x5SMaRme064913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 28 Jun 2019 22:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r349525 - in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive lib/li... X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive lib/libarchive/tests usr.bin/bs... X-SVN-Commit-Revision: 349525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2549B8BC5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:36:30 -0000 Author: mm Date: Fri Jun 28 22:36:27 2019 New Revision: 349525 URL: https://svnweb.freebsd.org/changeset/base/349525 Log: MFC r348993,349135: Sync libarchive with vendor including security fixes r348993: - version bumped to 3.4.0 - check_symlinks_fsobj() without chdir() and fchdir() - bsdtar.1 manpage fixes - patches from OpenBSD to libarchive_fe/passphrase.c r349135: PR #1212: RAR5 reader - window_mask was not updated correctly (OSS-Fuzz 15278) OSS-Fuzz 15120: RAR reader - extend use after free bugfix Added: stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu - copied unchanged from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu - copied unchanged from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu Modified: stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/README.md stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/10/contrib/libarchive/libarchive_fe/line_reader.c stable/10/contrib/libarchive/libarchive_fe/passphrase.c stable/10/contrib/libarchive/tar/bsdtar.1 stable/10/lib/libarchive/config_freebsd.h stable/10/lib/libarchive/tests/Makefile stable/10/usr.bin/bsdcat/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/tar/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/NEWS Fri Jun 28 22:36:27 2019 (r349525) @@ -1,3 +1,7 @@ +Jun 11, 2019: libarchive 3.4.0 released + +May 18, 2019: Fixes for reading Android APK and JAR archives + Apr 16, 2019: Support for non-recursive list and extract Apr 14, 2019: New tar option: --exclude-vcs @@ -6,7 +10,7 @@ Mar 27, 2019: Support for file and directory symlinks Mar 12, 2019: Important fixes for storing file attributes and flags -Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 decompression in ZIP files Oct 06, 2018: RAR 5.0 reader Modified: stable/10/contrib/libarchive/README.md ============================================================================== --- stable/10/contrib/libarchive/README.md Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/README.md Fri Jun 28 22:36:27 2019 (r349525) @@ -81,6 +81,7 @@ Currently, the library automatically detects and reads * Binary cpio (big-endian or little-endian) * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/archive.h Fri Jun 28 22:36:27 2019 (r349525) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.3" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.0" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/10/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.h Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/archive_entry.h Fri Jun 28 22:36:27 2019 (r349525) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Fri Jun 28 22:36:27 2019 (r349525) @@ -1026,6 +1026,7 @@ archive_read_format_rar_read_data(struct archive_read if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); rar->start_new_table = 1; + rar->ppmd_valid = 0; } break; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:36:27 2019 (r349525) @@ -1125,6 +1125,13 @@ static void init_header(struct archive_read* a) { a->archive.archive_format_name = "RAR5"; } +static void init_window_mask(struct rar5* rar) { + if (rar->cstate.window_size) + rar->cstate.window_mask = rar->cstate.window_size - 1; + else + rar->cstate.window_mask = 0; +} + enum HEADER_FLAGS { HFL_EXTRA_DATA = 0x0001, HFL_DATA = 0x0002, @@ -1672,6 +1679,7 @@ static int process_head_file(struct archive_read* a, s /* Values up to 64M should fit into ssize_t on every * architecture. */ rar->cstate.window_size = (ssize_t) window_size; + init_window_mask(rar); rar->file.solid = (compression_info & SOLID) > 0; rar->file.service = 0; @@ -2235,10 +2243,7 @@ static int rar5_read_header(struct archive_read *a, static void init_unpack(struct rar5* rar) { rar->file.calculated_crc32 = 0; - if (rar->cstate.window_size) - rar->cstate.window_mask = rar->cstate.window_size - 1; - else - rar->cstate.window_mask = 0; + init_window_mask(rar); free(rar->cstate.window_buf); free(rar->cstate.filtered_buf); @@ -2851,7 +2856,7 @@ static int do_uncompress_block(struct archive_read* a, * - Values lower than 256 are just bytes. Those codes * can be stored in the output buffer directly. * - * - Code 256 defines a new filter, which is later used to + * - Code 256 defines a new filter, which is later used to * ransform the data block accordingly to the filter type. * The data block needs to be fully uncompressed first. * @@ -3906,7 +3911,7 @@ static int rar5_read_data_skip(struct archive_read *a) /* Turn off "skip mode". */ rar->skip_mode--; - if(ret < 0) { + if(ret < 0 || ret == ARCHIVE_EOF) { /* Propagate any potential error conditions * to the caller. */ return ret; Modified: stable/10/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Fri Jun 28 22:36:27 2019 (r349525) @@ -60,7 +60,7 @@ static int archive_filter_b64encode_write(struct archi const void *, size_t); static int archive_filter_b64encode_close(struct archive_write_filter *); static int archive_filter_b64encode_free(struct archive_write_filter *); -static void b64_encode(struct archive_string *, const unsigned char *, size_t); +static void la_b64_encode(struct archive_string *, const unsigned char *, size_t); static int64_t atol8(const char *, size_t); static const char base64[] = { @@ -180,7 +180,7 @@ archive_filter_b64encode_open(struct archive_write_fil } static void -b64_encode(struct archive_string *as, const unsigned char *p, size_t len) +la_b64_encode(struct archive_string *as, const unsigned char *p, size_t len) { int c; @@ -234,12 +234,12 @@ archive_filter_b64encode_write(struct archive_write_fi } if (state->hold_len < LBYTES) return (ret); - b64_encode(&state->encoded_buff, state->hold, LBYTES); + la_b64_encode(&state->encoded_buff, state->hold, LBYTES); state->hold_len = 0; } for (; length >= LBYTES; length -= LBYTES, p += LBYTES) - b64_encode(&state->encoded_buff, p, LBYTES); + la_b64_encode(&state->encoded_buff, p, LBYTES); /* Save remaining bytes. */ if (length > 0) { @@ -270,7 +270,7 @@ archive_filter_b64encode_close(struct archive_write_fi /* Flush remaining bytes. */ if (state->hold_len != 0) - b64_encode(&state->encoded_buff, state->hold, state->hold_len); + la_b64_encode(&state->encoded_buff, state->hold, state->hold_len); archive_string_sprintf(&state->encoded_buff, "====\n"); /* Write the last block */ archive_write_set_bytes_in_last_block(f->archive, 1); Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Jun 28 22:36:27 2019 (r349525) @@ -165,6 +165,10 @@ __FBSDID("$FreeBSD$"); #define O_NOFOLLOW 0 #endif +#ifndef AT_FDCWD +#define AT_FDCWD -100 +#endif + struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; @@ -348,6 +352,8 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) + +static int la_opendirat(int, const char *); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -401,6 +407,37 @@ static ssize_t _archive_write_disk_data_block(struct a size_t, int64_t); static int +la_opendirat(int fd, const char *path) { + const int flags = O_CLOEXEC +#if defined(O_BINARY) + | O_BINARY +#endif +#if defined(O_DIRECTORY) + | O_DIRECTORY +#endif +#if defined(O_PATH) + | O_PATH +#elif defined(O_SEARCH) + | O_SEARCH +#elif defined(O_EXEC) + | O_EXEC +#else + | O_RDONLY +#endif + ; + +#if !defined(HAVE_OPENAT) + if (fd != AT_FDCWD) { + errno = ENOTSUP; + return (-1); + } else + return (open(fd, path, flags)); +#else + return (openat(fd, path, flags)); +#endif +} + +static int lazy_stat(struct archive_write_disk *a) { if (a->pst != NULL) { @@ -1893,7 +1930,7 @@ edit_deep_directories(struct archive_write_disk *a) return; /* Try to record our starting dir. */ - a->restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + a->restore_pwd = la_opendirat(AT_FDCWD, "."); __archive_ensure_cloexec_flag(a->restore_pwd); if (a->restore_pwd < 0) return; @@ -2317,7 +2354,7 @@ _archive_write_disk_close(struct archive *_a) { struct archive_write_disk *a = (struct archive_write_disk *)_a; struct fixup_entry *next, *p; - int ret; + int fd, ret; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2328,21 +2365,33 @@ _archive_write_disk_close(struct archive *_a) p = sort_dir_list(a->fixup_list); while (p != NULL) { + fd = -1; a->pst = NULL; /* Mark stat cache as out-of-date. */ + if (p->fixup & + (TODO_TIMES | TODO_MODE_BASE | TODO_ACLS | TODO_FFLAGS)) { + fd = open(p->name, + O_WRONLY | O_BINARY | O_NOFOLLOW | O_CLOEXEC); + } if (p->fixup & TODO_TIMES) { - set_times(a, -1, p->mode, p->name, + set_times(a, fd, p->mode, p->name, p->atime, p->atime_nanos, p->birthtime, p->birthtime_nanos, p->mtime, p->mtime_nanos, p->ctime, p->ctime_nanos); } - if (p->fixup & TODO_MODE_BASE) + if (p->fixup & TODO_MODE_BASE) { +#ifdef HAVE_FCHMOD + if (fd >= 0) + fchmod(fd, p->mode); + else +#endif chmod(p->name, p->mode); + } if (p->fixup & TODO_ACLS) - archive_write_disk_set_acls(&a->archive, -1, p->name, - &p->acl, p->mode); + archive_write_disk_set_acls(&a->archive, fd, + p->name, &p->acl, p->mode); if (p->fixup & TODO_FFLAGS) - set_fflags_platform(a, -1, p->name, + set_fflags_platform(a, fd, p->name, p->mode, p->fflags_set, 0); if (p->fixup & TODO_MAC_METADATA) set_mac_metadata(a, p->name, p->mac_metadata, @@ -2351,6 +2400,8 @@ _archive_write_disk_close(struct archive *_a) archive_acl_clear(&p->acl); free(p->mac_metadata); free(p->name); + if (fd >= 0) + close(fd); free(p); p = next; } @@ -2515,8 +2566,6 @@ fsobj_error(int *a_eno, struct archive_string *a_estr, * scan the path and both can be optimized by comparing against other * recent paths. */ -/* TODO: Extend this to support symlinks on Windows Vista and later. */ - /* * Checks the given path to see if any elements along it are symlinks. Returns * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. @@ -2525,7 +2574,8 @@ static int check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags) { -#if !defined(HAVE_LSTAT) +#if !defined(HAVE_LSTAT) && \ + !(defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT)) /* Platform doesn't have lstat, so we can't look for symlinks. */ (void)path; /* UNUSED */ (void)error_number; /* UNUSED */ @@ -2540,7 +2590,10 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar char c; int r; struct stat st; - int restore_pwd; + int chdir_fd; +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + int fd; +#endif /* Nothing to do here if name is empty */ if(path[0] == '\0') @@ -2561,9 +2614,9 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * c holds what used to be in *tail * last is 1 if this is the last tail */ - restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); - __archive_ensure_cloexec_flag(restore_pwd); - if (restore_pwd < 0) { + chdir_fd = la_opendirat(AT_FDCWD, "."); + __archive_ensure_cloexec_flag(chdir_fd); + if (chdir_fd < 0) { fsobj_error(a_eno, a_estr, errno, "Could not open ", path); return (ARCHIVE_FATAL); @@ -2596,7 +2649,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar c = tail[0]; tail[0] = '\0'; /* Check that we haven't hit a symlink. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, AT_SYMLINK_NOFOLLOW); +#else r = lstat(head, &st); +#endif if (r != 0) { tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ @@ -2622,7 +2679,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } } else if (S_ISDIR(st.st_mode)) { if (!last) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not chdir ", path); @@ -2639,7 +2708,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * so we can overwrite it with the * item being extracted. */ - if (unlink(head)) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not remove symlink ", @@ -2669,7 +2743,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, 0, "Cannot remove intervening " @@ -2687,7 +2766,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * This is needed to extract hardlinks over * symlinks. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, 0); +#else r = la_stat(head, &st); +#endif if (r != 0) { tail[0] = c; if (errno == ENOENT) { @@ -2700,7 +2783,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } } else if (S_ISDIR(st.st_mode)) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, @@ -2736,16 +2831,21 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } /* Catches loop exits via break */ tail[0] = c; -#ifdef HAVE_FCHDIR +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + /* If we operate with openat(), fstatat() and unlinkat() there was + * no chdir(), so just close the fd */ + if (chdir_fd >= 0) + close(chdir_fd); +#elif HAVE_FCHDIR /* If we changed directory above, restore it here. */ - if (restore_pwd >= 0) { - r = fchdir(restore_pwd); + if (chdir_fd >= 0) { + r = fchdir(chdir_fd); if (r != 0) { fsobj_error(a_eno, a_estr, errno, "chdir() failure", ""); } - close(restore_pwd); - restore_pwd = -1; + close(chdir_fd); + chdir_fd = -1; if (r != 0) { res = (ARCHIVE_FATAL); } @@ -3362,6 +3462,7 @@ static int set_mode(struct archive_write_disk *a, int mode) { int r = ARCHIVE_OK; + int r2; mode &= 07777; /* Strip off file type bits. */ if (a->todo & TODO_SGID_CHECK) { @@ -3455,21 +3556,19 @@ set_mode(struct archive_write_disk *a, int mode) * post-extract fixup, which is handled elsewhere. */ #ifdef HAVE_FCHMOD - if (a->fd >= 0) { - if (fchmod(a->fd, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } - } else + if (a->fd >= 0) + r2 = fchmod(a->fd, mode); + else #endif - /* If this platform lacks fchmod(), then - * we'll just use chmod(). */ - if (chmod(a->name, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } + /* If this platform lacks fchmod(), then + * we'll just use chmod(). */ + r2 = chmod(a->name, mode); + + if (r2 != 0) { + archive_set_error(&a->archive, errno, + "Can't set permissions to 0%o", (int)mode); + r = ARCHIVE_WARN; + } } return (r); } Modified: stable/10/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_read_format_rar.c Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/test/test_read_format_rar.c Fri Jun 28 22:36:27 2019 (r349525) @@ -3776,6 +3776,35 @@ DEFINE_TEST(test_read_format_rar_ppmd_use_after_free) assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_ppmd_use_after_free2) +{ + uint8_t buf[16]; + const char* reffile = "test_read_format_rar_ppmd_use_after_free2.rar"; + + struct archive_entry *ae; + struct archive *a; + + extract_reference_file(reffile); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_filter_all(a)); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); + + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } Modified: stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:33:44 2019 (r349524) +++ stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:36:27 2019 (r349525) @@ -1194,3 +1194,24 @@ DEFINE_TEST(test_read_format_rar5_fileattr) EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_different_window_size) +{ + char buf[4096]; + PROLOGUE("test_read_format_rar5_different_window_size.rar"); + + /* Return codes of those calls are ignored, because this sample file + * is invalid. However, the unpacker shouldn't produce any SIGSEGV + * errors during processing. */ + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + EPILOGUE(); +} Copied: stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu (from r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu Fri Jun 28 22:36:27 2019 (r349525, copy of r349135, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) @@ -0,0 +1,675 @@ +begin 600 test_read_format_rar5_different_window_size.rar +M4F%R(1H'`0"-[P+2``'#M#P\7P$'`0"-[P+2``7#`/KZ^OKZA5N8F)B8F)@` +MF`*8T@7"F!=A_________P$$_____________________R%285(A&@?_____ +M_________________V@`[E##M#P\7P$'`0"-[P+2``7"87)26`!W=%)A\"T@`"QP\)`'(A&@\"T@`" +MQP\`"7(AFC`!&B/2+0`"*"%285(A&@<8`0"-[P+2``7#10!A4B$:!Q@!`#)S +M-/_______U)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1 +MT='1T='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\` +M`"\O``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$``/____\3]O;V]O;_ +M_S\``/]!(.VG+R\``/]!(.T)__^PWOS_```O+S$``/8@[;L````````````` +M-3XR9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q< +M7#)<7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E +M9"XR9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF +M+BX**%)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1T='1 +MT='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\``"\O +M``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$````````3]O;V]O;__S\` +M`/]!(.VG+R\``/]!(.T)__^PWOS_```O+P```/8@[;L`````````````-38R +M9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7#)< +M7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E9"XR +M9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF+E)A +M\"T@`"PP<KJZNKJZNKJZNKJZNKJZNKJ +MZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK#P\/#P\/#P\/#R\-MP\/# +MP\/#P\/#P\/#P\/#P\/#`\"T@`#QP\`"2$:TB,M``(H(5)A4B$:!Q@!`(WO`M(`!0`````````````` +M`````````0``````_____P#_965E965E965E965E965E965E8'-T/2X*+@HN +M"C(P-S`W,&EA='EAEQ<*EQ<7%PO7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7%PR7%PV7#!D:6=E +M\"T@`%PP`:!P`$9P`` +M````````[P+2``+'#P`)`"X),AP`_0$`%___"0`N"3(<`/T!`!?__Q%287(A +M_Q%287(A&H\Q`"@HW,@```/V-[P+2 +M``+'`"X),1P`_0$`%___$5)A<@$`C>\"T@`%PP`:!P`$9P``````````[P+2 +M``+'#P`)`"X),AP`_0$`%___$5)A\"T@`#QP\`"2$:TB,M``DA +M&M(C+0`"*"%285(A&@<8`0"-[P+2``7#`!H'`/R8__]E965E965E965E965E +M965E965@6%R(0HN"@HF+B8N"B@*+@HN"BY0 +M7B]A,C5I-F1G97-T/2X*+@HN"@HF+BX*"@HF+BX**`HN"BX*+E!<-3,R-C)D +M+W-.="`@6W-T/3TN"BX*+@H*)BXN"B@*+@HN"BY07#4S,C8A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A+@H*)BXN+EPV7#)D:6=E\"T@`%```` +M```````````````````!``````#_____```O+P``_T$@[?___[#>`/\`AH:Q +M;?;V]@.J_O;_S_\`Q+[?$?;?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?___?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W_^[XP## +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````#_________ +M__________________________________________\````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````"`````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````+8````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````!287(A&@\"T@`%PF%R4E@`=W1287(A&@EFZ>45J>E"(8*1QP&#AP1O__`````!X````````````` +MNKJZNKJZN@'U``"R____`````!X```"````````````````````````````` +M`"Q!`````````"T`%0``:#H`6@$M\"T@`"PP<< +MP@2```#_;24``F<<`0(`#@```0!02P@#`"8F)@!`___/0T+_____\?__K2-T +M='3_______[______R9"____,3,U__\3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3 +M$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$R8J8BQB`/______0D)"0D)"0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D+;V]O;V]O;V]O;V]O;-C8V +M-C8V&4PA`C8V-C8V-C8V-C8V-C8V&4PA`C8V-C8V-C8V-C8V-C8H*"@H*"@H +M*"@H*"@H(1H'`0"-[P(H*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`` +M````````````````````````````V]O;V]L`VP````#;V]L`VR@H*"@H*#8V +M-C8V-C8V-C8VEC8V-C8V-C8VV]O;``````````````````````````````#; +MV]O;VP#;`````-O;VP#;``````````````````````!"0D)"0D)"0D)S0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0EU=75)A4B$:!V%R0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0MO;V]O;V]O; +MV]O;V]LV-C8V-C893"$"-C8V-C8V-C8V-C8V-C893"$"-C8V-C8V-C8V-C8V +M-B@H*"@H*"@H*"@H*"@A&@\" +M*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````````````````````` +M`````````-O;V]O;`-L`````V]O;`-L``````````````````````$)"0D)" +M0D)"0G-"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"75U=4F%2(1H'87)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)" +MV]O;V]O;V]O;V]O;VS8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V-AE,(0(V-C8V +M-C8V-C8V-C8V*"@H*"@H*"@H*"@H*"$:!P$`C>\"*"@H*"@H-C8V-C8V-C8V +M-C:6-C8V-C8V-C;;V]L``````````````````````````````-O;V]O;`-L` +M````V]O;`-LH*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`````````` +M````````````````````V]O;V]L`VP````#;V]L`VP`````````````````` +M````0D)"0D)"0D)"\"T@`%PT4```!&%<\"T@`%PF%R4E@`=W1287(A&@7EY0H```#EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>5W=V%R(2\O+R`N"@H*75U=75U9R,C(R,C(R,C(R,C(R"<.`'\` +M``I=70!=!UU=7=D`Y>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY4$X.#@X]C@X+3@X.#@X.#@X.#@X.#@X.#@X +M.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#AR.#@X.#@X.#@X.#@X.#@X.#@X +M.#@X./DX.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X\"T@`%P_J%6YB8F)B8F`"8`IC2!<*8%V'_ +M________`03_____________________(5)A4B$:!___________________ +M____:`#N4,.T/#Q?`0 Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B6015CDF13; Fri, 28 Jun 2019 22:40:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C7CA8BE79; Fri, 28 Jun 2019 22:40:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 274B7571F; Fri, 28 Jun 2019 22:40:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMeZrZ065203; Fri, 28 Jun 2019 22:40:35 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMeY01065201; Fri, 28 Jun 2019 22:40:34 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906282240.x5SMeY01065201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 28 Jun 2019 22:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349526 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 349526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C7CA8BE79 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:40:35 -0000 Author: alc Date: Fri Jun 28 22:40:34 2019 New Revision: 349526 URL: https://svnweb.freebsd.org/changeset/base/349526 Log: When we protect PTEs (as opposed to PDEs), we only call vm_page_dirty() when, in fact, we are write protecting the page and the PTE has PG_M set. However, pmap_protect_pde() was always calling vm_page_dirty() when the PDE has PG_M set. So, adding PG_NX to a writeable PDE could result in unnecessary (but harmless) calls to vm_page_dirty(). Simplify the loop calling vm_page_dirty() in pmap_protect_pde(). Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20793 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jun 28 22:36:27 2019 (r349525) +++ head/sys/amd64/amd64/pmap.c Fri Jun 28 22:40:34 2019 (r349526) @@ -5202,8 +5202,7 @@ static boolean_t pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot) { pd_entry_t newpde, oldpde; - vm_offset_t eva, va; - vm_page_t m; + vm_page_t m, mt; boolean_t anychanged; pt_entry_t PG_G, PG_M, PG_RW; @@ -5217,15 +5216,15 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offs anychanged = FALSE; retry: oldpde = newpde = *pde; - if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == - (PG_MANAGED | PG_M | PG_RW)) { - eva = sva + NBPDR; - for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); - va < eva; va += PAGE_SIZE, m++) - vm_page_dirty(m); - } - if ((prot & VM_PROT_WRITE) == 0) + if ((prot & VM_PROT_WRITE) == 0) { + if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { + m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); + for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) + vm_page_dirty(mt); + } newpde &= ~(PG_RW | PG_M); + } if ((prot & VM_PROT_EXECUTE) == 0) newpde |= pg_nx; if (newpde != oldpde) { Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jun 28 22:36:27 2019 (r349525) +++ head/sys/i386/i386/pmap.c Fri Jun 28 22:40:34 2019 (r349526) @@ -3251,8 +3251,7 @@ static boolean_t pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot) { pd_entry_t newpde, oldpde; - vm_offset_t eva, va; - vm_page_t m; + vm_page_t m, mt; boolean_t anychanged; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -3261,15 +3260,15 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offs anychanged = FALSE; retry: oldpde = newpde = *pde; - if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == - (PG_MANAGED | PG_M | PG_RW)) { - eva = sva + NBPDR; - for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); - va < eva; va += PAGE_SIZE, m++) - vm_page_dirty(m); - } - if ((prot & VM_PROT_WRITE) == 0) + if ((prot & VM_PROT_WRITE) == 0) { + if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { + m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); + for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) + vm_page_dirty(mt); + } newpde &= ~(PG_RW | PG_M); + } #ifdef PMAP_PAE_COMP if ((prot & VM_PROT_EXECUTE) == 0 && !i386_read_exec) newpde |= pg_nx; From owner-svn-src-all@freebsd.org Fri Jun 28 22:41:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E166E15CDF96; Fri, 28 Jun 2019 22:41:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88A758C045; Fri, 28 Jun 2019 22:41:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62D8A5760; Fri, 28 Jun 2019 22:41:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SMfI2J069424; Fri, 28 Jun 2019 22:41:18 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SMfHdU069419; Fri, 28 Jun 2019 22:41:17 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906282241.x5SMfHdU069419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 28 Jun 2019 22:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349527 - in head/contrib/libarchive/libarchive: . test X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head/contrib/libarchive/libarchive: . test X-SVN-Commit-Revision: 349527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88A758C045 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 22:41:19 -0000 Author: mm Date: Fri Jun 28 22:41:17 2019 New Revision: 349527 URL: https://svnweb.freebsd.org/changeset/base/349527 Log: MFV r349454: Sync libarchive with vendor. Relevant vendor changes: PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary (OSS-Fuzz 15431) PR #1218: Fixes to sparse file handling MFC after: 1 week Added: head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu - copied unchanged from r349454, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu Modified: head/contrib/libarchive/libarchive/archive_read.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read.c Fri Jun 28 22:40:34 2019 (r349526) +++ head/contrib/libarchive/libarchive/archive_read.c Fri Jun 28 22:41:17 2019 (r349527) @@ -844,7 +844,8 @@ archive_read_data(struct archive *_a, void *buff, size dest = (char *)buff; while (s > 0) { - if (a->read_data_remaining == 0) { + if (a->read_data_offset == a->read_data_output_offset && + a->read_data_remaining == 0) { read_buf = a->read_data_block; a->read_data_is_posix_read = 1; a->read_data_requested = s; Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Fri Jun 28 22:40:34 2019 (r349526) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Fri Jun 28 22:41:17 2019 (r349527) @@ -1143,6 +1143,8 @@ _archive_read_next_header2(struct archive *_a, struct t->entry_fd = -1; } + archive_entry_clear(entry); + for (;;) { r = next_entry(a, t, entry); if (t->entry_fd >= 0) { Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:40:34 2019 (r349526) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Jun 28 22:41:17 2019 (r349527) @@ -623,9 +623,9 @@ static int run_arm_filter(struct rar5* rar, struct fil for(i = 0; i < flt->block_length - 3; i += 4) { uint8_t* b = &rar->cstate.window_buf[ (rar->cstate.solid_offset + - flt->block_start + i) & rar->cstate.window_mask]; + flt->block_start + i + 3) & rar->cstate.window_mask]; - if(b[3] == 0xEB) { + if(*b == 0xEB) { /* 0xEB = ARM's BL (branch + link) instruction. */ offset = read_filter_data(rar, (rar->cstate.solid_offset + flt->block_start + i) & Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:40:34 2019 (r349526) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Fri Jun 28 22:41:17 2019 (r349527) @@ -1215,3 +1215,18 @@ DEFINE_TEST(test_read_format_rar5_different_window_siz EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_arm_filter_on_window_boundary) +{ + char buf[4096]; + PROLOGUE("test_read_format_rar5_arm_filter_on_window_boundary.rar"); + + /* Return codes of those calls are ignored, because this sample file + * is invalid. However, the unpacker shouldn't produce any SIGSEGV + * errors during processing. */ + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + EPILOGUE(); +} Copied: head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu (from r349454, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu Fri Jun 28 22:41:17 2019 (r349527, copy of r349454, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu) @@ -0,0 +1,9 @@ +begin 600 test_read_format_rar5_arm_filter_on_window_boundary.rar +M4F%R(1H'`0"-[P+2``(''(`'`/[_(`#_!``"(0$``/X(TB`!'O___P@``/W_ +M_Q``_]U84%"0_P1LAFVQ9,S,M[$`20"#__\`_P#_`/G___!DSR0V2+$`20`Z +M@R[_______\I:!<**-@P70D`KB1! Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DEA915CED84; Fri, 28 Jun 2019 23:27:25 +0000 (UTC) (envelope-from mhorne063@gmail.com) Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFFF88D390; Fri, 28 Jun 2019 23:27:24 +0000 (UTC) (envelope-from mhorne063@gmail.com) Received: by mail-ot1-x344.google.com with SMTP id d17so7680509oth.5; Fri, 28 Jun 2019 16:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UU6mYjfhH9RH0RijFBft+NcEpD4uqF9MacTQ+c0GUsw=; b=I8q8Moca94+YBfbvra40PXH550l/ra9Gubn04DhnlJMkMLl9gp9JIdDAcM/vBgsYVm //q1aZjRet+gC3BLLZie3cDfLFqYGnw6PCKOpd30p3Btamcx/1PKuPeM0wqwAqqdCF+l Sw2ns9OXk/xdf0ZC9+N7U4KJx4mUa8NFAfRuDExu5kB0h3Zto3JppltB0OuFLucCZgI4 caGj7ta2KdSrrs4hk2CfPzJnFK9kCx5jgHTs+y4YMMGEBoigxHEyicJQJlciPEUh+a/K /+OKYIc5ulsvW7NsmLxxlkNZ5/riGwLUN/psNjT8+ECrLrYDg+zZaTBkkoyEW1cgGdCr 8eOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UU6mYjfhH9RH0RijFBft+NcEpD4uqF9MacTQ+c0GUsw=; b=D9aXcO21uID9xABfaebej4wZi/V2WtBXdaqYN/G/QaAjsWhMwuweTQdc8xLyVhpPca csttksx/tISqEkh1/GoQ09Xvurb7MDb7DvPTVYW8W4gTo3rT/DiOCYg0oTdM2PtZ1opN VOjsUt43KhfzBFywf2D54fsuWRwDr3ntrLPVizUb5YWCA2Y2b9MPWs5FDJCne3y2uZsD BRoJrmX30Bh2wQo6elp2K1mYcuj2JtIMyjvSq/8I5jMR12REev7eY/I8ICq9qcJ1EzQ1 82hBiUFm+XqH2GNlLduJ8V/AbLxKkCuR2+PNTtJ9dapDhO2oUmG933PDm6xdIktTvAjr 1gPw== X-Gm-Message-State: APjAAAUwXD5dZmUqgbK3I0HXeTzm4YNGyk35kIIgn2NpccemVm/XwLab brKqPMCsKp4enoSqjersgIzwVj/JOsTvrHj9ed7oWQ== X-Google-Smtp-Source: APXvYqzOW0U0v11xeHlT6Z91smtO2SbPKAhc2SknhUBhBzLpCX3JqEwc2gI+urg5rUtTz0+T+6qhxoHe7hj8brKnCew= X-Received: by 2002:a9d:68d7:: with SMTP id i23mr9383617oto.124.1561764443463; Fri, 28 Jun 2019 16:27:23 -0700 (PDT) MIME-Version: 1.0 References: <201906280010.x5S0ARLh056619@repo.freebsd.org> In-Reply-To: From: Mitchell Horne Date: Fri, 28 Jun 2019 19:27:12 -0400 Message-ID: Subject: Re: svn commit: r349482 - in head/contrib/elftoolchain: common readelf To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: CFFF88D390 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.922,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 23:27:25 -0000 On Fri, Jun 28, 2019 at 12:45 PM John Baldwin wrote: > > On 6/27/19 5:10 PM, Mitchell Horne wrote: > > Author: mhorne > > Date: Fri Jun 28 00:10:26 2019 > > New Revision: 349482 > > URL: https://svnweb.freebsd.org/changeset/base/349482 > > > > Log: > > readelf: Add support for RISC-V specific e_flags > > > > Reviewed by: markj > > Approved by: markj (mentor) > > MFC after: 3 days > > Differential Revision: https://reviews.freebsd.org/D20767 > > > > Modified: > > head/contrib/elftoolchain/common/elfdefinitions.h > > head/contrib/elftoolchain/readelf/readelf.c > > > > Modified: head/contrib/elftoolchain/common/elfdefinitions.h > > ============================================================================== > > --- head/contrib/elftoolchain/common/elfdefinitions.h Fri Jun 28 00:03:29 2019 (r349481) > > +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri Jun 28 00:10:26 2019 (r349482) > > @@ -426,6 +426,22 @@ _ELF_DEFINE_EF(EF_PPC_RELOCATABLE, 0x00010000UL, \ > > "-mrelocatable flag") \ > > _ELF_DEFINE_EF(EF_PPC_RELOCATABLE_LIB, 0x00008000UL, \ > > "-mrelocatable-lib flag") \ > > +_ELF_DEFINE_EF(EF_RISCV_RVE, 0x00000008UL, \ > > + "Compressed instruction ABI") \ > > I don't think this description for RVE is quite right. RVE is for RV32E which > is not using compressed ('C') instructions, but using a smaller register file > (16 GPRs instead of 32) which is in theory intended for embedded / microprocessor > variants. The riscv-elf-psabi-doc describes it as: > > EF_RISCV_RVE (0x0008): This bit is set when the binary targets the E ABI. > Yep, good catch. This got duplicated from the RVC entry and slipped by during review. I'll adjust it. Mitchell > -- > John Baldwin From owner-svn-src-all@freebsd.org Fri Jun 28 23:40:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4244515CEFF3; Fri, 28 Jun 2019 23:40:59 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D89758D993; Fri, 28 Jun 2019 23:40:58 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B236C6137; Fri, 28 Jun 2019 23:40:58 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5SNew5O099454; Fri, 28 Jun 2019 23:40:58 GMT (envelope-from seanc@FreeBSD.org) Received: (from seanc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5SNew5N099453; Fri, 28 Jun 2019 23:40:58 GMT (envelope-from seanc@FreeBSD.org) Message-Id: <201906282340.x5SNew5N099453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: seanc set sender to seanc@FreeBSD.org using -f From: Sean Chittenden Date: Fri, 28 Jun 2019 23:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r349528 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: seanc X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 349528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D89758D993 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2019 23:40:59 -0000 Author: seanc (ports committer) Date: Fri Jun 28 23:40:58 2019 New Revision: 349528 URL: https://svnweb.freebsd.org/changeset/base/349528 Log: Temporary suspension. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Jun 28 22:41:17 2019 (r349527) +++ svnadmin/conf/access Fri Jun 28 23:40:58 2019 (r349528) @@ -177,7 +177,7 @@ pstef qingli ram ray -rgrimes +# rgrimes rlibby rmacklem roberto From owner-svn-src-all@freebsd.org Sat Jun 29 00:48:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD8915D03C5; Sat, 29 Jun 2019 00:48:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFB9F8FEDA; Sat, 29 Jun 2019 00:48:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A51D6CAC; Sat, 29 Jun 2019 00:48:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T0maKq033145; Sat, 29 Jun 2019 00:48:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T0mYMt033132; Sat, 29 Jun 2019 00:48:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906290048.x5T0mYMt033132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 29 Jun 2019 00:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349529 - in head: sbin/ifconfig share/man/man9 sys/conf sys/kern sys/net sys/netinet sys/netinet6 sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sbin/ifconfig share/man/man9 sys/conf sys/kern sys/net sys/netinet sys/netinet6 sys/sys X-SVN-Commit-Revision: 349529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFB9F8FEDA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 00:48:37 -0000 Author: jhb Date: Sat Jun 29 00:48:33 2019 New Revision: 349529 URL: https://svnweb.freebsd.org/changeset/base/349529 Log: Add an external mbuf buffer type that holds multiple unmapped pages. Unmapped mbufs allow sendfile to carry multiple pages of data in a single mbuf, without mapping those pages. It is a requirement for Netflix's in-kernel TLS, and provides a 5-10% CPU savings on heavy web serving workloads when used by sendfile, due to effectively compressing socket buffers by an order of magnitude, and hence reducing cache misses. For this new external mbuf buffer type (EXT_PGS), the ext_buf pointer now points to a struct mbuf_ext_pgs structure instead of a data buffer. This structure contains an array of physical addresses (this reduces cache misses compared to an earlier version that stored an array of vm_page_t pointers). It also stores additional fields needed for in-kernel TLS such as the TLS header and trailer data that are currently unused. To more easily detect these mbufs, the M_NOMAP flag is set in m_flags in addition to M_EXT. Various functions like m_copydata() have been updated to safely access packet contents (using uiomove_fromphys()), to make things like BPF safe. NIC drivers advertise support for unmapped mbufs on transmit via a new IFCAP_NOMAP capability. This capability can be toggled via the new 'nomap' and '-nomap' ifconfig(8) commands. For NIC drivers that only transmit packet contents via DMA and use bus_dma, adding the capability to if_capabilities and if_capenable should be all that is required. If a NIC does not support unmapped mbufs, they are converted to a chain of mapped mbufs (using sf_bufs to provide the mapping) in ip_output or ip6_output. If an unmapped mbuf requires software checksums, it is also converted to a chain of mapped mbufs before computing the checksum. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Discussed with: ae, kp (firewalls) Relnotes: yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/share/man/man9/Makefile head/share/man/man9/mbuf.9 head/share/man/man9/sglist.9 head/sys/conf/files head/sys/conf/kern.mk head/sys/kern/kern_mbuf.c head/sys/kern/subr_bus_dma.c head/sys/kern/subr_sglist.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/net/bpf.c head/sys/net/bpf_buffer.c head/sys/net/if.h head/sys/netinet/ip_output.c head/sys/netinet/tcp_pcap.c head/sys/netinet/tcp_usrreq.c head/sys/netinet6/ip6_output.c head/sys/sys/mbuf.h head/sys/sys/sglist.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Jun 28 23:40:58 2019 (r349528) +++ head/sbin/ifconfig/ifconfig.8 Sat Jun 29 00:48:33 2019 (r349529) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 18, 2019 +.Dd June 28, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -538,6 +538,12 @@ large receive offloading, enable LRO on the interface. If the driver supports .Xr tcp 4 large receive offloading, disable LRO on the interface. +.It Cm nomap +If the driver supports unmapped network buffers, +enable them on the interface. +.It Fl nomap +If the driver supports unmapped network buffers, +disable them on the interface. .It Cm wol , wol_ucast , wol_mcast , wol_magic Enable Wake On Lan (WOL) support, if available. WOL is a facility whereby a machine in a low power state may be woken Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Fri Jun 28 23:40:58 2019 (r349528) +++ head/sbin/ifconfig/ifconfig.c Sat Jun 29 00:48:33 2019 (r349529) @@ -1257,7 +1257,7 @@ unsetifdescr(const char *val, int value, int s, const "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP" /* * Print the status of the interface. If an address family was @@ -1557,6 +1557,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-link2", -IFF_LINK2, setifflags), DEF_CMD("monitor", IFF_MONITOR, setifflags), DEF_CMD("-monitor", -IFF_MONITOR, setifflags), + DEF_CMD("nomap", IFCAP_NOMAP, setifcap), + DEF_CMD("-nomap", -IFCAP_NOMAP, setifcap), DEF_CMD("staticarp", IFF_STATICARP, setifflags), DEF_CMD("-staticarp", -IFF_STATICARP, setifflags), DEF_CMD("rxcsum6", IFCAP_RXCSUM_IPV6, setifcap), Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jun 28 23:40:58 2019 (r349528) +++ head/share/man/man9/Makefile Sat Jun 29 00:48:33 2019 (r349529) @@ -1834,6 +1834,8 @@ MLINKS+=sf_buf.9 sf_buf_alloc.9 \ MLINKS+=sglist.9 sglist_alloc.9 \ sglist.9 sglist_append.9 \ sglist.9 sglist_append_bio.9 \ + sglist.9 sglist_append_ext_pgs.9 \ + sglist.9 sglist_append_mb_ext_pgs.9 \ sglist.9 sglist_append_mbuf.9 \ sglist.9 sglist_append_phys.9 \ sglist.9 sglist_append_sglist.9 \ @@ -1844,6 +1846,8 @@ MLINKS+=sglist.9 sglist_alloc.9 \ sglist.9 sglist_clone.9 \ sglist.9 sglist_consume_uio.9 \ sglist.9 sglist_count.9 \ + sglist.9 sglist_count_ext_pgs.9 \ + sglist.9 sglist_count_mb_ext_pgs.9 \ sglist.9 sglist_count_vmpages.9 \ sglist.9 sglist_free.9 \ sglist.9 sglist_hold.9 \ Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Fri Jun 28 23:40:58 2019 (r349528) +++ head/share/man/man9/mbuf.9 Sat Jun 29 00:48:33 2019 (r349529) @@ -213,7 +213,7 @@ flag bits are defined as follows: #define M_PKTHDR 0x00000002 /* start of record */ #define M_EOR 0x00000004 /* end of record */ #define M_RDONLY 0x00000008 /* associated data marked read-only */ -#define M_NOMAP 0x00000100 /* mbuf data is unmapped (soon from Drew) */ +#define M_NOMAP 0x00000100 /* mbuf data is unmapped */ #define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ #define M_BCAST 0x00000010 /* send/received as link-level broadcast */ #define M_MCAST 0x00000020 /* send/received as link-level multicast */ @@ -272,6 +272,7 @@ The available external buffer types are defined as fol #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference */ #define EXT_RXRING 8 /* data in NIC receive ring */ +#define EXT_PGS 9 /* array of unmapped pages */ #define EXT_VENDOR1 224 /* for vendor-internal use */ #define EXT_VENDOR2 225 /* for vendor-internal use */ Modified: head/share/man/man9/sglist.9 ============================================================================== --- head/share/man/man9/sglist.9 Fri Jun 28 23:40:58 2019 (r349528) +++ head/share/man/man9/sglist.9 Sat Jun 29 00:48:33 2019 (r349529) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd June 28, 2019 .Dt SGLIST 9 .Os .Sh NAME @@ -34,6 +34,8 @@ .Nm sglist_alloc , .Nm sglist_append , .Nm sglist_append_bio , +.Nm sglist_append_ext_pgs, +.Nm sglist_append_mb_ext_pgs, .Nm sglist_append_mbuf , .Nm sglist_append_phys , .Nm sglist_append_sglist , @@ -44,6 +46,8 @@ .Nm sglist_clone , .Nm sglist_consume_uio , .Nm sglist_count , +.Nm sglist_count_ext_pgs , +.Nm sglist_count_mb_ext_pgs , .Nm sglist_count_vmpages , .Nm sglist_free , .Nm sglist_hold , @@ -64,6 +68,10 @@ .Ft int .Fn sglist_append_bio "struct sglist *sg" "struct bio *bp" .Ft int +.Fn sglist_append_ext_pgs "struct sglist *sg" "struct mbuf_ext_pgs *ext_pgs" "size_t offset" "size_t len" +.Ft int +.Fn sglist_append_mb_ext_pgs "struct sglist *sg" "struct mbuf *m" +.Ft int .Fn sglist_append_mbuf "struct sglist *sg" "struct mbuf *m" .Ft int .Fn sglist_append_phys "struct sglist *sg" "vm_paddr_t paddr" "size_t len" @@ -84,6 +92,10 @@ .Ft int .Fn sglist_count "void *buf" "size_t len" .Ft int +.Fn sglist_count_ext_pgs "struct mbuf_ext_pgs *ext_pgs" "size_t offset" "size_t len" +.Ft int +.Fn sglist_count_mb_ext_pgs "struct mbuf *m" +.Ft int .Fn sglist_count_vmpages "vm_page_t *m" "size_t pgoff" "size_t len" .Ft void .Fn sglist_free "struct sglist *sg" @@ -146,6 +158,22 @@ and is bytes long. .Pp The +.Nm sglist_count_ext_pgs +function returns the number of scatter/gather list elements needed to describe +the unmapped external mbuf buffer +.Fa ext_pgs . +The ranges start at an offset of +.Fa offset +relative to the start of the buffer and is +.Fa len +bytes long. +The +.Nm sglist_count_mb_ext_pgs +function returns the number of scatter/gather list elements needed to describe +the physical address ranges of a single unmapped mbuf +.Fa m . +.Pp +The .Nm sglist_count_vmpages function returns the number of scatter/gather list elements needed to describe the physical address ranges of a buffer backed by an array of virtual memory @@ -237,6 +265,34 @@ to the scatter/gather list .Fa sg . .Pp The +.Nm sglist_append_ext_pgs +function appends the physical address ranges described by the unmapped +external mbuf buffer +.Fa ext_pgs +to the scatter/gather list +.Fa sg . +The physical address ranges start at offset +.Fa offset +within +.Fa ext_pgs +and continue for +.Fa len +bytes. +.Pp +The +.Nm sglist_append_mb_ext_pgs +function appends the physical address ranges described by the unmapped +mbuf +.Fa m +to the scatter/gather list +.Fa sg . +Note that unlike +.Nm sglist_append_mbuf , +.Nm sglist_append_mb_ext_pgs +only adds ranges for a single mbuf, +not an entire mbuf chain. +.Pp +The .Nm sglist_append_mbuf function appends the physical address ranges described by an entire mbuf chain @@ -467,8 +523,7 @@ functions return zero on success or an error on failur .Pp The .Nm sglist_count -and -.Nm sglist_count_vmpages +family of functions return a count of scatter/gather list elements. .Pp The Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 28 23:40:58 2019 (r349528) +++ head/sys/conf/files Sat Jun 29 00:48:33 2019 (r349529) @@ -4255,7 +4255,8 @@ netinet/tcp_lro.c optional inet | inet6 netinet/tcp_output.c optional inet | inet6 netinet/tcp_offload.c optional tcp_offload inet | tcp_offload inet6 netinet/tcp_hpts.c optional tcphpts inet | tcphpts inet6 -netinet/tcp_pcap.c optional inet tcppcap | inet6 tcppcap +netinet/tcp_pcap.c optional inet tcppcap | inet6 tcppcap \ + compile-with "${NORMAL_C} ${NO_WNONNULL}" netinet/tcp_reass.c optional inet | inet6 netinet/tcp_sack.c optional inet | inet6 netinet/tcp_subr.c optional inet | inet6 Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Jun 28 23:40:58 2019 (r349528) +++ head/sys/conf/kern.mk Sat Jun 29 00:48:33 2019 (r349529) @@ -76,6 +76,7 @@ CWARNEXTRA?= -Wno-uninitialized # GCC 4.2 doesn't have -Wno-error=cast-qual, so just disable the warning for # the few files that are already known to generate cast-qual warnings. NO_WCAST_QUAL= -Wno-cast-qual +NO_WNONNULL= -Wno-nonnull .endif .endif Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Jun 28 23:40:58 2019 (r349528) +++ head/sys/kern/kern_mbuf.c Sat Jun 29 00:48:33 2019 (r349529) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -281,6 +282,7 @@ uma_zone_t zone_pack; uma_zone_t zone_jumbop; uma_zone_t zone_jumbo9; uma_zone_t zone_jumbo16; +uma_zone_t zone_extpgs; /* * Local prototypes. @@ -298,6 +300,9 @@ static void *mbuf_jumbo_alloc(uma_zone_t, vm_size_t /* Ensure that MSIZE is a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); +_Static_assert(sizeof(struct mbuf_ext_pgs) == 256, + "mbuf_ext_pgs size mismatch"); + /* * Initialize FreeBSD Network buffer allocation. */ @@ -379,6 +384,15 @@ mbuf_init(void *dummy) uma_zone_set_warning(zone_jumbo16, "kern.ipc.nmbjumbo16 limit reached"); uma_zone_set_maxaction(zone_jumbo16, mb_reclaim); + zone_extpgs = uma_zcreate(MBUF_EXTPGS_MEM_NAME, + sizeof(struct mbuf_ext_pgs), +#ifdef INVARIANTS + trash_ctor, trash_dtor, trash_init, trash_fini, +#else + NULL, NULL, NULL, NULL, +#endif + UMA_ALIGN_CACHE, 0); + /* * Hook event handler for low-memory situation, used to * drain protocols and push data back to the caches (UMA @@ -824,6 +838,380 @@ mb_reclaim(uma_zone_t zone __unused, int pending __unu } /* + * Free "count" units of I/O from an mbuf chain. They could be held + * in EXT_PGS or just as a normal mbuf. This code is intended to be + * called in an error path (I/O error, closed connection, etc). + */ +void +mb_free_notready(struct mbuf *m, int count) +{ + int i; + + for (i = 0; i < count && m != NULL; i++) { + if ((m->m_flags & M_EXT) != 0 && + m->m_ext.ext_type == EXT_PGS) { + m->m_ext.ext_pgs->nrdy--; + if (m->m_ext.ext_pgs->nrdy != 0) + continue; + } + m = m_free(m); + } + KASSERT(i == count, ("Removed only %d items from %p", i, m)); +} + +/* + * Compress an unmapped mbuf into a simple mbuf when it holds a small + * amount of data. This is used as a DOS defense to avoid having + * small packets tie up wired pages, an ext_pgs structure, and an + * mbuf. Since this converts the existing mbuf in place, it can only + * be used if there are no other references to 'm'. + */ +int +mb_unmapped_compress(struct mbuf *m) +{ + volatile u_int *refcnt; + struct mbuf m_temp; + + /* + * Assert that 'm' does not have a packet header. If 'm' had + * a packet header, it would only be able to hold MHLEN bytes + * and m_data would have to be initialized differently. + */ + KASSERT((m->m_flags & M_PKTHDR) == 0 && (m->m_flags & M_EXT) && + m->m_ext.ext_type == EXT_PGS, + ("%s: m %p !M_EXT or !EXT_PGS or M_PKTHDR", __func__, m)); + KASSERT(m->m_len <= MLEN, ("m_len too large %p", m)); + + if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { + refcnt = &m->m_ext.ext_count; + } else { + KASSERT(m->m_ext.ext_cnt != NULL, + ("%s: no refcounting pointer on %p", __func__, m)); + refcnt = m->m_ext.ext_cnt; + } + + if (*refcnt != 1) + return (EBUSY); + + /* + * Copy mbuf header and m_ext portion of 'm' to 'm_temp' to + * create a "fake" EXT_PGS mbuf that can be used with + * m_copydata() as well as the ext_free callback. + */ + memcpy(&m_temp, m, offsetof(struct mbuf, m_ext) + sizeof (m->m_ext)); + m_temp.m_next = NULL; + m_temp.m_nextpkt = NULL; + + /* Turn 'm' into a "normal" mbuf. */ + m->m_flags &= ~(M_EXT | M_RDONLY | M_NOMAP); + m->m_data = m->m_dat; + + /* Copy data from template's ext_pgs. */ + m_copydata(&m_temp, 0, m_temp.m_len, mtod(m, caddr_t)); + + /* Free the backing pages. */ + m_temp.m_ext.ext_free(&m_temp); + + /* Finally, free the ext_pgs struct. */ + uma_zfree(zone_extpgs, m_temp.m_ext.ext_pgs); + return (0); +} + +/* + * These next few routines are used to permit downgrading an unmapped + * mbuf to a chain of mapped mbufs. This is used when an interface + * doesn't supported unmapped mbufs or if checksums need to be + * computed in software. + * + * Each unmapped mbuf is converted to a chain of mbufs. First, any + * TLS header data is stored in a regular mbuf. Second, each page of + * unmapped data is stored in an mbuf with an EXT_SFBUF external + * cluster. These mbufs use an sf_buf to provide a valid KVA for the + * associated physical page. They also hold a reference on the + * original EXT_PGS mbuf to ensure the physical page doesn't go away. + * Finally, any TLS trailer data is stored in a regular mbuf. + * + * mb_unmapped_free_mext() is the ext_free handler for the EXT_SFBUF + * mbufs. It frees the associated sf_buf and releases its reference + * on the original EXT_PGS mbuf. + * + * _mb_unmapped_to_ext() is a helper function that converts a single + * unmapped mbuf into a chain of mbufs. + * + * mb_unmapped_to_ext() is the public function that walks an mbuf + * chain converting any unmapped mbufs to mapped mbufs. It returns + * the new chain of unmapped mbufs on success. On failure it frees + * the original mbuf chain and returns NULL. + */ +static void +mb_unmapped_free_mext(struct mbuf *m) +{ + struct sf_buf *sf; + struct mbuf *old_m; + + sf = m->m_ext.ext_arg1; + sf_buf_free(sf); + + /* Drop the reference on the backing EXT_PGS mbuf. */ + old_m = m->m_ext.ext_arg2; + mb_free_ext(old_m); +} + +static struct mbuf * +_mb_unmapped_to_ext(struct mbuf *m) +{ + struct mbuf_ext_pgs *ext_pgs; + struct mbuf *m_new, *top, *prev, *mref; + struct sf_buf *sf; + vm_page_t pg; + int i, len, off, pglen, pgoff, seglen, segoff; + volatile u_int *refcnt; + u_int ref_inc = 0; + + MBUF_EXT_PGS_ASSERT(m); + ext_pgs = m->m_ext.ext_pgs; + len = m->m_len; + KASSERT(ext_pgs->tls == NULL, ("%s: can't convert TLS mbuf %p", + __func__, m)); + + /* See if this is the mbuf that holds the embedded refcount. */ + if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { + refcnt = &m->m_ext.ext_count; + mref = m; + } else { + KASSERT(m->m_ext.ext_cnt != NULL, + ("%s: no refcounting pointer on %p", __func__, m)); + refcnt = m->m_ext.ext_cnt; + mref = __containerof(refcnt, struct mbuf, m_ext.ext_count); + } + + /* Skip over any data removed from the front. */ + off = mtod(m, vm_offset_t); + + top = NULL; + if (ext_pgs->hdr_len != 0) { + if (off >= ext_pgs->hdr_len) { + off -= ext_pgs->hdr_len; + } else { + seglen = ext_pgs->hdr_len - off; + segoff = off; + seglen = min(seglen, len); + off = 0; + len -= seglen; + m_new = m_get(M_NOWAIT, MT_DATA); + if (m_new == NULL) + goto fail; + m_new->m_len = seglen; + prev = top = m_new; + memcpy(mtod(m_new, void *), &ext_pgs->hdr[segoff], + seglen); + } + } + pgoff = ext_pgs->first_pg_off; + for (i = 0; i < ext_pgs->npgs && len > 0; i++) { + pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff); + if (off >= pglen) { + off -= pglen; + pgoff = 0; + continue; + } + seglen = pglen - off; + segoff = pgoff + off; + off = 0; + seglen = min(seglen, len); + len -= seglen; + + pg = PHYS_TO_VM_PAGE(ext_pgs->pa[i]); + m_new = m_get(M_NOWAIT, MT_DATA); + if (m_new == NULL) + goto fail; + if (top == NULL) { + top = prev = m_new; + } else { + prev->m_next = m_new; + prev = m_new; + } + sf = sf_buf_alloc(pg, SFB_NOWAIT); + if (sf == NULL) + goto fail; + + ref_inc++; + m_extadd(m_new, (char *)sf_buf_kva(sf), PAGE_SIZE, + mb_unmapped_free_mext, sf, mref, M_RDONLY, EXT_SFBUF); + m_new->m_data += segoff; + m_new->m_len = seglen; + + pgoff = 0; + }; + if (len != 0) { + KASSERT((off + len) <= ext_pgs->trail_len, + ("off + len > trail (%d + %d > %d)", off, len, + ext_pgs->trail_len)); + m_new = m_get(M_NOWAIT, MT_DATA); + if (m_new == NULL) + goto fail; + if (top == NULL) + top = m_new; + else + prev->m_next = m_new; + m_new->m_len = len; + memcpy(mtod(m_new, void *), &ext_pgs->trail[off], len); + } + + if (ref_inc != 0) { + /* + * Obtain an additional reference on the old mbuf for + * each created EXT_SFBUF mbuf. They will be dropped + * in mb_unmapped_free_mext(). + */ + if (*refcnt == 1) + *refcnt += ref_inc; + else + atomic_add_int(refcnt, ref_inc); + } + m_free(m); + return (top); + +fail: + if (ref_inc != 0) { + /* + * Obtain an additional reference on the old mbuf for + * each created EXT_SFBUF mbuf. They will be + * immediately dropped when these mbufs are freed + * below. + */ + if (*refcnt == 1) + *refcnt += ref_inc; + else + atomic_add_int(refcnt, ref_inc); + } + m_free(m); + m_freem(top); + return (NULL); +} + +struct mbuf * +mb_unmapped_to_ext(struct mbuf *top) +{ + struct mbuf *m, *next, *prev = NULL; + + prev = NULL; + for (m = top; m != NULL; m = next) { + /* m might be freed, so cache the next pointer. */ + next = m->m_next; + if (m->m_flags & M_NOMAP) { + if (prev != NULL) { + /* + * Remove 'm' from the new chain so + * that the 'top' chain terminates + * before 'm' in case 'top' is freed + * due to an error. + */ + prev->m_next = NULL; + } + m = _mb_unmapped_to_ext(m); + if (m == NULL) { + m_freem(top); + m_freem(next); + return (NULL); + } + if (prev == NULL) { + top = m; + } else { + prev->m_next = m; + } + + /* + * Replaced one mbuf with a chain, so we must + * find the end of chain. + */ + prev = m_last(m); + } else { + if (prev != NULL) { + prev->m_next = m; + } + prev = m; + } + } + return (top); +} + +/* + * Allocate an empty EXT_PGS mbuf. The ext_free routine is + * responsible for freeing any pages backing this mbuf when it is + * freed. + */ +struct mbuf * +mb_alloc_ext_pgs(int how, bool pkthdr, m_ext_free_t ext_free) +{ + struct mbuf *m; + struct mbuf_ext_pgs *ext_pgs; + + if (pkthdr) + m = m_gethdr(how, MT_DATA); + else + m = m_get(how, MT_DATA); + if (m == NULL) + return (NULL); + + ext_pgs = uma_zalloc(zone_extpgs, how); + if (ext_pgs == NULL) { + m_free(m); + return (NULL); + } + ext_pgs->npgs = 0; + ext_pgs->nrdy = 0; + ext_pgs->first_pg_off = 0; + ext_pgs->last_pg_len = 0; + ext_pgs->hdr_len = 0; + ext_pgs->trail_len = 0; + ext_pgs->tls = NULL; + ext_pgs->so = NULL; + m->m_data = NULL; + m->m_flags |= (M_EXT | M_RDONLY | M_NOMAP); + m->m_ext.ext_type = EXT_PGS; + m->m_ext.ext_flags = EXT_FLAG_EMBREF; + m->m_ext.ext_count = 1; + m->m_ext.ext_pgs = ext_pgs; + m->m_ext.ext_size = 0; + m->m_ext.ext_free = ext_free; + return (m); +} + +#ifdef INVARIANT_SUPPORT +void +mb_ext_pgs_check(struct mbuf_ext_pgs *ext_pgs) +{ + + /* + * NB: This expects a non-empty buffer (npgs > 0 and + * last_pg_len > 0). + */ + KASSERT(ext_pgs->npgs > 0, + ("ext_pgs with no valid pages: %p", ext_pgs)); + KASSERT(ext_pgs->npgs <= nitems(ext_pgs->pa), + ("ext_pgs with too many pages: %p", ext_pgs)); + KASSERT(ext_pgs->nrdy <= ext_pgs->npgs, + ("ext_pgs with too many ready pages: %p", ext_pgs)); + KASSERT(ext_pgs->first_pg_off < PAGE_SIZE, + ("ext_pgs with too large page offset: %p", ext_pgs)); + KASSERT(ext_pgs->last_pg_len > 0, + ("ext_pgs with zero last page length: %p", ext_pgs)); + KASSERT(ext_pgs->last_pg_len <= PAGE_SIZE, + ("ext_pgs with too large last page length: %p", ext_pgs)); + if (ext_pgs->npgs == 1) { + KASSERT(ext_pgs->first_pg_off + ext_pgs->last_pg_len <= + PAGE_SIZE, ("ext_pgs with single page too large: %p", + ext_pgs)); + } + KASSERT(ext_pgs->hdr_len <= sizeof(ext_pgs->hdr), + ("ext_pgs with too large header length: %p", ext_pgs)); + KASSERT(ext_pgs->trail_len <= sizeof(ext_pgs->trail), + ("ext_pgs with too large header length: %p", ext_pgs)); +} +#endif + +/* * Clean up after mbufs with M_EXT storage attached to them if the * reference count hits 1. */ @@ -886,6 +1274,10 @@ mb_free_ext(struct mbuf *m) break; case EXT_JUMBO16: uma_zfree(zone_jumbo16, m->m_ext.ext_buf); + uma_zfree(zone_mbuf, mref); + break; + case EXT_PGS: + uma_zfree(zone_extpgs, mref->m_ext.ext_pgs); uma_zfree(zone_mbuf, mref); break; case EXT_SFBUF: Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Fri Jun 28 23:40:58 2019 (r349528) +++ head/sys/kern/subr_bus_dma.c Sat Jun 29 00:48:33 2019 (r349529) @@ -111,6 +111,67 @@ _bus_dmamap_load_plist(bus_dma_tag_t dmat, bus_dmamap_ } /* + * Load an unmapped mbuf + */ +static int +_bus_dmamap_load_unmapped_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m, bus_dma_segment_t *segs, int *nsegs, int flags) +{ + struct mbuf_ext_pgs *ext_pgs; + int error, i, off, len, pglen, pgoff, seglen, segoff; + + MBUF_EXT_PGS_ASSERT(m); + ext_pgs = m->m_ext.ext_pgs; + + len = m->m_len; + error = 0; + + /* Skip over any data removed from the front. */ + off = mtod(m, vm_offset_t); + + if (ext_pgs->hdr_len != 0) { + if (off >= ext_pgs->hdr_len) { + off -= ext_pgs->hdr_len; + } else { + seglen = ext_pgs->hdr_len - off; + segoff = off; + seglen = min(seglen, len); + off = 0; + len -= seglen; + error = _bus_dmamap_load_buffer(dmat, map, + &ext_pgs->hdr[segoff], seglen, kernel_pmap, + flags, segs, nsegs); + } + } + pgoff = ext_pgs->first_pg_off; + for (i = 0; i < ext_pgs->npgs && error == 0 && len > 0; i++) { + pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff); + if (off >= pglen) { + off -= pglen; + pgoff = 0; + continue; + } + seglen = pglen - off; + segoff = pgoff + off; + off = 0; + seglen = min(seglen, len); + len -= seglen; + error = _bus_dmamap_load_phys(dmat, map, + ext_pgs->pa[i] + segoff, seglen, flags, segs, nsegs); + pgoff = 0; + }; + if (len != 0 && error == 0) { + KASSERT((off + len) <= ext_pgs->trail_len, + ("off + len > trail (%d + %d > %d)", off, len, + ext_pgs->trail_len)); + error = _bus_dmamap_load_buffer(dmat, map, + &ext_pgs->trail[off], len, kernel_pmap, flags, segs, + nsegs); + } + return (error); +} + +/* * Load an mbuf chain. */ static int @@ -123,9 +184,13 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmama error = 0; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { - error = _bus_dmamap_load_buffer(dmat, map, m->m_data, - m->m_len, kernel_pmap, flags | BUS_DMA_LOAD_MBUF, - segs, nsegs); + if ((m->m_flags & M_NOMAP) != 0) + error = _bus_dmamap_load_unmapped_mbuf_sg(dmat, + map, m, segs, nsegs, flags); + else + error = _bus_dmamap_load_buffer(dmat, map, + m->m_data, m->m_len, kernel_pmap, + flags | BUS_DMA_LOAD_MBUF, segs, nsegs); } } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Fri Jun 28 23:40:58 2019 (r349528) +++ head/sys/kern/subr_sglist.c Sat Jun 29 00:48:33 2019 (r349529) @@ -219,6 +219,75 @@ sglist_count_vmpages(vm_page_t *m, size_t pgoff, size_ } /* + * Determine the number of scatter/gather list elements needed to + * describe an EXT_PGS buffer. + */ +int +sglist_count_ext_pgs(struct mbuf_ext_pgs *ext_pgs, size_t off, size_t len) +{ + vm_paddr_t nextaddr, paddr; + size_t seglen, segoff; + int i, nsegs, pglen, pgoff; + + if (len == 0) + return (0); + + nsegs = 0; + if (ext_pgs->hdr_len != 0) { + if (off >= ext_pgs->hdr_len) { + off -= ext_pgs->hdr_len; + } else { + seglen = ext_pgs->hdr_len - off; + segoff = off; + seglen = MIN(seglen, len); + off = 0; + len -= seglen; + nsegs += sglist_count(&ext_pgs->hdr[segoff], seglen); + } + } + nextaddr = 0; + pgoff = ext_pgs->first_pg_off; + for (i = 0; i < ext_pgs->npgs && len > 0; i++) { + pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff); + if (off >= pglen) { + off -= pglen; + pgoff = 0; + continue; + } + seglen = pglen - off; + segoff = pgoff + off; + off = 0; + seglen = MIN(seglen, len); + len -= seglen; + paddr = ext_pgs->pa[i] + segoff; + if (paddr != nextaddr) + nsegs++; + nextaddr = paddr + seglen; + pgoff = 0; + }; + if (len != 0) { + seglen = MIN(len, ext_pgs->trail_len - off); + len -= seglen; + nsegs += sglist_count(&ext_pgs->trail[off], seglen); + } + KASSERT(len == 0, ("len != 0")); + return (nsegs); +} + +/* + * Determine the number of scatter/gather list elements needed to + * describe an EXT_PGS mbuf. + */ +int +sglist_count_mb_ext_pgs(struct mbuf *m) +{ + + MBUF_EXT_PGS_ASSERT(m); + return (sglist_count_ext_pgs(m->m_ext.ext_pgs, mtod(m, vm_offset_t), + m->m_len)); +} + +/* * Allocate a scatter/gather list along with 'nsegs' segments. The * 'mflags' parameters are the same as passed to malloc(9). The caller * should use sglist_free() to free this list. @@ -320,6 +389,76 @@ sglist_append_phys(struct sglist *sg, vm_paddr_t paddr } /* + * Append the segments to describe an EXT_PGS buffer to a + * scatter/gather list. If there are insufficient segments, then this + * fails with EFBIG. + */ +int +sglist_append_ext_pgs(struct sglist *sg, struct mbuf_ext_pgs *ext_pgs, + size_t off, size_t len) +{ + size_t seglen, segoff; + vm_paddr_t paddr; + int error, i, pglen, pgoff; + + error = 0; + if (ext_pgs->hdr_len != 0) { + if (off >= ext_pgs->hdr_len) { + off -= ext_pgs->hdr_len; + } else { + seglen = ext_pgs->hdr_len - off; + segoff = off; + seglen = MIN(seglen, len); + off = 0; + len -= seglen; + error = sglist_append(sg, + &ext_pgs->hdr[segoff], seglen); + } + } + pgoff = ext_pgs->first_pg_off; + for (i = 0; i < ext_pgs->npgs && error == 0 && len > 0; i++) { + pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff); + if (off >= pglen) { + off -= pglen; + pgoff = 0; + continue; + } + seglen = pglen - off; + segoff = pgoff + off; + off = 0; + seglen = MIN(seglen, len); + len -= seglen; + paddr = ext_pgs->pa[i] + segoff; + error = sglist_append_phys(sg, paddr, seglen); + pgoff = 0; + }; + if (error == 0 && len > 0) { + seglen = MIN(len, ext_pgs->trail_len - off); + len -= seglen; + error = sglist_append(sg, + &ext_pgs->trail[off], seglen); + } + if (error == 0) + KASSERT(len == 0, ("len != 0")); + return (error); +} + +/* + * Append the segments to describe an EXT_PGS mbuf to a scatter/gather + * list. If there are insufficient segments, then this fails with + * EFBIG. + */ +int +sglist_append_mb_ext_pgs(struct sglist *sg, struct mbuf *m) +{ + + /* for now, all unmapped mbufs are assumed to be EXT_PGS */ + MBUF_EXT_PGS_ASSERT(m); + return (sglist_append_ext_pgs(sg, m->m_ext.ext_pgs, + mtod(m, vm_offset_t), m->m_len)); +} + +/* * Append the segments that describe a single mbuf chain to a * scatter/gather list. If there are insufficient segments, then this * fails with EFBIG. @@ -338,7 +477,11 @@ sglist_append_mbuf(struct sglist *sg, struct mbuf *m0) SGLIST_SAVE(sg, save); for (m = m0; m != NULL; m = m->m_next) { if (m->m_len > 0) { - error = sglist_append(sg, m->m_data, m->m_len); + if ((m->m_flags & M_NOMAP) != 0) + error = sglist_append_mb_ext_pgs(sg, m); + else + error = sglist_append(sg, m->m_data, + m->m_len); if (error) { SGLIST_RESTORE(sg, save); return (error); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri Jun 28 23:40:58 2019 (r349528) +++ head/sys/kern/uipc_mbuf.c Sat Jun 29 00:48:33 2019 (r349529) @@ -49,7 +49,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include +#include SDT_PROBE_DEFINE5_XLATE(sdt, , , m__init, "struct mbuf *", "mbufinfo_t *", @@ -202,7 +206,7 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) else bcopy(&m->m_ext, &n->m_ext, m_ext_copylen); n->m_flags |= M_EXT; - n->m_flags |= m->m_flags & M_RDONLY; + n->m_flags |= m->m_flags & (M_RDONLY | M_NOMAP); /* See if this is the mbuf that holds the embedded refcount. */ if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { @@ -246,7 +250,8 @@ m_demote(struct mbuf *m0, int all, int flags) __func__, m, m0)); if (m->m_flags & M_PKTHDR) m_demote_pkthdr(m); - m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | flags); + m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | + M_NOMAP | flags); } } @@ -376,7 +381,8 @@ m_move_pkthdr(struct mbuf *to, struct mbuf *from) if (to->m_flags & M_PKTHDR) m_tag_delete_chain(to, NULL); #endif - to->m_flags = (from->m_flags & M_COPYFLAGS) | (to->m_flags & M_EXT); + to->m_flags = (from->m_flags & M_COPYFLAGS) | + (to->m_flags & (M_EXT | M_NOMAP)); if ((to->m_flags & M_EXT) == 0) to->m_data = to->m_pktdat; to->m_pkthdr = from->m_pkthdr; /* especially tags */ @@ -414,7 +420,8 @@ m_dup_pkthdr(struct mbuf *to, const struct mbuf *from, if (to->m_flags & M_PKTHDR) m_tag_delete_chain(to, NULL); #endif - to->m_flags = (from->m_flags & M_COPYFLAGS) | (to->m_flags & M_EXT); + to->m_flags = (from->m_flags & M_COPYFLAGS) | + (to->m_flags & (M_EXT | M_NOMAP)); if ((to->m_flags & M_EXT) == 0) to->m_data = to->m_pktdat; to->m_pkthdr = from->m_pkthdr; @@ -579,6 +586,30 @@ nospace: return (NULL); } +static void +m_copyfromunmapped(const struct mbuf *m, int off, int len, caddr_t cp) +{ + struct iovec iov; + struct uio uio; + int error; + + KASSERT(off >= 0, ("m_copyfromunmapped: negative off %d", off)); + KASSERT(len >= 0, ("m_copyfromunmapped: negative len %d", len)); + KASSERT(off < m->m_len, + ("m_copyfromunmapped: len exceeds mbuf length")); + iov.iov_base = cp; + iov.iov_len = len; + uio.uio_resid = len; + uio.uio_iov = &iov; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_iovcnt = 1; + uio.uio_offset = 0; + uio.uio_rw = UIO_READ; + error = m_unmappedtouio(m, off, &uio, len); + KASSERT(error == 0, ("m_unmappedtouio failed: off %d, len %d", off, + len)); +} + /* * Copy data from an mbuf chain starting "off" bytes from the beginning, * continuing for "len" bytes, into the indicated buffer. @@ -600,7 +631,10 @@ m_copydata(const struct mbuf *m, int off, int len, cad *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 29 00:49:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1E7215D0443; Sat, 29 Jun 2019 00:49:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489CC9002E; Sat, 29 Jun 2019 00:49:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FEBD6CAF; Sat, 29 Jun 2019 00:49:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T0naP7033229; Sat, 29 Jun 2019 00:49:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T0nZUm033226; Sat, 29 Jun 2019 00:49:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906290049.x5T0nZUm033226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 29 Jun 2019 00:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349530 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 349530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 489CC9002E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 00:49:36 -0000 Author: jhb Date: Sat Jun 29 00:49:35 2019 New Revision: 349530 URL: https://svnweb.freebsd.org/changeset/base/349530 Log: Add support for using unmapped mbufs with sendfile(2). This can be enabled at runtime via the kern.ipc.mb_use_ext_pgs sysctl. It is disabled by default. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Relnotes: yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Jun 29 00:48:33 2019 (r349529) +++ head/sys/kern/kern_mbuf.c Sat Jun 29 00:49:35 2019 (r349530) @@ -112,6 +112,11 @@ int nmbjumbop; /* limits number of page size jumbo c int nmbjumbo9; /* limits number of 9k jumbo clusters */ int nmbjumbo16; /* limits number of 16k jumbo clusters */ +bool mb_use_ext_pgs; /* use EXT_PGS mbufs for sendfile */ +SYSCTL_BOOL(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLFLAG_RWTUN, + &mb_use_ext_pgs, 0, + "Use unmapped mbufs for sendfile(2)"); + static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ SYSCTL_QUAD(_kern_ipc, OID_AUTO, maxmbufmem, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxmbufmem, 0, Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sat Jun 29 00:48:33 2019 (r349529) +++ head/sys/kern/kern_sendfile.c Sat Jun 29 00:49:35 2019 (r349530) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #define EXT_FLAG_SYNC EXT_FLAG_VENDOR1 #define EXT_FLAG_NOCACHE EXT_FLAG_VENDOR2 +#define EXT_FLAG_CACHE_LAST EXT_FLAG_VENDOR3 /* * Structure describing a single sendfile(2) I/O, which may consist of @@ -201,6 +203,39 @@ sendfile_free_mext(struct mbuf *m) } } +static void +sendfile_free_mext_pg(struct mbuf *m) +{ + struct mbuf_ext_pgs *ext_pgs; + vm_page_t pg; + int i; + bool nocache, cache_last; + + KASSERT(m->m_flags & M_EXT && m->m_ext.ext_type == EXT_PGS, + ("%s: m %p !M_EXT or !EXT_PGS", __func__, m)); + + nocache = m->m_ext.ext_flags & EXT_FLAG_NOCACHE; + cache_last = m->m_ext.ext_flags & EXT_FLAG_CACHE_LAST; + ext_pgs = m->m_ext.ext_pgs; + + for (i = 0; i < ext_pgs->npgs; i++) { + if (cache_last && i == ext_pgs->npgs - 1) + nocache = false; + pg = PHYS_TO_VM_PAGE(ext_pgs->pa[i]); + sendfile_free_page(pg, nocache); + } + + if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { + struct sendfile_sync *sfs = m->m_ext.ext_arg2; + + mtx_lock(&sfs->mtx); + KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); + if (--sfs->count == 0) + cv_signal(&sfs->cv); + mtx_unlock(&sfs->mtx); + } +} + /* * Helper function to calculate how much data to put into page i of n. * Only first and last pages are special. @@ -283,8 +318,6 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i CURVNET_SET(so->so_vnet); if (sfio->error) { - struct mbuf *m; - /* * I/O operation failed. The state of data in the socket * is now inconsistent, and all what we can do is to tear @@ -299,9 +332,7 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i so->so_proto->pr_usrreqs->pru_abort(so); so->so_error = EIO; - m = sfio->m; - for (int i = 0; i < sfio->npages; i++) - m = m_free(m); + mb_free_notready(sfio->m, sfio->npages); } else (void)(so->so_proto->pr_usrreqs->pru_ready)(so, sfio->m, sfio->npages); @@ -540,13 +571,15 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h struct vnode *vp; struct vm_object *obj; struct socket *so; + struct mbuf_ext_pgs *ext_pgs; struct mbuf *m, *mh, *mhtail; struct sf_buf *sf; struct shmfd *shmfd; struct sendfile_sync *sfs; struct vattr va; off_t off, sbytes, rem, obj_size; - int error, softerr, bsize, hdrlen; + int bsize, error, ext_pgs_idx, hdrlen, max_pgs, softerr; + bool use_ext_pgs; obj = NULL; so = NULL; @@ -554,6 +587,7 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h sfs = NULL; hdrlen = sbytes = 0; softerr = 0; + use_ext_pgs = false; error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize); if (error != 0) @@ -714,6 +748,17 @@ retry_space: if (space > rem) space = rem; + else if (space > PAGE_SIZE) { + /* + * Use page boundaries when possible for large + * requests. + */ + if (off & PAGE_MASK) + space -= (PAGE_SIZE - (off & PAGE_MASK)); + space = trunc_page(space); + if (off & PAGE_MASK) + space += (PAGE_SIZE - (off & PAGE_MASK)); + } npages = howmany(space + (off & PAGE_MASK), PAGE_SIZE); @@ -751,6 +796,22 @@ retry_space: * dumped into socket buffer. */ pa = sfio->pa; + + /* + * Use unmapped mbufs if enabled for TCP. Unmapped + * bufs are restricted to TCP as that is what has been + * tested. In particular, unmapped mbufs have not + * been tested with UNIX-domain sockets. + */ + if (mb_use_ext_pgs && + so->so_proto->pr_protocol == IPPROTO_TCP) { + use_ext_pgs = true; + max_pgs = MBUF_PEXT_MAX_PGS; + + /* Start at last index, to wrap on first use. */ + ext_pgs_idx = max_pgs - 1; + } + for (int i = 0; i < npages; i++) { struct mbuf *m0; @@ -764,6 +825,66 @@ retry_space: npages = i; softerr = EBUSY; break; + } + + if (use_ext_pgs) { + off_t xfs; + + ext_pgs_idx++; + if (ext_pgs_idx == max_pgs) { + m0 = mb_alloc_ext_pgs(M_WAITOK, false, + sendfile_free_mext_pg); + + if (flags & SF_NOCACHE) { + m0->m_ext.ext_flags |= + EXT_FLAG_NOCACHE; + + /* + * See comment below regarding + * ignoring SF_NOCACHE for the + * last page. + */ + if ((npages - i <= max_pgs) && + ((off + space) & PAGE_MASK) && + (rem > space || rhpages > 0)) + m0->m_ext.ext_flags |= + EXT_FLAG_CACHE_LAST; + } + if (sfs != NULL) { + m0->m_ext.ext_flags |= + EXT_FLAG_SYNC; + m0->m_ext.ext_arg2 = sfs; + mtx_lock(&sfs->mtx); + sfs->count++; + mtx_unlock(&sfs->mtx); + } + ext_pgs = m0->m_ext.ext_pgs; + if (i == 0) + sfio->m = m0; + ext_pgs_idx = 0; + + /* Append to mbuf chain. */ + if (mtail != NULL) + mtail->m_next = m0; + else + m = m0; + mtail = m0; + ext_pgs->first_pg_off = + vmoff(i, off) & PAGE_MASK; + } + if (nios) { + mtail->m_flags |= M_NOTREADY; + ext_pgs->nrdy++; + } + + ext_pgs->pa[ext_pgs_idx] = VM_PAGE_TO_PHYS(pa[i]); + ext_pgs->npgs++; + xfs = xfsize(i, npages, off, space); + ext_pgs->last_pg_len = xfs; + MBUF_EXT_PGS_ASSERT_SANITY(ext_pgs); + mtail->m_len += xfs; + mtail->m_ext.ext_size += PAGE_SIZE; + continue; } /* Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Jun 29 00:48:33 2019 (r349529) +++ head/sys/sys/mbuf.h Sat Jun 29 00:49:35 2019 (r349530) @@ -1129,6 +1129,7 @@ extern int max_hdr; /* Largest link + protocol header extern int max_linkhdr; /* Largest link-level header */ extern int max_protohdr; /* Largest protocol header */ extern int nmbclusters; /* Maximum number of clusters */ +extern bool mb_use_ext_pgs; /* Use ext_pgs for sendfile */ /*- * Network packets may have annotations attached by affixing a list of From owner-svn-src-all@freebsd.org Sat Jun 29 00:50:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75AF015D0531; Sat, 29 Jun 2019 00:50:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1947B901E8; Sat, 29 Jun 2019 00:50:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFC0E6CE1; Sat, 29 Jun 2019 00:50:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T0oPXK033333; Sat, 29 Jun 2019 00:50:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T0oPJg033332; Sat, 29 Jun 2019 00:50:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906290050.x5T0oPJg033332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 29 Jun 2019 00:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349531 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1947B901E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 00:50:26 -0000 Author: jhb Date: Sat Jun 29 00:50:25 2019 New Revision: 349531 URL: https://svnweb.freebsd.org/changeset/base/349531 Log: Compress pending socket buffer data once it is marked ready. Apply similar logic from sbcompress to pending data in the socket buffer once it is marked ready via sbready. Normally sbcompress merges small mbufs to reduce the length of mbuf chains in the socket buffer. However, sbcompress cannot do this for mbufs marked M_NOTREADY. sbcompress_ready is now called from sbready when mbufs are marked ready to merge small mbuf chains once the data is available to copy. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Modified: head/sys/kern/uipc_sockbuf.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sat Jun 29 00:49:35 2019 (r349530) +++ head/sys/kern/uipc_sockbuf.c Sat Jun 29 00:50:25 2019 (r349531) @@ -89,6 +89,78 @@ sbm_clrprotoflags(struct mbuf *m, int flags) } /* + * Compress M_NOTREADY mbufs after they have been readied by sbready(). + * + * sbcompress() skips M_NOTREADY mbufs since the data is not available to + * be copied at the time of sbcompress(). This function combines small + * mbufs similar to sbcompress() once mbufs are ready. 'm0' is the first + * mbuf sbready() marked ready, and 'end' is the first mbuf still not + * ready. + */ +static void +sbready_compress(struct sockbuf *sb, struct mbuf *m0, struct mbuf *end) +{ + struct mbuf *m, *n; + int ext_size; + + SOCKBUF_LOCK_ASSERT(sb); + + if ((sb->sb_flags & SB_NOCOALESCE) != 0) + return; + + for (m = m0; m != end; m = m->m_next) { + MPASS((m->m_flags & M_NOTREADY) == 0); + + /* Compress small unmapped mbufs into plain mbufs. */ + if ((m->m_flags & M_NOMAP) && m->m_len <= MLEN) { + MPASS(m->m_flags & M_EXT); + ext_size = m->m_ext.ext_size; + if (mb_unmapped_compress(m) == 0) { + sb->sb_mbcnt -= ext_size; + sb->sb_ccnt -= 1; + } + } + + /* + * NB: In sbcompress(), 'n' is the last mbuf in the + * socket buffer and 'm' is the new mbuf being copied + * into the trailing space of 'n'. Here, the roles + * are reversed and 'n' is the next mbuf after 'm' + * that is being copied into the trailing space of + * 'm'. + */ + n = m->m_next; + while ((n != NULL) && (n != end) && (m->m_flags & M_EOR) == 0 && + M_WRITABLE(m) && + (m->m_flags & M_NOMAP) == 0 && + n->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ + n->m_len <= M_TRAILINGSPACE(m) && + m->m_type == n->m_type) { + KASSERT(sb->sb_lastrecord != n, + ("%s: merging start of record (%p) into previous mbuf (%p)", + __func__, n, m)); + m_copydata(n, 0, n->m_len, mtodo(m, m->m_len)); + m->m_len += n->m_len; + m->m_next = n->m_next; + m->m_flags |= n->m_flags & M_EOR; + if (sb->sb_mbtail == n) + sb->sb_mbtail = m; + + sb->sb_mbcnt -= MSIZE; + sb->sb_mcnt -= 1; + if (n->m_flags & M_EXT) { + sb->sb_mbcnt -= n->m_ext.ext_size; + sb->sb_ccnt -= 1; + } + m_free(n); + n = m->m_next; + } + } + SBLASTRECORDCHK(sb); + SBLASTMBUFCHK(sb); +} + +/* * Mark ready "count" units of I/O starting with "m". Most mbufs * count as a single unit of I/O except for EXT_PGS-backed mbufs which * can be backed by multiple pages. @@ -138,6 +210,7 @@ sbready(struct sockbuf *sb, struct mbuf *m0, int count } if (!blocker) { + sbready_compress(sb, m0, m); return (EINPROGRESS); } @@ -150,6 +223,7 @@ sbready(struct sockbuf *sb, struct mbuf *m0, int count } sb->sb_fnrdy = m; + sbready_compress(sb, m0, m); return (0); } From owner-svn-src-all@freebsd.org Sat Jun 29 00:51:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C801C15D05D6; Sat, 29 Jun 2019 00:51:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CEE19052F; Sat, 29 Jun 2019 00:51:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DEC86D3A; Sat, 29 Jun 2019 00:51:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T0pdYs037550; Sat, 29 Jun 2019 00:51:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T0pdRN037549; Sat, 29 Jun 2019 00:51:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906290051.x5T0pdRN037549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 29 Jun 2019 00:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349532 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 349532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CEE19052F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 00:51:40 -0000 Author: jhb Date: Sat Jun 29 00:51:38 2019 New Revision: 349532 URL: https://svnweb.freebsd.org/changeset/base/349532 Log: Support IFCAP_NOMAP in vlan(4). Enable IFCAP_NOMAP for a vlan interface if it is supported by the underlying trunk device. Reviewed by: gallatin, hselasky, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sat Jun 29 00:50:25 2019 (r349531) +++ head/sys/net/if_vlan.c Sat Jun 29 00:51:38 2019 (r349532) @@ -1731,6 +1731,16 @@ vlan_capabilities(struct ifvlan *ifv) ena |= (mena & IFCAP_TXRTLMT); #endif + /* + * If the parent interface supports unmapped mbufs, so does + * the VLAN interface. Note that this should be fine even for + * interfaces that don't support hardware tagging as headers + * are prepended in normal mbufs to unmapped mbufs holding + * payload data. + */ + cap |= (p->if_capabilities & IFCAP_NOMAP); + ena |= (mena & IFCAP_NOMAP); + ifp->if_capabilities = cap; ifp->if_capenable = ena; ifp->if_hwassist = hwa; From owner-svn-src-all@freebsd.org Sat Jun 29 00:52:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7254615D07A5; Sat, 29 Jun 2019 00:52:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10028906F7; Sat, 29 Jun 2019 00:52:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 001676E75; Sat, 29 Jun 2019 00:52:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T0qLmJ037624; Sat, 29 Jun 2019 00:52:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T0qL66037621; Sat, 29 Jun 2019 00:52:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906290052.x5T0qL66037621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 29 Jun 2019 00:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349533 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 349533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10028906F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 00:52:22 -0000 Author: jhb Date: Sat Jun 29 00:52:21 2019 New Revision: 349533 URL: https://svnweb.freebsd.org/changeset/base/349533 Log: Add support for IFCAP_NOMAP to cxgbe(4). Since cxgbe(4) uses sglist instead of bus_dma, this required updates to the code that generates scatter/gather lists for packets. Also, unmapped mbufs are always sent via DMA and never as immediate data in the payload of a work request. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Discussed with: np Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Jun 29 00:51:38 2019 (r349532) +++ head/sys/dev/cxgbe/t4_main.c Sat Jun 29 00:52:21 2019 (r349533) @@ -1623,7 +1623,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS | \ - IFCAP_HWRXTSTMP) + IFCAP_HWRXTSTMP | IFCAP_NOMAP) #define T4_CAP_ENABLE (T4_CAP) static int @@ -1986,6 +1986,8 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd rxq->iq.flags &= ~IQ_RX_TIMESTAMP; } } + if (mask & IFCAP_NOMAP) + ifp->if_capenable ^= IFCAP_NOMAP; #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Jun 29 00:51:38 2019 (r349532) +++ head/sys/dev/cxgbe/t4_sge.c Sat Jun 29 00:52:21 2019 (r349533) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #endif /* Internal mbuf flags stored in PH_loc.eight[1]. */ +#define MC_NOMAP 0x01 #define MC_RAW_WR 0x02 /* @@ -2434,15 +2435,78 @@ m_advance(struct mbuf **pm, int *poffset, int len) return ((void *)p); } +static inline int +count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_t *nextaddr) +{ + struct mbuf_ext_pgs *ext_pgs; + vm_paddr_t paddr; + int i, len, off, pglen, pgoff, seglen, segoff; + int nsegs = 0; + + MBUF_EXT_PGS_ASSERT(m); + ext_pgs = m->m_ext.ext_pgs; + off = mtod(m, vm_offset_t); + len = m->m_len; + off += skip; + len -= skip; + + if (ext_pgs->hdr_len != 0) { + if (off >= ext_pgs->hdr_len) { + off -= ext_pgs->hdr_len; + } else { + seglen = ext_pgs->hdr_len - off; + segoff = off; + seglen = min(seglen, len); + off = 0; + len -= seglen; + paddr = pmap_kextract( + (vm_offset_t)&ext_pgs->hdr[segoff]); + if (*nextaddr != paddr) + nsegs++; + *nextaddr = paddr + seglen; + } + } + pgoff = ext_pgs->first_pg_off; + for (i = 0; i < ext_pgs->npgs && len > 0; i++) { + pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff); + if (off >= pglen) { + off -= pglen; + pgoff = 0; + continue; + } + seglen = pglen - off; + segoff = pgoff + off; + off = 0; + seglen = min(seglen, len); + len -= seglen; + paddr = ext_pgs->pa[i] + segoff; + if (*nextaddr != paddr) + nsegs++; + *nextaddr = paddr + seglen; + pgoff = 0; + }; + if (len != 0) { + seglen = min(len, ext_pgs->trail_len - off); + len -= seglen; + paddr = pmap_kextract((vm_offset_t)&ext_pgs->trail[off]); + if (*nextaddr != paddr) + nsegs++; + *nextaddr = paddr + seglen; + } + + return (nsegs); +} + + /* * Can deal with empty mbufs in the chain that have m_len = 0, but the chain * must have at least one mbuf that's not empty. It is possible for this * routine to return 0 if skip accounts for all the contents of the mbuf chain. */ static inline int -count_mbuf_nsegs(struct mbuf *m, int skip) +count_mbuf_nsegs(struct mbuf *m, int skip, uint8_t *cflags) { - vm_paddr_t lastb, next; + vm_paddr_t nextaddr, paddr; vm_offset_t va; int len, nsegs; @@ -2451,9 +2515,8 @@ count_mbuf_nsegs(struct mbuf *m, int skip) MPASS(m->m_pkthdr.len >= skip); nsegs = 0; - lastb = 0; + nextaddr = 0; for (; m; m = m->m_next) { - len = m->m_len; if (__predict_false(len == 0)) continue; @@ -2461,14 +2524,20 @@ count_mbuf_nsegs(struct mbuf *m, int skip) skip -= len; continue; } + if ((m->m_flags & M_NOMAP) != 0) { + *cflags |= MC_NOMAP; + nsegs += count_mbuf_ext_pgs(m, skip, &nextaddr); + skip = 0; + continue; + } va = mtod(m, vm_offset_t) + skip; len -= skip; skip = 0; - next = pmap_kextract(va); + paddr = pmap_kextract(va); nsegs += sglist_count((void *)(uintptr_t)va, len); - if (lastb + 1 == next) + if (paddr == nextaddr) nsegs--; - lastb = pmap_kextract(va + len - 1); + nextaddr = pmap_kextract(va + len - 1) + 1; } return (nsegs); @@ -2490,7 +2559,9 @@ parse_pkt(struct adapter *sc, struct mbuf **mp) struct tcphdr *tcp; #endif uint16_t eh_type; + uint8_t cflags; + cflags = 0; M_ASSERTPKTHDR(m0); if (__predict_false(m0->m_pkthdr.len < ETHER_HDR_LEN)) { rc = EINVAL; @@ -2506,7 +2577,7 @@ restart: */ M_ASSERTPKTHDR(m0); MPASS(m0->m_pkthdr.len > 0); - nsegs = count_mbuf_nsegs(m0, 0); + nsegs = count_mbuf_nsegs(m0, 0, &cflags); if (nsegs > (needs_tso(m0) ? TX_SGL_SEGS_TSO : TX_SGL_SEGS)) { if (defragged++ > 0 || (m = m_defrag(m0, M_NOWAIT)) == NULL) { rc = EFBIG; @@ -2516,7 +2587,8 @@ restart: goto restart; } - if (__predict_false(nsegs > 2 && m0->m_pkthdr.len <= MHLEN)) { + if (__predict_false(nsegs > 2 && m0->m_pkthdr.len <= MHLEN && + !(cflags & MC_NOMAP))) { m0 = m_pullup(m0, m0->m_pkthdr.len); if (m0 == NULL) { /* Should have left well enough alone. */ @@ -2527,7 +2599,7 @@ restart: goto restart; } set_mbuf_nsegs(m0, nsegs); - set_mbuf_cflags(m0, 0); + set_mbuf_cflags(m0, cflags); if (sc->flags & IS_VF) set_mbuf_len16(m0, txpkt_vm_len16(nsegs, needs_tso(m0))); else @@ -2616,7 +2688,9 @@ restart: /* EO WRs have the headers in the WR and not the GL. */ immhdrs = m0->m_pkthdr.l2hlen + m0->m_pkthdr.l3hlen + m0->m_pkthdr.l4hlen; - nsegs = count_mbuf_nsegs(m0, immhdrs); + cflags = 0; + nsegs = count_mbuf_nsegs(m0, immhdrs, &cflags); + MPASS(cflags == mbuf_cflags(m0)); set_mbuf_eo_nsegs(m0, nsegs); set_mbuf_eo_len16(m0, txpkt_eo_len16(nsegs, immhdrs, needs_tso(m0))); @@ -4723,7 +4797,8 @@ write_txpkt_wr(struct sge_txq *txq, struct fw_eth_tx_p ctrl = sizeof(struct cpl_tx_pkt_core); if (needs_tso(m0)) ctrl += sizeof(struct cpl_tx_pkt_lso_core); - else if (pktlen <= imm_payload(2) && available >= 2) { + else if (!(mbuf_cflags(m0) & MC_NOMAP) && pktlen <= imm_payload(2) && + available >= 2) { /* Immediate data. Recalculate len16 and set nsegs to 0. */ ctrl += pktlen; len16 = howmany(sizeof(struct fw_eth_tx_pkt_wr) + Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jun 29 00:51:38 2019 (r349532) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jun 29 00:52:21 2019 (r349533) @@ -650,6 +650,8 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbu if (IS_AIOTX_MBUF(m)) rc = sglist_append_vmpages(&sg, aiotx_mbuf_pages(m), aiotx_mbuf_pgoff(m), m->m_len); + else if (m->m_flags & M_NOMAP) + rc = sglist_append_mb_ext_pgs(&sg, m); else rc = sglist_append(&sg, mtod(m, void *), m->m_len); if (__predict_false(rc != 0)) @@ -771,6 +773,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep if (IS_AIOTX_MBUF(m)) n = sglist_count_vmpages(aiotx_mbuf_pages(m), aiotx_mbuf_pgoff(m), m->m_len); + else if (m->m_flags & M_NOMAP) + n = sglist_count_mb_ext_pgs(m); else n = sglist_count(mtod(m, void *), m->m_len); From owner-svn-src-all@freebsd.org Sat Jun 29 00:53:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BEEF15D0812; Sat, 29 Jun 2019 00:53:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C256490840; Sat, 29 Jun 2019 00:53:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB3CF6E7F; Sat, 29 Jun 2019 00:53:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T0r71C038660; Sat, 29 Jun 2019 00:53:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T0r72q038659; Sat, 29 Jun 2019 00:53:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906290053.x5T0r72q038659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 29 Jun 2019 00:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349534 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 349534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C256490840 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 00:53:08 -0000 Author: jhb Date: Sat Jun 29 00:53:07 2019 New Revision: 349534 URL: https://svnweb.freebsd.org/changeset/base/349534 Log: Add support for IFCAP_NOMAP to mlx5(4). Since mlx5 uses bus_dma, this only required adding the capability flag. Submitted by: gallatin Reviewed by: gallatin, hselasky, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Sat Jun 29 00:52:21 2019 (r349533) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Sat Jun 29 00:53:07 2019 (r349534) @@ -3281,6 +3281,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t "tso6 disabled due to -txcsum6.\n"); } } + if (mask & IFCAP_NOMAP) + ifp->if_capenable ^= IFCAP_NOMAP; if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; if (mask & IFCAP_RXCSUM_IPV6) @@ -4147,6 +4149,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) ifp->if_capabilities |= IFCAP_LRO; ifp->if_capabilities |= IFCAP_TSO | IFCAP_VLAN_HWTSO; ifp->if_capabilities |= IFCAP_HWSTATS | IFCAP_HWRXTSTMP; + ifp->if_capabilities |= IFCAP_NOMAP; ifp->if_capabilities |= IFCAP_TXRTLMT; ifp->if_snd_tag_alloc = mlx5e_snd_tag_alloc; ifp->if_snd_tag_free = mlx5e_snd_tag_free; From owner-svn-src-all@freebsd.org Sat Jun 29 04:39:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4862215D3D23; Sat, 29 Jun 2019 04:39:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE17296730; Sat, 29 Jun 2019 04:39:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1D7194C5; Sat, 29 Jun 2019 04:39:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T4d3Fl057021; Sat, 29 Jun 2019 04:39:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T4d12m057009; Sat, 29 Jun 2019 04:39:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906290439.x5T4d12m057009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 29 Jun 2019 04:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349535 - vendor/less/dist X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/less/dist X-SVN-Commit-Revision: 349535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE17296730 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 04:39:04 -0000 Author: delphij Date: Sat Jun 29 04:39:01 2019 New Revision: 349535 URL: https://svnweb.freebsd.org/changeset/base/349535 Log: Vendor import of less v551. Modified: vendor/less/dist/LICENSE vendor/less/dist/Makefile.aut vendor/less/dist/NEWS vendor/less/dist/README vendor/less/dist/brac.c vendor/less/dist/ch.c vendor/less/dist/charset.c vendor/less/dist/charset.h vendor/less/dist/cmd.h vendor/less/dist/cmdbuf.c vendor/less/dist/command.c vendor/less/dist/compose.uni vendor/less/dist/configure vendor/less/dist/configure.ac vendor/less/dist/cvt.c vendor/less/dist/decode.c vendor/less/dist/defines.ds vendor/less/dist/defines.h.in vendor/less/dist/defines.o2 vendor/less/dist/defines.o9 vendor/less/dist/defines.wn vendor/less/dist/edit.c vendor/less/dist/filename.c vendor/less/dist/fmt.uni vendor/less/dist/forwback.c vendor/less/dist/funcs.h vendor/less/dist/help.c vendor/less/dist/ifile.c vendor/less/dist/input.c vendor/less/dist/jump.c vendor/less/dist/less.h vendor/less/dist/less.hlp vendor/less/dist/less.man vendor/less/dist/less.nro vendor/less/dist/lessecho.c vendor/less/dist/lessecho.man vendor/less/dist/lessecho.nro vendor/less/dist/lesskey.c vendor/less/dist/lesskey.h vendor/less/dist/lesskey.man vendor/less/dist/lesskey.nro vendor/less/dist/lglob.h vendor/less/dist/line.c vendor/less/dist/linenum.c vendor/less/dist/lsystem.c vendor/less/dist/main.c vendor/less/dist/mark.c vendor/less/dist/mkutable vendor/less/dist/optfunc.c vendor/less/dist/option.c vendor/less/dist/option.h vendor/less/dist/opttbl.c vendor/less/dist/os.c vendor/less/dist/output.c vendor/less/dist/pattern.c vendor/less/dist/pattern.h vendor/less/dist/pckeys.h vendor/less/dist/position.c vendor/less/dist/position.h vendor/less/dist/prompt.c vendor/less/dist/screen.c vendor/less/dist/scrsize.c vendor/less/dist/search.c vendor/less/dist/signal.c vendor/less/dist/tags.c vendor/less/dist/ttyin.c vendor/less/dist/ubin.uni vendor/less/dist/version.c vendor/less/dist/wide.uni Modified: vendor/less/dist/LICENSE ============================================================================== --- vendor/less/dist/LICENSE Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/LICENSE Sat Jun 29 04:39:01 2019 (r349535) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2016 Mark Nudelman +Copyright (C) 1984-2018 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: vendor/less/dist/Makefile.aut ============================================================================== --- vendor/less/dist/Makefile.aut Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/Makefile.aut Sat Jun 29 04:39:01 2019 (r349535) @@ -112,6 +112,13 @@ ubin.uni: unicode/UnicodeData.txt wide.uni: unicode/EastAsianWidth.txt ./mkutable -f1 W F -- unicode/EastAsianWidth.txt > $@ +unicode/UnicodeData.txt: + mkdir -p unicode + curl -s -o $@ ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt +unicode/EastAsianWidth.txt: + mkdir -p unicode + curl -s -o $@ ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt + distfiles: ${DISTFILES} dist: ${DISTFILES} @@ -137,4 +144,4 @@ dist: ${DISTFILES} tagall: @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/v\1/' -e q ${srcdir}/version.c`; \ echo "tagging $$REL"; \ - $(GIT) tag -f "$$REL" + $(GIT) tag -a -f -m "$$REL" "$$REL" Modified: vendor/less/dist/NEWS ============================================================================== --- vendor/less/dist/NEWS Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/NEWS Sat Jun 29 04:39:01 2019 (r349535) @@ -11,6 +11,38 @@ ====================================================================== + Major changes between "less" versions 530 and 551 + +* Add --mouse option. + +* Add --wheel-lines option. + +* Add --no-histdups option. + +* Add --save-marks option. + +* Support PCRE2 regular expression library. + +* Redraw screen on SIGWINCH even if screen size doesn't change. + +* Shell-escape filenames in history so they can be used again. + +* Ring bell if user enters invalid long option name. + +* Use PCRE_UTF8 flag for pcre regular expressions when in UTF-8 mode. + +* Windows: use wide-char string to set console title. + +* Don't count lines in initial screen if using -X with -F. + +* Support mingw build system. + +* Fix bug in v command on empty file. + +* Fix bug in v command when filename contains shell metacharacters. + +====================================================================== + Major changes between "less" versions 487 and 530 * Don't output terminal init sequence if using -F and file fits on one screen. Modified: vendor/less/dist/README ============================================================================== --- vendor/less/dist/README Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/README Sat Jun 29 04:39:01 2019 (r349535) @@ -1,7 +1,7 @@ - Less, version 530 + Less, version 551 - This is the distribution of less, version 530, released 05 Dec 2017. + This is the distribution of less, version 551, released 11 Jun 2019. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -48,6 +48,7 @@ INSTALLATION (Unix systems only): finds a regular expression library automatically. Other values are: gnu Use the GNU regex library. pcre Use the PCRE library. + pcre2 Use the PCRE2 library. posix Use the POSIX-compatible regcomp. regcmp Use the regcmp library. re_comp Use the re_comp library. @@ -55,6 +56,7 @@ INSTALLATION (Unix systems only): regcomp-local Use Henry Spencer's V8-compatible regcomp (source is supplied with less). none No regular expressions, only simple string matching. + --with-secure Builds a "secure" version of less, with some features disabled to prevent users from viewing other files, accessing shell Modified: vendor/less/dist/brac.c ============================================================================== --- vendor/less/dist/brac.c Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/brac.c Sat Jun 29 04:39:01 2019 (r349535) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/ch.c ============================================================================== --- vendor/less/dist/ch.c Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/ch.c Sat Jun 29 04:39:01 2019 (r349535) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -144,7 +144,7 @@ static int ch_addbuf(); * Get the character pointed to by the read pointer. */ int -ch_get() +ch_get(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -392,7 +392,7 @@ ch_ungetchar(c) * If we haven't read all of standard input into it, do that now. */ public void -end_logfile() +end_logfile(VOID_PARAM) { static int tried = FALSE; @@ -417,7 +417,7 @@ end_logfile() * Write all the existing buffered data to the log file. */ public void -sync_logfile() +sync_logfile(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -515,7 +515,7 @@ ch_seek(pos) * Seek to the end of the file. */ public int -ch_end_seek() +ch_end_seek(VOID_PARAM) { POSITION len; @@ -542,7 +542,7 @@ ch_end_seek() * Seek to the last position in the file that is currently buffered. */ public int -ch_end_buffer_seek() +ch_end_buffer_seek(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -570,7 +570,7 @@ ch_end_buffer_seek() * beginning of the pipe is no longer buffered. */ public int -ch_beg_seek() +ch_beg_seek(VOID_PARAM) { struct bufnode *bn; struct bufnode *firstbn; @@ -602,7 +602,7 @@ ch_beg_seek() * Return the length of the file, if known. */ public POSITION -ch_length() +ch_length(VOID_PARAM) { if (thisfile == NULL) return (NULL_POSITION); @@ -619,7 +619,7 @@ ch_length() * Return the current position in the file. */ public POSITION -ch_tell() +ch_tell(VOID_PARAM) { if (thisfile == NULL) return (NULL_POSITION); @@ -630,7 +630,7 @@ ch_tell() * Get the current char and post-increment the read pointer. */ public int -ch_forw_get() +ch_forw_get(VOID_PARAM) { int c; @@ -653,7 +653,7 @@ ch_forw_get() * Pre-decrement the read pointer and get the new current char. */ public int -ch_back_get() +ch_back_get(VOID_PARAM) { if (thisfile == NULL) return (EOI); @@ -693,7 +693,7 @@ ch_setbufspace(bufspace) * Flush (discard) any saved file state, including buffer contents. */ public void -ch_flush() +ch_flush(VOID_PARAM) { struct bufnode *bn; @@ -760,7 +760,7 @@ ch_flush() * The buffer is added to the tail of the buffer chain. */ static int -ch_addbuf() +ch_addbuf(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -785,7 +785,7 @@ ch_addbuf() * */ static void -init_hashtbl() +init_hashtbl(VOID_PARAM) { int h; @@ -800,7 +800,7 @@ init_hashtbl() * Delete all buffers for this file. */ static void -ch_delbufs() +ch_delbufs(VOID_PARAM) { struct bufnode *bn; @@ -840,7 +840,7 @@ seekable(f) * This is used after an ignore_eof read, during which the EOF may change. */ public void -ch_set_eof() +ch_set_eof(VOID_PARAM) { ch_fsize = ch_fpos; } @@ -890,7 +890,7 @@ ch_init(f, flags) * Close a filestate. */ public void -ch_close() +ch_close(VOID_PARAM) { int keepstate = FALSE; @@ -933,7 +933,7 @@ ch_close() * Return ch_flags for the current file. */ public int -ch_getflags() +ch_getflags(VOID_PARAM) { if (thisfile == NULL) return (0); Modified: vendor/less/dist/charset.c ============================================================================== --- vendor/less/dist/charset.c Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/charset.c Sat Jun 29 04:39:01 2019 (r349535) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -245,7 +245,7 @@ icharset(name, no_error) * Define a charset, given a locale name. */ static void -ilocale() +ilocale(VOID_PARAM) { int c; @@ -315,7 +315,7 @@ setfmt(s, fmtvarptr, attrptr, default_fmt) * */ static void -set_charset() +set_charset(VOID_PARAM) { char *s; @@ -338,7 +338,7 @@ set_charset() * LESSCHARSET is not defined: try LESSCHARDEF. */ s = lgetenv("LESSCHARDEF"); - if (s != NULL && *s != '\0') + if (!isnullenv(s)) { ichardef(s); return; @@ -395,7 +395,7 @@ set_charset() * Initialize charset data structures. */ public void -init_charset() +init_charset(VOID_PARAM) { char *s; Modified: vendor/less/dist/charset.h ============================================================================== --- vendor/less/dist/charset.h Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/charset.h Sat Jun 29 04:39:01 2019 (r349535) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/cmd.h ============================================================================== --- vendor/less/dist/cmd.h Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/cmd.h Sat Jun 29 04:39:01 2019 (r349535) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -71,6 +71,13 @@ #define A_RRSHIFT 59 #define A_CLRMARK 62 #define A_SETMARKBOT 63 +#define A_X11MOUSE_IN 64 +#define A_X11MOUSE_IGNORE 65 +#define A_F_MOUSE 66 +#define A_B_MOUSE 67 +/* Note "X116" refers to extended (1006) X11 mouse reporting. */ +#define A_X116MOUSE_IN 68 +#define A_X116MOUSE_IGNORE 69 #define A_INVALID 100 #define A_NOACTION 101 Modified: vendor/less/dist/cmdbuf.c ============================================================================== --- vendor/less/dist/cmdbuf.c Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/cmdbuf.c Sat Jun 29 04:39:01 2019 (r349535) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -22,6 +22,8 @@ extern int sc_width; extern int utf_mode; +extern int no_hist_dups; +extern int marks_modified; static char cmdbuf[CMDBUF_SIZE]; /* Buffer for holding a multi-char command */ static int cmd_col; /* Current column of the cursor */ @@ -58,6 +60,7 @@ public char closequote = '"'; #define HISTFILE_FIRST_LINE ".less-history-file:" #define HISTFILE_SEARCH_SECTION ".search" #define HISTFILE_SHELL_SECTION ".shell" +#define HISTFILE_MARK_SECTION ".mark" /* * A mlist structure represents a command history. @@ -114,7 +117,7 @@ static int cmd_mbc_buf_index; * Reset command buffer (to empty). */ public void -cmd_reset() +cmd_reset(VOID_PARAM) { cp = cmdbuf; *cp = '\0'; @@ -129,7 +132,7 @@ cmd_reset() * Clear command line. */ public void -clear_cmd() +clear_cmd(VOID_PARAM) { cmd_col = prompt_col = 0; cmd_mbc_buf_len = 0; @@ -169,7 +172,7 @@ cmd_putstr(s) * How many characters are in the command buffer? */ public int -len_cmdbuf() +len_cmdbuf(VOID_PARAM) { char *s = cmdbuf; char *endline = s + strlen(s); @@ -302,7 +305,7 @@ cmd_repaint(old_cp) * and set cp to the corresponding char in cmdbuf. */ static void -cmd_home() +cmd_home(VOID_PARAM) { while (cmd_col > prompt_col) { @@ -321,7 +324,7 @@ cmd_home() * Shift the cmdbuf display left a half-screen. */ static void -cmd_lshift() +cmd_lshift(VOID_PARAM) { char *s; char *save_cp; @@ -359,7 +362,7 @@ cmd_lshift() * Shift the cmdbuf display right a half-screen. */ static void -cmd_rshift() +cmd_rshift(VOID_PARAM) { char *s; char *save_cp; @@ -389,7 +392,7 @@ cmd_rshift() * Move cursor right one character. */ static int -cmd_right() +cmd_right(VOID_PARAM) { char *pr; char *ncp; @@ -424,7 +427,7 @@ cmd_right() * Move cursor left one character. */ static int -cmd_left() +cmd_left(VOID_PARAM) { char *ncp; int width = 0; @@ -492,7 +495,7 @@ cmd_ichar(cs, clen) * Delete the char to the left of the cursor. */ static int -cmd_erase() +cmd_erase(VOID_PARAM) { char *s; int clen; @@ -541,7 +544,7 @@ cmd_erase() * Delete the char under the cursor. */ static int -cmd_delete() +cmd_delete(VOID_PARAM) { if (*cp == '\0') { @@ -560,7 +563,7 @@ cmd_delete() * Delete the "word" to the left of the cursor. */ static int -cmd_werase() +cmd_werase(VOID_PARAM) { if (cp > cmdbuf && cp[-1] == ' ') { @@ -586,7 +589,7 @@ cmd_werase() * Delete the "word" under the cursor. */ static int -cmd_wdelete() +cmd_wdelete(VOID_PARAM) { if (*cp == ' ') { @@ -612,7 +615,7 @@ cmd_wdelete() * Delete all chars in the command buffer. */ static int -cmd_kill() +cmd_kill(VOID_PARAM) { if (cmdbuf[0] == '\0') { @@ -702,6 +705,7 @@ cmd_updown(action) s = ml->string; if (s == NULL) s = ""; + cmd_offset = 0; cmd_home(); clear_eol(); strcpy(cmdbuf, s); @@ -719,6 +723,31 @@ cmd_updown(action) #endif /* + * + */ + static void +ml_link(mlist, ml) + struct mlist *mlist; + struct mlist *ml; +{ + ml->next = mlist; + ml->prev = mlist->prev; + mlist->prev->next = ml; + mlist->prev = ml; +} + +/* + * + */ + static void +ml_unlink(ml) + struct mlist *ml; +{ + ml->prev->next = ml->next; + ml->next->prev = ml->prev; +} + +/* * Add a string to an mlist. */ public void @@ -736,6 +765,21 @@ cmd_addhist(mlist, cmd, modified) if (strlen(cmd) == 0) return; + if (no_hist_dups) + { + struct mlist *next = NULL; + for (ml = mlist->next; ml->string != NULL; ml = next) + { + next = ml->next; + if (strcmp(ml->string, cmd) == 0) + { + ml_unlink(ml); + free(ml->string); + free(ml); + } + } + } + /* * Save the command unless it's a duplicate of the * last command in the history. @@ -750,10 +794,7 @@ cmd_addhist(mlist, cmd, modified) ml = (struct mlist *) ecalloc(1, sizeof(struct mlist)); ml->string = save(cmd); ml->modified = modified; - ml->next = mlist; - ml->prev = mlist->prev; - mlist->prev->next = ml; - mlist->prev = ml; + ml_link(mlist, ml); } /* * Point to the cmd just after the just-accepted command. @@ -768,13 +809,13 @@ cmd_addhist(mlist, cmd, modified) * Add it to the currently selected history list. */ public void -cmd_accept() +cmd_accept(VOID_PARAM) { #if CMD_HISTORY /* * Nothing to do if there is no currently selected history list. */ - if (curr_mlist == NULL) + if (curr_mlist == NULL || curr_mlist == ml_examine) return; cmd_addhist(curr_mlist, cmdbuf, 1); curr_mlist->modified = 1; @@ -799,7 +840,7 @@ cmd_edit(c) #if TAB_COMPLETE_FILENAME #define not_in_completion() in_completion = 0 #else -#define not_in_completion() +#define not_in_completion(VOID_PARAM) #endif /* @@ -934,7 +975,7 @@ cmd_istr(str) * cursor at the end of the word. */ static char * -delimit_word() +delimit_word(VOID_PARAM) { char *word; #if SPACES_IN_FILENAMES @@ -1021,7 +1062,7 @@ delimit_word() * which start with that word, and set tk_text to that list. */ static void -init_compl() +init_compl(VOID_PARAM) { char *word; char c; @@ -1148,9 +1189,9 @@ cmd_complete(action) tk_trial = next_compl(action, tk_trial); } - /* - * Remove the original word, or the previous trial completion. - */ + /* + * Remove the original word, or the previous trial completion. + */ while (cp > tk_ipoint) (void) cmd_erase(); @@ -1323,7 +1364,7 @@ cmd_int(frac) * Return a pointer to the command buffer. */ public char * -get_cmdbuf() +get_cmdbuf(VOID_PARAM) { return (cmdbuf); } @@ -1333,7 +1374,7 @@ get_cmdbuf() * Return the last (most recent) string in the current command history. */ public char * -cmd_lastpattern() +cmd_lastpattern(VOID_PARAM) { if (curr_mlist == NULL) return (NULL); @@ -1358,7 +1399,7 @@ mlist_size(ml) * Get the name of the history file. */ static char * -histfile_name() +histfile_name(VOID_PARAM) { char *home; char *name; @@ -1366,7 +1407,7 @@ histfile_name() /* See if filename is explicitly specified by $LESSHISTFILE. */ name = lgetenv("LESSHISTFILE"); - if (name != NULL && *name != '\0') + if (!isnullenv(name)) { if (strcmp(name, "-") == 0 || strcmp(name, "/dev/null") == 0) /* $LESSHISTFILE == "-" means don't use a history file. */ @@ -1380,11 +1421,11 @@ histfile_name() /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); - if (home == NULL || *home == '\0') + if (isnullenv(home)) { #if OS2 home = lgetenv("INIT"); - if (home == NULL || *home == '\0') + if (isnullenv(home)) #endif return (NULL); } @@ -1447,6 +1488,9 @@ read_cmdhist2(action, uparam, skip_search, skip_shell) ml = NULL; skip = NULL; #endif + } else if (strcmp(line, HISTFILE_MARK_SECTION) == 0) + { + ml = NULL; } else if (*line == '"') { if (ml != NULL) @@ -1456,6 +1500,9 @@ read_cmdhist2(action, uparam, skip_search, skip_shell) else (*action)(uparam, ml, line+1); } + } else if (*line == 'm') + { + (*action)(uparam, NULL, line); } } fclose(f); @@ -1475,9 +1522,10 @@ read_cmdhist(action, uparam, skip_search, skip_shell) static void addhist_init(void *uparam, struct mlist *ml, char *string) { - if (ml == NULL || string == NULL) - return; - cmd_addhist(ml, string, 0); + if (ml != NULL) + cmd_addhist(ml, string, 0); + else if (string != NULL) + restore_mark(string); } #endif /* CMD_HISTORY */ @@ -1485,7 +1533,7 @@ addhist_init(void *uparam, struct mlist *ml, char *str * Initialize history from a .lesshist file. */ public void -init_cmdhist() +init_cmdhist(VOID_PARAM) { #if CMD_HISTORY read_cmdhist(&addhist_init, NULL, 0, 0); @@ -1558,7 +1606,7 @@ copy_hist(void *uparam, struct mlist *ml, char *string { struct save_ctx *ctx = (struct save_ctx *) uparam; - if (ml != ctx->mlist) { + if (ml != NULL && ml != ctx->mlist) { /* We're changing mlists. */ if (ctx->mlist) /* Append any new entries to the end of the current mlist. */ @@ -1567,13 +1615,9 @@ copy_hist(void *uparam, struct mlist *ml, char *string ctx->mlist = ml; write_mlist_header(ctx->mlist, ctx->fout); } - if (string != NULL) + + if (string == NULL) /* End of file */ { - /* Copy the entry. */ - fprintf(ctx->fout, "\"%s\n", string); - } - if (ml == NULL) /* End of file */ - { /* Write any sections that were not in the original file. */ if (mlist_search.modified) { @@ -1587,7 +1631,12 @@ copy_hist(void *uparam, struct mlist *ml, char *string write_mlist(&mlist_shell, ctx->fout); } #endif + } else if (ml != NULL) + { + /* Copy mlist entry. */ + fprintf(ctx->fout, "\"%s\n", string); } + /* Skip marks */ } #endif /* CMD_HISTORY */ @@ -1616,7 +1665,7 @@ make_file_private(f) * Does the history file need to be updated? */ static int -histfile_modified() +histfile_modified(VOID_PARAM) { if (mlist_search.modified) return 1; @@ -1624,6 +1673,10 @@ histfile_modified() if (mlist_shell.modified) return 1; #endif +#if CMD_HISTORY + if (marks_modified) + return 1; +#endif return 0; } @@ -1631,7 +1684,7 @@ histfile_modified() * Update the .lesshst file. */ public void -save_cmdhist() +save_cmdhist(VOID_PARAM) { #if CMD_HISTORY char *histname; @@ -1665,7 +1718,8 @@ save_cmdhist() fprintf(fout, "%s\n", HISTFILE_FIRST_LINE); ctx.fout = fout; ctx.mlist = NULL; - read_cmdhist(copy_hist, &ctx, skip_search, skip_shell); + read_cmdhist(©_hist, &ctx, skip_search, skip_shell); + save_marks(fout, HISTFILE_MARK_SECTION); fclose(fout); #if MSDOS_COMPILER==WIN32C /* Modified: vendor/less/dist/command.c ============================================================================== --- vendor/less/dist/command.c Sat Jun 29 00:53:07 2019 (r349534) +++ vendor/less/dist/command.c Sat Jun 29 04:39:01 2019 (r349535) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -47,6 +47,7 @@ extern struct scrpos initial_scrpos; extern IFILE curr_ifile; extern void *ml_search; extern void *ml_examine; +extern int wheel_lines; #if SHELL_ESCAPE || PIPEC extern void *ml_shell; #endif @@ -58,6 +59,9 @@ extern int screen_trashed; /* The screen has been over extern int shift_count; extern int oldbot; extern int forw_prompt; +#if MSDOS_COMPILER==WIN32C +extern int utf_mode; +#endif #if SHELL_ESCAPE static char *shellcmd = NULL; /* For holding last shell command for "!!" */ @@ -92,14 +96,39 @@ static void multi_search(); * updating the screen. */ static void -cmd_exec() +cmd_exec(VOID_PARAM) { - clear_attn(); + clear_attn(); clear_bot(); flush(); } /* + * Indicate we are reading a multi-character command. + */ + static void +set_mca(action) + int action; +{ + mca = action; + deinit_mouse(); /* we don't want mouse events while entering a cmd */ + clear_bot(); + clear_cmd(); +} + +/* + * Indicate we are not reading a multi-character command. + */ + static void +clear_mca(VOID_PARAM) +{ + if (mca == 0) + return; + mca = 0; + init_mouse(); +} + +/* * Set up the display to start a new multi-character command. */ static void @@ -109,15 +138,13 @@ start_mca(action, prompt, mlist, cmdflags) void *mlist; int cmdflags; { - mca = action; - clear_bot(); - clear_cmd(); + set_mca(action); cmd_putstr(prompt); set_mlist(mlist, cmdflags); } public int -in_mca() +in_mca(VOID_PARAM) { return (mca != 0 && mca != A_PREFIX); } @@ -126,21 +153,18 @@ in_mca() * Set up the display to start a new search command. */ static void -mca_search() +mca_search(VOID_PARAM) { #if HILITE_SEARCH if (search_type & SRCH_FILTER) - mca = A_FILTER; + set_mca(A_FILTER); else #endif if (search_type & SRCH_FORW) - mca = A_F_SEARCH; + set_mca(A_F_SEARCH); else - mca = A_B_SEARCH; + set_mca(A_B_SEARCH); - clear_bot(); - clear_cmd(); - if (search_type & SRCH_NO_MATCH) cmd_putstr("Non-match "); if (search_type & SRCH_FIRST_FILE) @@ -169,7 +193,7 @@ mca_search() * Set up the display to start a new toggle-option command. */ static void -mca_opt_toggle() +mca_opt_toggle(VOID_PARAM) { int no_prompt; int flag; @@ -179,9 +203,7 @@ mca_opt_toggle() flag = (optflag & ~OPT_NO_PROMPT); dash = (flag == OPT_NO_TOGGLE) ? "_" : "-"; - mca = A_OPT_TOGGLE; - clear_bot(); - clear_cmd(); + set_mca(A_OPT_TOGGLE); cmd_putstr(dash); if (optgetname) cmd_putstr(dash); @@ -204,7 +226,7 @@ mca_opt_toggle() * Execute a multicharacter command. */ static void -exec_mca() +exec_mca(VOID_PARAM) { char *cbuf; @@ -371,6 +393,7 @@ mca_opt_nonfirst_char(c) { char *p; char *oname; + int err; if (curropt != NULL) { @@ -390,7 +413,8 @@ mca_opt_nonfirst_char(c) return (MCA_DONE); p = get_cmdbuf(); opt_lower = ASCII_IS_LOWER(p[0]); - curropt = findopt_name(&p, &oname, NULL); + err = 0; + curropt = findopt_name(&p, &oname, &err); if (curropt != NULL) { /* @@ -408,6 +432,9 @@ mca_opt_nonfirst_char(c) if (cmd_char(c) != CC_OK) return (MCA_DONE); } + } else if (err != OPT_AMBIG) + { + bell(); } return (MCA_MORE); } @@ -459,6 +486,7 @@ mca_opt_char(c) error("There is no %s option", &parg); return (MCA_DONE); } + opt_lower = ASCII_IS_LOWER(c); } /* * If the option which was entered does not take a @@ -468,7 +496,7 @@ mca_opt_char(c) if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE || !opt_has_param(curropt)) { - toggle_option(curropt, ASCII_IS_LOWER(c), "", optflag); + toggle_option(curropt, opt_lower, "", optflag); return (MCA_DONE); } /* @@ -571,7 +599,7 @@ mca_char(c) * as a normal command character. */ number = cmd_int(&fraction); - mca = 0; + clear_mca(); cmd_accept(); return (NO_MCA); } @@ -638,7 +666,7 @@ mca_char(c) * Discard any buffered file data. */ static void -clear_buffers() +clear_buffers(VOID_PARAM) { if (!(ch_getflags() & CH_CANSEEK)) return; @@ -653,7 +681,7 @@ clear_buffers() * Make sure the screen is displayed. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 29 04:43:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71B3115D405A; Sat, 29 Jun 2019 04:43:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 193B496B96; Sat, 29 Jun 2019 04:43:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD8339663; Sat, 29 Jun 2019 04:43:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5T4hDKq061971; Sat, 29 Jun 2019 04:43:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5T4hDCI061970; Sat, 29 Jun 2019 04:43:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906290443.x5T4hDCI061970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 29 Jun 2019 04:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349536 - vendor/less/v551 X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/less/v551 X-SVN-Commit-Revision: 349536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 193B496B96 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 04:43:14 -0000 Author: delphij Date: Sat Jun 29 04:43:13 2019 New Revision: 349536 URL: https://svnweb.freebsd.org/changeset/base/349536 Log: Tag less v551. Added: vendor/less/v551/ - copied from r349535, vendor/less/dist/ From owner-svn-src-all@freebsd.org Sat Jun 29 10:58:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2149215D9CAA; Sat, 29 Jun 2019 10:58:32 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB171717CE; Sat, 29 Jun 2019 10:58:31 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 842F8D5B9; Sat, 29 Jun 2019 10:58:31 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TAwVSc057331; Sat, 29 Jun 2019 10:58:31 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TAwVIr057330; Sat, 29 Jun 2019 10:58:31 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201906291058.x5TAwVIr057330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 29 Jun 2019 10:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349538 - head/lib/libarchive/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/lib/libarchive/tests X-SVN-Commit-Revision: 349538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB171717CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 10:58:32 -0000 Author: lwhsu Date: Sat Jun 29 10:58:31 2019 New Revision: 349538 URL: https://svnweb.freebsd.org/changeset/base/349538 Log: Install missing test data file MFC with: r349527 Sponsored by: The FreeBSD Foundation Modified: head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Sat Jun 29 09:14:53 2019 (r349537) +++ head/lib/libarchive/tests/Makefile Sat Jun 29 10:58:31 2019 (r349538) @@ -512,6 +512,7 @@ ${PACKAGE}FILES+= test_read_format_rar_subblock.rar.uu ${PACKAGE}FILES+= test_read_format_rar_unicode.rar.uu ${PACKAGE}FILES+= test_read_format_rar_windows.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_arm.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_arm_filter_on_window_boundary.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_blake2.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_compressed.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_different_window_size.rar.uu From owner-svn-src-all@freebsd.org Sat Jun 29 12:19:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E65315DB95D; Sat, 29 Jun 2019 12:19:58 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23A3E736FD; Sat, 29 Jun 2019 12:19:58 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8C40E327; Sat, 29 Jun 2019 12:19:57 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TCJvCo098992; Sat, 29 Jun 2019 12:19:57 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TCJvgp098990; Sat, 29 Jun 2019 12:19:57 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201906291219.x5TCJvgp098990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 29 Jun 2019 12:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349539 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 349539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23A3E736FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 12:19:58 -0000 Author: lwhsu Date: Sat Jun 29 12:19:57 2019 New Revision: 349539 URL: https://svnweb.freebsd.org/changeset/base/349539 Log: Skip sys.netpfil.pf.names.names and sys.netpfil.pf.synproxy.synproxy temporarily because kernel panics when flushing epair queue. PR: 238870 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netpfil/pf/names.sh head/tests/sys/netpfil/pf/synproxy.sh Modified: head/tests/sys/netpfil/pf/names.sh ============================================================================== --- head/tests/sys/netpfil/pf/names.sh Sat Jun 29 10:58:31 2019 (r349538) +++ head/tests/sys/netpfil/pf/names.sh Sat Jun 29 12:19:57 2019 (r349539) @@ -11,6 +11,7 @@ names_head() names_body() { + atf_skip "Kernel panics when flushing epair queue (bug238870)" pft_init epair=$(vnet_mkepair) Modified: head/tests/sys/netpfil/pf/synproxy.sh ============================================================================== --- head/tests/sys/netpfil/pf/synproxy.sh Sat Jun 29 10:58:31 2019 (r349538) +++ head/tests/sys/netpfil/pf/synproxy.sh Sat Jun 29 12:19:57 2019 (r349539) @@ -11,6 +11,7 @@ synproxy_head() synproxy_body() { + atf_skip "Kernel panics when flushing epair queue (bug238870)" pft_init epair=$(vnet_mkepair) From owner-svn-src-all@freebsd.org Sat Jun 29 12:49:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7CE615DC297; Sat, 29 Jun 2019 12:49:53 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8350C749A3; Sat, 29 Jun 2019 12:49:53 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DAFCE838; Sat, 29 Jun 2019 12:49:53 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TCnrUA014413; Sat, 29 Jun 2019 12:49:53 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TCnrUZ014411; Sat, 29 Jun 2019 12:49:53 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201906291249.x5TCnrUZ014411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 29 Jun 2019 12:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349540 - in stable/12: share/man/man4 sys/dev/atkbdc X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/atkbdc X-SVN-Commit-Revision: 349540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8350C749A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 12:49:54 -0000 Author: wulf Date: Sat Jun 29 12:49:52 2019 New Revision: 349540 URL: https://svnweb.freebsd.org/changeset/base/349540 Log: MFC r346455-r346458, r348520, r348529, r348817, r348818 r346455: psm(4): Add support for 4 and 5 finger touches in synaptics driver While 4-th and 5-th finger positions are not exported through PS/2 interface, total number of touches is reported by MT trackpads. r346456: psm(4): do not process gestures when palm is present Ignoring of gesture processing when the palm is detected helps to reduce some of the erratic pointer behavior. This fixes regression introduced in r317814 Reported by: Ben LeMasurier r346457: psm(4): respect tap_disabled configuration with enabled Extended support This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps were processed. tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1). To respect PR kern/139272, taps are ignored only when explicity disabled. Submitted by: Ben LeMasurier (initial version) r346458: psm(4): give names to synaptics commands Submitted by: Ben LeMasurier r348520: psm(4): Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops PR: 238291 Submitted by: Andrey Kosachenko r348529: psm(4): Add natural scrolling support to sysmouse protocol This change enables natural scrolling with two finger scroll enabled and when user is using a trackpad (mouse and trackpoint are not affected). Depending on trackpad model it can be activated with setting of hw.psm.synaptics.natural_scroll or hw.psm.elantech.natural_scroll sysctl values to 1. Evdev protocol is not affected by this change too. Tune userland client e.g. libinput to enable natural scrolling in that case. Submitted by: nyan_myuji.xyz Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D20447 r348817: psm(4): Fix Elantech trackpoint support. Sign bits for X and Y motion data were taken from wrong places. PR: 238291 Reported by: Andrey Kosachenko Tested by: Andrey Kosachenko r348818: psm(4): Add extra sanity checks to Elantech trackpoint packet parser. Add strict checks for unused bit states in Elantech trackpoint packet parser to filter out spurious events produces by some hardware which are detected as trackpoint packets. See comment on r328191 for example. Tested by: Andrey Kosachenko Modified: stable/12/share/man/man4/psm.4 stable/12/sys/dev/atkbdc/psm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/psm.4 ============================================================================== --- stable/12/share/man/man4/psm.4 Sat Jun 29 12:19:57 2019 (r349539) +++ stable/12/share/man/man4/psm.4 Sat Jun 29 12:49:52 2019 (r349540) @@ -354,8 +354,8 @@ Tap and drag gestures can be disabled by setting to .Em 0 at boot-time. -Currently, this is only supported on Synaptics touchpads with Extended -support disabled. +Currently, this is supported on Synaptics touchpads regardless of Extended +support state and on Elantech touchpads with Extended support enabled. The behaviour may be changed after boot by setting the sysctl with the same name and by restarting .Xr moused 8 Modified: stable/12/sys/dev/atkbdc/psm.c ============================================================================== --- stable/12/sys/dev/atkbdc/psm.c Sat Jun 29 12:19:57 2019 (r349539) +++ stable/12/sys/dev/atkbdc/psm.c Sat Jun 29 12:49:52 2019 (r349540) @@ -178,6 +178,22 @@ typedef struct packetbuf { #define PSM_PACKETQUEUE 128 #endif +/* + * Synaptics command definitions. + */ +#define SYNAPTICS_READ_IDENTITY 0x00 +#define SYNAPTICS_READ_MODES 0x01 +#define SYNAPTICS_READ_CAPABILITIES 0x02 +#define SYNAPTICS_READ_MODEL_ID 0x03 +#define SYNAPTICS_READ_SERIAL_PREFIX 0x06 +#define SYNAPTICS_READ_SERIAL_SUFFIX 0x07 +#define SYNAPTICS_READ_RESOLUTIONS 0x08 +#define SYNAPTICS_READ_EXTENDED 0x09 +#define SYNAPTICS_READ_CAPABILITIES_CONT 0x0c +#define SYNAPTICS_READ_MAX_COORDS 0x0d +#define SYNAPTICS_READ_DELUXE_LED 0x0e +#define SYNAPTICS_READ_MIN_COORDS 0x0f + typedef struct synapticsinfo { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -219,6 +235,7 @@ typedef struct synapticsinfo { int softbutton3_x; int max_x; int max_y; + int natural_scroll; } synapticsinfo_t; typedef struct synapticspacket { @@ -554,6 +571,8 @@ enum { SYNAPTICS_SYSCTL_SOFTBUTTONS_Y = SYN_OFFSET(softbuttons_y), SYNAPTICS_SYSCTL_SOFTBUTTON2_X = SYN_OFFSET(softbutton2_x), SYNAPTICS_SYSCTL_SOFTBUTTON3_X = SYN_OFFSET(softbutton3_x), + SYNAPTICS_SYSCTL_NATURAL_SCROLL = SYN_OFFSET(natural_scroll), +#define SYNAPTICS_SYSCTL_LAST SYNAPTICS_SYSCTL_NATURAL_SCROLL }; /* packet formatting function */ @@ -1119,7 +1138,7 @@ doopen(struct psm_softc *sc, int command_byte) "active multiplexing mode.\n", sc->unit); } - mouse_ext_command(sc->kbdc, 1); + mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODES); get_mouse_status(sc->kbdc, stat, 0, 3); if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || stat[1] == 0x47) && @@ -1830,7 +1849,7 @@ psm_register_synaptics(device_t dev) if (sc->synhw.capClickPad && sc->synhw.topButtonPad) evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD); evdev_support_key(evdev_a, BTN_TOUCH); - evdev_support_nfingers(evdev_a, 3); + evdev_support_nfingers(evdev_a, sc->synhw.capReportsV ? 5 : 3); psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt); @@ -3212,8 +3231,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, { static int touchpad_buttons; static int guest_buttons; + static int ew_finger_count; static finger_t f[PSM_FINGERS]; - int w, id, nfingers, ewcode, extended_buttons, clickpad_pressed; + int w, id, nfingers, palm, ewcode, extended_buttons, clickpad_pressed; extended_buttons = 0; @@ -3372,6 +3392,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, (pb->ipacket[1] & 0x01)) + 8, .flags = PSM_FINGER_FUZZY, }; + break; + case 2: + ew_finger_count = pb->ipacket[1] & 0x0f; default: break; } @@ -3379,6 +3402,11 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, goto SYNAPTICS_END; case 1: + if (sc->synhw.capReportsV && ew_finger_count > 3) { + nfingers = ew_finger_count; + break; + } + /* FALLTHROUGH */ case 0: nfingers = w + 2; break; @@ -3568,12 +3596,16 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, ms->button = touchpad_buttons; - psmgestures(sc, &f[0], nfingers, ms); + palm = psmpalmdetect(sc, &f[0], nfingers); + + /* Palm detection doesn't terminate the current action. */ + if (!palm) + psmgestures(sc, &f[0], nfingers, ms); + for (id = 0; id < PSM_FINGERS; id++) psmsmoother(sc, &f[id], id, ms, x, y); - /* Palm detection doesn't terminate the current action. */ - if (psmpalmdetect(sc, &f[0], nfingers)) { + if (palm) { *x = *y = *z = 0; ms->button = ms->obutton; return (0); @@ -3807,9 +3839,15 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i gest->in_vscroll = 0; /* Compute tap timeout. */ - gest->taptimeout.tv_sec = tap_timeout / 1000000; - gest->taptimeout.tv_usec = tap_timeout % 1000000; - timevaladd(&gest->taptimeout, &sc->lastsoftintr); + if (tap_enabled != 0) { + gest->taptimeout = (struct timeval) { + .tv_sec = tap_timeout / 1000000, + .tv_usec = tap_timeout % 1000000, + }; + timevaladd( + &gest->taptimeout, &sc->lastsoftintr); + } else + timevalclear(&gest->taptimeout); sc->flags |= PSM_FLAGS_FINGERDOWN; @@ -4098,6 +4136,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo int len, weight_prev_x, weight_prev_y; int div_max_x, div_max_y, div_x, div_y; int is_fuzzy; + int natural_scroll; /* Read sysctl. */ /* XXX Verify values? */ @@ -4125,6 +4164,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo two_finger_scroll = sc->syninfo.two_finger_scroll; max_x = sc->syninfo.max_x; max_y = sc->syninfo.max_y; + natural_scroll = sc->syninfo.natural_scroll; is_fuzzy = (f->flags & PSM_FINGER_FUZZY) != 0; @@ -4286,14 +4326,24 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo smoother_id, dx, dy, dxp, dyp)); break; case 1: /* Vertical scrolling. */ - if (dyp != 0) - ms->button |= (dyp > 0) ? - MOUSE_BUTTON4DOWN : MOUSE_BUTTON5DOWN; + if (dyp != 0) { + if (two_finger_scroll && natural_scroll) + ms->button |= (dyp > 0) ? + MOUSE_BUTTON5DOWN : MOUSE_BUTTON4DOWN; + else + ms->button |= (dyp > 0) ? + MOUSE_BUTTON4DOWN : MOUSE_BUTTON5DOWN; + } break; case 2: /* Horizontal scrolling. */ - if (dxp != 0) - ms->button |= (dxp > 0) ? - MOUSE_BUTTON7DOWN : MOUSE_BUTTON6DOWN; + if (dxp != 0) { + if (two_finger_scroll && natural_scroll) + ms->button |= (dxp > 0) ? + MOUSE_BUTTON6DOWN : MOUSE_BUTTON7DOWN; + else + ms->button |= (dxp > 0) ? + MOUSE_BUTTON7DOWN : MOUSE_BUTTON6DOWN; + } break; } @@ -4315,7 +4365,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m { static int touchpad_button, trackpoint_button; finger_t fn, f[ELANTECH_MAX_FINGERS]; - int pkt, id, scale, i, nfingers, mask; + int pkt, id, scale, i, nfingers, mask, palm; if (!elantech_support) return (0); @@ -4625,7 +4675,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m case ELANTECH_PKT_TRACKPOINT: /* 7 6 5 4 3 2 1 0 (LSB) * ------------------------------------------- - * ipacket[0]: 0 0 SX SY 0 M R L + * ipacket[0]: 0 0 SY SX 0 M R L * ipacket[1]: ~SX 0 0 0 0 0 0 0 * ipacket[2]: ~SY 0 0 0 0 0 0 0 * ipacket[3]: 0 0 ~SY ~SX 0 1 1 0 @@ -4636,22 +4686,32 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m * over 9 bits with SX/SY the relative top bit and * X7..X0 and Y7..Y0 the lower bits. */ - *x = (pb->ipacket[0] & 0x20) ? - pb->ipacket[4] - 256 : pb->ipacket[4]; - *y = (pb->ipacket[0] & 0x10) ? - pb->ipacket[5] - 256 : pb->ipacket[5]; + if (!(pb->ipacket[0] & 0xC8) && !(pb->ipacket[1] & 0x7F) && + !(pb->ipacket[2] & 0x7F) && !(pb->ipacket[3] & 0xC9) && + !(pb->ipacket[0] & 0x10) != !(pb->ipacket[1] & 0x80) && + !(pb->ipacket[0] & 0x10) != !(pb->ipacket[3] & 0x10) && + !(pb->ipacket[0] & 0x20) != !(pb->ipacket[2] & 0x80) && + !(pb->ipacket[0] & 0x20) != !(pb->ipacket[3] & 0x20)) { - trackpoint_button = - ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | - ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | - ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); + *x = (pb->ipacket[0] & MOUSE_PS2_XNEG) ? + pb->ipacket[4] - 256 : pb->ipacket[4]; + *y = (pb->ipacket[0] & MOUSE_PS2_YNEG) ? + pb->ipacket[5] - 256 : pb->ipacket[5]; + + trackpoint_button = + ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | + ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | + ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); #ifdef EVDEV_SUPPORT - evdev_push_rel(sc->evdev_r, REL_X, *x); - evdev_push_rel(sc->evdev_r, REL_Y, -*y); - evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); - evdev_sync(sc->evdev_r); + evdev_push_rel(sc->evdev_r, REL_X, *x); + evdev_push_rel(sc->evdev_r, REL_Y, -*y); + evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); + evdev_sync(sc->evdev_r); #endif - ms->button = touchpad_button | trackpoint_button; + ms->button = touchpad_button | trackpoint_button; + } else + VLOG(3, (LOG_DEBUG, "elantech: " + "unexpected trackpoint packet skipped\n")); return (0); case ELANTECH_PKT_NOP: @@ -4704,10 +4764,14 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m ms->button = touchpad_button | trackpoint_button; + /* Palm detection doesn't terminate the current action. */ + palm = psmpalmdetect(sc, &f[0], nfingers); + /* Send finger 1 position to gesture processor */ - if (PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) || - nfingers == 0) + if ((PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) || + nfingers == 0) && !palm) psmgestures(sc, &f[0], imin(nfingers, 3), ms); + /* Send fingers positions to movement smoothers */ for (id = 0; id < PSM_FINGERS; id++) if (PSM_FINGER_IS_SET(f[id]) || !(mask & (1 << id))) @@ -4722,8 +4786,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m } sc->elanaction.mask = mask; - /* Palm detection doesn't terminate the current action. */ - if (psmpalmdetect(sc, &f[0], nfingers)) { + if (palm) { *x = *y = *z = 0; ms->button = ms->obutton; return (0); @@ -5602,7 +5665,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) int error, arg; if (oidp->oid_arg1 == NULL || oidp->oid_arg2 < 0 || - oidp->oid_arg2 > SYNAPTICS_SYSCTL_SOFTBUTTON3_X) + oidp->oid_arg2 > SYNAPTICS_SYSCTL_LAST) return (EINVAL); sc = oidp->oid_arg1; @@ -5691,6 +5754,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); break; case SYNAPTICS_SYSCTL_TOUCHPAD_OFF: + case SYNAPTICS_SYSCTL_NATURAL_SCROLL: if (arg < 0 || arg > 1) return (EINVAL); break; @@ -6083,6 +6147,15 @@ synaptics_sysctl_create_tree(struct psm_softc *sc, con synaptics_sysctl, "I", "Turn off touchpad"); + /* hw.psm.synaptics.natural_scroll. */ + sc->syninfo.natural_scroll = 0; + SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, + "natural_scroll", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, SYNAPTICS_SYSCTL_NATURAL_SCROLL, + synaptics_sysctl, "I", + "Enable natural scrolling"); + sc->syninfo.softbuttons_y = 0; sc->syninfo.softbutton2_x = 0; sc->syninfo.softbutton3_x = 0; @@ -6136,7 +6209,7 @@ synaptics_set_mode(struct psm_softc *sc, int mode_byte */ if ((sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) && sc->hw.model == MOUSE_MODEL_SYNAPTICS && !(mode_byte & (1 << 5))) { - mouse_ext_command(sc->kbdc, 3); + mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODEL_ID); set_mouse_sampling_rate(sc->kbdc, 0xc8); } } @@ -6216,7 +6289,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a set_mouse_scaling(kbdc, 1); /* Identify the Touchpad version. */ - if (mouse_ext_command(kbdc, 0) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_IDENTITY) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6237,7 +6310,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a } /* Get the Touchpad model information. */ - if (mouse_ext_command(kbdc, 3) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODEL_ID) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6268,7 +6341,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a } /* Read the extended capability bits. */ - if (mouse_ext_command(kbdc, 2) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_CAPABILITIES) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6299,7 +6372,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x08) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_RESOLUTIONS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6336,7 +6409,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.nExtendedQueries >= 1) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x09) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_EXTENDED) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6375,7 +6449,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.nExtendedQueries >= 4) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0c) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_CAPABILITIES_CONT) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6396,7 +6471,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.capReportsMax) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0d) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_MAX_COORDS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6417,7 +6493,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.capReportsMin) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0f) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_MIN_COORDS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6520,7 +6597,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a * byte of the response to this query to be a constant 0x3b, this * does not appear to be true for Touchpads with guest devices. */ - if (mouse_ext_command(kbdc, 1) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODES) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -7071,7 +7148,7 @@ enable_elantech(struct psm_softc *sc, enum probearg ar { static const int ic2hw[] = /*IC: 0 1 2 3 4 5 6 7 8 9 a b c d e f */ - { 0, 0, 2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0 }; + { 0, 0, 2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; static const int fw_sizes[][3] = { /* FW.vers MaxX MaxY */ { 0x020030, 1152, 768 }, From owner-svn-src-all@freebsd.org Sat Jun 29 12:54:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE3FB15DC463; Sat, 29 Jun 2019 12:54:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6960074D7F; Sat, 29 Jun 2019 12:54:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BFEBE9D8; Sat, 29 Jun 2019 12:54:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TCsSvr019745; Sat, 29 Jun 2019 12:54:28 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TCsRvQ019744; Sat, 29 Jun 2019 12:54:27 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201906291254.x5TCsRvQ019744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 29 Jun 2019 12:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349541 - in stable/11: share/man/man4 sys/dev/atkbdc X-SVN-Group: stable-11 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/atkbdc X-SVN-Commit-Revision: 349541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6960074D7F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 12:54:29 -0000 Author: wulf Date: Sat Jun 29 12:54:27 2019 New Revision: 349541 URL: https://svnweb.freebsd.org/changeset/base/349541 Log: MFC r346455-r346458, r348520, r348529, r348817, r348818 r346455: psm(4): Add support for 4 and 5 finger touches in synaptics driver While 4-th and 5-th finger positions are not exported through PS/2 interface, total number of touches is reported by MT trackpads. r346456: psm(4): do not process gestures when palm is present Ignoring of gesture processing when the palm is detected helps to reduce some of the erratic pointer behavior. This fixes regression introduced in r317814 Reported by: Ben LeMasurier r346457: psm(4): respect tap_disabled configuration with enabled Extended support This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps were processed. tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1). To respect PR kern/139272, taps are ignored only when explicity disabled. Submitted by: Ben LeMasurier (initial version) r346458: psm(4): give names to synaptics commands Submitted by: Ben LeMasurier r348520: psm(4): Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops PR: 238291 Submitted by: Andrey Kosachenko r348529: psm(4): Add natural scrolling support to sysmouse protocol This change enables natural scrolling with two finger scroll enabled and when user is using a trackpad (mouse and trackpoint are not affected). Depending on trackpad model it can be activated with setting of hw.psm.synaptics.natural_scroll or hw.psm.elantech.natural_scroll sysctl values to 1. Evdev protocol is not affected by this change too. Tune userland client e.g. libinput to enable natural scrolling in that case. Submitted by: nyan_myuji.xyz Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D20447 r348817: psm(4): Fix Elantech trackpoint support. Sign bits for X and Y motion data were taken from wrong places. PR: 238291 Reported by: Andrey Kosachenko Tested by: Andrey Kosachenko r348818: psm(4): Add extra sanity checks to Elantech trackpoint packet parser. Add strict checks for unused bit states in Elantech trackpoint packet parser to filter out spurious events produces by some hardware which are detected as trackpoint packets. See comment on r328191 for example. Tested by: Andrey Kosachenko Modified: stable/11/share/man/man4/psm.4 stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/psm.4 ============================================================================== --- stable/11/share/man/man4/psm.4 Sat Jun 29 12:49:52 2019 (r349540) +++ stable/11/share/man/man4/psm.4 Sat Jun 29 12:54:27 2019 (r349541) @@ -354,8 +354,8 @@ Tap and drag gestures can be disabled by setting to .Em 0 at boot-time. -Currently, this is only supported on Synaptics touchpads with Extended -support disabled. +Currently, this is supported on Synaptics touchpads regardless of Extended +support state and on Elantech touchpads with Extended support enabled. The behaviour may be changed after boot by setting the sysctl with the same name and by restarting .Xr moused 8 Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Sat Jun 29 12:49:52 2019 (r349540) +++ stable/11/sys/dev/atkbdc/psm.c Sat Jun 29 12:54:27 2019 (r349541) @@ -178,6 +178,22 @@ typedef struct packetbuf { #define PSM_PACKETQUEUE 128 #endif +/* + * Synaptics command definitions. + */ +#define SYNAPTICS_READ_IDENTITY 0x00 +#define SYNAPTICS_READ_MODES 0x01 +#define SYNAPTICS_READ_CAPABILITIES 0x02 +#define SYNAPTICS_READ_MODEL_ID 0x03 +#define SYNAPTICS_READ_SERIAL_PREFIX 0x06 +#define SYNAPTICS_READ_SERIAL_SUFFIX 0x07 +#define SYNAPTICS_READ_RESOLUTIONS 0x08 +#define SYNAPTICS_READ_EXTENDED 0x09 +#define SYNAPTICS_READ_CAPABILITIES_CONT 0x0c +#define SYNAPTICS_READ_MAX_COORDS 0x0d +#define SYNAPTICS_READ_DELUXE_LED 0x0e +#define SYNAPTICS_READ_MIN_COORDS 0x0f + typedef struct synapticsinfo { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -219,6 +235,7 @@ typedef struct synapticsinfo { int softbutton3_x; int max_x; int max_y; + int natural_scroll; } synapticsinfo_t; typedef struct synapticspacket { @@ -554,6 +571,8 @@ enum { SYNAPTICS_SYSCTL_SOFTBUTTONS_Y = SYN_OFFSET(softbuttons_y), SYNAPTICS_SYSCTL_SOFTBUTTON2_X = SYN_OFFSET(softbutton2_x), SYNAPTICS_SYSCTL_SOFTBUTTON3_X = SYN_OFFSET(softbutton3_x), + SYNAPTICS_SYSCTL_NATURAL_SCROLL = SYN_OFFSET(natural_scroll), +#define SYNAPTICS_SYSCTL_LAST SYNAPTICS_SYSCTL_NATURAL_SCROLL }; /* packet formatting function */ @@ -1116,7 +1135,7 @@ doopen(struct psm_softc *sc, int command_byte) "active multiplexing mode.\n", sc->unit); } - mouse_ext_command(sc->kbdc, 1); + mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODES); get_mouse_status(sc->kbdc, stat, 0, 3); if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || stat[1] == 0x47) && @@ -1827,7 +1846,7 @@ psm_register_synaptics(device_t dev) if (sc->synhw.capClickPad && sc->synhw.topButtonPad) evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD); evdev_support_key(evdev_a, BTN_TOUCH); - evdev_support_nfingers(evdev_a, 3); + evdev_support_nfingers(evdev_a, sc->synhw.capReportsV ? 5 : 3); psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt); @@ -3221,8 +3240,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, { static int touchpad_buttons; static int guest_buttons; + static int ew_finger_count; static finger_t f[PSM_FINGERS]; - int w, id, nfingers, ewcode, extended_buttons, clickpad_pressed; + int w, id, nfingers, palm, ewcode, extended_buttons, clickpad_pressed; extended_buttons = 0; @@ -3381,6 +3401,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, (pb->ipacket[1] & 0x01)) + 8, .flags = PSM_FINGER_FUZZY, }; + break; + case 2: + ew_finger_count = pb->ipacket[1] & 0x0f; default: break; } @@ -3388,6 +3411,11 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, goto SYNAPTICS_END; case 1: + if (sc->synhw.capReportsV && ew_finger_count > 3) { + nfingers = ew_finger_count; + break; + } + /* FALLTHROUGH */ case 0: nfingers = w + 2; break; @@ -3577,12 +3605,16 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, ms->button = touchpad_buttons; - psmgestures(sc, &f[0], nfingers, ms); + palm = psmpalmdetect(sc, &f[0], nfingers); + + /* Palm detection doesn't terminate the current action. */ + if (!palm) + psmgestures(sc, &f[0], nfingers, ms); + for (id = 0; id < PSM_FINGERS; id++) psmsmoother(sc, &f[id], id, ms, x, y); - /* Palm detection doesn't terminate the current action. */ - if (psmpalmdetect(sc, &f[0], nfingers)) { + if (palm) { *x = *y = *z = 0; ms->button = ms->obutton; return (0); @@ -3816,9 +3848,15 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i gest->in_vscroll = 0; /* Compute tap timeout. */ - gest->taptimeout.tv_sec = tap_timeout / 1000000; - gest->taptimeout.tv_usec = tap_timeout % 1000000; - timevaladd(&gest->taptimeout, &sc->lastsoftintr); + if (tap_enabled != 0) { + gest->taptimeout = (struct timeval) { + .tv_sec = tap_timeout / 1000000, + .tv_usec = tap_timeout % 1000000, + }; + timevaladd( + &gest->taptimeout, &sc->lastsoftintr); + } else + timevalclear(&gest->taptimeout); sc->flags |= PSM_FLAGS_FINGERDOWN; @@ -4104,6 +4142,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo int len, weight_prev_x, weight_prev_y; int div_max_x, div_max_y, div_x, div_y; int is_fuzzy; + int natural_scroll; /* Read sysctl. */ /* XXX Verify values? */ @@ -4131,6 +4170,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo two_finger_scroll = sc->syninfo.two_finger_scroll; max_x = sc->syninfo.max_x; max_y = sc->syninfo.max_y; + natural_scroll = sc->syninfo.natural_scroll; is_fuzzy = (f->flags & PSM_FINGER_FUZZY) != 0; @@ -4292,14 +4332,24 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo smoother_id, dx, dy, dxp, dyp)); break; case 1: /* Vertical scrolling. */ - if (dyp != 0) - ms->button |= (dyp > 0) ? - MOUSE_BUTTON4DOWN : MOUSE_BUTTON5DOWN; + if (dyp != 0) { + if (two_finger_scroll && natural_scroll) + ms->button |= (dyp > 0) ? + MOUSE_BUTTON5DOWN : MOUSE_BUTTON4DOWN; + else + ms->button |= (dyp > 0) ? + MOUSE_BUTTON4DOWN : MOUSE_BUTTON5DOWN; + } break; case 2: /* Horizontal scrolling. */ - if (dxp != 0) - ms->button |= (dxp > 0) ? - MOUSE_BUTTON7DOWN : MOUSE_BUTTON6DOWN; + if (dxp != 0) { + if (two_finger_scroll && natural_scroll) + ms->button |= (dxp > 0) ? + MOUSE_BUTTON6DOWN : MOUSE_BUTTON7DOWN; + else + ms->button |= (dxp > 0) ? + MOUSE_BUTTON7DOWN : MOUSE_BUTTON6DOWN; + } break; } @@ -4321,7 +4371,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m { static int touchpad_button, trackpoint_button; finger_t fn, f[ELANTECH_MAX_FINGERS]; - int pkt, id, scale, i, nfingers, mask; + int pkt, id, scale, i, nfingers, mask, palm; if (!elantech_support) return (0); @@ -4631,7 +4681,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m case ELANTECH_PKT_TRACKPOINT: /* 7 6 5 4 3 2 1 0 (LSB) * ------------------------------------------- - * ipacket[0]: 0 0 SX SY 0 M R L + * ipacket[0]: 0 0 SY SX 0 M R L * ipacket[1]: ~SX 0 0 0 0 0 0 0 * ipacket[2]: ~SY 0 0 0 0 0 0 0 * ipacket[3]: 0 0 ~SY ~SX 0 1 1 0 @@ -4642,22 +4692,32 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m * over 9 bits with SX/SY the relative top bit and * X7..X0 and Y7..Y0 the lower bits. */ - *x = (pb->ipacket[0] & 0x20) ? - pb->ipacket[4] - 256 : pb->ipacket[4]; - *y = (pb->ipacket[0] & 0x10) ? - pb->ipacket[5] - 256 : pb->ipacket[5]; + if (!(pb->ipacket[0] & 0xC8) && !(pb->ipacket[1] & 0x7F) && + !(pb->ipacket[2] & 0x7F) && !(pb->ipacket[3] & 0xC9) && + !(pb->ipacket[0] & 0x10) != !(pb->ipacket[1] & 0x80) && + !(pb->ipacket[0] & 0x10) != !(pb->ipacket[3] & 0x10) && + !(pb->ipacket[0] & 0x20) != !(pb->ipacket[2] & 0x80) && + !(pb->ipacket[0] & 0x20) != !(pb->ipacket[3] & 0x20)) { - trackpoint_button = - ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | - ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | - ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); + *x = (pb->ipacket[0] & MOUSE_PS2_XNEG) ? + pb->ipacket[4] - 256 : pb->ipacket[4]; + *y = (pb->ipacket[0] & MOUSE_PS2_YNEG) ? + pb->ipacket[5] - 256 : pb->ipacket[5]; + + trackpoint_button = + ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | + ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | + ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); #ifdef EVDEV_SUPPORT - evdev_push_rel(sc->evdev_r, REL_X, *x); - evdev_push_rel(sc->evdev_r, REL_Y, -*y); - evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); - evdev_sync(sc->evdev_r); + evdev_push_rel(sc->evdev_r, REL_X, *x); + evdev_push_rel(sc->evdev_r, REL_Y, -*y); + evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); + evdev_sync(sc->evdev_r); #endif - ms->button = touchpad_button | trackpoint_button; + ms->button = touchpad_button | trackpoint_button; + } else + VLOG(3, (LOG_DEBUG, "elantech: " + "unexpected trackpoint packet skipped\n")); return (0); case ELANTECH_PKT_NOP: @@ -4710,10 +4770,14 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m ms->button = touchpad_button | trackpoint_button; + /* Palm detection doesn't terminate the current action. */ + palm = psmpalmdetect(sc, &f[0], nfingers); + /* Send finger 1 position to gesture processor */ - if (PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) || - nfingers == 0) + if ((PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) || + nfingers == 0) && !palm) psmgestures(sc, &f[0], imin(nfingers, 3), ms); + /* Send fingers positions to movement smoothers */ for (id = 0; id < PSM_FINGERS; id++) if (PSM_FINGER_IS_SET(f[id]) || !(mask & (1 << id))) @@ -4728,8 +4792,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m } sc->elanaction.mask = mask; - /* Palm detection doesn't terminate the current action. */ - if (psmpalmdetect(sc, &f[0], nfingers)) { + if (palm) { *x = *y = *z = 0; ms->button = ms->obutton; return (0); @@ -5608,7 +5671,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) int error, arg; if (oidp->oid_arg1 == NULL || oidp->oid_arg2 < 0 || - oidp->oid_arg2 > SYNAPTICS_SYSCTL_SOFTBUTTON3_X) + oidp->oid_arg2 > SYNAPTICS_SYSCTL_LAST) return (EINVAL); sc = oidp->oid_arg1; @@ -5697,6 +5760,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); break; case SYNAPTICS_SYSCTL_TOUCHPAD_OFF: + case SYNAPTICS_SYSCTL_NATURAL_SCROLL: if (arg < 0 || arg > 1) return (EINVAL); break; @@ -6089,6 +6153,15 @@ synaptics_sysctl_create_tree(struct psm_softc *sc, con synaptics_sysctl, "I", "Turn off touchpad"); + /* hw.psm.synaptics.natural_scroll. */ + sc->syninfo.natural_scroll = 0; + SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, + "natural_scroll", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, SYNAPTICS_SYSCTL_NATURAL_SCROLL, + synaptics_sysctl, "I", + "Enable natural scrolling"); + sc->syninfo.softbuttons_y = 0; sc->syninfo.softbutton2_x = 0; sc->syninfo.softbutton3_x = 0; @@ -6142,7 +6215,7 @@ synaptics_set_mode(struct psm_softc *sc, int mode_byte */ if ((sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) && sc->hw.model == MOUSE_MODEL_SYNAPTICS && !(mode_byte & (1 << 5))) { - mouse_ext_command(sc->kbdc, 3); + mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODEL_ID); set_mouse_sampling_rate(sc->kbdc, 0xc8); } } @@ -6222,7 +6295,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a set_mouse_scaling(kbdc, 1); /* Identify the Touchpad version. */ - if (mouse_ext_command(kbdc, 0) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_IDENTITY) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6243,7 +6316,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a } /* Get the Touchpad model information. */ - if (mouse_ext_command(kbdc, 3) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODEL_ID) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6274,7 +6347,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a } /* Read the extended capability bits. */ - if (mouse_ext_command(kbdc, 2) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_CAPABILITIES) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6305,7 +6378,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x08) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_RESOLUTIONS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6342,7 +6415,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.nExtendedQueries >= 1) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x09) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_EXTENDED) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6381,7 +6455,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.nExtendedQueries >= 4) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0c) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_CAPABILITIES_CONT) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6402,7 +6477,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.capReportsMax) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0d) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_MAX_COORDS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6423,7 +6499,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (synhw.capReportsMin) { if (!set_mouse_scaling(kbdc, 1)) return (FALSE); - if (mouse_ext_command(kbdc, 0x0f) == 0) + if (mouse_ext_command(kbdc, + SYNAPTICS_READ_MIN_COORDS) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -6526,7 +6603,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a * byte of the response to this query to be a constant 0x3b, this * does not appear to be true for Touchpads with guest devices. */ - if (mouse_ext_command(kbdc, 1) == 0) + if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODES) == 0) return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); @@ -7077,7 +7154,7 @@ enable_elantech(struct psm_softc *sc, enum probearg ar { static const int ic2hw[] = /*IC: 0 1 2 3 4 5 6 7 8 9 a b c d e f */ - { 0, 0, 2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0 }; + { 0, 0, 2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; static const int fw_sizes[][3] = { /* FW.vers MaxX MaxY */ { 0x020030, 1152, 768 }, From owner-svn-src-all@freebsd.org Sat Jun 29 14:55:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8C0215DDFBD; Sat, 29 Jun 2019 14:55:54 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55046801B5; Sat, 29 Jun 2019 14:55:54 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D051FE69; Sat, 29 Jun 2019 14:55:54 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TEtrRY082095; Sat, 29 Jun 2019 14:55:53 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TEtrPb082094; Sat, 29 Jun 2019 14:55:53 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201906291455.x5TEtrPb082094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 29 Jun 2019 14:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349543 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55046801B5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 14:55:54 -0000 Author: lwhsu Date: Sat Jun 29 14:55:53 2019 New Revision: 349543 URL: https://svnweb.freebsd.org/changeset/base/349543 Log: Fix VOP_PUTPAGES(9) in regards to the use of VM_PAGER_CLUSTER_OK Submitted by: Ka Ho Ng Reviewed by: mckusick MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20695 Modified: head/share/man/man9/VOP_GETPAGES.9 Modified: head/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- head/share/man/man9/VOP_GETPAGES.9 Sat Jun 29 13:30:05 2019 (r349542) +++ head/share/man/man9/VOP_GETPAGES.9 Sat Jun 29 14:55:53 2019 (r349543) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2017 +.Dd June 29, 2019 .Dt VOP_GETPAGES 9 .Os .Sh NAME @@ -105,7 +105,7 @@ This could occur via a call to which puts such pages onto the head of the inactive queue. If .Dv VM_PAGER_CLUSTER_OK -is set, writes may be performed asynchronously, so that related writes +is set, writes may be delayed, so that related writes can be coalesced for efficiency, e.g., using the clustering mechanism of the buffer cache. .It Fa rtvals From owner-svn-src-all@freebsd.org Sat Jun 29 15:27:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7660F15DE657; Sat, 29 Jun 2019 15:27:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22E5B810FB; Sat, 29 Jun 2019 15:27:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE0B318387; Sat, 29 Jun 2019 15:27:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TFRNjv098296; Sat, 29 Jun 2019 15:27:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TFRJDJ098270; Sat, 29 Jun 2019 15:27:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906291527.x5TFRJDJ098270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 29 Jun 2019 15:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349544 - in vendor/elftoolchain/dist: . addr2line common documentation/libelf-by-example elfcopy elfdump libdwarf libelf libelftc mk nm readelf test/ar/tc/add-nonexistent/out test/libe... X-SVN-Group: vendor X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in vendor/elftoolchain/dist: . addr2line common documentation/libelf-by-example elfcopy elfdump libdwarf libelf libelftc mk nm readelf test/ar/tc/add-nonexistent/out test/libelf/tset test/libelf/tset/... X-SVN-Commit-Revision: 349544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22E5B810FB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 15:27:24 -0000 Author: emaste Date: Sat Jun 29 15:27:18 2019 New Revision: 349544 URL: https://svnweb.freebsd.org/changeset/base/349544 Log: Import ELF Tool Chain snapshot at r3769 From https://svn.code.sf.net/p/elftoolchain/code/ Added: vendor/elftoolchain/dist/.cirrus.yml vendor/elftoolchain/dist/libelf/os.Linux.mk (contents, props changed) vendor/elftoolchain/dist/test/ar/tc/add-nonexistent/out/archive.a (contents, props changed) vendor/elftoolchain/dist/test/libelf/tset/common/ehdr-malformed-1.yaml vendor/elftoolchain/dist/test/libelf/tset/elf_begin/entry-too-large.ar (contents, props changed) vendor/elftoolchain/dist/test/libelf/tset/elf_rand/ vendor/elftoolchain/dist/test/libelf/tset/elf_rand/Makefile (contents, props changed) vendor/elftoolchain/dist/test/libelf/tset/elf_rand/empty-file.ar (contents, props changed) vendor/elftoolchain/dist/test/libelf/tset/elf_rand/missing-file.ar (contents, props changed) vendor/elftoolchain/dist/test/libelf/tset/elf_rand/rand.m4 vendor/elftoolchain/dist/test/libtest/driver/driver.c (contents, props changed) vendor/elftoolchain/dist/test/libtest/driver/driver.h (contents, props changed) vendor/elftoolchain/dist/test/libtest/driver/driver_main.c (contents, props changed) vendor/elftoolchain/dist/test/libtest/driver/test_driver.1 (contents, props changed) vendor/elftoolchain/dist/test/libtest/lib/test_case.h (contents, props changed) Deleted: vendor/elftoolchain/dist/test/libtest/driver/test_main.c vendor/elftoolchain/dist/test/libtest/lib/test_runner.c vendor/elftoolchain/dist/test/libtest/lib/test_runner.h Modified: vendor/elftoolchain/dist/README.rst vendor/elftoolchain/dist/addr2line/addr2line.c vendor/elftoolchain/dist/common/elfdefinitions.h vendor/elftoolchain/dist/common/native-elf-format vendor/elftoolchain/dist/documentation/libelf-by-example/libelf-by-example.tex vendor/elftoolchain/dist/documentation/libelf-by-example/prog3.txt vendor/elftoolchain/dist/documentation/libelf-by-example/prog4.txt vendor/elftoolchain/dist/documentation/libelf-by-example/prog6.txt vendor/elftoolchain/dist/elfcopy/ascii.c vendor/elftoolchain/dist/elfcopy/binary.c vendor/elftoolchain/dist/elfcopy/elfcopy.h vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfcopy/sections.c vendor/elftoolchain/dist/elfdump/elfdump.c vendor/elftoolchain/dist/libdwarf/dwarf.h vendor/elftoolchain/dist/libdwarf/dwarf_dump.c vendor/elftoolchain/dist/libdwarf/libdwarf_attr.c vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c vendor/elftoolchain/dist/libelf/_libelf.h vendor/elftoolchain/dist/libelf/_libelf_config.h vendor/elftoolchain/dist/libelf/elf.3 vendor/elftoolchain/dist/libelf/elf_data.c vendor/elftoolchain/dist/libelf/elf_end.c vendor/elftoolchain/dist/libelf/elf_flagdata.3 vendor/elftoolchain/dist/libelf/elf_getdata.3 vendor/elftoolchain/dist/libelf/elf_getident.c vendor/elftoolchain/dist/libelf/elf_next.3 vendor/elftoolchain/dist/libelf/elf_next.c vendor/elftoolchain/dist/libelf/elf_open.3 vendor/elftoolchain/dist/libelf/elf_rand.c vendor/elftoolchain/dist/libelf/elf_rawfile.c vendor/elftoolchain/dist/libelf/elf_scn.c vendor/elftoolchain/dist/libelf/elf_update.3 vendor/elftoolchain/dist/libelf/elf_update.c vendor/elftoolchain/dist/libelf/gelf.3 vendor/elftoolchain/dist/libelf/gelf_cap.c vendor/elftoolchain/dist/libelf/gelf_dyn.c vendor/elftoolchain/dist/libelf/gelf_getcap.3 vendor/elftoolchain/dist/libelf/gelf_getdyn.3 vendor/elftoolchain/dist/libelf/gelf_getmove.3 vendor/elftoolchain/dist/libelf/gelf_getrel.3 vendor/elftoolchain/dist/libelf/gelf_getrela.3 vendor/elftoolchain/dist/libelf/gelf_getsym.3 vendor/elftoolchain/dist/libelf/gelf_getsyminfo.3 vendor/elftoolchain/dist/libelf/gelf_getsymshndx.3 vendor/elftoolchain/dist/libelf/gelf_move.c vendor/elftoolchain/dist/libelf/gelf_newehdr.3 vendor/elftoolchain/dist/libelf/gelf_newphdr.3 vendor/elftoolchain/dist/libelf/gelf_rel.c vendor/elftoolchain/dist/libelf/gelf_rela.c vendor/elftoolchain/dist/libelf/gelf_sym.c vendor/elftoolchain/dist/libelf/gelf_syminfo.c vendor/elftoolchain/dist/libelf/gelf_symshndx.c vendor/elftoolchain/dist/libelf/libelf_allocate.c vendor/elftoolchain/dist/libelf/libelf_ar.c vendor/elftoolchain/dist/libelf/libelf_convert.m4 vendor/elftoolchain/dist/libelf/libelf_data.c vendor/elftoolchain/dist/libelf/libelf_ehdr.c vendor/elftoolchain/dist/libelf/libelf_extended.c vendor/elftoolchain/dist/libelf/libelf_memory.c vendor/elftoolchain/dist/libelf/libelf_msize.m4 vendor/elftoolchain/dist/libelf/libelf_phdr.c vendor/elftoolchain/dist/libelf/libelf_xlate.c vendor/elftoolchain/dist/libelftc/elftc_bfd_find_target.3 vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c vendor/elftoolchain/dist/libelftc/elftc_string_table.c vendor/elftoolchain/dist/libelftc/elftc_string_table_create.3 vendor/elftoolchain/dist/libelftc/libelftc.h vendor/elftoolchain/dist/libelftc/libelftc_bfdtarget.c vendor/elftoolchain/dist/libelftc/make-toolchain-version vendor/elftoolchain/dist/mk/elftoolchain.subdir.mk vendor/elftoolchain/dist/mk/elftoolchain.test.mk vendor/elftoolchain/dist/nm/nm.c vendor/elftoolchain/dist/readelf/readelf.1 vendor/elftoolchain/dist/readelf/readelf.c vendor/elftoolchain/dist/test/libelf/tset/Makefile vendor/elftoolchain/dist/test/libelf/tset/bin/elfc vendor/elftoolchain/dist/test/libelf/tset/common/Makefile vendor/elftoolchain/dist/test/libelf/tset/common/ehdr_template.m4 vendor/elftoolchain/dist/test/libelf/tset/elf32_getehdr/Makefile vendor/elftoolchain/dist/test/libelf/tset/elf32_newehdr/Makefile vendor/elftoolchain/dist/test/libelf/tset/elf64_getehdr/Makefile vendor/elftoolchain/dist/test/libelf/tset/elf64_newehdr/Makefile vendor/elftoolchain/dist/test/libelf/tset/elf_begin/Makefile vendor/elftoolchain/dist/test/libelf/tset/elf_begin/begin.m4 vendor/elftoolchain/dist/test/libelf/tset/elf_getdata/getdata.m4 vendor/elftoolchain/dist/test/libtest/Makefile vendor/elftoolchain/dist/test/libtest/README.rst vendor/elftoolchain/dist/test/libtest/bin/make-test-scaffolding vendor/elftoolchain/dist/test/libtest/driver/Makefile vendor/elftoolchain/dist/test/libtest/examples/minimal_example.c vendor/elftoolchain/dist/test/libtest/examples/simple_example.c vendor/elftoolchain/dist/test/libtest/lib/Makefile vendor/elftoolchain/dist/test/libtest/lib/test.3 vendor/elftoolchain/dist/test/libtest/lib/test.h vendor/elftoolchain/dist/test/nm/ts/Makefile.tset vendor/elftoolchain/dist/test/tet/patches/configure.patch Added: vendor/elftoolchain/dist/.cirrus.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/elftoolchain/dist/.cirrus.yml Sat Jun 29 15:27:18 2019 (r349544) @@ -0,0 +1,22 @@ +freebsd_11_task: + freebsd_instance: + image: freebsd-11-2-release-amd64 + install_script: pkg install -y git py27-yaml + script: + - fetch http://tetworks.opengroup.org/downloads/38/software/Sources/3.8/tet3.8-src.tar.gz + - tar -x -C test/tet -f tet3.8-src.tar.gz + - make + +debian_stable_task: + container: + image: debian:stable + setup_script: + - apt-get update + - apt-get install -y + binutils bison bmake curl flex g++ gcc git + libarchive-dev libbsd-dev libc6-dev libexpat1-dev lsb-release + m4 perl python-yaml sharutils zlib1g-dev + script: + - curl -O http://tetworks.opengroup.org/downloads/38/software/Sources/3.8/tet3.8-src.tar.gz + - tar -x -C test/tet -z -f tet3.8-src.tar.gz + - bmake Modified: vendor/elftoolchain/dist/README.rst ============================================================================== --- vendor/elftoolchain/dist/README.rst Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/README.rst Sat Jun 29 15:27:18 2019 (r349544) @@ -62,12 +62,12 @@ The project uses subversion_ for its version control s The subversion branch for the current set of sources may be accessed at the following URL:: - https://elftoolchain.svn.sourceforge.net/svnroot/elftoolchain/trunk + https://sourceforge.net/p/elftoolchain/code/HEAD/tree/trunk/ The project's source tree may be checked out from its repository by using the ``svn checkout`` command:: - % svn checkout https://elftoolchain.svn.sourceforge.net/svnroot/elftoolchain/trunk + % svn checkout https://svn.code.sf.net/p/elftoolchain/code/trunk Checked-out sources may be kept upto-date by running ``svn update`` inside the source directory:: @@ -105,10 +105,10 @@ The project's developers may be contacted using the ma Reporting Bugs -------------- -Please use our `Trac instance`_ for viewing existing bug reports and +Please use our `bug tracker`_ for viewing existing bug reports and for submitting new bug reports. -.. _`Trac instance`: http://sourceforge.net/apps/trac/elftoolchain/report +.. _`bug tracker`: https://sourceforge.net/p/elftoolchain/tickets/ Additional Information @@ -119,7 +119,7 @@ website`_. .. _project website: http://elftoolchain.sourceforge.net/ -.. $Id: README.rst 3656 2018-12-26 09:46:24Z jkoshy $ +.. $Id: README.rst 3677 2019-02-11 09:37:09Z jkoshy $ .. Local Variables: .. mode: rst Modified: vendor/elftoolchain/dist/addr2line/addr2line.c ============================================================================== --- vendor/elftoolchain/dist/addr2line/addr2line.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/addr2line/addr2line.c Sat Jun 29 15:27:18 2019 (r349544) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3544 2017-06-05 14:51:44Z emaste $"); +ELFTC_VCSID("$Id: addr2line.c 3499 2016-11-25 16:06:29Z emaste $"); struct Func { char *name; Modified: vendor/elftoolchain/dist/common/elfdefinitions.h ============================================================================== --- vendor/elftoolchain/dist/common/elfdefinitions.h Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/common/elfdefinitions.h Sat Jun 29 15:27:18 2019 (r349544) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3515 2017-01-24 22:04:22Z emaste $ + * $Id: elfdefinitions.h 3769 2019-06-29 15:15:02Z emaste $ */ /* @@ -72,7 +72,39 @@ _ELF_DEFINE_DF(DF_TEXTREL, 0x4, \ _ELF_DEFINE_DF(DF_BIND_NOW, 0x8, \ "process relocation entries at load time") \ _ELF_DEFINE_DF(DF_STATIC_TLS, 0x10, \ - "uses static thread-local storage") + "uses static thread-local storage") \ +_ELF_DEFINE_DF(DF_1_BIND_NOW, 0x1, \ + "process relocation entries at load time") \ +_ELF_DEFINE_DF(DF_1_GLOBAL, 0x2, \ + "unused") \ +_ELF_DEFINE_DF(DF_1_GROUP, 0x4, \ + "object is a member of a group") \ +_ELF_DEFINE_DF(DF_1_NODELETE, 0x8, \ + "object cannot be deleted from a process") \ +_ELF_DEFINE_DF(DF_1_LOADFLTR, 0x10, \ + "immediate load filtees") \ +_ELF_DEFINE_DF(DF_1_INITFIRST, 0x20, \ + "initialize object first") \ +_ELF_DEFINE_DF(DF_1_NOOPEN, 0x40, \ + "disallow dlopen()") \ +_ELF_DEFINE_DF(DF_1_ORIGIN, 0x80, \ + "object being loaded may refer to $ORIGIN") \ +_ELF_DEFINE_DF(DF_1_DIRECT, 0x100, \ + "direct bindings enabled") \ +_ELF_DEFINE_DF(DF_1_INTERPOSE, 0x400, \ + "object is interposer") \ +_ELF_DEFINE_DF(DF_1_NODEFLIB, 0x800, \ + "ignore default library search path") \ +_ELF_DEFINE_DF(DF_1_NODUMP, 0x1000, \ + "disallow dldump()") \ +_ELF_DEFINE_DF(DF_1_CONFALT, 0x2000, \ + "object is a configuration alternative") \ +_ELF_DEFINE_DF(DF_1_ENDFILTEE, 0x4000, \ + "filtee terminates filter search") \ +_ELF_DEFINE_DF(DF_1_DISPRELDNE, 0x8000, \ + "displacement relocation done") \ +_ELF_DEFINE_DF(DF_1_DISPRELPND, 0x10000, \ + "displacement relocation pending") #undef _ELF_DEFINE_DF #define _ELF_DEFINE_DF(N, V, DESCR) N = V , enum { @@ -2448,7 +2480,10 @@ _ELF_DEFINE_NT(NT_PSTATUS, 10, "Linux process status") _ELF_DEFINE_NT(NT_FPREGS, 12, "Linux floating point regset") \ _ELF_DEFINE_NT(NT_PSINFO, 13, "Linux process information") \ _ELF_DEFINE_NT(NT_LWPSTATUS, 16, "Linux lwpstatus_t type") \ -_ELF_DEFINE_NT(NT_LWPSINFO, 17, "Linux lwpinfo_t type") +_ELF_DEFINE_NT(NT_LWPSINFO, 17, "Linux lwpinfo_t type") \ +_ELF_DEFINE_NT(NT_FREEBSD_NOINIT_TAG, 2, "FreeBSD no .init tag") \ +_ELF_DEFINE_NT(NT_FREEBSD_ARCH_TAG, 3, "FreeBSD arch tag") \ +_ELF_DEFINE_NT(NT_FREEBSD_FEATURE_CTL, 4, "FreeBSD feature control") #undef _ELF_DEFINE_NT #define _ELF_DEFINE_NT(N, V, DESCR) N = V , @@ -2806,7 +2841,8 @@ typedef struct { #define ELF64_R_SYM(I) ((I) >> 32) #define ELF64_R_TYPE(I) ((I) & 0xFFFFFFFFUL) -#define ELF64_R_INFO(S,T) (((S) << 32) + ((T) & 0xFFFFFFFFUL)) +#define ELF64_R_INFO(S,T) \ + (((Elf64_Xword) (S) << 32) + ((T) & 0xFFFFFFFFUL)) /* * Symbol versioning structures. Modified: vendor/elftoolchain/dist/common/native-elf-format ============================================================================== --- vendor/elftoolchain/dist/common/native-elf-format Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/common/native-elf-format Sat Jun 29 15:27:18 2019 (r349544) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: native-elf-format 3650 2018-11-25 12:06:28Z jkoshy $ +# $Id: native-elf-format 3735 2019-04-25 19:44:47Z jkoshy $ # # Find the native ELF format for a host platform by compiling a # test object and examining the resulting object. @@ -37,6 +37,8 @@ $1 ~ "Machine:" { elfarch = "EM_MIPS"; } else if (match($0, ".*[xX]86[-_]64")) { elfarch = "EM_X86_64"; + } else if (match($0, "PowerPC64")) { + elfarch = "EM_PPC64"; } else { elfarch = "unknown"; } Modified: vendor/elftoolchain/dist/documentation/libelf-by-example/libelf-by-example.tex ============================================================================== --- vendor/elftoolchain/dist/documentation/libelf-by-example/libelf-by-example.tex Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/documentation/libelf-by-example/libelf-by-example.tex Sat Jun 29 15:27:18 2019 (r349544) @@ -24,7 +24,7 @@ % out of the use of this software, even if advised of the possibility of % such damage. % -% $Id: libelf-by-example.tex 2457 2012-03-09 14:38:10Z jkoshy $ +% $Id: libelf-by-example.tex 3699 2019-02-28 06:34:53Z jkoshy $ % \documentclass[a4paper,pdftex]{book} @@ -2700,6 +2700,12 @@ typedef struct { \emph{parent} archive descriptor (referenced by variable \parameter{ar} in this example) to return the next archive member on the next call to function \function{elf\_begin}. + + The \function{elf\_next} function ordinarily returns the value + \constant{ELF\_C\_READ}, allowing the traversal of the archive to + continue normally. In the event of an error the function + returns the value \constant{ELF\_C\_NULL}, which causes the function + \function{elf\_begin} to stop archive traversal. \item[\coref{6}] It is good programming practice to call \function{elf\_end} on descriptors that are no longer needed. \end{description} Modified: vendor/elftoolchain/dist/documentation/libelf-by-example/prog3.txt ============================================================================== --- vendor/elftoolchain/dist/documentation/libelf-by-example/prog3.txt Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/documentation/libelf-by-example/prog3.txt Sat Jun 29 15:27:18 2019 (r349544) @@ -1,7 +1,7 @@ /* * Print the ELF Program Header Table in an ELF object. * - * $Id: prog3.txt 2133 2011-11-10 08:28:22Z jkoshy $ + * $Id: prog3.txt 3686 2019-02-22 07:54:47Z jkoshy $ */ #include @@ -11,7 +11,6 @@ #include #include #include -#include void print_ptype(size_t pt) @\co{7}@ Modified: vendor/elftoolchain/dist/documentation/libelf-by-example/prog4.txt ============================================================================== --- vendor/elftoolchain/dist/documentation/libelf-by-example/prog4.txt Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/documentation/libelf-by-example/prog4.txt Sat Jun 29 15:27:18 2019 (r349544) @@ -1,7 +1,7 @@ /* * Print the names of ELF sections. * - * $Id: prog4.txt 2133 2011-11-10 08:28:22Z jkoshy $ + * $Id: prog4.txt 3687 2019-02-22 07:55:09Z jkoshy $ */ #include @@ -18,11 +18,11 @@ main(int argc, char **argv) { int fd; Elf *e; - char *name, *p, pc[4*sizeof(char)]; Elf_Scn *scn; Elf_Data *data; GElf_Shdr shdr; size_t n, shstrndx, sz; + char *name, *p, pc[(4 * sizeof(char)) + 1]; if (argc != 2) errx(EXIT_FAILURE, "usage: %s file-name", argv[0]); Modified: vendor/elftoolchain/dist/documentation/libelf-by-example/prog6.txt ============================================================================== --- vendor/elftoolchain/dist/documentation/libelf-by-example/prog6.txt Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/documentation/libelf-by-example/prog6.txt Sat Jun 29 15:27:18 2019 (r349544) @@ -1,7 +1,7 @@ /* * Iterate through an ar(1) archive. * - * $Id: prog6.txt 2135 2011-11-10 08:59:47Z jkoshy $ + * $Id: prog6.txt 3699 2019-02-28 06:34:53Z jkoshy $ */ #include @@ -16,6 +16,7 @@ main(int argc, char **argv) { int fd; Elf *ar, *e; + Elf_Cmd cmd; Elf_Arhdr *arh; if (argc != 2) @@ -39,7 +40,8 @@ main(int argc, char **argv) errx(EXIT_FAILURE, "%s is not an ar(1) archive.", argv[1]); - while ((e = elf_begin(fd, ELF_C_READ, ar)) != NULL) { @\co{3}@ + cmd = ELF_C_READ; + while ((e = elf_begin(fd, cmd, ar)) != NULL) { @\co{3}@ if ((arh = elf_getarhdr(e)) == NULL) @\co{4}@ errx(EXIT_FAILURE, "elf_getarhdr() failed: %s.", elf_errmsg(-1)); @@ -47,7 +49,7 @@ main(int argc, char **argv) (void) printf("%20s %zd\n", arh->ar_name, arh->ar_size); - (void) elf_next(e); @\co{5}@ + cmd = elf_next(e); @\co{5}@ (void) elf_end(e); @\co{6}@ } Modified: vendor/elftoolchain/dist/elfcopy/ascii.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/ascii.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/elfcopy/ascii.c Sat Jun 29 15:27:18 2019 (r349544) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: ascii.c 3487 2016-08-24 18:12:08Z emaste $"); +ELFTC_VCSID("$Id: ascii.c 3757 2019-06-28 01:15:28Z emaste $"); static void append_data(struct section *s, const void *buf, size_t sz); static char hex_digit(uint8_t n); @@ -378,9 +378,6 @@ done: errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); - /* Update sh_name pointer for each section header entry. */ update_shdr(ecp, 0); @@ -604,9 +601,6 @@ done: if (gelf_update_ehdr(ecp->eout, &oeh) == 0) errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); /* Update sh_name pointer for each section header entry. */ update_shdr(ecp, 0); Modified: vendor/elftoolchain/dist/elfcopy/binary.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/binary.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/elfcopy/binary.c Sat Jun 29 15:27:18 2019 (r349544) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: binary.c 3611 2018-04-16 21:35:18Z jkoshy $"); +ELFTC_VCSID("$Id: binary.c 3757 2019-06-28 01:15:28Z emaste $"); /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set @@ -250,11 +250,8 @@ create_elf_from_binary(struct elfcopy *ecp, int ifd, c errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - /* Generate section name string table (.shstrtab). */ - ecp->flags |= SYMTAB_EXIST; - set_shstrtab(ecp); - /* Update sh_name pointer for each section header entry. */ + ecp->flags |= SYMTAB_EXIST; update_shdr(ecp, 0); /* Properly set sh_link field of .symtab section. */ Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.h ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.h Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.h Sat Jun 29 15:27:18 2019 (r349544) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfcopy.h 3615 2018-05-17 04:12:24Z kaiwang27 $ + * $Id: elfcopy.h 3757 2019-06-28 01:15:28Z emaste $ */ #include @@ -135,9 +135,13 @@ struct section { int pseudo; int nocopy; + Elftc_String_Table *strtab; + TAILQ_ENTRY(section) sec_list; /* next section */ }; +TAILQ_HEAD(sectionlist, section); + /* Internal data structure for segments. */ struct segment { uint64_t vaddr; /* virtual addr (VMA) */ @@ -311,7 +315,6 @@ struct sec_action *lookup_sec_act(struct elfcopy *_ecp struct symop *lookup_symop_list(struct elfcopy *_ecp, const char *_name, unsigned int _op); void resync_sections(struct elfcopy *_ecp); -void set_shstrtab(struct elfcopy *_ecp); void setup_phdr(struct elfcopy *_ecp); void update_shdr(struct elfcopy *_ecp, int _update_link); Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/elfcopy/main.c Sat Jun 29 15:27:18 2019 (r349544) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3577 2017-09-14 02:19:42Z emaste $"); +ELFTC_VCSID("$Id: main.c 3757 2019-06-28 01:15:28Z emaste $"); enum options { @@ -388,9 +388,6 @@ create_elf(struct elfcopy *ecp) errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); - /* * Second processing of output sections: Update section headers. * At this stage we set name string index, update st_link and st_info @@ -486,6 +483,9 @@ free_elf(struct elfcopy *ecp) /* Free symbol table buffers. */ free_symtab(ecp); + /* Free section name string table. */ + elftc_string_table_destroy(ecp->shstrtab->strtab); + /* Free internal section list. */ if (!TAILQ_EMPTY(&ecp->v_sec)) { TAILQ_FOREACH_SAFE(sec, &ecp->v_sec, sec_list, sec_temp) { @@ -1565,7 +1565,6 @@ main(int argc, char **argv) ecp = calloc(1, sizeof(*ecp)); if (ecp == NULL) err(EXIT_FAILURE, "calloc failed"); - memset(ecp, 0, sizeof(*ecp)); ecp->itf = ecp->otf = ETF_ELF; ecp->iec = ecp->oec = ELFCLASSNONE; Modified: vendor/elftoolchain/dist/elfcopy/sections.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/sections.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/elfcopy/sections.c Sat Jun 29 15:27:18 2019 (r349544) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3646 2018-10-27 02:25:39Z emaste $"); +ELFTC_VCSID("$Id: sections.c 3758 2019-06-28 01:16:50Z emaste $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); @@ -42,19 +42,18 @@ static void check_section_rename(struct elfcopy *ecp, static void filter_reloc(struct elfcopy *ecp, struct section *s); static int get_section_flags(struct elfcopy *ecp, const char *name); static void insert_sections(struct elfcopy *ecp); -static void insert_to_strtab(struct section *t, const char *s); static int is_append_section(struct elfcopy *ecp, const char *name); static int is_compress_section(struct elfcopy *ecp, const char *name); static int is_debug_section(const char *name); static int is_dwo_section(const char *name); static int is_modify_section(struct elfcopy *ecp, const char *name); static int is_print_section(struct elfcopy *ecp, const char *name); -static int lookup_string(struct section *t, const char *s); static void modify_section(struct elfcopy *ecp, struct section *s); static void pad_section(struct elfcopy *ecp, struct section *s); static void print_data(const char *d, size_t sz); static void print_section(struct section *s); static void *read_section(struct section *s, size_t *size); +static void set_shstrtab(struct elfcopy *ecp); static void update_reloc(struct elfcopy *ecp, struct section *s); static void update_section_group(struct elfcopy *ecp, struct section *s); @@ -119,21 +118,19 @@ is_remove_reloc_sec(struct elfcopy *ecp, uint32_t sh_i errx(EXIT_FAILURE, "elf_getshstrndx failed: %s", elf_errmsg(-1)); - is = NULL; - while ((is = elf_nextscn(ecp->ein, is)) != NULL) { - if (sh_info == elf_ndxscn(is)) { - if (gelf_getshdr(is, &ish) == NULL) - errx(EXIT_FAILURE, "gelf_getshdr failed: %s", - elf_errmsg(-1)); - if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == - NULL) - errx(EXIT_FAILURE, "elf_strptr failed: %s", - elf_errmsg(-1)); - if (is_remove_section(ecp, name)) - return (1); - else - return (0); - } + is = elf_getscn(ecp->ein, sh_info); + if (is != NULL) { + if (gelf_getshdr(is, &ish) == NULL) + errx(EXIT_FAILURE, "gelf_getshdr failed: %s", + elf_errmsg(-1)); + if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == + NULL) + errx(EXIT_FAILURE, "elf_strptr failed: %s", + elf_errmsg(-1)); + if (is_remove_section(ecp, name)) + return (1); + else + return (0); } elferr = elf_errno(); if (elferr != 0) @@ -314,18 +311,18 @@ insert_to_sec_list(struct elfcopy *ecp, struct section { struct section *s; - if (!tail) { + if (tail || TAILQ_EMPTY(&ecp->v_sec) || + TAILQ_LAST(&ecp->v_sec, sectionlist)->off <= sec->off) { + TAILQ_INSERT_TAIL(&ecp->v_sec, sec, sec_list); + } else { TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { if (sec->off < s->off) { TAILQ_INSERT_BEFORE(s, sec, sec_list); - goto inc_nos; + break; } } } - TAILQ_INSERT_TAIL(&ecp->v_sec, sec, sec_list); - -inc_nos: if (sec->pseudo == 0) ecp->nos++; } @@ -711,13 +708,13 @@ filter_reloc(struct elfcopy *ecp, struct section *s) #define COPYREL(REL, SZ) do { \ if (nrels == 0) { \ if ((REL##SZ = malloc(cap * \ - sizeof(Elf##SZ##_Rel))) == NULL) \ + sizeof(*REL##SZ))) == NULL) \ err(EXIT_FAILURE, "malloc failed"); \ } \ if (nrels >= cap) { \ cap *= 2; \ if ((REL##SZ = realloc(REL##SZ, cap * \ - sizeof(Elf##SZ##_Rel))) == NULL) \ + sizeof(*REL##SZ))) == NULL) \ err(EXIT_FAILURE, "realloc failed"); \ } \ REL##SZ[nrels].r_offset = REL.r_offset; \ @@ -1335,10 +1332,9 @@ insert_sections(struct elfcopy *ecp) void add_to_shstrtab(struct elfcopy *ecp, const char *name) { - struct section *s; - s = ecp->shstrtab; - insert_to_strtab(s, name); + if (elftc_string_table_insert(ecp->shstrtab->strtab, name) == 0) + errx(EXIT_FAILURE, "elftc_string_table_insert failed"); } void @@ -1348,6 +1344,9 @@ update_shdr(struct elfcopy *ecp, int update_link) GElf_Shdr osh; int elferr; + /* Finalize the section name string table (.shstrtab). */ + set_shstrtab(ecp); + TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { if (s->pseudo) continue; @@ -1357,7 +1356,8 @@ update_shdr(struct elfcopy *ecp, int update_link) elf_errmsg(-1)); /* Find section name in string table and set sh_name. */ - osh.sh_name = lookup_string(ecp->shstrtab, s->name); + osh.sh_name = elftc_string_table_lookup(ecp->shstrtab->strtab, + s->name); /* * sh_link needs to be updated, since the index of the @@ -1395,8 +1395,24 @@ update_shdr(struct elfcopy *ecp, int update_link) void init_shstrtab(struct elfcopy *ecp) { + Elf_Scn *shstrtab; + GElf_Shdr shdr; struct section *s; + size_t indx, sizehint; + if (elf_getshstrndx(ecp->ein, &indx) != 0) { + shstrtab = elf_getscn(ecp->ein, indx); + if (shstrtab == NULL) + errx(EXIT_FAILURE, "elf_getscn failed: %s", + elf_errmsg(-1)); + if (gelf_getshdr(shstrtab, &shdr) != &shdr) + errx(EXIT_FAILURE, "gelf_getshdr failed: %s", + elf_errmsg(-1)); + sizehint = shdr.sh_size; + } else { + sizehint = 0; + } + if ((ecp->shstrtab = calloc(1, sizeof(*ecp->shstrtab))) == NULL) err(EXIT_FAILURE, "calloc failed"); s = ecp->shstrtab; @@ -1407,19 +1423,22 @@ init_shstrtab(struct elfcopy *ecp) s->loadable = 0; s->type = SHT_STRTAB; s->vma = 0; + s->strtab = elftc_string_table_create(sizehint); - insert_to_strtab(s, ""); - insert_to_strtab(s, ".symtab"); - insert_to_strtab(s, ".strtab"); - insert_to_strtab(s, ".shstrtab"); + add_to_shstrtab(ecp, ""); + add_to_shstrtab(ecp, ".symtab"); + add_to_shstrtab(ecp, ".strtab"); + add_to_shstrtab(ecp, ".shstrtab"); } -void +static void set_shstrtab(struct elfcopy *ecp) { struct section *s; Elf_Data *data; GElf_Shdr sh; + const char *image; + size_t sz; s = ecp->shstrtab; @@ -1452,19 +1471,21 @@ set_shstrtab(struct elfcopy *ecp) * which are reserved for this in the beginning of shstrtab. */ if (!(ecp->flags & SYMTAB_EXIST)) { - s->sz -= sizeof(".symtab\0.strtab"); - memmove(s->buf, (char *)s->buf + sizeof(".symtab\0.strtab"), - s->sz); + elftc_string_table_remove(s->strtab, ".symtab"); + elftc_string_table_remove(s->strtab, ".strtab"); } - sh.sh_size = s->sz; + image = elftc_string_table_image(s->strtab, &sz); + s->sz = sz; + + sh.sh_size = sz; if (!gelf_update_shdr(s->os, &sh)) errx(EXIT_FAILURE, "gelf_update_shdr() failed: %s", elf_errmsg(-1)); data->d_align = 1; - data->d_buf = s->buf; - data->d_size = s->sz; + data->d_buf = (void *)(uintptr_t)image; + data->d_size = sz; data->d_off = 0; data->d_type = ELF_T_BYTE; data->d_version = EV_CURRENT; @@ -1588,73 +1609,6 @@ add_gnu_debuglink(struct elfcopy *ecp) STAILQ_INSERT_TAIL(&ecp->v_sadd, sa, sadd_list); ecp->flags |= SEC_ADD; -} - -static void -insert_to_strtab(struct section *t, const char *s) -{ - const char *r; - char *b, *c; - size_t len, slen; - int append; - - if (t->sz == 0) { - t->cap = 512; - if ((t->buf = malloc(t->cap)) == NULL) - err(EXIT_FAILURE, "malloc failed"); - } - - slen = strlen(s); - append = 0; - b = t->buf; - for (c = b; c < b + t->sz;) { - len = strlen(c); - if (!append && len >= slen) { - r = c + (len - slen); - if (strcmp(r, s) == 0) - return; - } else if (len < slen && len != 0) { - r = s + (slen - len); - if (strcmp(c, r) == 0) { - t->sz -= len + 1; - memmove(c, c + len + 1, t->sz - (c - b)); - append = 1; - continue; - } - } - c += len + 1; - } - - while (t->sz + slen + 1 >= t->cap) { - t->cap *= 2; - if ((t->buf = realloc(t->buf, t->cap)) == NULL) - err(EXIT_FAILURE, "realloc failed"); - } - b = t->buf; - strncpy(&b[t->sz], s, slen); - b[t->sz + slen] = '\0'; - t->sz += slen + 1; -} - -static int -lookup_string(struct section *t, const char *s) -{ - const char *b, *c, *r; - size_t len, slen; - - slen = strlen(s); - b = t->buf; - for (c = b; c < b + t->sz;) { - len = strlen(c); - if (len >= slen) { - r = c + (len - slen); - if (strcmp(r, s) == 0) - return (r - b); - } - c += len + 1; - } - - return (-1); } static uint32_t crctable[256] = Modified: vendor/elftoolchain/dist/elfdump/elfdump.c ============================================================================== --- vendor/elftoolchain/dist/elfdump/elfdump.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/elfdump/elfdump.c Sat Jun 29 15:27:18 2019 (r349544) @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3584 2017-11-05 20:51:43Z jkoshy $"); +ELFTC_VCSID("$Id: elfdump.c 3762 2019-06-28 21:06:24Z emaste $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -343,17 +343,20 @@ elf_phdr_type_str(unsigned int type) static char s_type[32]; switch (type) { - case PT_NULL: return "PT_NULL"; - case PT_LOAD: return "PT_LOAD"; - case PT_DYNAMIC: return "PT_DYNAMIC"; - case PT_INTERP: return "PT_INTERP"; - case PT_NOTE: return "PT_NOTE"; - case PT_SHLIB: return "PT_SHLIB"; - case PT_PHDR: return "PT_PHDR"; - case PT_TLS: return "PT_TLS"; - case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME"; - case PT_GNU_STACK: return "PT_GNU_STACK"; - case PT_GNU_RELRO: return "PT_GNU_RELRO"; + case PT_NULL: return "PT_NULL"; + case PT_LOAD: return "PT_LOAD"; + case PT_DYNAMIC: return "PT_DYNAMIC"; + case PT_INTERP: return "PT_INTERP"; + case PT_NOTE: return "PT_NOTE"; + case PT_SHLIB: return "PT_SHLIB"; + case PT_PHDR: return "PT_PHDR"; + case PT_TLS: return "PT_TLS"; + case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME"; + case PT_GNU_STACK: return "PT_GNU_STACK"; + case PT_GNU_RELRO: return "PT_GNU_RELRO"; + case PT_OPENBSD_RANDOMIZE: return "PT_OPENBSD_RANDOMIZE"; + case PT_OPENBSD_WXNEEDED: return "PT_OPENBSD_WXNEEDED"; + case PT_OPENBSD_BOOTDATA: return "PT_OPENBSD_BOOTDATA"; } snprintf(s_type, sizeof(s_type), "", type); return (s_type); Modified: vendor/elftoolchain/dist/libdwarf/dwarf.h ============================================================================== --- vendor/elftoolchain/dist/libdwarf/dwarf.h Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/libdwarf/dwarf.h Sat Jun 29 15:27:18 2019 (r349544) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: dwarf.h 3494 2016-09-20 17:16:13Z emaste $ + * $Id: dwarf.h 3749 2019-06-28 01:10:44Z emaste $ */ #ifndef _DWARF_H_ @@ -523,6 +523,24 @@ #define DW_LANG_ObjC_plus_plus 0x0011 #define DW_LANG_UPC 0x0012 #define DW_LANG_D 0x0013 +#define DW_LANG_Python 0x0014 +#define DW_LANG_OpenCL 0x0015 +#define DW_LANG_Go 0x0016 +#define DW_LANG_Modula3 0x0017 +#define DW_LANG_Haskell 0x0018 +#define DW_LANG_C_plus_plus_03 0x0019 +#define DW_LANG_C_plus_plus_11 0x001a +#define DW_LANG_OCaml 0x001b +#define DW_LANG_Rust 0x001c +#define DW_LANG_C11 0x001d +#define DW_LANG_Swift 0x001e +#define DW_LANG_Julia 0x001f +#define DW_LANG_Dylan 0x0020 +#define DW_LANG_C_plus_plus_14 0x0021 +#define DW_LANG_Fortran03 0x0022 +#define DW_LANG_Fortran08 0x0023 +#define DW_LANG_RenderScript 0x0024 +#define DW_LANG_BLISS 0x0025 #define DW_LANG_lo_user 0x8000 #define DW_LANG_Mips_Assembler 0x8001 #define DW_LANG_hi_user 0xffff Modified: vendor/elftoolchain/dist/libdwarf/dwarf_dump.c ============================================================================== --- vendor/elftoolchain/dist/libdwarf/dwarf_dump.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/libdwarf/dwarf_dump.c Sat Jun 29 15:27:18 2019 (r349544) @@ -27,7 +27,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: dwarf_dump.c 3494 2016-09-20 17:16:13Z emaste $"); +ELFTC_VCSID("$Id: dwarf_dump.c 3749 2019-06-28 01:10:44Z emaste $"); int dwarf_get_ACCESS_name(unsigned access, const char **s) @@ -605,7 +605,7 @@ dwarf_get_DS_name(unsigned ds, const char **s) case DW_DS_leading_separate: *s = "DW_DS_leading_separate"; break; case DW_DS_trailing_separate: - *s = "DW_DS_trailing_separate"; + *s = "DW_DS_trailing_separate"; break; default: return (DW_DLV_NO_ENTRY); } @@ -788,6 +788,42 @@ dwarf_get_LANG_name(unsigned lang, const char **s) *s = "DW_LANG_UPC"; break; case DW_LANG_D: *s = "DW_LANG_D"; break; + case DW_LANG_Python: + *s = "DW_LANG_Python"; break; + case DW_LANG_OpenCL: + *s = "DW_LANG_OpenCL"; break; + case DW_LANG_Go: + *s = "DW_LANG_Go"; break; + case DW_LANG_Modula3: + *s = "DW_LANG_Modula3"; break; + case DW_LANG_Haskell: + *s = "DW_LANG_Haskell"; break; + case DW_LANG_C_plus_plus_03: + *s = "DW_LANG_C_plus_plus_03"; break; + case DW_LANG_C_plus_plus_11: + *s = "DW_LANG_C_plus_plus_11"; break; + case DW_LANG_OCaml: + *s = "DW_LANG_OCaml"; break; + case DW_LANG_Rust: + *s = "DW_LANG_Rust"; break; + case DW_LANG_C11: + *s = "DW_LANG_C11"; break; + case DW_LANG_Swift: + *s = "DW_LANG_Swift"; break; + case DW_LANG_Julia: + *s = "DW_LANG_Julia"; break; + case DW_LANG_Dylan: + *s = "DW_LANG_Dylan"; break; + case DW_LANG_C_plus_plus_14: + *s = "DW_LANG_C_plus_plus_14"; break; + case DW_LANG_Fortran03: + *s = "DW_LANG_Fortran03"; break; + case DW_LANG_Fortran08: + *s = "DW_LANG_Fortran08"; break; + case DW_LANG_RenderScript: + *s = "DW_LANG_RenderScript"; break; + case DW_LANG_BLISS: + *s = "DW_LANG_BLISS"; break; case DW_LANG_lo_user: *s = "DW_LANG_lo_user"; break; case DW_LANG_Mips_Assembler: Modified: vendor/elftoolchain/dist/libdwarf/libdwarf_attr.c ============================================================================== --- vendor/elftoolchain/dist/libdwarf/libdwarf_attr.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/libdwarf/libdwarf_attr.c Sat Jun 29 15:27:18 2019 (r349544) @@ -27,7 +27,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: libdwarf_attr.c 3064 2014-06-06 19:35:55Z kaiwang27 $"); +ELFTC_VCSID("$Id: libdwarf_attr.c 3748 2019-06-28 01:11:13Z emaste $"); int _dwarf_attr_alloc(Dwarf_Die die, Dwarf_Attribute *atp, Dwarf_Error *error) @@ -100,7 +100,6 @@ _dwarf_attr_init(Dwarf_Debug dbg, Dwarf_Section *ds, u uint64_t form, int indirect, Dwarf_Error *error) { struct _Dwarf_Attribute atref; - Dwarf_Section *str; int ret; ret = DW_DLE_NONE; @@ -183,9 +182,7 @@ _dwarf_attr_init(Dwarf_Debug dbg, Dwarf_Section *ds, u break; case DW_FORM_strp: atref.u[0].u64 = dbg->read(ds->ds_data, offsetp, dwarf_size); - str = _dwarf_find_section(dbg, ".debug_str"); - assert(str != NULL); - atref.u[1].s = (char *) str->ds_data + atref.u[0].u64; + atref.u[1].s = _dwarf_strtab_get_table(dbg) + atref.u[0].u64; break; case DW_FORM_ref_sig8: atref.u[0].u64 = 8; Modified: vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c ============================================================================== --- vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c Sat Jun 29 15:27:18 2019 (r349544) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: libdwarf_reloc.c 3578 2017-09-14 02:21:28Z emaste $"); +ELFTC_VCSID("$Id: libdwarf_reloc.c 3741 2019-06-07 06:32:01Z jkoshy $"); Dwarf_Unsigned _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) @@ -44,7 +44,7 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) case DW_ISA_SPARC: return (is64 ? R_SPARC_UA64 : R_SPARC_UA32); case DW_ISA_PPC: - return (R_PPC_ADDR32); + return (is64 ? R_PPC64_ADDR64 : R_PPC_ADDR32); case DW_ISA_ARM: return (R_ARM_ABS32); case DW_ISA_MIPS: @@ -96,6 +96,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, Dwarf_Unsigned case EM_PPC: if (rel_type == R_PPC_ADDR32) return (4); + break; + case EM_PPC64: + if (rel_type == R_PPC_ADDR32) + return (4); + else if (rel_type == R_PPC64_ADDR64) + return (8); break; case EM_MIPS: if (rel_type == R_MIPS_32) Modified: vendor/elftoolchain/dist/libelf/_libelf.h ============================================================================== --- vendor/elftoolchain/dist/libelf/_libelf.h Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/libelf/_libelf.h Sat Jun 29 15:27:18 2019 (r349544) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf.h 3632 2018-10-10 21:12:43Z jkoshy $ + * $Id: _libelf.h 3738 2019-05-05 21:49:06Z jkoshy $ */ #ifndef __LIBELF_H_ @@ -90,7 +90,7 @@ struct _Elf { Elf_Kind e_kind; /* ELF_K_* */ Elf *e_parent; /* non-NULL for archive members */ unsigned char *e_rawfile; /* uninterpreted bytes */ - size_t e_rawsize; /* size of uninterpreted bytes */ + off_t e_rawsize; /* size of uninterpreted bytes */ unsigned int e_version; /* file version */ /* @@ -226,7 +226,7 @@ size_t _libelf_msize(Elf_Type _t, int _elfclass, unsig void *_libelf_newphdr(Elf *_e, int _elfclass, size_t _count); Elf *_libelf_open_object(int _fd, Elf_Cmd _c, int _reporterror); struct _Libelf_Data *_libelf_release_data(struct _Libelf_Data *_d); -Elf *_libelf_release_elf(Elf *_e); +void _libelf_release_elf(Elf *_e); Elf_Scn *_libelf_release_scn(Elf_Scn *_s); int _libelf_setphnum(Elf *_e, void *_eh, int _elfclass, size_t _phnum); int _libelf_setshnum(Elf *_e, void *_eh, int _elfclass, size_t _shnum); Modified: vendor/elftoolchain/dist/libelf/_libelf_config.h ============================================================================== --- vendor/elftoolchain/dist/libelf/_libelf_config.h Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/libelf/_libelf_config.h Sat Jun 29 15:27:18 2019 (r349544) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf_config.h 3566 2017-08-31 02:28:40Z emaste $ + * $Id: _libelf_config.h 3764 2019-06-28 21:44:46Z emaste $ */ #if defined(__APPLE__) || defined(__DragonFly__) @@ -98,6 +98,12 @@ #define LIBELF_CLASS ELFCLASS32 #elif defined(__riscv) && (__riscv_xlen == 64) + +#define LIBELF_ARCH EM_RISCV +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 + +#elif defined(__riscv64) #define LIBELF_ARCH EM_RISCV #define LIBELF_BYTEORDER ELFDATA2LSB Modified: vendor/elftoolchain/dist/libelf/elf.3 ============================================================================== --- vendor/elftoolchain/dist/libelf/elf.3 Sat Jun 29 14:55:53 2019 (r349543) +++ vendor/elftoolchain/dist/libelf/elf.3 Sat Jun 29 15:27:18 2019 (r349544) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006-2008,2011 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006-2008,2011,2019 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -21,9 +21,9 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf.3 3643 2018-10-14 21:09:24Z jkoshy $ +.\" $Id: elf.3 3743 2019-06-12 19:36:30Z jkoshy $ .\" -.Dd October 10, 2018 +.Dd June 12, 2019 .Dt ELF 3 .Os .Sh NAME @@ -266,36 +266,43 @@ The operating version for the data in this buffer. .El .Pp .Vt Elf_Data -descriptors are usually associated with +descriptors are usually used in conjunction with .Vt Elf_Scn descriptors. -Existing data descriptors associated with an ELF section may be -structures are retrieved using the -.Fn elf_getdata -and -.Fn elf_rawdata -functions. -The -.Fn elf_newdata -function may be used to attach new data descriptors to an ELF section. .It Vt Elf_Scn .Vt Elf_Scn -descriptors represent a section in an ELF object. +descriptors represent sections in an ELF object. +These descriptors are opaque and contain no application modifiable +fields. .Pp -They are retrieved using the +The +.Vt Elf_Scn *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 29 15:28:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAB5D15DE6CE; Sat, 29 Jun 2019 15:28:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C55281234; Sat, 29 Jun 2019 15:28:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62E7018389; Sat, 29 Jun 2019 15:28:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TFSbfs098381; Sat, 29 Jun 2019 15:28:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TFSbTc098380; Sat, 29 Jun 2019 15:28:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906291528.x5TFSbTc098380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 29 Jun 2019 15:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349545 - vendor/elftoolchain/elftoolchain-r3769 X-SVN-Group: vendor X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: vendor/elftoolchain/elftoolchain-r3769 X-SVN-Commit-Revision: 349545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C55281234 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.921,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 15:28:38 -0000 Author: emaste Date: Sat Jun 29 15:28:36 2019 New Revision: 349545 URL: https://svnweb.freebsd.org/changeset/base/349545 Log: Tag ELF Tool Chain r3769 Added: vendor/elftoolchain/elftoolchain-r3769/ - copied from r349544, vendor/elftoolchain/dist/ From owner-svn-src-all@freebsd.org Sat Jun 29 16:05:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF3D15DF7BA; Sat, 29 Jun 2019 16:05:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F1F82A8C; Sat, 29 Jun 2019 16:05:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC1A618A5A; Sat, 29 Jun 2019 16:05:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TG5qDh019556; Sat, 29 Jun 2019 16:05:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TG5qBA019555; Sat, 29 Jun 2019 16:05:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906291605.x5TG5qBA019555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 29 Jun 2019 16:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349546 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11F1F82A8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 16:05:53 -0000 Author: markj Date: Sat Jun 29 16:05:52 2019 New Revision: 349546 URL: https://svnweb.freebsd.org/changeset/base/349546 Log: Fix mutual exclusion in pipe_direct_write(). We use PIPE_DIRECTW as a semaphore for direct writes to a pipe, where the reader copies data directly from pages mapped into the writer. However, when a reader finishes such a copy, it previously cleared PIPE_DIRECTW, allowing multiple writers to race and corrupt the state used to track wired pages belonging to the writer. Fix this by having the writer clear PIPE_DIRECTW and instead use the count of unread bytes to determine whether a write is finished. Reported by: syzbot+21811cc0a89b2a87a9e7@syzkaller.appspotmail.com Reviewed by: kib, mjg Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20784 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Sat Jun 29 15:28:36 2019 (r349545) +++ head/sys/kern/sys_pipe.c Sat Jun 29 16:05:52 2019 (r349546) @@ -724,7 +724,7 @@ pipe_read(struct file *fp, struct uio *uio, struct ucr rpipe->pipe_map.pos += size; rpipe->pipe_map.cnt -= size; if (rpipe->pipe_map.cnt == 0) { - rpipe->pipe_state &= ~(PIPE_DIRECTW|PIPE_WANTW); + rpipe->pipe_state &= ~PIPE_WANTW; wakeup(rpipe); } #endif @@ -855,13 +855,17 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio } /* - * unmap and unwire the process buffer + * Unwire the process buffer. */ static void pipe_destroy_write_buffer(struct pipe *wpipe) { PIPE_LOCK_ASSERT(wpipe, MA_OWNED); + KASSERT((wpipe->pipe_state & PIPE_DIRECTW) != 0, + ("%s: PIPE_DIRECTW not set on %p", __func__, wpipe)); + + wpipe->pipe_state &= ~PIPE_DIRECTW; vm_page_unhold_pages(wpipe->pipe_map.ms, wpipe->pipe_map.npages); wpipe->pipe_map.npages = 0; } @@ -880,13 +884,15 @@ pipe_clone_write_buffer(struct pipe *wpipe) int pos; PIPE_LOCK_ASSERT(wpipe, MA_OWNED); + KASSERT((wpipe->pipe_state & PIPE_DIRECTW) != 0, + ("%s: PIPE_DIRECTW not set on %p", __func__, wpipe)); + size = wpipe->pipe_map.cnt; pos = wpipe->pipe_map.pos; wpipe->pipe_buffer.in = size; wpipe->pipe_buffer.out = 0; wpipe->pipe_buffer.cnt = size; - wpipe->pipe_state &= ~PIPE_DIRECTW; PIPE_UNLOCK(wpipe); iov.iov_base = wpipe->pipe_buffer.buffer; @@ -925,7 +931,7 @@ retry: pipeunlock(wpipe); goto error1; } - while (wpipe->pipe_state & PIPE_DIRECTW) { + if (wpipe->pipe_state & PIPE_DIRECTW) { if (wpipe->pipe_state & PIPE_WANTR) { wpipe->pipe_state &= ~PIPE_WANTR; wakeup(wpipe); @@ -968,8 +974,7 @@ retry: goto error1; } - error = 0; - while (!error && (wpipe->pipe_state & PIPE_DIRECTW)) { + while (wpipe->pipe_map.cnt != 0) { if (wpipe->pipe_state & PIPE_EOF) { pipe_destroy_write_buffer(wpipe); pipeselwakeup(wpipe); @@ -987,20 +992,19 @@ retry: error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdwt", 0); pipelock(wpipe, 0); + if (error != 0) + break; } if (wpipe->pipe_state & PIPE_EOF) error = EPIPE; - if (wpipe->pipe_state & PIPE_DIRECTW) { - /* - * this bit of trickery substitutes a kernel buffer for - * the process that might be going away. - */ + if (error == EINTR || error == ERESTART) pipe_clone_write_buffer(wpipe); - } else { + else pipe_destroy_write_buffer(wpipe); - } pipeunlock(wpipe); + KASSERT((wpipe->pipe_state & PIPE_DIRECTW) == 0, + ("pipe %p leaked PIPE_DIRECTW", wpipe)); return (error); error1: From owner-svn-src-all@freebsd.org Sat Jun 29 16:11:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8409015DFA4A; Sat, 29 Jun 2019 16:11:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E741882EE7; Sat, 29 Jun 2019 16:11:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C32A718A95; Sat, 29 Jun 2019 16:11:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TGB9Eg022249; Sat, 29 Jun 2019 16:11:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TGB908022248; Sat, 29 Jun 2019 16:11:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906291611.x5TGB908022248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 29 Jun 2019 16:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349547 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E741882EE7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 16:11:10 -0000 Author: markj Date: Sat Jun 29 16:11:09 2019 New Revision: 349547 URL: https://svnweb.freebsd.org/changeset/base/349547 Log: Use a consistent snapshot of the fd's rights in fget_mmap(). fget_mmap() translates rights on the descriptor to a VM protection mask. It was doing so without holding any locks on the descriptor table, so a writer could simultaneously be modifying those rights. Such a situation would be detected using a sequence counter, but not before an inconsistency could trigger assertion failures in the capability code. Fix the problem by copying the fd's rights to a structure on the stack, and perform the translation only once we know that that snapshot is consistent. Reported by: syzbot+ae359438769fda1840f8@syzkaller.appspotmail.com Reviewed by: brooks, mjg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20800 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jun 29 16:05:52 2019 (r349546) +++ head/sys/kern/kern_descrip.c Sat Jun 29 16:11:09 2019 (r349547) @@ -2761,6 +2761,7 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig if (maxprotp != NULL) *maxprotp = VM_PROT_ALL; #else + cap_rights_t fdrights; struct filedesc *fdp = td->td_proc->p_fd; seqc_t seq; @@ -2769,15 +2770,18 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig error = _fget(td, fd, fpp, 0, rightsp, &seq); if (error != 0) return (error); - /* - * If requested, convert capability rights to access flags. - */ if (maxprotp != NULL) - *maxprotp = cap_rights_to_vmprot(cap_rights(fdp, fd)); + fdrights = *cap_rights(fdp, fd); if (!fd_modified(fdp, fd, seq)) break; fdrop(*fpp, td); } + + /* + * If requested, convert capability rights to access flags. + */ + if (maxprotp != NULL) + *maxprotp = cap_rights_to_vmprot(&fdrights); #endif return (error); } From owner-svn-src-all@freebsd.org Sat Jun 29 17:01:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE3315E0505; Sat, 29 Jun 2019 17:01:57 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C353784259; Sat, 29 Jun 2019 17:01:56 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E45D19337; Sat, 29 Jun 2019 17:01:56 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TH1uN3051058; Sat, 29 Jun 2019 17:01:56 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TH1uh8051057; Sat, 29 Jun 2019 17:01:56 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201906291701.x5TH1uh8051057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sat, 29 Jun 2019 17:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349548 - head X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 349548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C353784259 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 17:01:57 -0000 Author: tijl Date: Sat Jun 29 17:01:56 2019 New Revision: 349548 URL: https://svnweb.freebsd.org/changeset/base/349548 Log: Build lib32 libl. The library is built from usr.bin/lex/lib. It would be better to move this directory to lib/libl, but this requires more extensive changes to Makefile.inc1. This simple fix can be MFCed quickly. PR: 238874 Reviewed by: imp MFC after: 3 days Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sat Jun 29 16:11:09 2019 (r349547) +++ head/Makefile.libcompat Sat Jun 29 17:01:56 2019 (r349548) @@ -136,6 +136,7 @@ LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR= _LC_LIBDIRS.yes= lib _LC_LIBDIRS.yes+= gnu/lib +_LC_LIBDIRS.yes+= usr.bin/lex/lib _LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib _LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib From owner-svn-src-all@freebsd.org Sat Jun 29 18:41:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1528D15E1EBD; Sat, 29 Jun 2019 18:41:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B668F867FB; Sat, 29 Jun 2019 18:41:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A48041A4EF; Sat, 29 Jun 2019 18:41:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5TIfgO7099798; Sat, 29 Jun 2019 18:41:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5TIfep6099788; Sat, 29 Jun 2019 18:41:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906291841.x5TIfep6099788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 29 Jun 2019 18:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349549 - in head: contrib/less usr.bin/less X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/less usr.bin/less X-SVN-Commit-Revision: 349549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B668F867FB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2019 18:41:43 -0000 Author: delphij Date: Sat Jun 29 18:41:40 2019 New Revision: 349549 URL: https://svnweb.freebsd.org/changeset/base/349549 Log: MFV r349535: less v551. MFC after: 2 weeks Relnotes: yes Modified: head/contrib/less/LICENSE head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/compose.uni head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/fmt.uni head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.hlp head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkutable head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/ubin.uni head/contrib/less/version.c head/contrib/less/wide.uni head/usr.bin/less/defines.h Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/LICENSE ============================================================================== --- head/contrib/less/LICENSE Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/LICENSE Sat Jun 29 18:41:40 2019 (r349549) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2016 Mark Nudelman +Copyright (C) 1984-2018 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/NEWS Sat Jun 29 18:41:40 2019 (r349549) @@ -11,6 +11,38 @@ ====================================================================== + Major changes between "less" versions 530 and 551 + +* Add --mouse option. + +* Add --wheel-lines option. + +* Add --no-histdups option. + +* Add --save-marks option. + +* Support PCRE2 regular expression library. + +* Redraw screen on SIGWINCH even if screen size doesn't change. + +* Shell-escape filenames in history so they can be used again. + +* Ring bell if user enters invalid long option name. + +* Use PCRE_UTF8 flag for pcre regular expressions when in UTF-8 mode. + +* Windows: use wide-char string to set console title. + +* Don't count lines in initial screen if using -X with -F. + +* Support mingw build system. + +* Fix bug in v command on empty file. + +* Fix bug in v command when filename contains shell metacharacters. + +====================================================================== + Major changes between "less" versions 487 and 530 * Don't output terminal init sequence if using -F and file fits on one screen. Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/README Sat Jun 29 18:41:40 2019 (r349549) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 530 + Less, version 551 - This is the distribution of less, version 530, released 05 Dec 2017. + This is the distribution of less, version 551, released 11 Jun 2019. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -56,6 +56,7 @@ INSTALLATION (Unix systems only): finds a regular expression library automatically. Other values are: gnu Use the GNU regex library. pcre Use the PCRE library. + pcre2 Use the PCRE2 library. posix Use the POSIX-compatible regcomp. regcmp Use the regcmp library. re_comp Use the re_comp library. @@ -63,6 +64,7 @@ INSTALLATION (Unix systems only): regcomp-local Use Henry Spencer's V8-compatible regcomp (source is supplied with less). none No regular expressions, only simple string matching. + --with-secure Builds a "secure" version of less, with some features disabled to prevent users from viewing other files, accessing shell Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/brac.c Sat Jun 29 18:41:40 2019 (r349549) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/ch.c Sat Jun 29 18:41:40 2019 (r349549) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -144,7 +144,7 @@ static int ch_addbuf(); * Get the character pointed to by the read pointer. */ int -ch_get() +ch_get(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -392,7 +392,7 @@ ch_ungetchar(c) * If we haven't read all of standard input into it, do that now. */ public void -end_logfile() +end_logfile(VOID_PARAM) { static int tried = FALSE; @@ -417,7 +417,7 @@ end_logfile() * Write all the existing buffered data to the log file. */ public void -sync_logfile() +sync_logfile(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -515,7 +515,7 @@ ch_seek(pos) * Seek to the end of the file. */ public int -ch_end_seek() +ch_end_seek(VOID_PARAM) { POSITION len; @@ -542,7 +542,7 @@ ch_end_seek() * Seek to the last position in the file that is currently buffered. */ public int -ch_end_buffer_seek() +ch_end_buffer_seek(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -570,7 +570,7 @@ ch_end_buffer_seek() * beginning of the pipe is no longer buffered. */ public int -ch_beg_seek() +ch_beg_seek(VOID_PARAM) { struct bufnode *bn; struct bufnode *firstbn; @@ -602,7 +602,7 @@ ch_beg_seek() * Return the length of the file, if known. */ public POSITION -ch_length() +ch_length(VOID_PARAM) { if (thisfile == NULL) return (NULL_POSITION); @@ -619,7 +619,7 @@ ch_length() * Return the current position in the file. */ public POSITION -ch_tell() +ch_tell(VOID_PARAM) { if (thisfile == NULL) return (NULL_POSITION); @@ -630,7 +630,7 @@ ch_tell() * Get the current char and post-increment the read pointer. */ public int -ch_forw_get() +ch_forw_get(VOID_PARAM) { int c; @@ -653,7 +653,7 @@ ch_forw_get() * Pre-decrement the read pointer and get the new current char. */ public int -ch_back_get() +ch_back_get(VOID_PARAM) { if (thisfile == NULL) return (EOI); @@ -693,7 +693,7 @@ ch_setbufspace(bufspace) * Flush (discard) any saved file state, including buffer contents. */ public void -ch_flush() +ch_flush(VOID_PARAM) { struct bufnode *bn; @@ -760,7 +760,7 @@ ch_flush() * The buffer is added to the tail of the buffer chain. */ static int -ch_addbuf() +ch_addbuf(VOID_PARAM) { struct buf *bp; struct bufnode *bn; @@ -785,7 +785,7 @@ ch_addbuf() * */ static void -init_hashtbl() +init_hashtbl(VOID_PARAM) { int h; @@ -800,7 +800,7 @@ init_hashtbl() * Delete all buffers for this file. */ static void -ch_delbufs() +ch_delbufs(VOID_PARAM) { struct bufnode *bn; @@ -840,7 +840,7 @@ seekable(f) * This is used after an ignore_eof read, during which the EOF may change. */ public void -ch_set_eof() +ch_set_eof(VOID_PARAM) { ch_fsize = ch_fpos; } @@ -890,7 +890,7 @@ ch_init(f, flags) * Close a filestate. */ public void -ch_close() +ch_close(VOID_PARAM) { int keepstate = FALSE; @@ -933,7 +933,7 @@ ch_close() * Return ch_flags for the current file. */ public int -ch_getflags() +ch_getflags(VOID_PARAM) { if (thisfile == NULL) return (0); Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/charset.c Sat Jun 29 18:41:40 2019 (r349549) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -245,7 +245,7 @@ icharset(name, no_error) * Define a charset, given a locale name. */ static void -ilocale() +ilocale(VOID_PARAM) { int c; @@ -315,7 +315,7 @@ setfmt(s, fmtvarptr, attrptr, default_fmt) * */ static void -set_charset() +set_charset(VOID_PARAM) { char *s; @@ -338,7 +338,7 @@ set_charset() * LESSCHARSET is not defined: try LESSCHARDEF. */ s = lgetenv("LESSCHARDEF"); - if (s != NULL && *s != '\0') + if (!isnullenv(s)) { ichardef(s); return; @@ -395,7 +395,7 @@ set_charset() * Initialize charset data structures. */ public void -init_charset() +init_charset(VOID_PARAM) { char *s; Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/charset.h Sat Jun 29 18:41:40 2019 (r349549) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/cmd.h Sat Jun 29 18:41:40 2019 (r349549) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -71,6 +71,13 @@ #define A_RRSHIFT 59 #define A_CLRMARK 62 #define A_SETMARKBOT 63 +#define A_X11MOUSE_IN 64 +#define A_X11MOUSE_IGNORE 65 +#define A_F_MOUSE 66 +#define A_B_MOUSE 67 +/* Note "X116" refers to extended (1006) X11 mouse reporting. */ +#define A_X116MOUSE_IN 68 +#define A_X116MOUSE_IGNORE 69 #define A_INVALID 100 #define A_NOACTION 101 Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/cmdbuf.c Sat Jun 29 18:41:40 2019 (r349549) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -22,6 +22,8 @@ extern int sc_width; extern int utf_mode; +extern int no_hist_dups; +extern int marks_modified; static char cmdbuf[CMDBUF_SIZE]; /* Buffer for holding a multi-char command */ static int cmd_col; /* Current column of the cursor */ @@ -58,6 +60,7 @@ public char closequote = '"'; #define HISTFILE_FIRST_LINE ".less-history-file:" #define HISTFILE_SEARCH_SECTION ".search" #define HISTFILE_SHELL_SECTION ".shell" +#define HISTFILE_MARK_SECTION ".mark" /* * A mlist structure represents a command history. @@ -114,7 +117,7 @@ static int cmd_mbc_buf_index; * Reset command buffer (to empty). */ public void -cmd_reset() +cmd_reset(VOID_PARAM) { cp = cmdbuf; *cp = '\0'; @@ -129,7 +132,7 @@ cmd_reset() * Clear command line. */ public void -clear_cmd() +clear_cmd(VOID_PARAM) { cmd_col = prompt_col = 0; cmd_mbc_buf_len = 0; @@ -169,7 +172,7 @@ cmd_putstr(s) * How many characters are in the command buffer? */ public int -len_cmdbuf() +len_cmdbuf(VOID_PARAM) { char *s = cmdbuf; char *endline = s + strlen(s); @@ -302,7 +305,7 @@ cmd_repaint(old_cp) * and set cp to the corresponding char in cmdbuf. */ static void -cmd_home() +cmd_home(VOID_PARAM) { while (cmd_col > prompt_col) { @@ -321,7 +324,7 @@ cmd_home() * Shift the cmdbuf display left a half-screen. */ static void -cmd_lshift() +cmd_lshift(VOID_PARAM) { char *s; char *save_cp; @@ -359,7 +362,7 @@ cmd_lshift() * Shift the cmdbuf display right a half-screen. */ static void -cmd_rshift() +cmd_rshift(VOID_PARAM) { char *s; char *save_cp; @@ -389,7 +392,7 @@ cmd_rshift() * Move cursor right one character. */ static int -cmd_right() +cmd_right(VOID_PARAM) { char *pr; char *ncp; @@ -424,7 +427,7 @@ cmd_right() * Move cursor left one character. */ static int -cmd_left() +cmd_left(VOID_PARAM) { char *ncp; int width = 0; @@ -492,7 +495,7 @@ cmd_ichar(cs, clen) * Delete the char to the left of the cursor. */ static int -cmd_erase() +cmd_erase(VOID_PARAM) { char *s; int clen; @@ -541,7 +544,7 @@ cmd_erase() * Delete the char under the cursor. */ static int -cmd_delete() +cmd_delete(VOID_PARAM) { if (*cp == '\0') { @@ -560,7 +563,7 @@ cmd_delete() * Delete the "word" to the left of the cursor. */ static int -cmd_werase() +cmd_werase(VOID_PARAM) { if (cp > cmdbuf && cp[-1] == ' ') { @@ -586,7 +589,7 @@ cmd_werase() * Delete the "word" under the cursor. */ static int -cmd_wdelete() +cmd_wdelete(VOID_PARAM) { if (*cp == ' ') { @@ -612,7 +615,7 @@ cmd_wdelete() * Delete all chars in the command buffer. */ static int -cmd_kill() +cmd_kill(VOID_PARAM) { if (cmdbuf[0] == '\0') { @@ -702,6 +705,7 @@ cmd_updown(action) s = ml->string; if (s == NULL) s = ""; + cmd_offset = 0; cmd_home(); clear_eol(); strcpy(cmdbuf, s); @@ -719,6 +723,31 @@ cmd_updown(action) #endif /* + * + */ + static void +ml_link(mlist, ml) + struct mlist *mlist; + struct mlist *ml; +{ + ml->next = mlist; + ml->prev = mlist->prev; + mlist->prev->next = ml; + mlist->prev = ml; +} + +/* + * + */ + static void +ml_unlink(ml) + struct mlist *ml; +{ + ml->prev->next = ml->next; + ml->next->prev = ml->prev; +} + +/* * Add a string to an mlist. */ public void @@ -736,6 +765,21 @@ cmd_addhist(mlist, cmd, modified) if (strlen(cmd) == 0) return; + if (no_hist_dups) + { + struct mlist *next = NULL; + for (ml = mlist->next; ml->string != NULL; ml = next) + { + next = ml->next; + if (strcmp(ml->string, cmd) == 0) + { + ml_unlink(ml); + free(ml->string); + free(ml); + } + } + } + /* * Save the command unless it's a duplicate of the * last command in the history. @@ -750,10 +794,7 @@ cmd_addhist(mlist, cmd, modified) ml = (struct mlist *) ecalloc(1, sizeof(struct mlist)); ml->string = save(cmd); ml->modified = modified; - ml->next = mlist; - ml->prev = mlist->prev; - mlist->prev->next = ml; - mlist->prev = ml; + ml_link(mlist, ml); } /* * Point to the cmd just after the just-accepted command. @@ -768,13 +809,13 @@ cmd_addhist(mlist, cmd, modified) * Add it to the currently selected history list. */ public void -cmd_accept() +cmd_accept(VOID_PARAM) { #if CMD_HISTORY /* * Nothing to do if there is no currently selected history list. */ - if (curr_mlist == NULL) + if (curr_mlist == NULL || curr_mlist == ml_examine) return; cmd_addhist(curr_mlist, cmdbuf, 1); curr_mlist->modified = 1; @@ -799,7 +840,7 @@ cmd_edit(c) #if TAB_COMPLETE_FILENAME #define not_in_completion() in_completion = 0 #else -#define not_in_completion() +#define not_in_completion(VOID_PARAM) #endif /* @@ -934,7 +975,7 @@ cmd_istr(str) * cursor at the end of the word. */ static char * -delimit_word() +delimit_word(VOID_PARAM) { char *word; #if SPACES_IN_FILENAMES @@ -1021,7 +1062,7 @@ delimit_word() * which start with that word, and set tk_text to that list. */ static void -init_compl() +init_compl(VOID_PARAM) { char *word; char c; @@ -1148,9 +1189,9 @@ cmd_complete(action) tk_trial = next_compl(action, tk_trial); } - /* - * Remove the original word, or the previous trial completion. - */ + /* + * Remove the original word, or the previous trial completion. + */ while (cp > tk_ipoint) (void) cmd_erase(); @@ -1323,7 +1364,7 @@ cmd_int(frac) * Return a pointer to the command buffer. */ public char * -get_cmdbuf() +get_cmdbuf(VOID_PARAM) { return (cmdbuf); } @@ -1333,7 +1374,7 @@ get_cmdbuf() * Return the last (most recent) string in the current command history. */ public char * -cmd_lastpattern() +cmd_lastpattern(VOID_PARAM) { if (curr_mlist == NULL) return (NULL); @@ -1358,7 +1399,7 @@ mlist_size(ml) * Get the name of the history file. */ static char * -histfile_name() +histfile_name(VOID_PARAM) { char *home; char *name; @@ -1366,7 +1407,7 @@ histfile_name() /* See if filename is explicitly specified by $LESSHISTFILE. */ name = lgetenv("LESSHISTFILE"); - if (name != NULL && *name != '\0') + if (!isnullenv(name)) { if (strcmp(name, "-") == 0 || strcmp(name, "/dev/null") == 0) /* $LESSHISTFILE == "-" means don't use a history file. */ @@ -1380,11 +1421,11 @@ histfile_name() /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); - if (home == NULL || *home == '\0') + if (isnullenv(home)) { #if OS2 home = lgetenv("INIT"); - if (home == NULL || *home == '\0') + if (isnullenv(home)) #endif return (NULL); } @@ -1447,6 +1488,9 @@ read_cmdhist2(action, uparam, skip_search, skip_shell) ml = NULL; skip = NULL; #endif + } else if (strcmp(line, HISTFILE_MARK_SECTION) == 0) + { + ml = NULL; } else if (*line == '"') { if (ml != NULL) @@ -1456,6 +1500,9 @@ read_cmdhist2(action, uparam, skip_search, skip_shell) else (*action)(uparam, ml, line+1); } + } else if (*line == 'm') + { + (*action)(uparam, NULL, line); } } fclose(f); @@ -1475,9 +1522,10 @@ read_cmdhist(action, uparam, skip_search, skip_shell) static void addhist_init(void *uparam, struct mlist *ml, char *string) { - if (ml == NULL || string == NULL) - return; - cmd_addhist(ml, string, 0); + if (ml != NULL) + cmd_addhist(ml, string, 0); + else if (string != NULL) + restore_mark(string); } #endif /* CMD_HISTORY */ @@ -1485,7 +1533,7 @@ addhist_init(void *uparam, struct mlist *ml, char *str * Initialize history from a .lesshist file. */ public void -init_cmdhist() +init_cmdhist(VOID_PARAM) { #if CMD_HISTORY read_cmdhist(&addhist_init, NULL, 0, 0); @@ -1558,7 +1606,7 @@ copy_hist(void *uparam, struct mlist *ml, char *string { struct save_ctx *ctx = (struct save_ctx *) uparam; - if (ml != ctx->mlist) { + if (ml != NULL && ml != ctx->mlist) { /* We're changing mlists. */ if (ctx->mlist) /* Append any new entries to the end of the current mlist. */ @@ -1567,13 +1615,9 @@ copy_hist(void *uparam, struct mlist *ml, char *string ctx->mlist = ml; write_mlist_header(ctx->mlist, ctx->fout); } - if (string != NULL) + + if (string == NULL) /* End of file */ { - /* Copy the entry. */ - fprintf(ctx->fout, "\"%s\n", string); - } - if (ml == NULL) /* End of file */ - { /* Write any sections that were not in the original file. */ if (mlist_search.modified) { @@ -1587,7 +1631,12 @@ copy_hist(void *uparam, struct mlist *ml, char *string write_mlist(&mlist_shell, ctx->fout); } #endif + } else if (ml != NULL) + { + /* Copy mlist entry. */ + fprintf(ctx->fout, "\"%s\n", string); } + /* Skip marks */ } #endif /* CMD_HISTORY */ @@ -1616,7 +1665,7 @@ make_file_private(f) * Does the history file need to be updated? */ static int -histfile_modified() +histfile_modified(VOID_PARAM) { if (mlist_search.modified) return 1; @@ -1624,6 +1673,10 @@ histfile_modified() if (mlist_shell.modified) return 1; #endif +#if CMD_HISTORY + if (marks_modified) + return 1; +#endif return 0; } @@ -1631,7 +1684,7 @@ histfile_modified() * Update the .lesshst file. */ public void -save_cmdhist() +save_cmdhist(VOID_PARAM) { #if CMD_HISTORY char *histname; @@ -1665,7 +1718,8 @@ save_cmdhist() fprintf(fout, "%s\n", HISTFILE_FIRST_LINE); ctx.fout = fout; ctx.mlist = NULL; - read_cmdhist(copy_hist, &ctx, skip_search, skip_shell); + read_cmdhist(©_hist, &ctx, skip_search, skip_shell); + save_marks(fout, HISTFILE_MARK_SECTION); fclose(fout); #if MSDOS_COMPILER==WIN32C /* Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Sat Jun 29 17:01:56 2019 (r349548) +++ head/contrib/less/command.c Sat Jun 29 18:41:40 2019 (r349549) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2017 Mark Nudelman + * Copyright (C) 1984-2019 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -49,6 +49,7 @@ extern struct scrpos initial_scrpos; extern IFILE curr_ifile; extern void *ml_search; extern void *ml_examine; +extern int wheel_lines; #if SHELL_ESCAPE || PIPEC extern void *ml_shell; #endif @@ -60,6 +61,9 @@ extern int screen_trashed; /* The screen has been over extern int shift_count; extern int oldbot; extern int forw_prompt; +#if MSDOS_COMPILER==WIN32C +extern int utf_mode; +#endif #if SHELL_ESCAPE static char *shellcmd = NULL; /* For holding last shell command for "!!" */ @@ -94,14 +98,39 @@ static void multi_search(); * updating the screen. */ static void -cmd_exec() +cmd_exec(VOID_PARAM) { - clear_attn(); + clear_attn(); clear_bot(); flush(); } /* + * Indicate we are reading a multi-character command. + */ + static void +set_mca(action) + int action; +{ + mca = action; + deinit_mouse(); /* we don't want mouse events while entering a cmd */ + clear_bot(); + clear_cmd(); +} + +/* + * Indicate we are not reading a multi-character command. + */ + static void +clear_mca(VOID_PARAM) +{ + if (mca == 0) + return; + mca = 0; + init_mouse(); +} + +/* * Set up the display to start a new multi-character command. */ static void @@ -111,15 +140,13 @@ start_mca(action, prompt, mlist, cmdflags) void *mlist; int cmdflags; { - mca = action; - clear_bot(); - clear_cmd(); + set_mca(action); cmd_putstr(prompt); set_mlist(mlist, cmdflags); } public int -in_mca() +in_mca(VOID_PARAM) { return (mca != 0 && mca != A_PREFIX); } @@ -128,21 +155,18 @@ in_mca() * Set up the display to start a new search command. */ static void -mca_search() +mca_search(VOID_PARAM) { #if HILITE_SEARCH if (search_type & SRCH_FILTER) - mca = A_FILTER; + set_mca(A_FILTER); else #endif if (search_type & SRCH_FORW) - mca = A_F_SEARCH; + set_mca(A_F_SEARCH); else - mca = A_B_SEARCH; + set_mca(A_B_SEARCH); - clear_bot(); - clear_cmd(); - if (search_type & SRCH_NO_MATCH) cmd_putstr("Non-match "); if (search_type & SRCH_FIRST_FILE) @@ -171,7 +195,7 @@ mca_search() * Set up the display to start a new toggle-option command. */ static void -mca_opt_toggle() +mca_opt_toggle(VOID_PARAM) { int no_prompt; int flag; @@ -181,9 +205,7 @@ mca_opt_toggle() flag = (optflag & ~OPT_NO_PROMPT); dash = (flag == OPT_NO_TOGGLE) ? "_" : "-"; - mca = A_OPT_TOGGLE; - clear_bot(); - clear_cmd(); + set_mca(A_OPT_TOGGLE); cmd_putstr(dash); if (optgetname) cmd_putstr(dash); @@ -206,7 +228,7 @@ mca_opt_toggle() * Execute a multicharacter command. */ static void -exec_mca() +exec_mca(VOID_PARAM) { char *cbuf; @@ -373,6 +395,7 @@ mca_opt_nonfirst_char(c) { char *p; char *oname; + int err; if (curropt != NULL) { @@ -392,7 +415,8 @@ mca_opt_nonfirst_char(c) return (MCA_DONE); p = get_cmdbuf(); opt_lower = ASCII_IS_LOWER(p[0]); - curropt = findopt_name(&p, &oname, NULL); + err = 0; + curropt = findopt_name(&p, &oname, &err); if (curropt != NULL) { /* @@ -410,6 +434,9 @@ mca_opt_nonfirst_char(c) if (cmd_char(c) != CC_OK) return (MCA_DONE); } + } else if (err != OPT_AMBIG) + { + bell(); } return (MCA_MORE); } @@ -461,6 +488,7 @@ mca_opt_char(c) error("There is no %s option", &parg); return (MCA_DONE); } + opt_lower = ASCII_IS_LOWER(c); } /* * If the option which was entered does not take a @@ -470,7 +498,7 @@ mca_opt_char(c) if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE || !opt_has_param(curropt)) { - toggle_option(curropt, ASCII_IS_LOWER(c), "", optflag); + toggle_option(curropt, opt_lower, "", optflag); return (MCA_DONE); } /* @@ -577,7 +605,7 @@ mca_char(c) * as a normal command character. */ number = cmd_int(&fraction); - mca = 0; + clear_mca(); cmd_accept(); return (NO_MCA); } @@ -644,7 +672,7 @@ mca_char(c) * Discard any buffered file data. */ static void -clear_buffers() +clear_buffers(VOID_PARAM) { if (!(ch_getflags() & CH_CANSEEK)) return; @@ -659,7 +687,7 @@ clear_buffers() * Make sure the screen is displayed. */ static void -make_display() +make_display(VOID_PARAM) { /* * If nothing is displayed yet, display starting from initial_scrpos. @@ -699,7 +727,7 @@ make_display() * Display the appropriate prompt. */ static void -prompt() +prompt(VOID_PARAM) { constant char *p; @@ -739,8 +767,14 @@ prompt() * In Win32, display the file name in the window title. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***